Download presentation
Presentation is loading. Please wait.
Published byEdgar Hutchinson Modified over 8 years ago
1
1 Hough Transform
2
2 A Technique to Isolate Features of a Particular Shape within an Image The classical Hough transform is most commonly used for the detection of regular curves such as: lines, circles, ellipses, etc Because: The desired features be specified in some parametric form
3
Voting schemes 3 Let each feature vote for all the models that are compatible with it Hopefully the noise features will not vote consistently for any single model Missing data doesn’t matter as long as there are enough features remaining to agree on a good model
4
Properties 4 Can tolerate noise and gaps in edge image Look for solutions in a parameter space Classical Hough transform Detect simple shape Line detection Circle detection
5
Hough transform 5 An early type of voting scheme General outline: Discretize parameter space into bins For each feature point in the image, put a vote in every bin in the parameter space that could have generated this point Find bins that have the most votes
6
Hough Transform شنبه زاده 6 Instead of going directly for the solution (as in template matching), we can use a voting scheme. Each possible point (edge) votes in the parameter space of a line. A line can be specified uniquely by two parameters m and n. y = m.x + n Parameter space of 2 dimensions (m and n).
7
7 y x b m m0m0 b0b0 Hough spaceimage space Connection between image (x,y) and Hough (m,b) spaces A line in the image corresponds to a point in Hough space To go from image space to Hough space: - given a set of points (x,y), find all (m,b) such that y = mx + b Finding lines in an image A line in the image corresponds to a point in Hough space
8
8 Where is the line that contains both (x 0, y 0 ) and (x 1, y 1 )?
9
9 It is the intersection of the lines b = –x 0 m + y 0 and b = – x 1 m + y 1
10
10 Equation of Line: Find: Consider point: Image Space Parameter space also called Hough Space Parameter Space
11
11 Algorithm: Quantize Parameter Space Create Accumulator Array Set For each image edge increment: If lies on the line: Find local maxima in 11 11 11 2 11 11 11 Parameter Space
12
شنبه زاده 12 Problem with m-n parameter space. Both m and n can get very large [-∞, ∞]. How do we address this problem?
13
13 An alternative parameter space is polar coordinates. We use ( ρ, θ ) space to represent a line. ρ = x.cos( θ ) + y.sin( θ ) Points in picture sinusoids in parameter space Points in parameter space lines in picture Sinusoids corresponding to co-linear points intersect at an unique point
14
14 Example: Line: 0.6x + 0.4y = 2.4 Sinusoids intersect at:ρ = 2.4, θ = 0.9273
15
شنبه زاده 15 Let ρ= [−R, R] and θ= [0,pi ) For each edge point (xi, yi ), calculate: θ ‘ = xi cos θ ‘+ yi sin θ Accumulator: A(ρ, θ) = A(ρ, θ) + 1 Threshold the accumulator values to get parameters for detected lines Threshold at A(ρ, θ) = 30 Threshold at A(ρ, θ) = 20 Threshold at A(ρ, θ) = 15
16
Example 16
17
Hough Transform Example with breaks in lines 17
18
Hough Transform Example with 1% salt and pepper noise 18
19
The Hough transform of the line is simply: a point at coordinate (ρ,θ) 19
20
A family of lines passing through a common point 20
21
The Hough transform of the family of curves passing through the three points results in the set of three parametric curves. These three curves cross at a single point corresponding to the dashed line passing through the collinear points. 21
22
22
23
23
24
24
25
25
26
Example 26
27
27
28
28 Theta = 45º = 0.785 rad r = (1√2) / 2 = 0.707 Theta: 0 to 3.14 (rad) Tokens Votes Brightest point = 20 votes
29
29 Brightest point = 6 votes
30
30 Noise Lowers the Peaks
31
31 Noise Increases the Votes in Spurious Accumulator Elements
32
( e) Straight dashed line ( f) Hough transform of dashed line 32
33
33
34
34 Edges need not be connected Complete object need not be visible Key Idea: Edges VOTE for the possible model Advantages
35
35 1)Exponential time and memory increase with the increase of the parameter numbers. 2) Sampling of parameter space is difficult. 3) Similar shapes might produce peaks in the Hough Space (wide ellipses might interfere with lines) Problems with HT
36
A city scene where the buildings are obstructed in fog 36
37
To find the true edges of the buildings 37
38
Hough transform can detect some of the straight lines representing building edges within the obstructed region The histogram equalizedhistogram equalized accumulator space شنبه زاده 38
39
De-Houghed image set the relative threshold to 70% 39
40
Relative Threshold 50% 40
41
Street information is not available 41
42
Hough line detector is able to recover some of this information 42
43
شنبه زاده 43 Hough Transform By MATLAB I = imread('circuit.tif'); BW = edge(I,'canny'); [H,T,R] = hough(BW); P = houghpeaks(H,12,'threshold',ceil(0.3*max(H(:)))); lines = houghlines(BW,T,R,P,'FillGap',5,'MinLength',7);
44
شنبه زاده 44
45
Hough transform for circles 45
46
Hough transform for circles 46
47
47
48
Implementation of the Hough transform for circles 48
49
شنبه زاده 49
50
شنبه زاده 50
51
آلگوريتم زير را از صفحه 206 کتاب استخراج ويژگی های تصوير مطالعه نموده و برای يک تصوير چهره عنبيه را مشخص سازيد. 51
52
Hough transform for ellipses 52
53
Circles are very important in shape detection since many objects have a circular shape. However, because of the camera’s viewpoint, circles do not always look like circles in images. We can define the mapping between the circle and an ellipse by a similarity transformation. 53
54
54
55
با توجه به وجود 5 پارامتربرای محاسبات اگر 100 حالت برای هر کدام از آنها وجود داشته باشد، حافظه مورد نياز برای ذخيره سازی را محاسبه نماييد. 55
56
56
57
57
58
58
59
59
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.