Class ProjectiveFit2d

java.lang.Object
imagingbook.common.geometry.fitting.points.ProjectiveFit2d
All Implemented Interfaces:
LinearFit2d

public class ProjectiveFit2d extends Object implements 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 Details

    • ProjectiveFit2d

      public ProjectiveFit2d(Pnt2d[] P, Pnt2d[] Q)
      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 points
      Q - the target points
  • Method Details

    • getTransformationMatrix

      public double[][] getTransformationMatrix()
      Description copied from interface: LinearFit2d
      Returns the (3,3) or (2,3) transformation matrix A for this fit, such that y_i ~ A * x_i (with x_i in homogeneous coordinates).
      Specified by:
      getTransformationMatrix in interface LinearFit2d
      Returns:
      the transformation matrix for this fit
    • getError

      public double getError()
      Description copied from interface: LinearFit2d
      Returns the total error for this fit.
      Specified by:
      getError in interface LinearFit2d
      Returns:
      the fitting error