Download - Nick 2D Tran
-
7/27/2019 Nick 2D Tran
1/33
2D Coordinate Transformations
Nick Battjes, Senior Student
Bluelake
GreenPark
Dark
Rive
rRedHills
WGStation
Spatial data without coordinates Control Points
Bluelake
Green Park
Dark
Rive
r
Red Hills
WG Station
-
7/27/2019 Nick 2D Tran
2/33
Integrating of maps and spatial data in local coordinate system into aworld database system.
Note how the vector data (USGS Road layer) should be transformedto match the raster data (Ikonos 1 meter res. Image)
Applications
-
7/27/2019 Nick 2D Tran
3/33
Three different transformation primitives for theSimilarity transformation:
Translation-origin is moved, axes do not rotate i.e.:
Xn = X0 DX0 Yn = Y0 DY0
Scaling -both origin and axes are fixed, scale change
Xn = sXX0 Yn = sY Y0
Rotation - origin fixed, axes move (rotate about origin)
Xn = X0 cos() + Y0 sin(); Yn = - X0 sin() + Y0 cos()
2D Spatial Transformations
-
7/27/2019 Nick 2D Tran
4/33
Two-Dimensional
Geographic Transformations
Xn
Yn
X0
Y0
Xn
Yn
X0
Y0
Xn
Yn
X0
Y0
Translation Scaling Rotation
-
7/27/2019 Nick 2D Tran
5/33
Moves and rotates objects in 2D and 3D space. Additionally,
you can scale the objects based on alignment points whenusing the 2D option.
Conformal Transformation
-
7/27/2019 Nick 2D Tran
6/33
Isogonal: having equal angles
Impose additional condition of equal scale (S = Cx =Cy) yielding 4 parameters: S, , DX0, DY0
Moves and rotates and scale objects in 2D space.
Isogonal Affine Transformation
or Conformal/SimilarityTransformation
cos sin* * *
sin cos
Xn a b Xo c Xo DXoS
Yn b a Yo d Yo DYo
4 parameters: Sscale, rotation, DX0, DY0 shifts in X and Y.
Xn,Yn are the transformed coordinates.
Xo, Yo are the original coordinates.
Two given points are required ( X1,Y1 and X2,Y2)
-
7/27/2019 Nick 2D Tran
7/33
Conformal Transformation
Moves and rotates and scale objects in 2D space.
Often called similarity Transformation since the basic shaperemain similar after the transformation
-
7/27/2019 Nick 2D Tran
8/33
The formulas can be written in different forms1. To compute the parameters given the coordinates
2. To compute the new coordinates given the parameters
0 0 0
0 0 0
cos sin
sin cos
Xn S X S Y DX
Yn S X S Y DY
0 0
0 0
Xn a X b Y c
Yn b X a Y d
0 0
0 0
1 0
0 1
a
X YXn b
Y XYn c
d
Conformal Transformation
-
7/27/2019 Nick 2D Tran
9/33
The formulas can be written in different forms3. To compute the old coordinates given the parameters and new
coordinates (back substitution)
0 0
0 0
Xn a X b Y c
Yn b X a Y d
Conformal/SimilarityTransformation
0 0
0 0
( )
( )
Xn c a X b Y
Yn d b X a Y
2
0 0
2
0 0
( )( )
a Xn c a X ab Y b Yn d b X ab Y
Multiply Eq. 1 by a, Eq 2 by b
0 2 2
0 2 2
a Xn c b Yn d
X a b
b Xn c a Yn d Y
a b
Add equations to get X0
The same operation to
obtain Y0
-
7/27/2019 Nick 2D Tran
10/33
Moves, rotates and scale objects in 2D space.
Cy
Cx
Yo
Xo
ab
ba
Yn
Xn*
y
x
x
Cab
Cba
Cyab
Cba
6080300
6080250
1010190
1010350
No Xo
(map)
Yo
(map)
Xn
(ground)
Yn
(ground)
1 10 10 350 190
2 80 60 250 300
y
x
C
C
ba
*
108060
016080
101010011010
300
250
190350
Conformal Transformation: Example
-
7/27/2019 Nick 2D Tran
11/33
Transform a given point X0=121.48, Y0=22.78
The point is transformed to Xn=310.59, Yn=373.6773
865.174
189.369
716.1203.0
300
250
190350
*
108060
016080
101010011010
1
y
x
C
C
ba
6773.37359.310
865.174189.369
78.2248.121*
203.0716.1716.1203.0
YnXn
Conformal Transformation:
Example
-
7/27/2019 Nick 2D Tran
12/33
Used in photogrammetry for:
Transform comparator coordinates to photo coordinates and
used for correcting film distortion
Transform model coordinates to survey coordinates
Property
Carry parallel lines
into parallel lines
Does not have to
preserve orthogonality
y1
y2
x1
x2
t2
t1
Affine Transformation
-
7/27/2019 Nick 2D Tran
13/33
Physical interpretation:
6 parameters: Cx, Cy, , , Dx0, Dy0, and in linear form:
0 0 0
0 0 0
cos( ) sin
sin cos
x y
x y
Xn C X C Y DX
Yn C X C Y DY
0 0
cos sin
sin cos
x x
y y
a C d C
b C e C
c Dx f Dy
Xn
Yn
X0Y0
DX DY
Cy
Cx
Yo
Xo
dc
ba
Yn
Xn*
Affine Transformation
-
7/27/2019 Nick 2D Tran
14/33
2-D Affine Transformation
The formulas for an affine transformation:
Ifn control points are measured, this Equation is reorganized asfollows:
sT A A A
sT A A A
xx a b c
yy d e f
1 1 1
1 1 1
1 0 0 0
0 0 0 1
1 0 0 0
0 0 0 1
A
T s s
A
T s s
A
A
Tn sn sn
A
Tn sn sn
A
ax x y
by x y
c
dx x y
ey x y
fy A
-
7/27/2019 Nick 2D Tran
15/33
Projective or Polynomial Transformation
Instead of 4 or 6 parameters we have many parameters at
least 8 (8 would be the Bi-linear or projective
transformation)
With more parameters we need more known points to solve
the equations N-equations and N unknowns.
...
...2
052
0400302010
205
20400302010
YbXbXYbYbXbbYn
YaXaXYaYaXaaXn
-
7/27/2019 Nick 2D Tran
16/33
General form
Alternatively,
xybybxbybbxbb'y
xyayaxayaxaa'x
5
2
4
2
3210
5
2
4
2
3210
xy2AyxAyAxAB'y
xy2AyxAyAxAA'x
3
22
4120
422
3210
Polynomial Transformation
-
7/27/2019 Nick 2D Tran
17/33
Frequently used in photogrammetry
General form:
1 0 2 0 3
1 0 2 0
1 0 2 0 3
1 0 2 0
1
1
a X a Y aXn
d X d Y
b X b Y bYn
d X d Y
Projective Transformation
-
7/27/2019 Nick 2D Tran
18/33
Impose condition of orthogonality ( = 0)yielding 5 parameters: Cx, Cy, , x, y
Orthogonal Affine Transformation
0 0 0
0 0 0
cos sin
sin cosx y
x y
Xn C X C Y DX
Yn C X C Y DY
-
7/27/2019 Nick 2D Tran
19/33
Condition: orthogonality and no scale change (Cx =
Cy = 1)
3 parameters: , x, y
Rigid Body Transformation
0 0 0
0 0 0
cos sinsin cos
Xn X Y DXYn X Y DY
-
7/27/2019 Nick 2D Tran
20/33
Least Squares Adjustment ReviewModel of adjustment of indirect observation ( Gauss-Markov model)
n: # of observations
m: # of parameters
f is a vector of given observation
Vis the vector of residuals
B is the matrix of coefficients
W it the matrix of weights (VarianceCovariance matrix)
0 is the reference variance
is the vectors of parameters to be estimated
Number of observation is larger than number of parameters (redundant
observations). The solution that minimize the least-squares criterion
(vTwv) is:
),0(~ 20 WVVBf
nurkB
fWBBWBTT
1
)(
-
7/27/2019 Nick 2D Tran
21/33
Four fiducial marks (1 - 4) and two image points (a and
b) were measured on a comparator. The comparator
photo observations and the known values from the
camera calibration report are given in the following
spreadsheet.
Photo Coordinates Known Values
Point No. x y X Y
1 -111.734 -114.293 -113.007 -112.997
2 111.734 114.293 113.001 112.9893 -114.289 111.699 -112.997 113.004
4 114.280 -111.749 112.985 -112.997
a 74.794 12.202
b -67.123 53.432
General 2D Conformal Transformation,
Example
-
7/27/2019 Nick 2D Tran
22/33
4-Parameter Coordinate Transformation Program______________________________________________________________________________________
Solution
Forming the B-matrix and f-matrix:
B
x1
y1
x2
y2
x3
y3
x4
y4
y1
x1
y2
x2y3
x3
y4
x4
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
f
X1
Y1
X2
Y2
X3
Y3
X4
Y4
General 2D Conformal Transformation,
Example
-
7/27/2019 Nick 2D Tran
23/33
N B
T
B
1
The variance-covariance matrix is: QXX N
QXX
9.787E-006
0E+000
22.02E-009
122.332E-009
0E+000
9.787E-006
122.332E-009
22.02E-009
22.02E-009
122.332E-009
250E-003
0E+000
122.332E-009
22.02E-009
0E+000
250E-003
t BT
f
t
102157.371
1161.611
0.018
0.001
General 2D Conformal Transformation, Example
-
7/27/2019 Nick 2D Tran
24/33
The solution vector is:
N t
0.99977
0.01137
0.00211
0.01222
The resisuals are V B f
V
0.002
0.013
0.004
0.019
0.002
0.020
0.004
0.013
General 2D Conformal Transformation, Example
-
7/27/2019 Nick 2D Tran
25/33
The reference variance for the adjustment is
V
TV
4 0.0003( )
The Transformed coordinates become:
Xa 1 xa 2 ya 3 Xa 74.913
Ya 2 xa 1 ya 4 Ya 11.361
Xb 1 xb 2 yb 3 Xb 66.502
Yb 2 xb 1 yb 4 Yb 54.195
General 2D Conformal Transformation, Example
-
7/27/2019 Nick 2D Tran
26/33
Normally shown as
Unique solution if
0 0
0 0
Xn a X b Y c
Yn d X e Y f
0a b
d e
General 2D Affine Transformation
0 0
0 0
1 0 0 0
0 0 0 1
a
b
X YXn c
X YYn d
e
f
-
7/27/2019 Nick 2D Tran
27/33
Four fiducial marks (1 - 4) and two image points (a andb) were measured on a comparator. The comparator
photo observations and the known values from the
camera calibration report are given in the following
spreadsheet.
Photo Coordinates Known Values
Point No. x y X Y
1 -111.734 -114.293 -113.007 -112.997
2 111.734 114.293 113.001 112.9893 -114.289 111.699 -112.997 113.004
4 114.280 -111.749 112.985 -112.997
a 74.794 12.202
b -67.123 53.432
General 2D Affine Transformation,
Example
-
7/27/2019 Nick 2D Tran
28/33
_____________________________________________________________________________________
yb 53.432xb 67.123
ya 12.202xa 74.794The measured points are:
Y4 112.997X4 112.985y4 111.749x4 114.280
Y3 113.004X3 112.997y3 111.699x3 114.289
Y2 112.989X2 113.001y2 114.293x2 111.734
Y1 112.997X1 113.007y1 114.293x1 111.734
Input Values:Note that low er case values represent observed comparator coordinates w hile the uppercase represents the know n camera calibration coordinates for the respective f iducial values
______________________________________________________________________________________
6-Parameter Coordinate Transformation Program
General Affine Transformation, Example
-
7/27/2019 Nick 2D Tran
29/33
B
x1
0
x2
0
x3
0
x4
0
y1
0
y2
0
y3
0
y4
0
1
0
1
0
1
0
1
0
0
x1
0
x2
0
x3
0
x4
0
y1
0
y2
0
y3
0
y4
0
1
0
1
0
1
0
1
f
X1
Y1
X2
Y2
X3
Y3
X4
Y4
N BT
B 1
General Affine Transformation, Example
Solution: forming the B matrix and f vector
-
7/27/2019 Nick 2D Tran
30/33
The variance-covariance matrix is: QXX N
QXX
19.573E-006
1.603E-009
44.019E-009
0E+000
0E+0000E+000
1.603E-00919.573E-006
244.661E-009
0E+000
0E+0000E+000
44.019E-009
244.661E-009
250E-003
0E+000
0E+0000E+000
0E+000
0E+000
0E+000
19.573E-006
1.603E-00944.019E-009
0E+000
0E+000
0E+000
1.603E-009
19.573E-006244.661E-009
0E+000
0E+000
0E+000
44.019E-009
244.661E-009250E-003
General Affine Transformation, Example
-
7/27/2019 Nick 2D Tran
31/33
t BT
f
t
51079.018
583.52
0.018
578.092
51078.353
0.001
The solution vector is: N t
0.99977
0.01134
0.00211
0.01140
0.99977
0.01222
General Affine Transformation, Example
-
7/27/2019 Nick 2D Tran
32/33
The resisuals are V B f
V
0.001
0.016
0.001
0.016
0.001
0.016
0.001
0.016
The reference variance for the adjustment is
V
TV
2
0.001( )
General Affine Transformation, Example
-
7/27/2019 Nick 2D Tran
33/33
The Transformed coordinates become:
Xa 1 xa 2 ya 3 Xa 74.913
Ya 4 xa 5 ya 6 Ya 11.359
Xb 1 xb 2 yb 3 Xb 66.504
Yb 4 xb 5 yb 6 Yb 54.197
General Affine Transformation, Example