Docsity

Coordinate Transformations - Lecture Notes | SURE 440, Study notes of Engineering

Toggle sidebar
bg1
COORDINATE TRANSFORMATIONS
Surveying Engineering Department
Ferris State University
Basic Principles
A coordinate transformation is a mathematical process whereby coordinate values expressed in one
system are converted (transformed) into coordinate values for a second coordinate system. This
does not change the physical location of the point. An example is when the field surveyor sets up
an arbitrary coordinate system, such as orienting the axes along two perpendicular roads. Later, the
office may want to place this survey onto the state plane coordinate system. This can be done by a
simple transformation. The geometry is shown in figure 1.
Figure 1. Geometry of simple linear transformation in two dimensions.
In figure 1, a point P can be expressed in a U, V coordinate system as UP and VP. Likewise, in the
X, Y coordinate system, the point is defined as XP and YP. Assume for the time that both systems
share the same origin. Then the X-axis is oriented at some angle α from the U-axis. The same
applies for the Y and V axes. The X-coordinate of the point can be shown to be
epdeX P
+
=
From triangle feP:
α
=⇒=α cos
fP
eP
eP
fP
cos
The XP coordinate can be written as
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Coordinate Transformations - Lecture Notes | SURE 440 and more Study notes Engineering in PDF only on Docsity!

COORDINATE TRANSFORMATIONS

Surveying Engineering Department

Ferris State University

Basic Principles

A coordinate transformation is a mathematical process whereby coordinate values expressed in one

system are converted (transformed) into coordinate values for a second coordinate system. This

does not change the physical location of the point. An example is when the field surveyor sets up

an arbitrary coordinate system, such as orienting the axes along two perpendicular roads. Later, the

office may want to place this survey onto the state plane coordinate system. This can be done by a simple transformation. The geometry is shown in figure 1.

Figure 1. Geometry of simple linear transformation in two dimensions.

In figure 1, a point P can be expressed in a U, V coordinate system as UP and VP. Likewise, in the

X, Y coordinate system, the point is defined as XP and YP. Assume for the time that both systems

share the same origin. Then the X-axis is oriented at some angle α from the U-axis. The same

applies for the Y and V axes. The X-coordinate of the point can be shown to be

X (^) P =de+ep

From triangle feP:

α

α = ⇒ = cos

fP eP eP

fP cos

The XP coordinate can be written as

X (^) P =de+eP

But,

α

α= ∴ =

α= ∴ = α

cos

U

eP eP

U

cos

de Y tan Y

de tan

P P

P P

Then,

= α− α

α= α+

α

α

α

α

= α+

U X cos Y sin

X cos Ysin U

cos

U

cos

Ysin

cos

U

X Y tan

P P P

P P P

P P

P P P

In a similar fashion, the VP coordinate transformation can also be developed.

VP =ab+Pb

But,

⇒ = ( − ) α −

α=

α= ⇒ = α

ab X bc sin X bc

ab sin

bc Y tan Y

bc tan

P P

P P

Therefore, ab becomes

( )

α

α = α−

= − α α

cos

sin X sin Y

ab X Y tan sin 2 P P

P P

and Pb can be shown to be

α

α = ⇒ = cos

Y

Pb Pb

Y

cos P P

The VP coordinate then becomes

a) Transforms comparator coordinates to photo coordinates and is used for correcting film distortion. b) Connecting stereo models. c) Transforms model coordinates to survey coordinates.

The property of the affine transformation is that it will carry parallel lines into parallel lines. In other words, two lines that are parallel to each other prior to the transformation will remain parallel after the transformation. It will not preserve orthogonality.

Figure 2. Physical interpretation of the affine transformation.

Figure 2 shows the physical interpretation involved in this transformation. The x and y axes represent the original axis system while x’, y’ represent the newly transformed coordinate system. The transformation can then be written as

where: Δx’, Δy’ are the translation elements in moving from the center of the original coordinate

system to the center of the transformed coordinate system, Cx , Cy are scale factors in the x and y direction, α is the angle of rotation, and ε is the angle of non-orthogonality between the axes of the transformed coordinate system.

Note that there are six parameters in this transformation (Cx , Cy, α, ε, Δx’, and Δy’). When comparing equations (1) and (2), one can see the following.

( ) ( )

( ) ( ) ( ) ( )

( ) 2 y' C xsin C ycos y'

x' C xcos C ysin x'

x y

x y

=− α+ε + α+ε +Δ

= α+ α+Δ

( ) ( ) ( ) 3 c x' c y'

b C sin b C cos

a C cos a C sin

1 2

1 y 2 y

1 x 2 x

= α = α+ε

= α =− α+ε

The solution of the general affine transformation requires at least three points with coordinate pairs

in both coordinate systems. Three points will yield a unique solution. More points provide more

redundancy and a better solution (generally).

The design matrix can be developed from equation (1) by differentiating the model with respect to

the unknown parameters.

2

' n 2

' n 2

' n 1

' n 1

' n 1

' n

2

' 2 2

' 2 2

' 2 1

' 2 1

' 2 1

' 2

2

' 1 2

' 1 2

' 1 1

' 1 1

' 1 1

' 1

2

' 1 2

' 1 2

' 1 1

' 1 1

' 1 1

' 1

c

y b

y a

y c

y b

y a

y

c

x b

x a

x c

x b

x a

x

c

y b

y a

y c

y b

y a

y

c

x b

x a

x c

x b

x a

x

B

M M M M M M

where

c

x' 0 b

x' 0 a

x'

c

x' y b

x' x a

x'

2 2 2

1 1 1

= ∂

c

y' y b

y' x a

y'

c

y' 0 b

y' 0 a

y'

2 2 2

1 1 1

= ∂

Because the model is linear, the f-matrix is composed of the known values in the second coordinate

system. Thus,

[ ] ' T n

' 2

' 2

' 1

' f = x 1 y x y L y

The normal equations are computed as

B T^ BΔ+BTf= 0 or NΔ+t= 0

with the solution being

N t − 1 Δ=−

xb :=−67.123 y (^) b :=53.

xa :=74.794 y (^) a :=12.

The measured points are:

x 4 :=114.280 y 4 :=−111.749 X 4 :=112.985 Y 4 :=−112.

x 3 :=−114.289 y 3 :=111.699 X 3 :=−112.997 Y 3 :=113.

x 2 :=111.734 y 2 :=114.293 X 2 :=113.001 Y 2 :=112.

x 1 :=−111.734 y 1 :=−114.293 X 1 :=−113.007 Y 1 :=−112.

Input Values: Note that lower case values represent observed comparator coordinates while the upper case represents the known camera calibration coordinates for the respective fiducial values

6-Parameter Coordinate Transformation Program

Solution

Forming the B-matrix and f-matrix:

B

x 1 0 x 2 0 x 3 0 x 4 0

y (^1) 0 y (^2) 0 y (^3) 0 y (^4) 0

1 0 1 0 1 0 1 0 0 x 1 0 x 2 0 x 3 0 x 4

0 y (^1) 0 y (^2) 0 y (^3) 0 y (^4)

0 1 0 1 0 1 0 1 ⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝

⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

:= f

X 1 Y 1 X 2 Y 2 X 3 Y 3 X 4 Y 4

⎛⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝

⎞⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

:=

N B T ( (^) B)

− 1 := The variance-covariance matrix is: (^) QXX :=N

QXX

19.573E- −1.603E- 44.019E- 0E+ 0E+ 0E+

−1.603E- 19.573E- 244.661E- 0E+ 0E+ 0E+

44.019E- 244.661E- 250E- 0E+ 0E+ 0E+

0E+ 0E+ 0E+ 19.573E- −1.603E- 44.019E-

0E+ 0E+ 0E+ −1.603E- 19.573E- 244.661E-

0E+ 0E+ 0E+ 44.019E- 244.661E- 250E-

=

t B T := f

t

−0. − 578.

−0.

=

The solution vector is: (^) Δ :=N ⋅t

Δ

−0. − 0.

=

Note that Δ is in the form [ ] T a 1 b 1 c 1 a 2 b 2 c 2 as identified in equation 1.

The resisuals are (^) V :=B ⋅ Δ−f

V

−0. − 0. − 0. − 0.

=

The reference variance for the adjustment is

σ

V T ⋅V 2

:= σ =( 0.001)

∂α

∂α

∂α

∂α

y '

y x'

y y C

y C

y

y'

x x'

x x C

x C

x

y'

y x'

y y C

y C

y

y'

x x'

x x C

x C

x

B

' n

' n

' n y

' n x

' n

' 2

' 2

' 2 y

' 2 x

' 2

' 1

' 1

' 1 y

' 1 x

' 1

' 1

' 1

' 1 y

' 1 x

' 1

M M M M M

The solution will also require initial estimates of the parameters. Generally, in conventional

analytical photogrammetry, the rotation angle is close to zero and scale factors are close to one.

The translations need to be estimated in some fashion. The discrepancy vector is found by comparing the observed values to the estimates of the observed values using the back solution with

the current estimates of the parameters. Rearranging equation (4), we can write the transformation

formula as

( ) ( ) ( )

(C cos ) y y' (C sin ) x y' ( 5 b)

C cos x x' C sin y x' 5 a

y x

x y α = + α − Δ

α = − α −Δ

Solving for y in (5b) yields

( ) α

  • α −Δ = C cos

y' C sin x y' y y

x

Substitute this value of y into equation (5a).

( ) ( )

( )

( )

(C cos C sin tan ) x' y'tan y'tan x'

x' y'tan C sin tan x y'tan x'

x' C cos

y' C sin x y' C cos x x' C sin

x x

x

y

x x y

α+ α α = − α+Δ α− Δ

= − α− α α +Δ α−Δ

α

  • α −Δ α = − α

( )

( ) 6 C cos sin tan

x' y'tan y'tan x' x x α+ α α

− α+Δ α−Δ

In a similar vein, from equation (5a), solve for x.

( )

α

− α −Δ

C cos

x' C sin y x' x x

y

Substitute this value of x into equation (5b) and solve for y.

( ) ( )

( )

( )

(C (^) cos C sin tan ) (^) y y' x'tan x'tan y'

y' x'tan C sin tan y x'tan y'

y' C cos

x' C sin y x C cos y y' C sin

y y

y

x

y y x

α+ α α = + α−Δ α− Δ

= + α− α α −Δ α−Δ

α

− α −Δ α = + α

( )

C cos sin tan

y' x'tan x'tan y' y y α+ α α

  • α−Δ α−Δ =

Equations (6) and (7) are used to estimate what the observed quantity should be given the current

estimates of the parameters and the known quantities. The discrepancy vector, f, is found using

these two equations with the observed quantity, l. The subscript ‘o’ indicates the current estimates

of the parameters in the transformation model.

( )

( ) ( )

( )

( )

( )

( )

( ) ⎥

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

C cos sin tam

y x tan x'tan y' y

C cos sin tam

x y tan y'tan x' x

C cos sin tam

y x tan x'tan y' y

C cos sin tam

x y tan y'tan x' x

Fy

Fx

Fy

Fx

f

x

' n

' n n

x

' 2

' 2 2

x

' 1

' 1 1

x

' 1

' 1 1

2 n n o

3 2 o

2 1 o

1 1 o

l^ M

M

l

l

l

Just as in any least squares solution, the current estimates of the parameters must be updated. The alteration vector, Δ, represents the correction to be added to the current estimates of the parameters.

In other words,

δΔ

δΔ

δα

δ

δ

y '

x'

C

C

y

x

The parameters are updated and a new solution is found for the problem. The problem iterates until the corrections within the alteration vector are small enough and diverges to the solution. The

alteration vector is small enough so as to have no general impact on the solution.

Example of an Othogonal Affine Transformation

f

x 1

X 1 − Y 1 ⋅tan (^ α)+a

Cx ⋅d

−

y (^1)

Y 1 +X 1 ⋅ tan (α^ )−c

Cy ⋅d

−

x 2

X 2 − Y 2 ⋅tan ( α)+a

Cx ⋅d

−

y (^2)

Y 2 +X 2 ⋅ tan (α^ )−c

Cy ⋅d

−

x 3

X 3 − Y 3 ⋅tan (^ α)+a

Cx ⋅d

−

y (^3)

Y 3 +X 3 ⋅ tan (α^ )−c

Cy ⋅d

−

x 4

X 4 − Y 4 ⋅tan ( α)+a

Cx ⋅d

−

y (^4)

Y 4 +X 4 ⋅ tan (α^ )−c

Cy ⋅d

−

:= f

−1. − 1.

−1. − 1.

=

t B T := ⋅f

t

−1161.

−0.

=

The solution vector is: (^) Δ :=N ⋅t

Updating the Estimates of the Parameters

Δ

−0.

−0.

= Cx := Cx −Δ 1 Cx =0. Cy := Cy −Δ 2 Cy =0. α := α −Δ 3 α =0.

Δx := Δx −Δ 4 Δx =−0. Δy := Δy −Δ 5 Δy =0.

The Second Iteration is as follows:

Forming the B-matrix and f-matrix:

B

x 1 ⋅cos (^ α)

− x 1 ⋅sin (α^ )

x 2 ⋅cos (^ α)

− x 2 ⋅sin (α^ )

x 3 ⋅cos (^ α)

− x 3 ⋅sin (α^ )

x 4 ⋅cos (^ α)

− x 4 ⋅sin (α^ )

y 1 ⋅sin (α^ )

y 1 ⋅cos (^ α)

y 2 ⋅sin (α^ )

y 2 ⋅cos (^ α)

y 3 ⋅sin (α^ )

y 3 ⋅cos (^ α)

y 4 ⋅sin (α^ )

y 4 ⋅cos (^ α)

− C x⋅ x 1 ⋅ sin (α^ )+Cy ⋅ y 1 ⋅cos (^ α)

− C x⋅ x 1 ⋅ cos (^ α)−Cy ⋅ y 1 ⋅sin (^ α)

− C x⋅ x 2 ⋅ sin (α^ )+Cy ⋅ y 2 ⋅cos (^ α)

− C x⋅ x 2 ⋅ cos (^ α)−Cy ⋅ y 2 ⋅sin (^ α)

− C x⋅ x 3 ⋅ sin (α^ )+Cy ⋅ y 3 ⋅cos (^ α)

− C x⋅ x 3 ⋅ cos (^ α)−Cy ⋅ y 3 ⋅sin (^ α)

− C x⋅ x 4 ⋅ sin (α^ )+Cy ⋅ y 4 ⋅cos (^ α)

− C x⋅ x 4 ⋅ cos (^ α)−Cy ⋅ y 4 ⋅sin (^ α)

1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

:=

N B T ( (^) B)

− 1 :=

The variance-covariance matrix is: (^) QXX :=N

QXX

19.573E- −65.674E- − 801.884E- 44.026E- −498.717E-

− 65.674E- 19.573E- 801.893E- 2.791E- 244.647E-

−801.884E- 801.893E- 9.791E- 122.1E- −23.404E-

44.026E- 2.791E- 122.1E- 250E- −258.227E-

− 498.717E- 244.647E- −23.404E- − 258.227E- 250E-

=

a := Δy ⋅ tan (α^ )−Δx c := Δx ⋅ tan (^ α)+Δy d :=cos (^ α)^ +sin (^ α)^ ⋅tan (α^ )

f

x 1

X 1 − Y 1 ⋅tan (α^ )+a

Cx ⋅d

−

y (^1)

Y 1 +X 1 ⋅ tan (^ α)−c

Cy ⋅d

−

x 2

X 2 − Y 2 ⋅tan (α )+a

Cx ⋅d

−

y (^2)

Y 2 +X 2 ⋅ tan (^ α)−c

Cy ⋅d

−

x 3

X 3 − Y 3 ⋅tan (α^ )+a

Cx ⋅d

−

y (^3)

Y 3 +X 3 ⋅ tan (^ α)−c

Cy ⋅d

−

x 4

X 4 − Y 4 ⋅tan (α )+a

Cx ⋅d

−

y (^4)

Y 4 +X 4 ⋅ tan (^ α)−c

Cy ⋅d

−

:= f

4.931 × 10 − 3

−3.516 × 10 − 3

9.687 × 10 − 3 − 0. − 0.

− 5.516 × 10 − 3

=

also called the Helmert transformation, similarity transformation, Euclidean transformation, and

conformal transformation. It is shown as:

y' Cxsin Cycos y' ( 8 b)

x' Cxcos Cysin x' ( 8 a)

=− α+ α+ Δ

= α+ α+Δ

If one recalls those equalities expressed in equation (3), we can see that

Therefore, equation (8) can be expressed as

1 1 2

1 1 1

y' bx a y c

x' ax by c

or, as normally shown as:

In this form (9), the transformation is linear. The back solution is developed in a similar manner as

discussed under the orthogonal transformation section. From equation (9), rewrite the equations in

terms of x and y.

a

y' bx d y a

x' by c x

x' ax by c y' ay bx d

  • − =

Then, substituting x and y into the respective right hand sides of equations gives

( ) ( ) ( )

( ) ( ) 2 2

2 2

2 2

a b

a x' c by' d x

xa b a x' c b y' d

a x ax' by' b x bd ac

c a

y' bx d ax x' b

and

1 2

1 2

Csin b a

Ccos a b

− α=− =

α= =

( ) 9 y' bx ay d

x' ax by c

( ) ( ) ( )

( ) ( ) ( 2 2 )

2 2

2 2

a b

bx' c a y' d y

ya b bx' c a y' d

a y ay' bx' by bc ad

d a

x' by c ay y' b

Thus, the back solution is shown as:

( ) ( )

( ) ( )

( 10 )

a b

b x' c a y' d y

a b

a x' c by' d x

2 2

2 2

Example of an Isogonal Affine Transformation:

The example that has been used in the last two transformation types is also given here for the isogonal affine transformation. The results are as shown below.

4-Parameter Coordinate Transformation Program

Solution

Forming the B-matrix and f-matrix:

B

x 1

y (^1)

x 2

y (^2) x 3

y (^3)

x 4

y (^4)

y (^1)

−x 1

y (^2)

−x 2 y (^3)

−x 3

y (^4)

−x 4

1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎝ ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠

:= f

X 1

Y 1

X 2

Y 2 X 3

Y 3

X 4

Y 4

:=

The Transformed coordinates become:

Xa := Δ 1 ⋅ xa+ Δ 2 ⋅y (^) a+Δ 3 Xa =74.

Ya := −Δ 2 ⋅ xa+ Δ 1 ⋅y (^) a+Δ 4 Ya =11.

Xb := Δ 1 ⋅ xb+ Δ 2 ⋅y (^) b+Δ 3 Xb =−66.

Yb := −Δ 2 ⋅ xb+ Δ 1 ⋅y (^) b+Δ 4 Yb =54.

For simplicity, the linear form of the isogonal affine transformation was used. What would be

interesting would be to see if the non-linear model would result in the same answers. The solution

will require the formation of the Jacobian matrix using equation (8). The design matrix is thus,

∂α

∂α

∂α

∂α

y '

y x'

y y C

y

y'

x x'

x x C

x

y'

y x'

y y C

y

y'

x x'

x x C

x

B

' 4

' 4

' 4

' 4

' 2

' 2

' 2

' 2

' 1

' 1

' 1

' 1

' 1

' 1

' 1

' 1

M M M M

where:

y'

x Cx sin Cy cos

x

x'

x x cos y sin C

x

' i i i

' i

' i i i

' i

=− α+ α ∂α

= α+ α ∂

y'

y Cx cos Cy sin

y

x'

y x sin y cos C

y

' i i i

' i

' i i i

' i

=− α− α ∂α

=− α+ α ∂

Like we have done previously, use equation (8) to isolate the variables x and y. Thus we can write

α

  • α−Δ = α

− α−Δ

Ccos

y' Cxsin y' y Ccos

x' Cysin x' x

Taking the value for y, substitute this into equation (8a) and solve for x.

( ) ( )

( )

( α+ α α)

− α+Δ α−Δ

α+ α α = − α+Δ α−Δ

α

  • α−Δ α = − α

Ccos sin tan

x' y'tan y'tan x' x

x Ccos Csin tan x' y'tan y'tan x'

x' Ccos

y' Cxsin y' xCcos x' Csin

In a similar vein, substitute the value for x computed above into equation (8b) and solve for y.

( ) ( )

( )

( α+ α α)

  • α−Δ α−Δ =

α+ α α = + α−Δ α−Δ

α

− α−Δ α = + α

Ccos sin tan

y' x'tan x'tan y' y

yCcos Csin tan y' x'tan x'tan y'

y' Ccos

x' Cysin x' yCcos y' Csin

The discrepancy vector, f, is then found using the following relationship.

( )

( )

( )

( ) ⎥

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

α+ α α

− α+Δ α−Δ −

Ccos sin tan

y x tan x'tan y' y

Ccos sin tan

x y tan y'tan x' x

Ccos sin tan

y x tan x'tan y' y

Ccos sin tan

x y tan y'tan x' x

f

' 4

' 4 4

' 2

' 2 2

' 1

' 1 1

' 1

' 1 1

M

The following MathCAD program shows the results of the adjustment. For the first iteration, the

initial estimates of the parameters are: C = 1.0, α = 0.0, Δx’ = 0.0 and Δy’ = 0.0. The solution converged on the second iteration and the results are the same in both cases, as one would expect.

Note that Δ in the linear model yields the solution to the parameters directly whereas in the non-

linear model it represents alterations (here expressed in terms of an error which is why it is

subtracted) to be applied to the current estimates of the parameters.

4-Parameter Coordinate Transformation Program