java.lang.Object
imagingbook.common.geometry.fitting.points.ProjectiveFit2d
- All Implemented Interfaces:
LinearFit2d
This class implements 2D point fitting under projective (4-point) transformations (exact and least-squares). See Sec. 21.1.4 of [1] for details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/08/01
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetError()Returns the total error for this fit.double[][]Returns the (3,3) or (2,3) transformation matrix A for this fit, such thaty_i ~ A * x_i(withx_iin homogeneous coordinates).
-
Constructor Details
-
ProjectiveFit2d
Constructor. Fits two sequences of 2D points using a projective transformation model. At least 4 point pairs are required. For 4 point pairs, the solution is an exact fit, otherwise a least-squares fit is found.- Parameters:
P- the source pointsQ- the target points
-
-
Method Details
-
getTransformationMatrix
Description copied from interface:LinearFit2dReturns the (3,3) or (2,3) transformation matrix A for this fit, such thaty_i ~ A * x_i(withx_iin homogeneous coordinates).- Specified by:
getTransformationMatrixin interfaceLinearFit2d- Returns:
- the transformation matrix for this fit
-
getError
Description copied from interface:LinearFit2dReturns the total error for this fit.- Specified by:
getErrorin interfaceLinearFit2d- Returns:
- the fitting error
-