hough transform16385/lectures/lecture4.pdfcourse announcements • homework 1 posted on course...
TRANSCRIPT
![Page 1: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/1.jpg)
Hough transform
16-385 Computer VisionSpring 2020, Lecture 4http://www.cs.cmu.edu/~16385/
![Page 2: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/2.jpg)
Course announcements
• Homework 1 posted on course website.- Due on February 5th at 23:59.- This homework is in Matlab.
• First theory quiz will be posted tonight and will be due on February 3rd, at 23:59.
• From here on, all office hours will be at Smith Hall 200.- Conference room next to the second floor restrooms.
![Page 3: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/3.jpg)
Leftover from lecture 3:
• Frequency-domain filtering.
• Revisiting sampling.
New in lecture 4:
• Finding boundaries.
• Line fitting.
• Line parameterizations.
• Hough transform.
• Hough circles.
• Some applications.
Overview of today’s lecture
![Page 4: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/4.jpg)
Slide credits
Most of these slides were adapted from:
• Kris Kitani (15-463, Fall 2016).
Some slides were inspired or taken from:
• Fredo Durand (MIT).• James Hays (Georgia Tech).
![Page 5: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/5.jpg)
Finding boundaries
![Page 6: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/6.jpg)
Where are the object boundaries?
![Page 7: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/7.jpg)
Human annotated boundaries
![Page 8: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/8.jpg)
edge detection
![Page 9: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/9.jpg)
Multi-scale edge detection
![Page 10: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/10.jpg)
Edge strength does not necessarily
correspond to our perception of boundaries
![Page 11: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/11.jpg)
Where are the object boundaries?
![Page 12: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/12.jpg)
Human annotated boundaries
![Page 13: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/13.jpg)
edge detection
![Page 14: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/14.jpg)
Defining boundaries are hard for us too
![Page 15: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/15.jpg)
Where is the boundary of the mountain top?
![Page 16: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/16.jpg)
Lines are hard to find
Edge detection
Noisy edge image
Incomplete boundaries
ThresholdingOriginal image
![Page 17: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/17.jpg)
Applications
tissue engineering
(blood vessel counting)
behavioral genetics
(earthworm contours)Autonomous Vehicles
(lane line detection)
Autonomous Vehicles
(semantic scene segmentation)Computational Photography
(image inpainting)
![Page 18: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/18.jpg)
![Page 19: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/19.jpg)
Line fitting
![Page 20: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/20.jpg)
Line fitting
Given: Many pairs
Find: Parameters
Minimize: Average square distance:
Using:
Note:
How can we solve this minimization?
![Page 21: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/21.jpg)
Line fitting
Given: Many pairs
Find: Parameters
Minimize: Average square distance:
Using:
Note:
What are some problems with the approach?
![Page 22: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/22.jpg)
Problems with parameterizations
Where is the line that minimizes E?
![Page 23: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/23.jpg)
Problems with parameterizations
Huge E!
Where is the line that minimizes E?
![Page 24: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/24.jpg)
Problems with parameterizations
Line that minimizes E!!
Where is the line that minimizes E?
![Page 25: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/25.jpg)
Problems with parameterizations
Line that minimizes E!!
Where is the line that minimizes E?
(Error E must be formulated carefully!)
How can we deal with this?
![Page 26: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/26.jpg)
Line fitting is easily setup as a maximum likelihood problem
… but choice of model is important
What optimization are we solving here?
![Page 27: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/27.jpg)
Problems with noise
Squared error heavily penalizes outliersLeast-squares error fit
![Page 28: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/28.jpg)
Model fitting is difficult because…
• Extraneous data: clutter or multiple models
– We do not know what is part of the model?
– Can we pull out models with a few parts from much larger
amounts of background clutter?
• Missing data: only some parts of model are present
• Noise
• Cost:
– It is not feasible to check all combinations of features by fitting a
model to each possible subset
So what can we do?
![Page 29: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/29.jpg)
Line parameterizations
![Page 30: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/30.jpg)
Slope intercept form
slope y-intercept
What are m and b?
![Page 31: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/31.jpg)
Slope intercept form
slope y-intercept
![Page 32: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/32.jpg)
Double intercept form
x-intercept y-intercept
What are x and y?
![Page 33: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/33.jpg)
Double intercept form
x-intercept y-intercept
(Similar slope)
Derivation:
![Page 34: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/34.jpg)
Normal Form
What are rho and theta?
![Page 35: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/35.jpg)
Normal Form
Derivation:
plug into:
![Page 36: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/36.jpg)
Hough transform
![Page 37: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/37.jpg)
Hough transform
• Generic framework for detecting a parametric model
• Edges don’t have to be connected
• Lines can be occluded
• Key idea: edges vote for the possible models
![Page 38: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/38.jpg)
Image and parameter spacevariables
parameters
Image space
![Page 39: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/39.jpg)
Image and parameter spacevariables
parameters parameters
variables
a line
becomes a
point
Image space Parameter space
![Page 40: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/40.jpg)
Image and parameter spacevariables
parameters
Image space
What would a point in image space
become in parameter space?
![Page 41: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/41.jpg)
Image and parameter spacevariables
parameters parameters
variables
a point
becomes a
line
Image space Parameter space
![Page 42: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/42.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
two points
become
?
![Page 43: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/43.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
two points
become
?
![Page 44: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/44.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
three points
become
?
![Page 45: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/45.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
three points
become
?
![Page 46: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/46.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
four points
become
?
![Page 47: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/47.jpg)
Image and parameter spacevariables
parameters parameters
variables
Image space Parameter space
four points
become
?
![Page 48: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/48.jpg)
How would you find the best fitting line?
Image space Parameter space
Is this method robust to measurement noise?
Is this method robust to outliers?
![Page 49: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/49.jpg)
Line Detection by Hough Transform
Parameter Space
1 1
1 1
1 1
2
1 1
1 1
1 1
Algorithm:
1.Quantize Parameter Space
2.Create Accumulator Array
3.Set
4. For each image edge
For each element in
If lies on the line:
Increment
5. Find local maxima in
![Page 50: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/50.jpg)
Problems with parameterization
1 1
1 1
1 1
2
1 1
1 1
1 1
How big does the accumulator need to be for the parameterization ?
![Page 51: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/51.jpg)
Problems with parameterization
1 1
1 1
1 1
2
1 1
1 1
1 1
The space of m is huge! The space of c is huge!
How big does the accumulator need to be for the parameterization ?
![Page 52: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/52.jpg)
Given points find
Better Parameterization
(Finite Accumulator Array Size)
Image Space
Hough Space
?
Hough Space Sinusoid
Use normal form:
![Page 53: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/53.jpg)
Image and parameter spacevariables
parameters
a point
becomes?
Image space Parameter space
parameters
variables
![Page 54: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/54.jpg)
Image and parameter spacevariables
parameters
a point
becomes a
wave
Image space Parameter space
parameters
variables
![Page 55: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/55.jpg)
Image and parameter spacevariables
parameters
a line
becomes?
Image space Parameter space
![Page 56: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/56.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 57: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/57.jpg)
Image and parameter spacevariables
parameters
a line
becomes?
Image space Parameter space
![Page 58: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/58.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 59: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/59.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 60: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/60.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 61: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/61.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 62: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/62.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
![Page 63: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/63.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
Wait …why is rho negative?
![Page 64: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/64.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
same line through
the point
![Page 65: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/65.jpg)
There are two ways to
write the same line:
Positive rho version:
Negative rho version:
Recall:
![Page 66: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/66.jpg)
Image and parameter spacevariables
parameters
a line
becomes a
point
Image space Parameter space
same line through
the point
![Page 67: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/67.jpg)
Image and parameter spacevariables
parameters
Image space Parameter space
two points
become
?
![Page 68: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/68.jpg)
Image and parameter spacevariables
parameters
Image space Parameter space
three points
become
?
![Page 69: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/69.jpg)
Image and parameter spacevariables
parameters
Image space Parameter space
four points
become
?
![Page 70: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/70.jpg)
Implementation1. Initialize accumulator H to all zeros
2. For each edge point (x,y) in the image
For θ = 0 to 180
ρ = x cos θ + y sin θ
H(θ, ρ) = H(θ, ρ) + 1
end
end
3. Find the value(s) of (θ, ρ) where H(θ, ρ)
is a local maximum
4. The detected line in the image is given by
ρ = x cos θ + y sin θ
NOTE: Watch your coordinates. Image origin is top left!
![Page 71: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/71.jpg)
Image space Votes
![Page 72: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/72.jpg)
Basic shapes(in parameter space)
can you guess the shape?
![Page 73: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/73.jpg)
line
Basic shapes(in parameter space)
![Page 74: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/74.jpg)
line rectangle
Basic shapes(in parameter space)
![Page 75: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/75.jpg)
line rectangle circle
Basic shapes(in parameter space)
![Page 76: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/76.jpg)
Basic Shapes
![Page 77: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/77.jpg)
More complex image
![Page 78: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/78.jpg)
In practice, measurements are noisy…
Image space Votes
![Page 79: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/79.jpg)
Image space Votes
Too much noise …
![Page 80: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/80.jpg)
Effects of noise level
More noise, fewer votes (in the right bin)
5
10
15
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
Ma
xim
um
nu
mb
er
of vo
tes
Noise level
Number of votes for a line of 20 points with increasing noise
![Page 81: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/81.jpg)
Effect of noise points
0
3
6
9
12
20 40 60 80 100 120 140 160 180 200
Ma
xim
um
nu
mb
er
of vo
tes
Number of noise points
More noise, more votes (in the wrong bin)
![Page 82: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/82.jpg)
Real-world example
Original Edges Hough Linesparameter space
![Page 83: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/83.jpg)
Hough Circles
![Page 84: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/84.jpg)
parameters
variables
parameters
variables
Let’s assume radius known
What is the dimension of the parameter space?
![Page 85: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/85.jpg)
Image space Parameter space
parameters
variables
parameters
variables
What does a point in image space correspond to in parameter space?
![Page 86: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/86.jpg)
parameters
variables
parameters
variables
![Page 87: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/87.jpg)
parameters
variables
parameters
variables
![Page 88: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/88.jpg)
parameters
variables
parameters
variables
![Page 89: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/89.jpg)
parameters
variables
parameters
variables
![Page 90: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/90.jpg)
parameters
variables
parameters
variables
What if radius is unknown?
![Page 91: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/91.jpg)
parameters
variables
parameters
variables
What if radius is unknown?
If radius is not known: 3D Hough Space!
Use Accumulator array
Surface shape in Hough space is complicated
![Page 92: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/92.jpg)
Using Gradient Information
Gradient information can save lot of computation:
Edge Location
Edge Direction
Need to increment only one point in accumulator!
Assume radius is known:
![Page 93: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/93.jpg)
parameters
variables
parameters
variables
![Page 94: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/94.jpg)
parameters
variables
parameters
variables
![Page 95: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/95.jpg)
![Page 96: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/96.jpg)
Pennie Hough detector Quarter Hough detector
![Page 97: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/97.jpg)
Pennie Hough detector Quarter Hough detector
![Page 98: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/98.jpg)
The Hough transform …
Deals with occlusion well?
Detects multiple instances?
Robust to noise?
Good computational complexity?
Easy to set parameters?
![Page 99: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/99.jpg)
Can you use Hough Transforms for other objects,
beyond lines and circles?
Do you have to use edge detectors to
vote in Hough Space?
![Page 100: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/100.jpg)
Application of
Hough transforms
![Page 101: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/101.jpg)
Detecting shape features
F. Jurie and C. Schmid, Scale-invariant shape features for
recognition of object categories, CVPR 2004
![Page 102: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/102.jpg)
Original
images
Laplacian circles Hough-like circles
Which feature detector is more consistent?
![Page 103: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/103.jpg)
Robustness to scale and clutter
![Page 104: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/104.jpg)
Object detection
training image
visual codeword with
displacement vectors
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
Index displacements by “visual codeword”
![Page 105: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/105.jpg)
![Page 106: Hough transform16385/lectures/lecture4.pdfCourse announcements • Homework 1 posted on course website. - Due on February 5th at 23:59. - This homework is in Matlab. • First theory](https://reader033.vdocuments.site/reader033/viewer/2022060503/5f1c9e69d4d9e723fd0f727c/html5/thumbnails/106.jpg)
Basic reading:• Szeliski textbook, Sections 4.2, 4.3.
References