1 Image Basics Hao Jiang Computer Science Department Sept. 4, 2014.
1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.
-
date post
20-Dec-2015 -
Category
Documents
-
view
215 -
download
0
Transcript of 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.
![Page 1: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/1.jpg)
1
Model Fitting
Hao Jiang
Computer Science Department
Oct 8, 2009
![Page 2: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/2.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 3: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/3.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 4: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/4.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 5: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/5.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 6: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/6.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 7: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/7.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 8: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/8.jpg)
Example: detecting circles with Hough
Crosshair indicates results of Hough transform,bounding box found via motion differencing.
Source: K. Grauman
![Page 9: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/9.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 10: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/10.jpg)
Original Edges
Example: detecting circles with Hough
Votes: Quarter
Coin finding sample images from: Vivek KwatraSource: K. Grauman
![Page 11: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/11.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
11Template Target
![Page 12: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/12.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
12Template Target
![Page 13: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/13.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
13Template Target
![Page 14: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/14.jpg)
General Hough Transform
Hough transform can also be used to detection arbitrary shaped object.
14Template Target
![Page 15: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/15.jpg)
General Hough Transform Rotation Invariance
15
![Page 16: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/16.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 17: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/17.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 18: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/18.jpg)
Example
range of voting locations for test point
![Page 19: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/19.jpg)
Example
range of voting locations for test point
![Page 20: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/20.jpg)
Example
votes for points with θ =
![Page 21: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/21.jpg)
Example
displacement vectors for model points
![Page 22: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/22.jpg)
Example
range of voting locations for test point
![Page 23: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/23.jpg)
votes for points with θ =
Example
![Page 24: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/24.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 25: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/25.jpg)
Application in recognition
• Instead of indexing displacements by gradient orientation, index by “visual codeword”
test image
Source: L. Lazebnik
![Page 26: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/26.jpg)
RANSAC
RANSAC – Random Sampling Consensus
Procedure: Randomly generate a hypothesis Test the hypothesis Repeat for large enough times and choose the best one
26
![Page 27: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/27.jpg)
Line Detection
27
![Page 28: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/28.jpg)
Line Detection
28
![Page 29: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/29.jpg)
Line Detection
29
![Page 30: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/30.jpg)
Line Detection
30
Count “inliers”: 7
![Page 31: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/31.jpg)
Line Detection
31
Inlier number: 3
![Page 32: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/32.jpg)
Line Detection
32
After many trails, we decide this is the best line.
![Page 33: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/33.jpg)
Probability of Success
What’s the success rate of RANSAC given a fixed number of validations?
Given a success rate, how to choose the minimum number of validations?
33
![Page 34: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/34.jpg)
Object Detection Using RANSAC
34
Template Target
![Page 35: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/35.jpg)
Scale and Rotation Invariant Feature
SIFT (D. Lowe, UBC)
35
![Page 36: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/36.jpg)
Stable Feature
36
![Page 37: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/37.jpg)
Stable Feature
37
Local max/min point’s valuesare stable when the scale changes
![Page 38: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/38.jpg)
SIFT
38
Filteringthe imageusing filters at differentscales.(for example using Gaussian filter)
![Page 39: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/39.jpg)
Difference of Gaussian
39
![Page 40: 1 Model Fitting Hao Jiang Computer Science Department Oct 8, 2009.](https://reader036.fdocuments.us/reader036/viewer/2022081515/56649d435503460f94a1e90c/html5/thumbnails/40.jpg)
SIFT Feature Points
40
(b) Shows the points at the local max/min of DOG scale space forthe image in (a).