Package boofcv.alg.geo.h
Class HomographyResidualSampson
java.lang.Object
boofcv.alg.geo.h.HomographyResidualSampson
- All Implemented Interfaces:
ModelObservationResidualN<DMatrixRMaj,
AssociatedPair>
public class HomographyResidualSampson
extends Object
implements ModelObservationResidualN<DMatrixRMaj,AssociatedPair>
Computes the Sampson distance residual for a set of observations given a homography matrix. For use in least-squares non-linear optimization algorithms. The full 9 elements of the 3x3 matrix are used to parameterize. This has an extra redundant parameter, but is much simpler and should not affect the final result.
R. Hartley, and A. Zisserman, "Multiple View Geometry in Computer Vision", 2nd Ed, Cambridge 2003
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
computeJacobian
(Point2D_F64 x1, Point2D_F64 x2) int
computeResiduals
(AssociatedPair p, double[] residuals, int index) Compute the residual errors for the observationdouble
error1
(double x1, double y1, double x2, double y2) x2 = H*x1double
error2
(double x1, double y1, double x2, double y2) int
getN()
The number of outputsvoid
Specify the model being evaluated
-
Constructor Details
-
HomographyResidualSampson
public HomographyResidualSampson()
-
-
Method Details
-
setModel
Description copied from interface:ModelObservationResidualN
Specify the model being evaluated- Specified by:
setModel
in interfaceModelObservationResidualN<DMatrixRMaj,
AssociatedPair> - Parameters:
H
- The model.
-
computeResiduals
Description copied from interface:ModelObservationResidualN
Compute the residual errors for the observation- Specified by:
computeResiduals
in interfaceModelObservationResidualN<DMatrixRMaj,
AssociatedPair> - Parameters:
p
- Observation of point feature in two views- Returns:
- The new index. index + getN()
-
error1
public double error1(double x1, double y1, double x2, double y2) x2 = H*x1 -
error2
public double error2(double x1, double y1, double x2, double y2) -
computeJacobian
-
getN
public int getN()Description copied from interface:ModelObservationResidualN
The number of outputs- Specified by:
getN
in interfaceModelObservationResidualN<DMatrixRMaj,
AssociatedPair> - Returns:
- number of outputs
-