C# Class SharpMap.Utilities.LeastSquaresTransform

Calculates Affine and Helmert transformation using Least-Squares Regression of input and output points
显示文件 Open project: jumpinjackie/fdotoolbox

Public Methods

Method Description
AddInputOutputPoint ( SharpMap input, SharpMap output ) : void

Adds an input and output value pair to the collection

GetAffineTransformation ( ) : double[]

Return an array with the six affine transformation parameters {a,b,c,d,e,f} and the sum of the squares of the residuals (s0)

a,b defines scale vector 1 of coordinate system, d,e scale vector 2. c,f defines offset.

Converting from input (X,Y) to output coordinate system (X',Y') is done by: X' = a*X + b*Y + c, Y' = d*X + e*Y + f

Transformation based on Mikhail "Introduction to Modern Photogrammetry" p. 399-300. Extended to arbitrary number of measurements by M. Nielsen

GetHelmertTransformation ( ) : double[]

Calculates the four helmert transformation parameters {a,b,c,d} and the sum of the squares of the residuals (s0)

a,b defines scale vector 1 of coordinate system, d,e scale vector 2. c,f defines offset.

Converting from input (X,Y) to output coordinate system (X',Y') is done by: X' = a*X + b*Y + c, Y' = -b*X + a*Y + d

This is a transformation initially based on the affine transformation but slightly simpler.

GetInputPoint ( int i ) : SharpMap.Geometries.Point

Gets the input point value at the specified index

GetOutputPoint ( int i ) : SharpMap.Geometries.Point

Gets the output point value at the specified index

LeastSquaresTransform ( ) : System

Initialize Least Squares transformations

RemoveInputOutputPointAt ( int i ) : void

Removes input and output value pair at the specified index

SetInputPointAt ( SharpMap p, int i ) : void

Sets the input point value at the specified index

SetOutputPointAt ( SharpMap p, int i ) : void

Sets the output point value at the specified index

Private Methods

Method Description
CreateMatrix ( int n, int m ) : double[][]

Creates an n x m matrix of doubles

Method Details

AddInputOutputPoint() public method

Adds an input and output value pair to the collection
public AddInputOutputPoint ( SharpMap input, SharpMap output ) : void
input SharpMap
output SharpMap
return void

GetAffineTransformation() public method

Return an array with the six affine transformation parameters {a,b,c,d,e,f} and the sum of the squares of the residuals (s0)
a,b defines scale vector 1 of coordinate system, d,e scale vector 2. c,f defines offset.

Converting from input (X,Y) to output coordinate system (X',Y') is done by: X' = a*X + b*Y + c, Y' = d*X + e*Y + f

Transformation based on Mikhail "Introduction to Modern Photogrammetry" p. 399-300. Extended to arbitrary number of measurements by M. Nielsen

public GetAffineTransformation ( ) : double[]
return double[]

GetHelmertTransformation() public method

Calculates the four helmert transformation parameters {a,b,c,d} and the sum of the squares of the residuals (s0)

a,b defines scale vector 1 of coordinate system, d,e scale vector 2. c,f defines offset.

Converting from input (X,Y) to output coordinate system (X',Y') is done by: X' = a*X + b*Y + c, Y' = -b*X + a*Y + d

This is a transformation initially based on the affine transformation but slightly simpler.

public GetHelmertTransformation ( ) : double[]
return double[]

GetInputPoint() public method

Gets the input point value at the specified index
public GetInputPoint ( int i ) : SharpMap.Geometries.Point
i int index
return SharpMap.Geometries.Point

GetOutputPoint() public method

Gets the output point value at the specified index
public GetOutputPoint ( int i ) : SharpMap.Geometries.Point
i int index
return SharpMap.Geometries.Point

LeastSquaresTransform() public method

Initialize Least Squares transformations
public LeastSquaresTransform ( ) : System
return System

RemoveInputOutputPointAt() public method

Removes input and output value pair at the specified index
public RemoveInputOutputPointAt ( int i ) : void
i int
return void

SetInputPointAt() public method

Sets the input point value at the specified index
public SetInputPointAt ( SharpMap p, int i ) : void
p SharpMap Point value
i int index
return void

SetOutputPointAt() public method

Sets the output point value at the specified index
public SetOutputPointAt ( SharpMap p, int i ) : void
p SharpMap Point value
i int index
return void