CV Lecture 09 Histograms Covariance PCA
CV Lecture 09 Histograms Covariance PCA
Representation (Histograms)
(Slides borrowed from various
presentations)
Image representations
• Templates
– Intensity, gradients, etc.
• Histograms
– Color, texture, SIFT descriptors, etc.
Image Representations: Histograms
Global histogram
• Represent distribution of features
Space Shuttle
– Color, texture, depth, …
Cargo Bay
Images from Dave Kauchak
Cumulative Histograms
Image Representations: Histograms
Histogram: Probability or count of data in each bin
EASE Truss
Assembly
Space Shuttle
Use the same cluster centers for all images
Cargo Bay
Images from Dave Kauchak
Modelling Multi-dimensional Data
Hough transform
• What kind of a histogram does Hough
Transform use?
• What is its weakness?
• Can you improve it?
Computing histogram distance
m =1
Histogram intersection (assuming normalized histograms)
K [ h ( m) - h ( m)]2
1
c 2 (hi , h j ) = å i j
• Matching
– Histogram intersection or Euclidean may be faster
– Chi-squared often works better
– Earth mover’s distance is good for when nearby bins
represent similar values
What kind of things do we compute
histograms of?
• Color
0 2p
T. Tuytelaars, B. Leibe
But what about layout?
level 0
level 0 level 1
Covariance
Matrix ??
Covariance Matrix
The data isn’t very spread out here, therefore it doesn’t have a large variance. It is
probably not the principal component.
Projection onto X axis
On this line the data is way more spread out, it has a large variance.
Eigenvectors and Eigenvalues in PCA
• When we get a set of data points, we can deconstruct the
set’s covariance matrix into eigenvectors and eigenvalues.
• Eigenvectors and values exist in pairs: every eigenvector has a
corresponding eigenvalue.
• An eigenvector is a direction, in the example above the
eigenvector was the direction of the line (vertical, horizontal,
45 degrees etc.)
• An eigenvalue is a number, telling you how much variance
there is in the data in that direction, in the example above the
eigenvalue is a number telling us how spread out the data is
on the line.
• The eigenvector with the highest eigenvalue is therefore the
principal component.
Example
Example: 1st Principle Component
Example: 2nd Principle Component
PCA and Dimensionality Reduction
How to select the reduced dimension?
• Can I automatically select the number of
effective dimensions of my data?