public class ProjectiveTransformBuilder extends MathTransformBuilder
[ x'] [ m00 m01 m02 ] [ x ] [ y'] = [ m10 m11 m12 ] [ y ] [ 1 ] [ m20 m21 1 ] [ 1 ] x' = m * xIn 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*mUsing the least square method we get this result:
m = (ATPA)-1 ATPx'
Modifier and Type | Field and Description |
---|---|
protected GeneralMatrix |
A
Matrix of derivations
|
protected GeneralMatrix |
P
Matrix of wights
|
protected GeneralMatrix |
X
Matrix of target values
|
mtFactory
Modifier | Constructor and Description |
---|---|
protected |
ProjectiveTransformBuilder() |
|
ProjectiveTransformBuilder(List<MappedPosition> vectors)
Creates ProjectiveTransformBuilder for the set of properties.
|
Modifier and Type | Method and Description |
---|---|
protected double[] |
calculateLSM()
Calculates the parameters using the least square method.
|
protected MathTransform |
computeMathTransform()
Calculates the math transform immediately.
|
protected void |
fillAMatrix()
Fills A matrix for m = (ATPA)-1 ATPx' equation
|
protected void |
fillPMatrix()
Fills P matrix for m = (ATPA)-1 ATPx' equation
|
protected void |
fillXMatrix()
Fills x' matrix for m = (ATPA)-1 ATPx' equation
|
Class<? extends CartesianCS> |
getCoordinateSystemType()
Returns the required coordinate system type, which is cartesian CS.
|
int |
getMinimumPointCount()
Returns the minimum number of points required by this builder, which is 4 by default.
|
protected GeneralMatrix |
getProjectiveMatrix()
Returns the matrix of parameters for Projective transformation.
|
void |
includeWeights(boolean include)
Switch whether to include weights into the calculation.
|
getDimension, getErrorStatistics, getMappedPositions, getMathTransform, getName, getSourceCRS, getSourcePoints, getTargetCRS, getTargetPoints, getTransformation, printPoints, setMappedPositions, setSourcePoints, setTargetPoints, toString
protected GeneralMatrix A
protected GeneralMatrix P
protected GeneralMatrix X
protected ProjectiveTransformBuilder()
public ProjectiveTransformBuilder(List<MappedPosition> vectors) throws IllegalArgumentException, MismatchedDimensionException, MismatchedReferenceSystemException
vectors
- list of MappedPositionMismatchedSizeException
- if the number of properties is not set properly.MismatchedDimensionException
- if the dimension of properties is not set properly.MismatchedReferenceSystemException
- -if there is mismatch in coordinate system in
MappedPositionIllegalArgumentException
public int getMinimumPointCount()
getMinimumPointCount
in class MathTransformBuilder
public Class<? extends CartesianCS> getCoordinateSystemType()
getCoordinateSystemType
in class MathTransformBuilder
protected void fillPMatrix() throws MissingInfoException
MissingInfoException
- if accuracy is not defined.protected void fillAMatrix()
protected void fillXMatrix()
public void includeWeights(boolean include) throws MissingInfoException
include
- if true then the weights will be included onto the calculation. False is
default.FactoryException
- if all or some of the points
does not have accuracy setup properly.MissingInfoException
protected double[] calculateLSM()
m = (ATA)-1 ATx'
protected GeneralMatrix getProjectiveMatrix()
[ m00 m01 m02 ] [ m10 m11 m12 ] [ m20 m21 1 ]
protected MathTransform computeMathTransform()
MathTransformBuilder
computeMathTransform
in class MathTransformBuilder
MappedPosition
.Copyright © 1996–2019 Geotools. All rights reserved.