You are on page 1of 31

M

.K

.B
hu

ya

Boundary Detection:
Hough Transform

.K

.B
hu

ya

Boundaries of Objects

Marked by many users

http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/bench/html/images.html

.K

.B
hu

ya

Boundaries of Objects from Edges

Brightness Gradient (Edge detection)

Missing edge continuity, many spurious edges

.K

.B
hu

ya

Boundaries of Objects from Edges

Multi-scale Brightness Gradient

But, low strength edges may be very important

.K

.B
hu

ya

Boundaries of Objects from Edges

Machine Edge Detection

Image

Human Boundary Marking

.K

.B
hu

ya

Boundaries in Medical Imaging

Detection of cancerous regions.

.K

.B
hu

ya

Boundaries in Ultrasound Images

Hard to detect in the presence of large amount of speckle noise

.K

.B
hu

ya

Boundaries of Objects

Sometimes hard even for humans!

.K

.B
hu

ya

Line Grouping Problem

Line Detection and Hough transform


Many edges can be approximated by straight lines.

edge pixels, there are n(n 1 )


n

For

possible lines.

.K

.B
hu

ya

To find whether a point is closer to a line we have to perform


n(n 1 ) comparisons. Thus, a total of 0(n3 ) comparisons.
n
2

Hough Transform
Elegant method for direct object recognition
Edges need not be connected

ya

Complete object need not be visible

.K

.B
hu

Key Idea: Edges VOTE for the possible model

Image and Parameter Spaces


Equation of Line:

y mx c

(m, c)
( xi , yi )

( xi , yi )

.B
hu

ya

Consider point:

Find:

y mx c

Image Space

.K

yi mxi c or c xi m yi

m
Parameter space also called Hough Space

(m, c)
Parameter Space

Hough transform uses parametric representation of a

ya

straight line for line detection.

.K

.B
hu

y mx c

(m, c)

( x1, y1 )

l2 c mx y

l1

( x, y)
P

x
.K

l1and l2

respectively in m c space

.B
hu

ya

The points ( x, y)and ( x1, y1 ) are mapped to lines

l1 and l2 will intersect at a point P representing the (m, c)


values of the line joining ( x, y) and ( x1, y1 ).
The straight line map of another point collinear with these two
points will also intersect at P. The intersection of multiple lines in the

m-c plane will give the (m,c) values of lines in the edge image plane.

Line Detection by Hough Transform


y
Algorithm:
Quantize Parameter Space

A(m, c)
Parameter Space

.K

.B
hu

ya

A(m, c) 0 m, c

A(m, c)

Set

(m, c)
n

Create Accumulator Array

(m, c)

For each image edge

( xi , yi )

increment:

1
1

A(m, c) A(m, c) 1

Find local maxima in

A(m, c)

Group the edges that belong to each line by traversing each line.

1
2

If (m, c) lies on the line:

c xi m yi

1
1
1

1
1
1

Better Parameterization
Note: m and c are, in principle, unbounded: cannot handle all situations.

m
Large Accumulator

Improvement:

(Finite Accumulator Array Size)

Instead of (m, c), we can consider ( , )


varying between -90o and 90o

0 to

M 2 N2

.B
hu

ya

with

and

.K

for an M N image.

as the parameters

varying from

.B
hu

ya

( xi , yi )

Hough Space is Sinusoid


M

.K

Image Space

?
Hough Space

.K

.B
hu

ya

Image space

Votes

Note that most points in the vote array are very dark, because they
get only one vote.

n
ya
.B
hu
.K
M

Image
space

Votes

ya

.B
hu

.K

n
ya
.B
hu
.K
M

Lots of noise can lead to large peaks in the array

.K

.B
hu

ya

Real World Example

Original

Edge
Detection

Parameter Space

Found Lines

Finding Circles by Hough Transform


Equation of Circle:

( xi a) 2 ( yi b) 2 r 2

.K

A(a, b)
M

Accumulator Array

.B
hu

ya

If radius is known: (2D Hough Space)

Finding Circles by Hough Transform


Equation of Circle:

.K

.B
hu

ya

( xi a) 2 ( yi b) 2 r 2

If radius is not known: 3D Hough Space!


Use Accumulator array A(a, b, r )

Finding Coins
Original

.K

.B
hu

ya

Edges (note noise)

Finding Coins (Continued)


Quarters

.K

.B
hu

ya

Penn
y

Generalized Hough Transform

.K

.B
hu

ya

Model Shape NOT described by equation

Generalized Hough Transform

.K

.B
hu

ya

Model Shape NOT described by equation

Generalized Hough Transform


Find Object Center

( xc , yc ) given edges ( xi , yi , i )

Create Accumulator Array

A( xc , yc ) 0 ( xc , yc )
.B
hu

ya

( xi , yi , i )

For each entry

rki

.K

For each edge point

Initialize:

A( xc , yc )

in table, compute:

xc xi rki cos ki
yc yi rki sin ki
Increment Accumulator:
Find Local Maxima in

A( xc , yc )

A( xc , yc ) A( xc , yc ) 1

ya

.B
hu

.K

Hough Transform: Comments


Works on Disconnected Edges
Relatively insensitive to occlusion

.B
hu

ya

Effective for simple shapes (lines, circles, etc)


M

.K

Trade-off between work in Image Space and Parameter Space


Handling inaccurate edge locations:
Increment Patch in Accumulator rather than a single point

You might also like