Download - 5.4 Generalized Hough Transform - cs.cmu.edu
![Page 1: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/1.jpg)
Generalized Hough Transform16-385 Computer Vision
![Page 2: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/2.jpg)
Hough Circles
![Page 3: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/3.jpg)
Finding Circles by Hough Transform
Equation of Circle:
222 )()( rbyax ii =−+−
If radius is known:
),( baAAccumulator Array
(2D Hough Space)
![Page 4: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/4.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x, y)
Image space Parameter space
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 5: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/5.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x, y)
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 6: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/6.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 7: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/7.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
a
b
parameters
variables
parameters
variables
![Page 8: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/8.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 9: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/9.jpg)
Finding Circles by Hough Transform
Equation of Circle:
222 )()( rbyax ii =−+−
If radius is not known: 3D Hough Space!
Use Accumulator array ),,( rbaA
What is the surface in the hough space?
![Page 10: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/10.jpg)
Finding Circles by Hough Transform
Equation of Circle:
222 )()( rbyax ii =−+−
If radius is not known: 3D Hough Space!
Use Accumulator array ),,( rbaA
What is the surface in the hough space?
![Page 11: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/11.jpg)
Using Gradient InformationGradient information can save lot of computation:
Edge Location
Edge Direction
Need to increment only one point in accumulator!!
iφ),( ii yx
Assume radius is known:
φ
φ
sincosrybrxa
−=
−=
![Page 12: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/12.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x, y,�)
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 13: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/13.jpg)
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
-5 -4 -3 -2 -1 0 1 2 3 4
-4
-3
-2
-1
1
2
3
4
a
b
(x, y,�)
(x� a)2 + (y � b)2 = r
2 (x� a)2 + (y � b)2 = r
2
parameters
variables
parameters
variables
![Page 14: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/14.jpg)
![Page 15: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/15.jpg)
Pennie Hough detector Quarter Hough detector
![Page 16: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/16.jpg)
Pennie Hough detector Quarter Hough detector
![Page 17: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/17.jpg)
Can you use Hough Transforms for other objects, beyond lines and circles?
![Page 18: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/18.jpg)
Generalized Hough Transform
![Page 19: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/19.jpg)
![Page 20: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/20.jpg)
Generalized Hough TransformFind Object Center given edges
Create Accumulator Array
Initialize:
For each edge point
For each entry in table, compute:
Increment Accumulator:
Find Local Maxima in
),( cc yxA
),(0),( cccc yxyxA ∀=
),,( iii yx φ
1),(),( += cccc yxAyxA
),( cc yxA
ik
ikic
ik
ikic
ryy
rxx
α
α
sin
cos
+=
+=
),( cc yx ),,( iii yx φ
r̄ik
![Page 21: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/21.jpg)
![Page 22: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/22.jpg)
Do you have to use edge detectors to vote in Hough Space?
![Page 23: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/23.jpg)
c
Template
A.Train phase:
1.Get features
2.Store all displacements of feature from center
B.Test phase:
1.Get features & lookup displacements
2.Vote for center location
![Page 24: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/24.jpg)
Template
A.Train phase:
1.Get features
2.Store all displacements of feature from center
B.Test phase:
1.Get features & lookup displacements
2.Vote for center location
![Page 25: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/25.jpg)
Test image
A.Train phase:
1.Get features
2.Store all displacements of feature from center
B.Test phase:
1.Get features & lookup displacements
2.Vote for center location
![Page 26: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/26.jpg)
Application of Hough Transforms
![Page 27: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/27.jpg)
Detecting shape features
F. Jurie and C. Schmid, Scale-invariant shape features for recognition of object categories, CVPR 2004
![Page 28: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/28.jpg)
Original images
Laplacian circles Hough-like circles
Which feature detector is more consistent?
![Page 29: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/29.jpg)
Robustness to scale and clutter
![Page 30: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/30.jpg)
Object detection
training image
visual codeword withdisplacement 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 31: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/31.jpg)
![Page 32: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/32.jpg)
1. get featuresTrain phase
![Page 33: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/33.jpg)
2. store displacementsTrain phase
![Page 34: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/34.jpg)
Test phase
![Page 35: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/35.jpg)
![Page 36: 5.4 Generalized Hough Transform - cs.cmu.edu](https://reader036.vdocuments.us/reader036/viewer/2022071118/62cb16ccef36e6617717c18b/html5/thumbnails/36.jpg)
The Hough transform …
Deals with occlusion well?
Detects multiple instances?
Robust to noise?
Good computational complexity?
Easy to set parameters?