This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.
In the previous section we were able to combine rotation and scaling into a single composite operation by matrix multiplication. Unfortunately,
translation cannot yet be included in the composite operator since we do it by addition rather than by multiplication.
Suppose we wish to rotate the image
G
G by π3π3 about the
point (-10,10)(-10,10). Our rotation matrix R(θ)R(θ) always rotates about the origin,
so we must combine three transformations to accomplish this:
- translate the point (-10,10)(-10,10) to the origin;
- rotate π3π3 radians about the origin; and
- translate the origin back to (-10,10)(-10,10).
For step (i), we have b0=l0-10b0=l0-10 and
G
1
=
G
+
b
0
1
T
.
G
1
=
G
+
b
0
1
T
.
(1)For step (ii),
G
2
=
R
(
π
3
)
G
1
=
R
(
π
3
)
[
G
+
b
0
1
T
]
=
R
(
π
3
)
G
+
R
(
π
3
)
b
0
1
T
.
G
2
=
R
(
π
3
)
G
1
=
R
(
π
3
)
[
G
+
b
0
1
T
]
=
R
(
π
3
)
G
+
R
(
π
3
)
b
0
1
T
.
(2)For step (iii), we can use-b0use-b0 from step (i):
G
n
e
w
=
G
2
-
b
0
1
T
=
R
(
π
3
)
G
+
R
(
π
3
)
b
0
1
T
-
b
0
1
T
=
R
(
π
3
)
G
+
[
(
R
(
π
3
)
-
I
)
b
0
]
1
T
.
G
n
e
w
=
G
2
-
b
0
1
T
=
R
(
π
3
)
G
+
R
(
π
3
)
b
0
1
T
-
b
0
1
T
=
R
(
π
3
)
G
+
[
(
R
(
π
3
)
-
I
)
b
0
]
1
T
.
(3)In this example we were unable to find a single matrix operator
A
A to do the entire job. The total transformation took the form
G
n
e
w
=
A
G
+
b
1
T
.
G
n
e
w
=
A
G
+
b
1
T
.
(4)
This is called an affine transformation because it involves both multiplication
by
A
A and addition of a constant matrix. This is in contrast to the more
desirable linear transformation, which involves only multiplication by
A
A.
We will now move toward a modified representation of the image and
the operators by rewriting the last equation as
Gnew=[Ab]G1TGnew=[Ab]G1T
(5)where in the example we had A=R(π3)A=R(π3) and b=(R(π3)-I)b0b=(R(π3)-I)b0.
Show that, for any matrices A,B,C,DA,B,C,D of compatible sizes,
A
B
+
C
D
=
[
A
C
]
B
D
.
A
B
+
C
D
=
[
A
C
]
B
D
.
(6)
The matrix G1TG1T looks like
x
1
x
2
x
n
y
1
y
2
y
n
1
1
1
,
x
1
x
2
x
n
y
1
y
2
y
n
1
1
1
,
(7)
and the points (xi,yi,1)(xi,yi,1) are called homogeneous coordinates. We can modify
Equation 5 so that the new point matrix is also in homogeneous coordinates:
G
n
e
w
1
T
=
A
b
O
T
1
G
1
T
.
G
n
e
w
1
T
=
A
b
O
T
1
G
1
T
.
(8)
In the new representation, each point in the image has a third coordinate,
which is always a 1. The homogeneous transformation is a 3×33×3 matrix,
A
h
=
A
b
0
T
1
,
A
h
=
A
b
0
T
1
,
(9)
which is capable of translation, rotation, and scaling all by matrix multi-
plication. Thus, using homogeneous coordinates, we can build composite
transformations that include translation.
In homogeneous coordinates, we have
R
(
θ
)
=
c
o
s
θ
-
s
i
n
θ
0
s
i
n
θ
c
o
s
θ
0
0
0
1
S
(
s
x
,
s
y
)
=
s
x
0
0
0
s
y
0
0
0
1
T
(
t
x
,
t
y
)
=
1
0
t
x
0
1
t
y
0
0
1
.
R
(
θ
)
=
c
o
s
θ
-
s
i
n
θ
0
s
i
n
θ
c
o
s
θ
0
0
0
1
S
(
s
x
,
s
y
)
=
s
x
0
0
0
s
y
0
0
0
1
T
(
t
x
,
t
y
)
=
1
0
t
x
0
1
t
y
0
0
1
.
(10)
The composite transformation to triple the size of an
image and then move it 2 units to the left is
A
=
1
0
-
2
0
1
0
0
0
l
3
0
0
0
3
0
0
0
1
=
3
0
-
2
0
3
0
0
0
1
.
A
=
1
0
-
2
0
1
0
0
0
l
3
0
0
0
3
0
0
0
1
=
3
0
-
2
0
3
0
0
0
1
.
(11)On the other hand, the composite transformation to move an image 2 units
to the left and then triple its size is
B
=
3
0
0
0
3
0
0
0
1
1
0
-
2
0
1
0
0
0
1
=
3
0
-
6
0
3
0
0
0
1
.
B
=
3
0
0
0
3
0
0
0
1
1
0
-
2
0
1
0
0
0
1
=
3
0
-
6
0
3
0
0
0
1
.
(12)In the latter case, the distance of the translation is also tripled.
Find a single composite transformation in homogeneous coordinates that rotates an image by angle
θ
θ about point (xi,yi)(xi,yi) as in Example 1.
"Reviewer's Comments: 'I recommend this book as a "required primary textbook." This text attempts to lower the barriers for students that take courses such as Principles of Electrical Engineering, […]"