Class ProjectiveTransformBuilder

  • Direct Known Subclasses:
    AffineTransformBuilder, SimilarTransformBuilder

    public class ProjectiveTransformBuilder
    extends MathTransformBuilder
    Builds MathTransform setup as Projective transformation from a list of MappedPosition. The calculation uses least square method. The Projective transform equation: (2D). The calculation uses least square method. Projective transform equation:
      [ x']   [  m00  m01  m02  ] [ x ]
       [ y'] = [  m10  m11  m12  ] [ y ]
       [ 1 ]   [  m20  m21    1  ] [ 1 ]                           x' = m * x
     
    In the case that we have more identical points we can write it like this (in Matrix):
      [ x'1 ]      [ x1 y1 1  0  0  0 -x'x  -x'y]   [ m00 ]
      [ x'2 ]      [ x2 y2 1  0  0  0 -x'x  -x'y]   [ m01 ]
      [  .  ]      [             .              ]   [ m02 ]
      [  .  ]      [             .              ] * [ m10 ]
      [ x'n ]   =  [ xn yn 1  0  0  0 -x'x  -x'y]   [ m11 ]
      [ y'1 ]      [ 0  0  0  x1 y1 1 -y'x  -y'y]   [ m12 ]
      [ y'2 ]      [ 0  0  0  x2 y2 1  -y'x  -y'y]   [ m20 ]
      [  .  ]      [             .              ]   [ m21 ]
      [  .  ]      [             .              ]
      [ y'n ]      [ 0  0  0  xn yn 1  -y'x  -y'y]
      x' = A*m 
    Using the least square method we get this result:
    m = (ATPA)-1 ATPx'
    Since:
    2.4
    Author:
    Jan Jezek