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

public class AffineFit2d extends Object implements LinearFit2d

This class implements 2D point fitting under affine (three-point) transformations (exact and least-squares). See Sec. 21.1.3 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

    • AffineFit2d

      public AffineFit2d(Pnt2d[] P, Pnt2d[] Q)
      Constructor. Fits two sequences of 2D points using an affine transformation model. At least 3 point pairs are required. For 3 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