Title: Lecture 5, Template PCA
1Lecture 5, Template PCA
- Last time we introduced the concept of PCA.
- Today Id like to follow up on that, and follow
through with showing how we can use PCA to make
better templates
2PCA rehashed.
- PCA has two parts.
- 1. Given a set of images, creating the basis
images, and their coefficients. - 2. Given a set of basis images,
- Use new coefficients to make a new image.
- Take a new image and compute its coefficients.
PCA
Basis images
0.1 -0.2 0.3
3SVD decompositon
D
U
S
V
- This decomposition makes
- an orthonormal matrix U,
- a diagonal matrix S, and
- an orthonormal matrix V
- The ortho-normality of U is useful, but not so
much for V, so lets squash S and V together and
we can make - the same U matrix, and
- a matrix of coefficients
D
U
coeffs
4SVD decomposition
D
U
coeffs
Why is it interesting that U is
orthonormal? Standard defintion UTU
I Or, if you consider each column of U as a
vector ui, uiTui 1 ( each column is a
unit vector) And uiTuj 0, when i ltgtj
(orthogonal to the others) uiTuj is, in vector
terms, ui dot uj if ui is an image, what
does this correspond to?
5SVD decomposition
What would happen if U wasnt orthonormal? uiTui
1 ( each column is a unit vector) uiTuj
0, when i ltgtj (orthogonal to the others) ALSO,
Suppose we get a new image w. UTw u1Tw,
u2Tw, u3Tw,
These are the coefficients for image w. If w
was one of the original images, these are a
column of the coeff matrix.
6SVD decomposition
Why is it interesting that U is
orthonormal? Given a new image w. UTw u1Tw,
u2Tw, u3Tw,
So, lets subtract the component of basis
1. u2T (w u1 u1Tw) u2T w - u2T u1 u1Tw
u2T w 0 Which is a consequence of the fact
that u1 and u2 are orthogonal. Alternately,
adding or subtracting some of basis 2 doesnt
affect how much of basis 1 is in the image.
7SVD decomposition
Why is it interesting that U is orthonormal? The
fact that u1 and u2 are orthogonal. Means that I
can find the coefficients for a new image w
as UTw u1Tw, u2Tw,
u3Tw, rathan than solving a
general matrix equation Uv w for an unknown
vector v. Now, since we dont need to do any
more complicated linear algebra, we can go back
to thinking of u1, u2, u3, as images (instead of
vectors).
8Correlation based PCA template
From lecture 2, The matching process moves the
template image to all possible positions in a
larger source image and computes a numerical
index that indicates how well the template
matches the image in that position. Before, we
computed the distance of the image from the
template. How can we compute the correlation
with a PCA basis?
9Correlation based PCA template
- Take each box of the image. Call it w.
- Subtract the mean template, to get w w -
meanTemplate - Compute the coefficients for that box, v UTw
- Compute the PCA reconstruction as Uv.
- Sum the squared difference as (w Uv)2, for
each pixel in box - Store that difference.
10(No Transcript)
11(1) Cameras
History, progression and comparisons of
different Cameras and optics.
Geometry, Linear Algebra
Many of todays slides adapted from Cornelia
Fermuller, Univ. of Maryland.
12Image Formation
- Vision infers world properties form images.
- How do images depend on these properties?
- Two key elements
- Geometry
- Radiometry
- We consider very simple models of these.
- If you want to consider really complicated
models, try a graphics class. In vision, the
real world does these computations for us.
13Camera Obscura
Camera Latin for room Obscura Latin for
dark
"When images of illuminated objects ... penetrate
through a small hole into a very dark room ...
you will see on the opposite wall these objects
in their proper form and color, reduced in size
... in a reversed position, owing to the
intersection of the rays". Da Vinci
http//www.acmi.net.au/AIC/CAMERA_OBSCURA.html
(Russell Naughton)
14(No Transcript)
15(No Transcript)
16- Used to observe eclipses (eg., Bacon, 1214-1294)
- By artists (eg., Vermeer).
- (hard to draw correct perspective!).
17Jetty at Margate England, 1898.
http//brightbytes.com/cosite/collection2.html
(Jack and Beverly Wilgus)
18Cameras
- First photograph due to Niepce
- Camera shown is from 1826.
19Pinhole cameras
- Abstract camera model - box with a small hole in
it
- Pinhole cameras work in practice
(Forsyth Ponce)
20Properties of pinhole cameras Distant objects
are smaller
C
B
(Forsyth Ponce)
21Properties of Projection
- Invariants
- Points project to points
- Lines project to lines
- Planes project to the whole image or a half image
-
- Degenerate cases
- Line through focal point projects to a point.
- Plane through focal point projects to line
- Plane perpendicular to image plane projects to
part of the image (with horizon). - Angles are not preserved
- Parallel lines may intersect.
22Pinhole cameras
X,Y,Z
f
23The equation of projection
- Cartesian coordinates
- We have, by similar triangles, that
-
- Ignore the third coordinate, and get
24Parallel lines meet
Common to draw image plane in front of the focal
point. Moving the image plane merely scales the
image.
(Forsyth Ponce)
25The equation of projection
(Forsyth Ponce)
26Limitations of pinhole optics.
27Cameras with Lenses
(Forsyth Ponce)
28(No Transcript)
29More Accuracy
Thin lens projection model
30(No Transcript)
31Lens systems
Ray tracing, virtual images, 1/3 of a class on
optics.
32(No Transcript)