| |
|
| java.lang.Object org.geotools.referencing.operation.builder.MathTransformBuilder org.geotools.referencing.operation.builder.ProjectiveTransformBuilder
All known Subclasses: org.geotools.referencing.operation.builder.AffineTransformBuilder, org.geotools.referencing.operation.builder.SimilarTransformBuilder,
ProjectiveTransformBuilder | public class ProjectiveTransformBuilder extends MathTransformBuilder (Code) | | Builds
setup as Projective transformation from a list of
. 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'
author: Jan Jezek version: $Id: ProjectiveTransformBuilder.java 28982 2008-01-28 16:27:33Z acuster $ since: 2.4 |
ProjectiveTransformBuilder | protected ProjectiveTransformBuilder()(Code) | | |
ProjectiveTransformBuilder | public ProjectiveTransformBuilder(List vectors) throws MismatchedSizeException, MismatchedDimensionException, MismatchedReferenceSystemException(Code) | | Creates ProjectiveTransformBuilder for the set of properties.
Parameters: vectors - list of throws: MismatchedSizeException - if the number of properties is not set properly. throws: MismatchedDimensionException - if the dimension of properties is not set properly. throws: MismatchedReferenceSystemException - -if there is mismatch in coordinate system in |
calculateLSM | protected double[] calculateLSM()(Code) | | Calculates the parameters using the least square method. The
equation:
m = (ATA)-1 ATx'
m matrix. |
computeMathTransform | protected MathTransform computeMathTransform()(Code) | | |
fillAMatrix | protected void fillAMatrix()(Code) | | Fills A matrix for m = (ATPA)-1
ATPx' equation
|
fillXMatrix | protected void fillXMatrix()(Code) | | Fills x' matrix for m = (ATPA)-1
ATPx' equation
|
getCoordinateSystemType | public Class getCoordinateSystemType()(Code) | | Returns the required coordinate system type, which is
.
required coordinate system type |
getMinimumPointCount | public int getMinimumPointCount()(Code) | | Returns the minimum number of points required by this builder,
which is 4 by default. Subclasses like
will reduce this minimum.
minimum number of points required by this builder, which is 4 bydefault. |
getProjectiveMatrix | protected GeneralMatrix getProjectiveMatrix()(Code) | | Returns the matrix of parameters for Projective transformation.
This method should by override for the special cases like affine or
similar transformation. The M matrix looks like this:
[ m00 m01 m02 ]
[ m10 m11 m12 ]
[ m20 m21 1 ]
Matrix M |
includeWeights | public void includeWeights(boolean include) throws MissingInfoException(Code) | | Switch whether to include weights into the calculation. Weights are derived from each point accuracy.
Weight p = 1 / accuracy2.
Parameters: include - if true then the weights will be included onto the calculation. False is default. throws: FactoryException - if all or some of the does not have accuracy setup properly. |
Fields inherited from org.geotools.referencing.operation.builder.MathTransformBuilder | final protected MathTransformFactory mtFactory(Code)(Java Doc)
|
|
|
|