Package boofcv.alg.geo.robust
Class DistanceSe3SymmetricSq
- java.lang.Object
-
- boofcv.alg.geo.robust.DistanceSe3SymmetricSq
-
- All Implemented Interfaces:
DistanceFromModelMultiView<georegression.struct.se.Se3_F64,AssociatedPair>,org.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>
public class DistanceSe3SymmetricSq extends java.lang.Object implements DistanceFromModelMultiView<georegression.struct.se.Se3_F64,AssociatedPair>
Computes the error for a given camera motion from two calibrated views. First a point is triangulated from the two views and the motion. Then the difference between the observed and projected point is found at each view. Error is normalized pixel difference squared.
error = Δx12 + Δy12 + Δx22 + Δy22
Error units can be in either pixels2 or unit less (normalized pixel coordinates). To compute the error in pixels pass in the correct intrinsic calibration parameters in the constructor. Otherwise pass in fx=1.fy=1,skew=0 for normalized.
NOTE: If a point does not pass the positive depth constraint then a very large error is returned.
NOTE: The provided transform must be from the key frame into the current frame.
-
-
Constructor Summary
Constructors Constructor Description DistanceSe3SymmetricSq(Triangulate2ViewsMetric triangulate)Configure distance calculation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecomputeDistance(AssociatedPair obs)Computes the error given the motion modelvoidcomputeDistance(java.util.List<AssociatedPair> associatedPairs, double[] distance)java.lang.Class<georegression.struct.se.Se3_F64>getModelType()intgetNumberOfViews()java.lang.Class<AssociatedPair>getPointType()voidsetIntrinsic(int view, CameraPinhole intrinsic)voidsetModel(georegression.struct.se.Se3_F64 keyToCurr)
-
-
-
Constructor Detail
-
DistanceSe3SymmetricSq
public DistanceSe3SymmetricSq(Triangulate2ViewsMetric triangulate)
Configure distance calculation.- Parameters:
triangulate- Triangulates the intersection of two observations
-
-
Method Detail
-
setModel
public void setModel(georegression.struct.se.Se3_F64 keyToCurr)
- Specified by:
setModelin interfaceorg.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>
-
computeDistance
public double computeDistance(AssociatedPair obs)
Computes the error given the motion model- Specified by:
computeDistancein interfaceorg.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>- Parameters:
obs- Observation in normalized pixel coordinates- Returns:
- observation error
-
computeDistance
public void computeDistance(java.util.List<AssociatedPair> associatedPairs, double[] distance)
- Specified by:
computeDistancein interfaceorg.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>
-
getPointType
public java.lang.Class<AssociatedPair> getPointType()
- Specified by:
getPointTypein interfaceorg.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>
-
getModelType
public java.lang.Class<georegression.struct.se.Se3_F64> getModelType()
- Specified by:
getModelTypein interfaceorg.ddogleg.fitting.modelset.DistanceFromModel<georegression.struct.se.Se3_F64,AssociatedPair>
-
setIntrinsic
public void setIntrinsic(int view, CameraPinhole intrinsic)- Specified by:
setIntrinsicin interfaceDistanceFromModelMultiView<georegression.struct.se.Se3_F64,AssociatedPair>
-
getNumberOfViews
public int getNumberOfViews()
- Specified by:
getNumberOfViewsin interfaceDistanceFromModelMultiView<georegression.struct.se.Se3_F64,AssociatedPair>
-
-