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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeJacobian(Point2D_F64 x1, Point2D_F64 x2) intcomputeResiduals(AssociatedPair p, double[] residuals, int index) Compute the residual errors for the observationdoubleerror1(double x1, double y1, double x2, double y2) x2 = H*x1doubleerror2(double x1, double y1, double x2, double y2) intgetN()The number of outputsvoidSpecify the model being evaluated
-
Constructor Details
-
HomographyResidualSampson
public HomographyResidualSampson()
-
-
Method Details
-
setModel
Description copied from interface:ModelObservationResidualNSpecify the model being evaluated- Specified by:
setModelin interfaceModelObservationResidualN<DMatrixRMaj,AssociatedPair> - Parameters:
H- The model.
-
computeResiduals
Description copied from interface:ModelObservationResidualNCompute the residual errors for the observation- Specified by:
computeResidualsin 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:ModelObservationResidualNThe number of outputs- Specified by:
getNin interfaceModelObservationResidualN<DMatrixRMaj,AssociatedPair> - Returns:
- number of outputs
-