Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4...
Transcript of Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4...
![Page 1: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/1.jpg)
1
Digital Image Processing
Lecture # 13 Image Segmentation & Hough Transform
![Page 2: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/2.jpg)
Image Segmentation
![Page 3: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/3.jpg)
1/14/2017 Image Segmentation 3
Image Segmentation
Group similar components (such as, pixels in an
image, image frames in a video)
Applications: Finding tumors, veins, etc. in medical
images, finding targets in satellite/aerial images,
finding people in surveillance images, summarizing
video, etc.
![Page 4: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/4.jpg)
1/14/2017 Image Segmentation 4
Image Segmentation
Segmentation algorithms are based on one of two basic
properties of gray-scale values:
Discontinuity
Partition an image based on abrupt changes in gray-scale levels.
Detection of isolated points, lines, and edges in an image.
Similarity
Thresholding, region growing, and region splitting/merging.
![Page 5: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/5.jpg)
1/14/2017 Image Segmentation 5
Thresholding Segmentation into two classes/groups
Foreground (Objects)
Background
![Page 6: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/6.jpg)
1/14/2017 Image Segmentation 6
Thresholding
1 ( , )( , )
0 ( , )
if f x y Tg x y
if f x y T
Objects & Background
Global Thresholding
Local/Adaptive Thresholding
![Page 7: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/7.jpg)
1/14/2017 Image Segmentation 7
Global Thresholding Single threshold value for entire image
Fixed ?
Automatic
Intensity histogram
![Page 8: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/8.jpg)
1/14/2017 Image Segmentation 8
Global Thresholding Single threshold value for entire image
Fixed ?
Automatic
Intensity histogram
![Page 9: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/9.jpg)
1/14/2017 Image Segmentation 9
Global Thresholding
Estimate an initial T
Segment Image using T: Two groups of pixels G1 and G2
Compute average gray values m1 and m2 of two groups
Compute new threshold value T=1/2(m1+m2)
Repeat steps 2 to 4 until: abs(Ti – Ti-1)<epsilon
![Page 10: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/10.jpg)
1/14/2017 Image Segmentation 10
Global Thresholding
Multilevel thresholding
![Page 11: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/11.jpg)
1/14/2017 Image Segmentation 11
Thresholding Non-uniform illumination:
![Page 12: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/12.jpg)
1/14/2017 Image Segmentation 12
Global Thresholding
![Page 13: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/13.jpg)
1/14/2017 Image Segmentation 13
Adaptive Thresholding
![Page 14: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/14.jpg)
1/14/2017 Image Segmentation 14
Adaptive Thresholding Threshold: function of neighboring pixels
max min
2
T mean
T median
T
![Page 15: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/15.jpg)
1/14/2017 Image Segmentation 15
Adaptive Thresholding
Original Image Global Thresholding
![Page 16: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/16.jpg)
1/14/2017 Image Segmentation 16
Adaptive Thresholding
T=mean, neighborhood=7x7 T=mean-Const., neighborhood=7x7
![Page 17: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/17.jpg)
1/14/2017 Image Segmentation 17
Adaptive Thresholding
mean
standard deviations
Niblack constant
T m k s
m
s
k
Niblack Algorithm
Neighborhood size???
![Page 18: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/18.jpg)
Document Binarization
• Local Thresholding – Examples
18
Original Niblack Sauvola
Wolf Feng NICK
![Page 19: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/19.jpg)
1/14/2017 Image Segmentation 19
Region-Based Segmentation Divide the image into regions
R1,R2,…,RN
Following properties must hold:
(For adjacent regions)
![Page 20: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/20.jpg)
1/14/2017 Image Segmentation 20
Region-Based Segmentation Region Growing
Region growing: groups pixels or subregions into larger
regions.
Pixel aggregation: starts with a set of “seed” points and from
these grows regions by appending to each seed points those
neighboring pixels that have similar properties (such as gray
level).
Predicate: for example abs(zj - seed) < Epsilon
1. Choose the seed pixel(s).
2. Check the neighboring pixels and add them to the region if they are
similar to the seed
3. Repeat step 2 for each of the newly added pixels; stop if no more
pixels can be added
![Page 21: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/21.jpg)
1/14/2017 Image Segmentation 21
Region-Based Segmentation Example
![Page 22: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/22.jpg)
1/14/2017 Image Segmentation 22
Region-Based Segmentation Region Splitting
Region Growing: Starts from a set of seed points.
Region Splitting: Starts with the whole image as a single
region and subdivide the regions that do not satisfy a
condition.
Image = One Region R
Select a predicate P (gray values etc.)
Successively divide each region into smaller and smaller
quadrant regions so that:
( )iP R true
![Page 23: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/23.jpg)
1/14/2017 Image Segmentation 23
Region-Based Segmentation Region Splitting
Problem? Adjacent regions could be same
Solution? Allow Merge
![Page 24: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/24.jpg)
1/14/2017 Image Segmentation 24
Region-Based Segmentation
Region Merging
Region merging is the opposite of region splitting.
Merge adjacent regions Ri and Rj for which:
Region Splitting/Merging
Stop when no further split or merge is possible
( )i jP R R True
![Page 25: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/25.jpg)
1/14/2017 Image Segmentation 25
Region-Based Segmentation
1. Split into four disjointed quadrants any region Ri where P(Ri)=False
2. Merge any adjacent regions Rj and Rk for which P(Rj U Rk)=True
3. Stop when no further merging or splitting is possible
Example
![Page 26: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/26.jpg)
Clustering
![Page 27: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/27.jpg)
1/14/2017 Image Segmentation 27
K-Means Clustering 1. Chose the number (K) of clusters and randomly select the
centroids of each cluster.
2. For each data point:
Calculate the distance from the data point to each cluster.
Assign the data point to the closest cluster.
3. Recompute the centroid of each cluster.
4. Repeat steps 2 and 3 until there is no further change in
the assignment of data points (or in the centroids).
![Page 28: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/28.jpg)
1/14/2017 Image Segmentation 28
K-Means Clustering
![Page 29: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/29.jpg)
1/14/2017 Image Segmentation 29
K-Means Clustering
![Page 30: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/30.jpg)
1/14/2017 Image Segmentation 30
K-Means Clustering
![Page 31: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/31.jpg)
1/14/2017 Image Segmentation 31
K-Means Clustering
![Page 32: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/32.jpg)
1/14/2017 Image Segmentation 32
K-Means Clustering
![Page 33: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/33.jpg)
1/14/2017 Image Segmentation 33
K-Means Clustering
![Page 34: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/34.jpg)
1/14/2017 Image Segmentation 34
K-Means Clustering
![Page 35: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/35.jpg)
1/14/2017 Image Segmentation 35
K-Means Clustering
![Page 36: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/36.jpg)
1/14/2017 Image Segmentation 36
K-Means Clustering
![Page 37: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/37.jpg)
1/14/2017 Image Segmentation 37
Clustering Example
![Page 38: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/38.jpg)
1/14/2017 Image Segmentation 38
Clustering Example
![Page 39: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/39.jpg)
1/14/2017 Image Segmentation 39
Clustering Example
![Page 40: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/40.jpg)
1/14/2017 Image Segmentation 40
Clustering Example
![Page 41: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/41.jpg)
1/14/2017 Image Segmentation 41
Clustering Example
D. Comaniciu and P.
Meer, Robust Analysis
of Feature Spaces:
Color Image
Segmentation, 1997.
![Page 42: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/42.jpg)
1/14/2017 Image Segmentation 42
K-Means Clustering Example
Original K=5 K=11
![Page 43: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/43.jpg)
Hough Transform
![Page 44: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/44.jpg)
44
![Page 45: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/45.jpg)
45
![Page 46: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/46.jpg)
46
![Page 47: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/47.jpg)
47
![Page 48: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/48.jpg)
48
![Page 49: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/49.jpg)
49
![Page 50: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/50.jpg)
![Page 51: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/51.jpg)
![Page 52: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/52.jpg)
![Page 53: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/53.jpg)
53
![Page 54: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/54.jpg)
54
Hough Transform • The edge points are linked by determining if they lie on a curve of
specified shape.
• Let us take the case of straight lines: we want to link points if they lie on a straight line.
• Consider a point (xi,yi), the equation of any line passing through this point is given by: yi = a xi + b, which can be written as: b = - xia + yi. Therefore every point in xy plane corresponds to a straight line in ab plane.
• If there is a second point (xj,yj), another line with equation: b = - xja + yj is drawn in the ab plane.
• The intersection of the two lines in ab space give the values of (a/,b/), which define a line passing through both points (xi,yi) and (xj,yj).
![Page 55: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/55.jpg)
55
Hough Transform
Implementation
The parameter space ab is subdivided into the accumulator cells, where (amax,amin) and (bmax,bmin) are the expected ranges of slope and intercept values.
![Page 56: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/56.jpg)
56
Hough Transform Implementation steps:
• Initially the accumulator cells are set to zero.
• Then for every point (xk,yk) in the image, a is varied over the allowed subdivision values and the corresponding b values are calculated using b = -xka + yk.
• The resulting b are then rounded off to the allowed values of b.
• If a value of ap results in solution bq, we let the corresponding accumulator value A(p,q) = A(p,q) +1.
• In the end the value of Q in A(i,j) corresponds to Q points on the line y = -aix + bj.
Note: The number of subdivisions in the ab plane determines the accuracy of the colinearity of these points.
![Page 57: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/57.jpg)
57
Hough Transform Implementation 1 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
-3 -2 -1 0 1 2 3 -3
-2
-1
0
1
2
3
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
0 0 0 1 0 0 0
-3 -2 -1 0 1 2 3 -3
-2
-1
0
1
2
3
0 0 0 1 0 0 0
0 0 0 1 0 0 1
0 0 0 1 0 1 0
0 0 0 1 1 0 0
0 0 0 2 0 0 0
0 0 1 1 0 0 0
0 1 0 1 0 0 0
-3 -2 -1 0 1 2 3 -3
-2
-1
0
1
2
3
0 0 0 1 0 0 0
0 0 0 1 0 0 1
0 0 0 1 0 1 0
0 0 0 1 1 1 0
0 0 0 3 0 0 0
0 1 1 1 0 0 0
0 1 0 1 0 0 0
-3 -2 -1 0 1 2 3 -3
-2
-1
0
1
2
3
0 0 0 1 0 0 0
0 0 0 1 0 0 1
0 0 0 1 0 1 0
0 0 0 1 1 1 2
0 0 1 5 0 0 0
1 1 1 1 0 0 0
0 1 0 1 0 0 0
-3 -2 -1 0 1 2 3 -3
-2
-1
0
1
2
3
….
Parameters a and b can take values between –infinity to +infinity
![Page 58: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/58.jpg)
58
Hough Transform • Limitation in using yi = a xi + b, as the representation of
straight line is that slope approaches to infinity as the line approaches to be vertical.
• Therefore usually Hough Transform is implemented using the polar equation of straight line, i.e.
and instead of ab-plane rq-plane is used.
• Every point in image gives a sinusoidal curve in the rq-plane.
rqq sincos yx
![Page 59: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/59.jpg)
See Example on You Tube:
https://www.youtube.com/watch?v=4zHbI-fFIlI
![Page 60: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/60.jpg)
60
Hough Transform
![Page 61: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/61.jpg)
Hough Transform
![Page 62: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/62.jpg)
Example
62
![Page 63: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/63.jpg)
![Page 64: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/64.jpg)
64
Hough Transform
![Page 65: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/65.jpg)
65
Implementation of the Hough transform • Construct an array representing q, r
• For each point, render the curve (q, r) into this array, adding one at each cell
• Difficulties
– how big should the cells be? (too big, and we cannot distinguish between quite different lines; too small, and noise causes lines to be missed)
• How many lines?
– count the peaks in the Hough array
• This method can be extended to other type of curves also by using the equation for the desired curve, e.g. circle:
2
3
2
2
2
1 )()( ccycx
![Page 66: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/66.jpg)
66
Hough Transform
![Page 67: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/67.jpg)
67
Hough Transform
![Page 68: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/68.jpg)
68
Two main limitations:noise and cell size
Noise Limitations of Hough Transform
Results for a specimen of line with 20 points, with different amounts of
noise
![Page 69: Lecture # 13 Image Segmentation & Hough Transform · 2017-04-20 · 1/14/2017 Image Segmentation 4 Image Segmentation Segmentation algorithms are based on one of two basic properties](https://reader030.fdocuments.in/reader030/viewer/2022040521/5e79cec6bb4ab91166737375/html5/thumbnails/69.jpg)
69
Acknowledgements
Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2002
Computer Vision for Computer Graphics, Mark Borg
Mat
eria
l in
th
ese
slid
es h
as b
een
tak
en f
rom
, th
e fo
llow
ing
reso
urc
es