Top Banner
Generalized Hough Transform 16-385 Computer Vision
36

5.4 Generalized Hough Transform - cs.cmu.edu

Jul 11, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 5.4 Generalized Hough Transform - cs.cmu.edu

Generalized Hough Transform16-385 Computer Vision

Page 2: 5.4 Generalized Hough Transform - cs.cmu.edu

Hough Circles

Page 3: 5.4 Generalized Hough Transform - cs.cmu.edu

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

-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

-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

-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

-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

-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

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

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

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

-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

-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
Page 15: 5.4 Generalized Hough Transform - cs.cmu.edu

Pennie Hough detector Quarter Hough detector

Page 16: 5.4 Generalized Hough Transform - cs.cmu.edu

Pennie Hough detector Quarter Hough detector

Page 17: 5.4 Generalized Hough Transform - cs.cmu.edu

Can you use Hough Transforms for other objects, beyond lines and circles?

Page 18: 5.4 Generalized Hough Transform - cs.cmu.edu

Generalized Hough Transform

Page 19: 5.4 Generalized Hough Transform - cs.cmu.edu
Page 20: 5.4 Generalized Hough Transform - cs.cmu.edu

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
Page 22: 5.4 Generalized Hough Transform - cs.cmu.edu

Do you have to use edge detectors to vote in Hough Space?

Page 23: 5.4 Generalized Hough Transform - cs.cmu.edu

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

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

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

Application of Hough Transforms

Page 27: 5.4 Generalized Hough Transform - cs.cmu.edu

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

Original images

Laplacian circles Hough-like circles

Which feature detector is more consistent?

Page 29: 5.4 Generalized Hough Transform - cs.cmu.edu

Robustness to scale and clutter

Page 30: 5.4 Generalized Hough Transform - cs.cmu.edu

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
Page 32: 5.4 Generalized Hough Transform - cs.cmu.edu

1. get featuresTrain phase

Page 33: 5.4 Generalized Hough Transform - cs.cmu.edu

2. store displacementsTrain phase

Page 34: 5.4 Generalized Hough Transform - cs.cmu.edu

Test phase

Page 35: 5.4 Generalized Hough Transform - cs.cmu.edu
Page 36: 5.4 Generalized Hough Transform - cs.cmu.edu

The Hough transform …

Deals with occlusion well?

Detects multiple instances?

Robust to noise?

Good computational complexity?

Easy to set parameters?