1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.
-
Upload
britney-curtis -
Category
Documents
-
view
213 -
download
0
Transcript of 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.
![Page 1: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/1.jpg)
1
Model Fitting
Hao Jiang
Computer Science Department
Sept 30, 2014
![Page 2: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/2.jpg)
Model Fitting
An object model constrains the kind of object we wish to find in images.
2
window
Front wheel
Back wheel
![Page 3: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/3.jpg)
Type of 2D Models
Rigid models
Deformable models
Articulated models
3
![Page 4: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/4.jpg)
Template Matching
4
Template
Target image
![Page 5: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/5.jpg)
Template Matching
5
Template
Target image
![Page 6: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/6.jpg)
Template Matching
6
Template
Target image
![Page 7: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/7.jpg)
Template Matching
7
Template
Target image
![Page 8: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/8.jpg)
Template Matching
8
Template
Target image
![Page 9: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/9.jpg)
Matching Criteria
9
At each location (x,y) the matching cost is:
![Page 10: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/10.jpg)
Dealing with Rotations
10
Template
Target image
![Page 11: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/11.jpg)
Dealing with Scale Changes
11
Template
Target image in multiple scales
Sweep windowand find the best match
![Page 12: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/12.jpg)
Multi-scale Refinement
12
Template
Target image in multiple scales
Start from here
Complexity reduced from O(n^2 k^2) to O(log(n/m) + m^2 j^2)
size n
size m
size k
size j
![Page 13: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/13.jpg)
Multi-scale Refinement
13
1. Generate the image pyramids
2. Exhaustive search the smallest image and get location (x,y)
3. Go to the next level of the pyramid and check the locations (x, y), (x+1,y), (x,y+1), (x+1,y+1), pick up the best and update the estimate (x,y)
4. If at the bottom of the pyramid, stop; otherwise go to 3.
5. Output the estimate (x,y)
![Page 14: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/14.jpg)
Binary Template Matching
14G.M. Gavrila, “Pedestrian detection from a moving vechicle”, ECCV 2000
![Page 15: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/15.jpg)
Matching Binary Template
15
Template
Binary target image
Targetobject
Clutter
![Page 16: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/16.jpg)
Distance between Curves
16
d_red(p)
d_green(q)
For each point p on the red curve,find the closed point q on the green curve.Denote
The distance from red curve to the greencurve =
Similarly, the distance from the green curve to the red curve is
q
p
![Page 17: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/17.jpg)
Distance Transform Transform binary image into an image whose pixel values equal
the closest distance to the binary foreground.
17
![Page 18: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/18.jpg)
Chamfer Matching
18
d_red(p) = distI(p)p
![Page 19: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/19.jpg)
Chamfer Matching in Matlab
19
% distance transform and matchingdist = bwdist(imTarget, ‘euclidean’);map = imfilter(dist, imTemplate, ‘corr’, ‘same’);
%look for the local minima in map to locate objectssmap = ordfilt2(map, 25, true(5));[r, c] = find((map == smap) & (map < threshold));
![Page 20: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/20.jpg)
Hough Transform
Template matching may become very complex if transformations such as rotation and scale is allowed.
A voting based method, Hough Transform, can be used to solve the problem.
Instead of trying to match the target at each location, we collect votes in a parameter space using features in the original image.
20
![Page 21: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/21.jpg)
Line Detection
21
![Page 22: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/22.jpg)
Line Detection
22
![Page 23: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/23.jpg)
Line Detection
23
x
y
(1) Where is the line?(2) How many lines?(3) Which point belongs to which line?
![Page 24: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/24.jpg)
Line Detection
24
x
y
y = ax + b
For each point, there are many lines that pass it.
(x1,y1)
![Page 25: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/25.jpg)
Line Detection
25
a
b
b = -x1a + y1
All the lines passing (x1,y1) can be represented as another linein the parameter space.
y1
y1/x1
![Page 26: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/26.jpg)
Line Detection
26
a
b
b = -x1a + y1
The co-linear points vote for the same point in the a-b space.
y
y/x
b = -x2a + y2
![Page 27: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/27.jpg)
Line Detection
27
a
b
b = -x1a + y1 y
y/x
b = -x2a + y2
b = -x(n)a + y(n)
The co-linear points vote for the same point in the a-b space. Thepoint that receives the most votes corresponds to the line.
![Page 28: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/28.jpg)
Line Parameterization
28
x
y
theta
d
x cos(theta) + y sin(theta) = d
![Page 29: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/29.jpg)
Parameter Space
29
theta
r
x cos(theta) + y sin(theta) = r
![Page 30: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/30.jpg)
Hough Transform AlgorithmUsing the polar parameterization:
Basic Hough transform algorithm1. Initialize H[d, ]=0
2. for each edge point I[x,y] in the image
for = 0 to 180 // some quantization
H[d, ] += 1§ Find the value(s) of (d, ) where H[d, ] is maximum§ The detected line in the image is given by
Hough line demo
H: accumulator array (votes)
d
Time complexity (in terms of number of votes)?
dyx sincos
Source: Steve Seitz
sincos yxd
sincos yxd
![Page 31: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/31.jpg)
Image spaceedge coordinates
Votes
d
x
y
Example: Hough transform for straight lines
Bright value = high vote countBlack = no votes
Source: K. Grauman
![Page 32: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/32.jpg)
Impact of noise on Hough
Image spaceedge coordinates
Votes
x
y d
What difficulty does this present for an implementation?Source: K. Grauman
![Page 33: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/33.jpg)
Image spaceedge coordinates
Votes
Impact of noise on Hough
Here, everything appears to be “noise”, or random edge points, but we still see peaks in the vote space.
Source: K. Grauman
![Page 34: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/34.jpg)
ExtensionsExtension 1: Use the image gradient
1. same
2. for each edge point I[x,y] in the image
= gradient angle at (x,y)
H[d, ] += 1
3. same
4. same
(Reduces degrees of freedom)
ExThe same procedure can be used with circles, squares, or any other shape
sincos yxd
Source: K. Grauman
![Page 35: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/35.jpg)
ExtensionsExtension 1: Use the image gradient
1. same
2. for each edge point I[x,y] in the image
compute unique (d, ) based on image gradient at (x,y)
H[d, ] += 1
3. same
4. same
(Reduces degrees of freedom)
Extension 2 give more votes for stronger edges (use magnitude of gradient)
Extension 3 change the sampling of (d, ) to give more/less resolution
Extension 4 The same procedure can be used with circles, squares, or any
other shape…
Source: K. Grauman
![Page 36: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/36.jpg)
Hough transform for circles
For a fixed radius r, unknown gradient direction
• Circle: center (a,b) and radius r222 )()( rbyax ii
Image space Hough space a
b
Source: K. Grauman
![Page 37: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/37.jpg)
Hough transform for circles
For a fixed radius r, unknown gradient direction
• Circle: center (a,b) and radius r222 )()( rbyax ii
Image space Hough space
Intersection: most votes for center occur here.
Source: K. Grauman
![Page 38: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/38.jpg)
Hough transform for circles
For an unknown radius r, unknown gradient direction
• Circle: center (a,b) and radius r222 )()( rbyax ii
Hough spaceImage space
b
a
r
Source: K. Grauman
![Page 39: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/39.jpg)
Hough transform for circles
For an unknown radius r, unknown gradient direction
• Circle: center (a,b) and radius r222 )()( rbyax ii
Hough spaceImage space
b
a
r
Source: K. Grauman
![Page 40: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/40.jpg)
Hough transform for circles
For an unknown radius r, known gradient direction
• Circle: center (a,b) and radius r222 )()( rbyax ii
Hough spaceImage space
θ
x
Source: K. Grauman
![Page 41: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/41.jpg)
Hough transform for circles
For every edge pixel (x,y) :
For each possible radius value r:
For each possible gradient direction θ: // or use estimated gradient
a = x – r cos(θ)
b = y + r sin(θ)
H[a,b,r] += 1
end
end
Source: K. Grauman
![Page 42: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/42.jpg)
Example: detecting circles with Hough
Crosshair indicates results of Hough transform,bounding box found via motion differencing.
Source: K. Grauman
![Page 43: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/43.jpg)
Original Edges
Example: detecting circles with Hough
Votes: Penny
Note: a different Hough transform (with separate accumulators) was used for each circle radius (quarters vs. penny).
Source: K. Grauman
![Page 44: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/44.jpg)
Original Edges
Example: detecting circles with Hough
Votes: Quarter
Coin finding sample images from: Vivek KwatraSource: K. Grauman
![Page 45: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/45.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
45Template Target
![Page 46: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/46.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
46Template Target
![Page 47: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/47.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
47Template Target
![Page 48: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/48.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
48Template Target
![Page 49: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/49.jpg)
General Hough Transform Rotation Invariance
49
![Page 50: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/50.jpg)
Example
model shape Source: L. Lazebnik
Say we’ve already stored a table of displacement vectors as a function of edge orientation for this model shape.
![Page 51: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/51.jpg)
Example
displacement vectors for model points
Now we want to look at some edge points detected in a new image, and vote on the position of that shape.
![Page 52: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/52.jpg)
Example
range of voting locations for test point
![Page 53: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/53.jpg)
Example
range of voting locations for test point
![Page 54: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/54.jpg)
Example
votes for points with θ =
![Page 55: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/55.jpg)
Example
displacement vectors for model points
![Page 56: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/56.jpg)
Example
range of voting locations for test point
![Page 57: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/57.jpg)
votes for points with θ =
Example
![Page 58: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/58.jpg)
Application in recognition
• Instead of indexing displacements by gradient orientation, index by “visual codeword”
B. Leibe, A. Leonardis, and B. Schiele,Combined Object Categorization and Segmentation with an Implicit Shape Model, ECCV Workshop on Statistical Learning in Computer Vision 2004
training image
visual codeword withdisplacement vectors
Source: L. Lazebnik
![Page 59: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/59.jpg)
Application in recognition
• Instead of indexing displacements by gradient orientation, index by “visual codeword”
test image
Source: L. Lazebnik
![Page 60: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/60.jpg)
RANSAC
RANSAC – Random Sampling Consensus
Procedure: Randomly generate a hypothesis Test the hypothesis Repeat for large enough times and choose the best one
60
![Page 61: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/61.jpg)
Line Detection
61
![Page 62: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/62.jpg)
Line Detection
62
![Page 63: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/63.jpg)
Line Detection
63
![Page 64: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/64.jpg)
Line Detection
64
Count “inliers”: 7
![Page 65: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/65.jpg)
Line Detection
65
Inlier number: 3
![Page 66: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/66.jpg)
Line Detection
66
After many trails, we decide this is the best line.
![Page 67: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/67.jpg)
Object Detection Using RANSAC
67
Template Target
![Page 68: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/68.jpg)
Scale and Rotation Invariant Feature
SIFT (D. Lowe)
68
![Page 69: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/69.jpg)
Stable Feature
69
![Page 70: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/70.jpg)
Stable Feature
70
Local max/min point’s valuesare stable when the scale changes
![Page 71: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/71.jpg)
SIFT
71
Filteringthe imageusing filters at differentscales.(for example using Gaussian filter)
![Page 72: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/72.jpg)
Difference of Gaussian
72
![Page 73: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/73.jpg)
SIFT Feature Points
73
(b) Shows the points at the local max/min of DOG scale space forthe image in (a).
![Page 74: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/74.jpg)
Matching SIFT
74
Template
![Page 75: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/75.jpg)
Matching SIFT
75
Target image
![Page 76: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/76.jpg)
Matching SIFT Using Nearest Neighbor
76
Matching result
![Page 77: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/77.jpg)
Matching SIFT Using Nearest Neighbor
77
Matching points whose ratio (best_match_cost / second_best_match_cost) < 0.7
![Page 78: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/78.jpg)
RANSAC Generate matching hypothesis
78
Template
Target
![Page 79: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/79.jpg)
RANSAC Generate matching hypothesis
79
Template
Target
Randomlychoose3 pairs
![Page 80: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/80.jpg)
RANSAC Generate matching hypothesis
80
Template
Target
Transformall thetemplatePointsto the targetimage
T
![Page 81: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/81.jpg)
Affine Transformation
81
u = a x + b y + cv = d x + e y + f
Point (x,y) is mapped to (u,v) by the linear function:
Template
Target
T
(x,y)
(u,v)
![Page 82: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/82.jpg)
Affine Transformation
82
u = a x + b y + cv = d x + e y + f
Point (x,y) is mapped to (u,v) by the linear function:
In matrix format:
uv =
a bd e
xy
+ cf
![Page 83: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/83.jpg)
Affine Transformation
83
u = a x + b y + cv = d x + e y + f
Point (x,y) is mapped to (u,v) by the linear function:
Using homogeneous coordinates:
uv1
=a b cd e f0 0 1
xy1
![Page 84: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/84.jpg)
Matlab
84
q = [x y 1] * t.tdata.T; % q = [u ,v, 1]
t = cp2tform(in_points, out_points, ‘affine’);
src_points: (x1 y1; x2 y2; x3 y3; …)target_points: (u1 v1; u2 v2; u3 v3; …)
Other transformations: ‘similarity’, ‘projective’
![Page 85: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/85.jpg)
RANSAC Validation
85
Template Target
T
Match points to the closes sift target points and compute the overall SIFT feature difference
![Page 86: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/86.jpg)
Demo and Assignment Discussion
86
Template Target
![Page 87: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/87.jpg)
Feature-based alignment outline
Source: L. Lazebnik
![Page 88: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/88.jpg)
Feature-based alignment outline
• Extract features
Source: L. Lazebnik
![Page 89: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/89.jpg)
Feature-based alignment outline
• Extract features• Compute putative matches
Source: L. Lazebnik
![Page 90: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/90.jpg)
Feature-based alignment outline
• Extract features• Compute putative matches• Loop:
Hypothesize transformation T (small group of putative matches that are related by T)
Source: L. Lazebnik
![Page 91: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/91.jpg)
Feature-based alignment outline
• Extract features• Compute putative matches• Loop:
Hypothesize transformation T (small group of putative matches that are related by T)
Verify transformation (search for other matches consistent with T)
Source: L. Lazebnik
![Page 92: 1 Model Fitting Hao Jiang Computer Science Department Sept 30, 2014.](https://reader035.fdocuments.us/reader035/viewer/2022070415/5697bfa71a28abf838c99066/html5/thumbnails/92.jpg)
Feature-based alignment outline
• Extract features• Compute putative matches• Loop:
Hypothesize transformation T (small group of putative matches that are related by T)
Verify transformation (search for other matches consistent with T)
Source: L. Lazebnik