Class ProjectiveTransform
java.lang.Object
com.vividsolutions.jump.warp.CoordinateTransform
com.vividsolutions.jump.warp.ProjectiveTransform
Giuseppe Aruta (2013)
This class derives from OpenJUMP original AffineTransformation class
and it implements a ProjectiveTransform that is initialized by specifying
four couples of points (source to target).
The matrix is a dapted from http://graphics.lcs.mit.edu/classes/6.837/F01/Lecture07/lecture07.pdf
[ x1_ ] = [ x1 y1 1 0 0 0 -x1x1_ -y1x1_ ] [ a11 ]
[ y1_ ] = [ 0 0 0 x1 y1 1 -x1y1_ -y1y1_ ] [ a12 ]
[ x2_ ] = [ x2 y2 1 0 0 0 -x2x2_ -y2x2_ ] [ a13 ]
[ y2_ ] = [ 0 0 0 x2 y2 1 -x2y2_ -y2y2_ ] [ a21 ]
[ x3_ ] = [ x3 y3 1 0 0 0 -x3x3_ -y3x3_ ] [ a22 ]
[ y3_ ] = [ 0 0 0 x3 y3 1 -x3y3_ -y3y3_ ] [ a23 ]
[ x4_ ] = [ x3 y3 1 0 0 0 -x4x4_ -y4x4_ ] [ a31 ]
[ y4_ ] = [ 0 0 0 x3 y3 1 -x4y4_ -y4y4_ ] [ a32 ]
See also http://en.wikipedia.org/wiki/Homography for Homographic transformations
and-
Constructor Summary
ConstructorsConstructorDescriptionProjectiveTransform(org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p1_, org.locationtech.jts.geom.Coordinate p2, org.locationtech.jts.geom.Coordinate p2_, org.locationtech.jts.geom.Coordinate p3, org.locationtech.jts.geom.Coordinate p3_, org.locationtech.jts.geom.Coordinate p4, org.locationtech.jts.geom.Coordinate p4_) A transformation that maps p1 to p1_, p2 to p2_, p3 to p3_ and p4 to p4_ -
Method Summary
Modifier and TypeMethodDescriptionorg.locationtech.jts.geom.Coordinatetransform(org.locationtech.jts.geom.Coordinate c) Applies the prospective transform to a point.Methods inherited from class CoordinateTransform
transform, transform
-
Constructor Details
-
ProjectiveTransform
public ProjectiveTransform(org.locationtech.jts.geom.Coordinate p1, org.locationtech.jts.geom.Coordinate p1_, org.locationtech.jts.geom.Coordinate p2, org.locationtech.jts.geom.Coordinate p2_, org.locationtech.jts.geom.Coordinate p3, org.locationtech.jts.geom.Coordinate p3_, org.locationtech.jts.geom.Coordinate p4, org.locationtech.jts.geom.Coordinate p4_) A transformation that maps p1 to p1_, p2 to p2_, p3 to p3_ and p4 to p4_- Parameters:
p1- a pointp1_- the point p1 maps top2- another pointp2_- the point p2 maps top3- another pointp3_- the point p3 maps top4- another pointp4_- the point p4 maps to
-
-
Method Details
-
transform
public org.locationtech.jts.geom.Coordinate transform(org.locationtech.jts.geom.Coordinate c) Applies the prospective transform to a point. From http://graphics.lcs.mit.edu/classes/6.837/F01/Lecture07/lecture07.pdf:[ wx_ ] = [ P11 P12 P13 ] [ x ] [ wy_ ] = [ P21 P22 P23 ] [ y ] [ w ] = [ P31 P32 1 ] [ 1 ]- Specified by:
transformin classCoordinateTransform- Parameters:
c- the input to the projective transform- Returns:
- the result of applying the projective transform to c
-