1. TARUNGEHLOTS
Linear Conformal Mapping
The goal of this exercise is to derive a linear transformation from one two-dimensional Euclidean
space to another, given a set of points that are supposed to correspond. The transformation can
involve a change of scale (e.g. dilation or compression) but must otherwise be rigid. In
particular, it must be conformal (i. e. angles and shapes are preserved).
The linear transformation that describes this mapping is
ui a b xi c
vi pb pa yi d
where the xi ’s, yi ’s, ui ’s, and vi ’s are known points that are used to calibrate the
transformation and p is a “parity parameter” that specifies whether the handedness of the x-y
coordinate system is the same (1) or opposite (-1) the handedness of the u-v coordinate system.
We will find the values of the unknown transformation parameters a , b , c , and d that
minimizes the value of the following quantity:
2 2
Q axi byi c ui pbxi pay d vi
i
i
This is an elementary least-squares technique. We set the derivatives of Q with respect to all
transformation parameters a , b , c , and d to zero:
Q
2 axi byi c ui xi bxi ayi pd pvi yi 0
a i
Q
2 axi byi c ui yi bxi ayi pd pvi xi 0
b i
Q
2 axi byi c ui 0
c i
Q
2 pbxi pay i d vi 0
d i
We then write these equations in matrix form:
2. x2 y2 0 x p y a ux p vy
2 2
0 x y y p x b uy p vx
x y n 0 c u
p y p x 0 n d v
where n is the number of data points. From the last two rows of the matrix equation it follows
that
c u ax by
d v pay pbx
where it is useful to note that p 2 1. Substituting c and d into the first two rows of the matrix
equation gives
a x2 y2 u ax by x pv ay bx y ux p vy
b x2 y2 u ax by y pv ay bx x uy p vx
Dividing by n and solving for a and b gives
ux u x pvy pv y
a
D
uy u y pvx pv x
b
D
where D x2 y2 x2 y 2 . Numerical error is best if these quantities are evaluated as
D ( x x )2 (y y )2
(u u )( x x ) p(v v )( y y )
a
D
(u u )( y y ) p(v v )( x x )
b
D
c and d can then be evaluated as above.
Parity Determination
It is possible to determine whether p is 1 or –1 a priori, without knowing it in advance, by
finding which possible value of p leads to the smaller value of Q . We begin this process by
substituting the expressions for c and d into the expression for Q . The result is
3. 2 2
Q a( xi x ) b( yi y ) (ui u) pb( xi x) pa( yi y ) (vi v)
i
Q
(a 2 b 2 ) D (u u ) 2 (v v ) 2
n
2a (u u )( x x ) p(v v )( y y) 2b (u u )( y y) p(v v )( x x )
(a 2 b 2 ) D (u u ) 2 (v v ) 2 2a 2 D 2b 2 D
(u u ) 2 (v v ) 2 (a 2 b2 ) D
We now substitute into this the expressions for a and b :
Q
(u u ) 2 (v v ) 2
n
2 2
(u u )( x x) (v v )( y y) 2 p (u u )( x x ) (v v )( y y)
D
2 2
(u u )( y y) (v v )( x x) 2 p(u u )( y y ) (v v )( x x)
D
Q
We now define Q and Q to be the value of D for p 1 and p 1, respectively. Then
n
Q Q 4(u u )( x x ) (v v )( y y ) 4(u u )( y y ) (v v )( x x ))
If Q Q 0 , then p 1 leads to the lower value of Q . If Q Q 0 , then p 1 leads to
the lower value of Q .
Error Estimation
If we want to know the error in estimating the transformation parameters a and b , we must look
upon them as statistics, i.e. functions of random variables that represent a sample from a
population. We will consider the ui ’s, and vi ’s to represent this sample, while the xi ’s, yi ’s are
not random variables; they are fixed values given to us and we are not interested in modeling
their distributions. In other words, we are doing regression analysis, not correlation analysis.
In the language of random variables,
(u u )( x x ) p(v v )( y y )
ˆ
a
D
ˆ (u u )( y y ) p(v v )( x x )
b
D
ˆ ˆ
It is easily shown that E(a) a and E (b ) ˆ
b . We can rewrite a as
u( x x) u(x x) pv ( y y) pv ( y y)
ˆ
a
D
Since u and v are constants with respect to averages over data points and x x y y 0,
4. u( x x) pv ( y y)
ˆ
a
D
By analogous reasoning,
ˆ u( y y ) pv ( x x)
b
D
We now have
1
var(u)( x x )2 1
var(v )( y y )2 2 p 1 cov( u, v )( x x )( y y)
ˆ
var(a ) n n n
D2
2 2
u (x x )2 v (y y )2 2 p uv (x x )( y y)
nD 2
Analogously,
2 2
ˆ u (y y )2 v (x x )2 2 p uv (x x )( y y)
var(b)
nD 2
2 2
( )( x x )( y y) p (x x )2 (y y )2
ˆ ˆ
cov(a , b) v u uv
nD 2
For given values of u and v (not coming from the data used to find the transformation), we wish
to find the variance of a “conditional probability distribution” of the values of x and y that
could have yielded the observed values of u and v . To do so, we will make use of the following
“chain rule of variances”, which makes a linear approximation of f over the variance of each of
its random variable arguments:
var(f ( x1 , x2 ,, xn )) fi ( x1,, xn ) f j ( x1,, xn ) cov(xi , x j )
ij
where x1,, xn are observed values for x1 ,, xn .
We write the inverse transformation:
x 1 a pb u c
2 2
y a b b pa v d
Substituting the values of c and d and performing some simple algebraic rearrangements
yields:
x x 1 a pb u u
2 2
y y a b b pa v v
Before proceeding, it is useful to note the following lemmas:
5. x (a 2 b 2 )(u u ) 2a[a(u u ) pb (v v )]
a (a 2 b 2 ) 2
(a 2 b 2 )(u u ) 2a(a 2 b 2 )[ x x]
(a 2 b 2 ) 2
a ( x x ) b( y y ) 2a ( x x )
a 2 b2
a ( x x ) b( y y )
a 2 b2
Analogously,
x b( x x ) a( y y )
b a 2 b2
y b( x x ) a ( y y )
a a 2 b2
y a ( x x ) b( y y )
b a 2 b2
We now apply the “chain rule of variances” to x and y as functions of a , b , u , v , u , and v :
a 2 (var(u) var(u )) b 2 (var(v ) var(v )) 2abp(cov( , v ) cov( , v ))
u u
var(x ) 2 2 2
(a b )
2 2
x x x x
var(a ) var(b) 2 cov( , b)
a
a b a b
2 2 2 2
1 a2 u b2 v 2abp uv x x x x
1 var(a ) var(b) 2 cov( , b)
a
n (a 2 2 2
b ) a b a b
b 2 (var(u) var(u )) a 2 (var(v ) var(v )) 2abp(cov( , v ) cov( , v ))
u u
var(y ) 2 2 2
(a b )
2 2
y y y y
var(a ) var(b) 2 cov( , b)
a
a b a b
2 2 2 2
1 b2 u a2 v 2abp uv y y y y
1 var(a ) var(b) 2 cov( , b)
a
n (a 2 2 2
b ) a b a b