Class DistanceSe3SymmetricSq
- java.lang.Object
-
- boofcv.alg.geo.robust.DistanceSe3SymmetricSq
-
- All Implemented Interfaces:
- DistanceModelStereoPixels<Se3_F64,AssociatedPair>, DistanceFromModel<Se3_F64,AssociatedPair>
public class DistanceSe3SymmetricSq extends java.lang.Object implements DistanceModelStereoPixels<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 and Description DistanceSe3SymmetricSq(TriangulateTwoViewsCalibrated triangulate)Configure distance calculation.DistanceSe3SymmetricSq(TriangulateTwoViewsCalibrated triangulate, double key_fx, double key_fy, double key_skew, double curr_fx, double curr_fy, double curr_skew)Configure distance calculation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecomputeDistance(AssociatedPair obs)Computes the error given the motion modelvoidcomputeDistance(java.util.List<AssociatedPair> associatedPairs, double[] distance)Computes the distance a set of points is from the model and saves the results in the provided array.voidsetIntrinsic(double cam1_fx, double cam1_fy, double cam1_skew, double cam2_fx, double cam2_fy, double cam2_skew)Specifies intrinsic parameters See comment above about how to specify error units using intrinsic parameters.voidsetModel(Se3_F64 keyToCurr)Sets the model parameters.
-
-
-
Constructor Detail
-
DistanceSe3SymmetricSq
public DistanceSe3SymmetricSq(TriangulateTwoViewsCalibrated triangulate, double key_fx, double key_fy, double key_skew, double curr_fx, double curr_fy, double curr_skew)
Configure distance calculation.- Parameters:
triangulate- Triangulates the intersection of two observations
-
DistanceSe3SymmetricSq
public DistanceSe3SymmetricSq(TriangulateTwoViewsCalibrated triangulate)
Configure distance calculation.- Parameters:
triangulate- Triangulates the intersection of two observations
-
-
Method Detail
-
setIntrinsic
public void setIntrinsic(double cam1_fx, double cam1_fy, double cam1_skew, double cam2_fx, double cam2_fy, double cam2_skew)Specifies intrinsic parameters See comment above about how to specify error units using intrinsic parameters.- Specified by:
setIntrinsicin interfaceDistanceModelStereoPixels<Se3_F64,AssociatedPair>- Parameters:
cam1_fx- intrinsic parameter: focal length x for camera 1cam1_fy- intrinsic parameter: focal length y for camera 1cam1_skew- intrinsic parameter: skew for camera 1 (usually zero)cam2_fx- intrinsic parameter: focal length x for camera 2cam2_fy- intrinsic parameter: focal length y for camera 2cam2_skew- intrinsic parameter: skew for camera 2 (usually zero)
-
setModel
public void setModel(Se3_F64 keyToCurr)
Description copied from interface:DistanceFromModelSets the model parameters.- Specified by:
setModelin interfaceDistanceFromModel<Se3_F64,AssociatedPair>- Parameters:
keyToCurr- Model parameters.
-
computeDistance
public double computeDistance(AssociatedPair obs)
Computes the error given the motion model- Specified by:
computeDistancein interfaceDistanceFromModel<Se3_F64,AssociatedPair>- Parameters:
obs- Observation in normalized pixel coordinates- Returns:
- observation error
-
computeDistance
public void computeDistance(java.util.List<AssociatedPair> associatedPairs, double[] distance)
Description copied from interface:DistanceFromModelComputes the distance a set of points is from the model and saves the results in the provided array.- Specified by:
computeDistancein interfaceDistanceFromModel<Se3_F64,AssociatedPair>- Parameters:
associatedPairs- Set of points which are to be evaluated.distance- Where model distance is stored.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG