0% found this document useful (0 votes)
13 views

Computer Vision - Hough Transform

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Computer Vision - Hough Transform

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

COMPUTER VISION

Le Thanh Ha, Ph.D


Assoc. Prof. at University of Engineering and Technology,
Vietnam National University
[email protected]; [email protected]; 0983 692 592
Hough Transform
• The Hough transform is a technique which can be used to
isolate features of a particular shape: line, circle, eclipse

• It uses a voting machenism in parameter space for detecting


these shapes.

3/13/2023 Le Thanh Ha 2
Parameter function
• Object in image can be defined by a function of parameter
(parameter function):
f (x, y, a1, · · · , an) = 0
In which (x,y) is pixel position and {a1, · · · , an} is a set of n
parameters specifying the shape.

3/13/2023 Le Thanh Ha 3
Hough transform
• Transform to parameter space:
– Every pixel (x,y) in a 2D image is transformed into a surface of n-
dimension space.

• Transform back to image spatial space:


– Every point (a1, · · · , an) in the n-dimension space is transformed to a
shape in the 2D image.

3/13/2023 Le Thanh Ha 4
Line detection
• Parameter function to be used:
y = ax + b
- It is a line in Image
- But, it is only a point (a,b) in parameter space.

3/13/2023 Le Thanh Ha 5
Line Detection
• A point (x0,y0)  I corresponds to the line a = y0/x0 - b/x0 in the
parameter space P.

• And, a point (a0,b0)  P corresponds to the line y = a0x+b0 in


image space I.

3/13/2023 Le Thanh Ha 6
Line detection
• Construct the line function of following image by hough
transform:

3/13/2023 Le Thanh Ha 7
Line detection
• Another line function can be used:

in which ρ0 là is the distance between line and the origin, and θ0 là is the angle
between the distance vector and Ox axis.

3/13/2023 Le Thanh Ha 8
Line detection algorithm
• Create a 2D matrix H(ρ, θ) for the parameter space. Initialize the matrix
with 0 values.

• Find gradient G(x,y) of I(x,y)

• For pixel (x,y) satisfies |G(x,y)| > Ts, increase H(ρ, θ) such that:

3/13/2023 Le Thanh Ha 9
Line detection algorithm

• This algorithm can be improved by using the gradient angle


∠G(x,y)

3/13/2023 Le Thanh Ha 10
Line detection

3/13/2023 Le Thanh Ha 11
Line detection

3/13/2023 Le Thanh Ha 12
Line detection

3/13/2023 Le Thanh Ha 13
Circle detection
• A circle with radius R at position (a,b) can be specified by a
function:

–  scans from 0 to 360 degree


– A pixel belonging to a circle corresponds to a set of (a,b, )

3/13/2023 Le Thanh Ha 14
Circle detection
• With a fixed radius R, (a,b) has a circle orbit centered at (x,y) and radius R.
• The coordinate of the real cirle can be found by a cummulative table

3/13/2023 Le Thanh Ha 15
Circle Detection
• For pixel (x,y) satisfies |G(x,y)| >Ts, increase the cummulative
table in in parameter space such that:

a = x  R cos G
R, 
 b = y  R sin G
H (a, b, R) = H (a, b, R) + 1

3/13/2023 Le Thanh Ha 16
Circle Detection

3/13/2023 Le Thanh Ha 17
Circle Detection

3/13/2023 Le Thanh Ha 18
Circle Detection

3/13/2023 Le Thanh Ha 19
Summary
• Hough transform
• It can be used to detect some image features having a paticular
shape properties: line, circle, …

3/13/2023 Le Thanh Ha 20

You might also like