1 Image Features Hao Jiang Sept. 2014. Image Matching 2.
-
Upload
ira-mckenzie -
Category
Documents
-
view
216 -
download
0
Transcript of 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.
![Page 1: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/1.jpg)
1
Image Features
Hao Jiang
Sept. 2014
![Page 2: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/2.jpg)
Image Matching
2
![Page 3: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/3.jpg)
Image Mosaicing
3
![Page 4: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/4.jpg)
How can This be Done Automatically?
4
![Page 5: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/5.jpg)
5
Easy to match Hard to match
![Page 6: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/6.jpg)
Image Local Structures
6
Step Ridge
Peak
Valley
Corner Junction
![Page 7: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/7.jpg)
Image Local Structures
7
Step Ridge
Peak
Valley
Corner Junction
Line Structures:“Edge”
Point Structures:“Corners”
![Page 8: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/8.jpg)
Regions
8
![Page 9: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/9.jpg)
An Example
9
edgeRegion
corners
![Page 10: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/10.jpg)
Edge Detection in Matlab
10
>> im = imread('flower.jpg');>> im = im2double(im);>> im = rgb2gray(im);>> ed = edge(im, 'canny', 0.15);
![Page 11: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/11.jpg)
How to Find an Edge?
11
A 1D edge
![Page 12: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/12.jpg)
12
f(x)
f’(x)
f’’(x)
![Page 13: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/13.jpg)
Extend to 2D
13
ab
There is a direction in whichimage f(x,y) increases thefastest. The direction is calledthe gradient direction.
Gradient [df/dx df/dy]Magnitude: sqrt(fx^2 + fy^2)Direction: atan2(fy, fx)
![Page 14: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/14.jpg)
Finite Difference
Approximating derivatives using finite difference.
Finite difference and convolution
14
![Page 15: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/15.jpg)
Noise Reduction
15
0.01 noise
0.03 noise
![Page 16: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/16.jpg)
Noise Reduction
16
![Page 17: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/17.jpg)
Gaussian Filtering in Edge Detection
17
![Page 18: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/18.jpg)
Gaussian Filtering in Edge Detection
18
h * (g * f) = (h * g) * f
Difference Kernel Gaussian Kernel
image
DifferenceGaussian Kernel
18
[1,-1]
![Page 19: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/19.jpg)
Edge Detection in Images
Gaussian smoothed filtering in x and y directions: Ix, Iy Non-maximum suppression for |Ix|+|Iy|
Edge Tracing – double thresholding.
19
![Page 20: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/20.jpg)
Edge Detection Using Matlab
Canny edge detector:
edge(image, ‘canny’, threshold) Sobel edge detector:
edge(image, ‘sobel’, threshold) Prewitt edge detector:
edge(image, ‘prewitt’, threshold)
20
![Page 21: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/21.jpg)
21D. Martin, C. Fowlkes, D. Tal, J. Malik. "A Database of Human Segmented Natural Images and its Application to Evaluating Segmentation Algorithms and Measuring Ecological Statistics”, ICCV, 2001
Berkeley Segmentation DataSet [BSDS]
![Page 22: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/22.jpg)
Corner Detection
Corner is a point feature that has large changing rate in all directions.
22
Step LineCorner
Flat region
![Page 23: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/23.jpg)
Harris corner detector
C.Harris, M.Stephens. “A Combined Corner and Edge Detector”. 1988
![Page 24: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/24.jpg)
The Basic Idea
We should easily recognize the point by looking through a small window
Shifting a window in any direction should give a large change in intensity
![Page 25: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/25.jpg)
Harris Detector: Basic Idea
“flat” region:no change in all directions
“edge”:no change along the edge direction
“corner”:significant change in all directions
![Page 26: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/26.jpg)
Find a Corner
26
Compute matrix H =
in each window. If the ratio (Ix2 * Iy2 – Ixy ^2 )R =------------------------ > T (Ix2 + Iy2 + eps)We have a corner
Ix2 IxyIxy Iy2=
![Page 27: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/27.jpg)
Harris Detector: Workflow
![Page 28: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/28.jpg)
Harris Detector: Workflow
Compute corner response R
![Page 29: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/29.jpg)
Harris Detector: Workflow
Find points with large corner response: R>threshold
![Page 30: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/30.jpg)
Harris Detector: Workflow
Take only the points of local maxima of R
![Page 31: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/31.jpg)
Harris Detector: Workflow
![Page 32: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/32.jpg)
Corner Detection Programming
32
![Page 33: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/33.jpg)
Harris Detector: Some Properties Rotation invariance
Ellipse rotates but its shape (i.e. eigenvalues) remains the same
Corner response R is invariant to image rotation
![Page 34: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/34.jpg)
Harris Detector: Some Properties Partial invariance to affine intensity change
Only derivatives are used => invariance to intensity shift I I + b
Intensity scale: I a I
R
x (image coordinate)
threshold
R
x (image coordinate)
![Page 35: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/35.jpg)
Harris Detector: Some Properties
But: non-invariant to image scale!
All points will be classified as edges
Corner !
![Page 36: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/36.jpg)
Scale Invariant Detection
Consider regions (e.g. circles) of different sizes around a point Regions of corresponding sizes will look the same in both
images
![Page 37: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/37.jpg)
Scale Invariant Detection
The problem: how do we choose corresponding circles independently in each image?
Choose the scale of the “best” corner
![Page 38: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/38.jpg)
Descriptors Invariant to Rotation
Find local orientation
Dominant direction of gradient
• Extract image patches relative to this orientation
![Page 39: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/39.jpg)
Descriptor Vector
Orientation = blurred gradient Rotation Invariant Frame
Scale-space position (x, y, s) + orientation ()
![Page 40: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/40.jpg)
Scale and Rotation Invariant Feature
SIFT (D. Lowe, UBC)
40
![Page 41: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/41.jpg)
Stable Feature
41
![Page 42: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/42.jpg)
Stable Feature
42
Local max/min point’s valuesare stable when the scale changes
![Page 43: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/43.jpg)
SIFT
43
Filteringthe imageusing filters at differentscales.(for example using Gaussian filter)
![Page 44: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/44.jpg)
Difference of Gaussian
44
![Page 45: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/45.jpg)
SIFT Feature Points
45
(b) Shows the points at the local max/min of DOG scale space forthe image in (a).
![Page 46: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/46.jpg)
Feature matching
?
![Page 47: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/47.jpg)
Feature matching
• Exhaustive search for each feature in one image, look at all the other features
in the other image(s)
• Hashing compute a short descriptor from each feature vector, or hash
longer descriptors (randomly)
• Nearest neighbor techniques kd-trees and their variants
![Page 48: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/48.jpg)
What about outliers?
?
![Page 49: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/49.jpg)
Feature-space outlier rejection Let’s not match all features, but only these that have
“similar enough” matches? How can we do it?
SSD(patch1,patch2) < threshold How to set threshold?
![Page 50: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/50.jpg)
Feature-space outlier rejection
A better way [Lowe, 1999]: 1-NN: SSD of the closest match 2-NN: SSD of the second-closest match Look at how much better 1-NN is than 2-NN, e.g. 1-NN/2-NN That is, is our best match so much better than the rest?
![Page 51: 1 Image Features Hao Jiang Sept. 2014. Image Matching 2.](https://reader036.fdocuments.us/reader036/viewer/2022062804/56649d6f5503460f94a504de/html5/thumbnails/51.jpg)
Feature-space outliner rejection
Can we now compute H from the blue points? No! Still too many outliers… What can we do?