Download presentation
Presentation is loading. Please wait.
1
Chapter 10 Image Segmentation
智能视觉理解 实验室
2
10.1 Fundamentals Boundary Region of Constant Intensity
Result of Segmentation Result of Segmentation Textured Region Result of Edge Computation
3
Horizontal Intensity Profile through the Center
10.2 Point Line and Edge Detection Horizontal Intensity Profile through the Center 𝝏𝒇 𝝏𝒙 = 𝒇 ′ 𝒙 =𝒇 𝒙+𝟏 −𝒇 𝒙 𝝏 𝟐 𝒇 𝝏 𝒙 𝟐 = 𝒇 ′′ 𝒙 =𝒇 𝒙+𝟏 +𝒇(𝒙−𝟏)−𝟐𝒇 𝒙
4
A General Spatial Filter Mask
10.2 Point Line and Edge Detection A General Spatial Filter Mask 𝑹= 𝒊=𝟏 𝟗 𝒘 𝒊 𝒛 𝒊
5
Point Detection (Laplacian) Mask Result of Convolving the Mask
Detection of Isolated Points Point Detection (Laplacian) Mask Result of Convolving the Mask 𝒈 𝒙,𝒚 = 𝟏 𝐢𝐟 𝑹 𝒙,𝒚 ≥𝑻 𝟎 𝐨𝐭𝐡𝐞𝐫𝐰𝐢𝐬𝐞 X-ray Image
6
Absolute Value of the Laplacian Positive Value of the Laplacian
Line Detection Original Image Laplacian Image Absolute Value of the Laplacian Positive Value of the Laplacian
7
Line Detection Line Detection Masks 𝐋𝐢𝐧𝐞 𝒊: 𝑹 𝒊 ≥| 𝑹 𝒋 |
8
10.2.3 Line Detection Wire-bond Template Result of +45 Line Detector
Zoomed View of the Top Left Zoomed View of the Bottom Right All Points Whose Value Satisfied 𝒈≥𝑻 All Negative Value set to Zero
9
Ideal Representations
Edge Models Ideal Representations Step Edge Ramp Edge Roof Edge
10
Edge Models A 1508×1970 image showing (zoomed) actual ramp (bottom, left), step (top, right), and roof edge profiles.
11
Horizontal Intensity Profile Separated by an Ideal Vertical Ramp Edge
Edge Models Detail Near the Edge Horizontal Intensity Profile Separated by an Ideal Vertical Ramp Edge
12
Ramp Edge Corrupted by Gaussian Noise
First-derivative Second-derivative 𝑵(𝟎,𝟎) Ramp Edge Corrupted by Gaussian Noise 𝑵(𝟎,𝟎.𝟏) 𝑵(𝟎,𝟏) 𝑵(𝟎,𝟏𝟎)
13
Gradient Operators 10.2.5 Basic Edge Detection
𝛁𝒇= 𝒈 𝒙 𝒈 𝒚 = 𝝏𝒇 𝝏𝒙 𝝏𝒇 𝝏𝒚 𝛁𝐟 = 𝝏𝒇 𝝏𝒙 𝟐 + 𝝏𝒇 𝝏𝒚 𝟐 𝟏 𝟐 ∞ 𝝏𝒇 𝝏𝒙 + 𝝏𝒇 𝝏𝒚 𝜶 𝒙,𝒚 =𝐭𝐚 𝐧 −𝟏 𝒈 𝒚 𝒈 𝒙
14
Basic Edge Detection Using the gradient to determine edge strength and direction at a point.
15
One-dimensional Masks
Basic Edge Detection One-dimensional Masks 𝒈 𝒙 = 𝝏𝒇(𝒙,𝒚) 𝝏𝒙 =𝒇 𝒙+𝟏,𝒚 −𝒇(𝒙,𝒚) 𝒈 𝒚 = 𝝏𝒇(𝒙,𝒚) 𝝏𝒚 =𝒇 𝒙,𝒚+𝟏 −𝒇(𝒙,𝒚)
16
Roberts Cross Gradients
Basic Edge Detection Roberts Cross Gradients 𝒈 𝒙 = 𝒛 𝟗 − 𝒛 𝟓 𝒈 𝒚 = 𝒛 𝟖 − 𝒛 𝟔 𝛁𝒇 ≈ 𝒛 𝟗 − 𝒛 𝟓 𝟐 + 𝒛 𝟖 − 𝒛 𝟔 𝟐 𝟏 𝟐 𝛁𝒇 ≈ 𝒛 𝟗 − 𝒛 𝟓 +| 𝒛 𝟖 − 𝒛 𝟔 | Prewitt Operators 𝒈 𝒙 = 𝒛 𝟕 + 𝒛 𝟖 + 𝒛 𝟗 −( 𝒛 𝟏 + 𝒛 𝟐 + 𝒛 𝟑 ) 𝒈 𝒚 = 𝒛 𝟑 + 𝒛 𝟔 + 𝒛 𝟗 −( 𝒛 𝟏 + 𝒛 𝟒 + 𝒛 𝟕 ) 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 𝒈 𝒙 = 𝒛 𝟕 + 𝟐𝒛 𝟖 + 𝒛 𝟗 −( 𝒛 𝟏 + 𝟐𝒛 𝟐 + 𝒛 𝟑 ) 𝒈 𝒚 = 𝒛 𝟑 + 𝟐𝒛 𝟔 + 𝒛 𝟗 −( 𝒛 𝟏 + 𝟐𝒛 𝟒 + 𝒛 𝟕 )
17
Y-Direction X-Direction
18
Basic Edge Detection Diagonal Edge 45-Direction -45-Direction
19
Basic Edge Detection Using the Sobel Mask Original Image | 𝒈 𝒙 | | 𝒈 𝒚 | 𝒈 𝒙 +| 𝒈 𝒚 |
20
Gradient Angle Image 10.2.5 Basic Edge Detection
𝜶 𝒙,𝒚 =𝐭𝐚 𝐧 −𝟏 𝒈 𝒚 𝒈 𝒙
21
Smoothed using a 5×5 averaging filter
Basic Edge Detection Smoothed using a 5×5 averaging filter Original Image | 𝒈 𝒙 | | 𝒈 𝒚 | 𝒈 𝒙 +| 𝒈 𝒚 |
22
Diagonal Edge Detection
Basic Edge Detection Diagonal Edge Detection Sobel 45 Sobel -45
23
Laplacian Masks 10.2.5 Basic Edge Detection
𝛁 𝟐 𝒇= 𝝏 𝟐 𝒇 𝝏 𝒙 𝟐 + 𝝏 𝟐 𝒇 𝝏 𝒚 𝟐 𝟒 𝑵 ′ 𝒔: 𝛁 𝟐 𝒇=𝟒 𝒛 𝟓 − 𝒛 𝟐 + 𝒛 𝟒 + 𝒛 𝟔 + 𝒛 𝟖 𝟖 𝑵 ′ 𝒔: 𝛁 𝟐 𝒇=𝟒 𝒛 𝟓 −( 𝒛 𝟏 + 𝒛 𝟐 + 𝒛 𝟑 + 𝒛 𝟒 + 𝒛 𝟓 + 𝒛 𝟔 + 𝒛 𝟕 + 𝒛 𝟖 + 𝒛 𝟗 )
24
Negative of the LoG 10.2.6 Marr-Hildreth Edge Detector
𝑮 𝒙,𝒚 = 𝒆 − 𝒙 𝟐 + 𝒚 𝟐 𝟐 𝝈 𝟐 𝛁 𝟐 𝑮 𝒙,𝒚 = 𝒙 𝟐 + 𝒚 𝟐 −𝟐 𝝈 𝟐 𝝈 𝟒 𝒆 − 𝒙 𝟐 + 𝒚 𝟐 𝟐 𝝈 𝟐
25
10.2.6 Marr-Hildreth Edge Detector
Original Image 𝝈=𝟒, 𝒏=𝟐𝟓 Threshold: 0 Threshold: 4
26
Gaussian Smoothing Function
Marr-Hildreth Edge Detector Original Image Sobel Gradient Gaussian Smoothing Function Laplacian Mask LoG Threshold LoG Zero Crossings
27
Negatives of the LoG (solid) and DoG (dotted)
Marr-Hildreth Edge Detector Negatives of the LoG (solid) and DoG (dotted) Ratio: 1.75:1 Ratio: 1.6:1
28
Canny Edge Detector Range of values (in gray) of 𝜶 Two possible orientation of a horizontal edge The angle ranges of the edge normals for the four types of edge directions in a neighborhood.
29
10.2.6 Canny Edge Detector Original Image Thresholded Gradient
Marr-Hildreth Canny
30
10.2.6 Canny Edge Detector Original Image Thresholded Gradient
Marr-Hildreth Canny
31
10.2.7 Edge Linking and Boundary Detection
𝑴 𝒔,𝒕 −𝑴 𝒙,𝒚 ≤𝑬 𝜶 𝒔,𝒕 −𝜶 𝒙,𝒚 ≤𝑨 Original Image Gradient magnitude |𝑮 𝒙 | Morphological thinning |𝑮 𝒚 | 𝐋𝐨𝐠𝐢𝐜𝐚𝐥 𝐎𝐑
32
10.2.7 Edge Linking and Boundary Detection
Illustration of the iterative polygonal fit algorithm
33
10.2.7 Edge Linking and Boundary Detection
Edge linking using a polygonal approximation
34
Morphological Shrinking Morphological cleaning
Gradient Image Majority Filter Morphological Shrinking Morphological cleaning Spur Reduction Skeleton T = 3 T = 6 T = 12 Smoothed Smoothed
35
( 𝒙 𝒊 , 𝒚 𝒊 ) & 𝒚=𝒂𝒙+𝒃⇒ 𝒚 𝒊 =𝒂 𝒙 𝒊 +𝒃
Edge Linking and Boundary Detection Global processing using the Hough transform ( 𝒙 𝒊 , 𝒚 𝒊 ) & 𝒚=𝒂𝒙+𝒃⇒ 𝒚 𝒊 =𝒂 𝒙 𝒊 +𝒃 𝒃=− 𝒙 𝒊 𝒂+ 𝒚 𝒊 All ( 𝒙 𝒊 , 𝒚 𝒊 )’s on a line intersect each other at (𝒂,𝒃 )
36
10.2.7 Edge Linking and Boundary Detection
Subdivision of the parameter plane for use in the Hough transform
37
10.2.7 Edge Linking and Boundary Detection
Geometrical interpretation of the parameters 𝒙 𝒊 𝒄𝒐𝒔𝜽+ 𝒚 𝒊 𝒔𝒊𝒏𝜽=𝝆 xy-plane 𝝆𝜽-plane Accumulator cells
38
Image containing five points
Edge Linking and Boundary Detection Image containing five points Parameter space
39
10.2.7 Edge Linking and Boundary Detection
Canny Hough parameter space Lines superimposed
40
10.3 Thresholding Original H-T Thr-Grad Linked
41
𝑭 𝒙,𝒚 >𝑻 𝐭𝐡𝐞𝐧 𝒙,𝒚 𝐢𝐬 𝐛𝐞𝐥𝐨𝐧𝐠 𝐭𝐨 𝐨𝐛𝐣𝐞𝐜𝐭,
10.3 Thresholding 𝑭 𝒙,𝒚 >𝑻 𝐭𝐡𝐞𝐧 𝒙,𝒚 𝐢𝐬 𝐛𝐞𝐥𝐨𝐧𝐠 𝐭𝐨 𝐨𝐛𝐣𝐞𝐜𝐭, 𝐞𝐥𝐬𝐞 𝒙,𝒚 𝐢𝐬 𝐛𝐞𝐨𝐧𝐠 𝐭𝐨 𝐛𝐚𝐜𝐤𝐠𝐫𝐨𝐮𝐧𝐝 Bi-level (T) Multi-level ( 𝐓 𝟏 , 𝐓 𝟐 ,…, 𝐓 𝐧 ) Threshold image: 𝒈 𝒙,𝒚 = 𝟏 𝒇 𝒙,𝒚 >𝑻 𝟎 𝒇 𝒙,𝒚 ≤𝑻
42
10.3 Thresholding Thresholds
43
10.3 Thresholding Noiseless 𝝁=𝟎 𝝈=𝟏𝟎 𝝁=𝟎 𝝈=𝟓𝟎
44
10.3 Thresholding Noised Image Ramp in [0.2, 0.6] Product
45
10.3.2 Basic Global Thresholding
A Heuristic Approach Initial estimate for T Segment image to 𝑮 𝟏 (>𝑻) and 𝑮 𝟐 (≤𝑻) Compute average value 𝒎 𝟏 and 𝒎 𝟐 in 𝑮 𝟏 and 𝑮 𝟐 𝑻= 𝟏 𝟐 𝒎 𝟏 + 𝒎 𝟐 Repeat 2-4 until small changed
46
10.3.2 Basic Global Thresholding
An example of segmentation based on a threshold 𝑻 𝟎 =𝟎 𝑪𝒐𝒏𝒗𝒆𝒓𝒈𝒆𝒏𝒄𝒆 𝑻 𝒇 =𝟏𝟐𝟓.𝟒
47
10.3.2 Basic Global Thresholding
Local Thr. Mosaic
48
10.3.2 Basic Global Thresholding
Good Subimage Bad Subimage Further block-ing
49
10.3.3 Optimum Global Thresholding Using Otsu’s Method
𝑷 𝟏 𝒌 = 𝒊=𝟎 𝒌 𝒑 𝒊 , 𝑷 𝟐 𝒌 = 𝒊=𝒌−𝟏 𝑳−𝟏 𝒑 𝒊 =𝟏− 𝑷 𝟏 𝒌 𝒑 𝒊 = 𝒏 𝒊 𝑴𝑵 Mean intensity value: 𝒎 𝟏 𝒌 = 𝟏 𝑷 𝟏 𝒌 𝒊=𝟎 𝒌 𝒊 𝒑 𝒊 , 𝒎 𝟐 𝒌 = 𝟏 𝑷 𝟐 (𝒌) 𝒊=𝒌+𝟏 𝑳−𝟏 𝒊 𝒑 𝒊 𝒎 𝒌 = 𝒊=𝟎 𝒌 𝒊 𝒑 𝒊 , 𝒎 𝑮 = 𝒊=𝟎 𝑳−𝟏 𝒊 𝒑 𝒊 Separability measure: 𝜼 𝒌 = 𝝈 𝑩 𝟐 𝒌 𝝈 𝑮 𝟐 , 𝝈 𝑮 𝟐 = 𝒊=𝟎 𝑳−𝟏 𝟏− 𝒎 𝑮 𝟐 𝒑 𝒊 , 𝝈 𝑩 𝟐 𝒌 = 𝒎 𝑮 𝑷 𝟏 𝒌 −𝒎 𝒌 𝟐 𝑷 𝟏 𝒌 𝟏− 𝑷 𝟏 𝒌
50
Basic Global Algorithm
Optimum Global Thresholding Using Otsu’s Method Input Histogram Basic Global Algorithm Ostu’s Method
51
10.3.4 Using Image Smoothing to Improve Global Thresholding
Noised Image Ostu’s Method 55 Averaging Mask Ostu’s Method
52
10.3.4 Using Image Smoothing to Improve Global Thresholding
Noised Image Ostu’s Method 55 Averaging Mask Ostu’s Method Failed in both cases
53
10.3.5 Using Edges to Improve Global Thresholding
Noisy Image Gradient Magnitude Product Ostu’s Method
54
Threshold Absolute Laplacian
Using Edges to Improve Global Thresholding Ostu’s Method Threshold Absolute Laplacian Ostu’s Method
55
Lower Value to Threshold the Absolute Laplacian
Using Edges to Improve Global Thresholding Lower Value to Threshold the Absolute Laplacian
56
10.3.6 Multiple Thresholds Between-class variance:
𝝈 𝑩 𝟐 = 𝒌=𝟏 𝑲 𝑷 𝒌 𝒎 𝒌 − 𝒎 𝑮 𝟐 , 𝑷 𝒌 = 𝒊∈ 𝑪 𝒌 𝒑 𝒊 , 𝒎 𝒌 = 𝟏 𝑷 𝒌 𝒊∈ 𝑪 𝒌 𝒊 𝒑 𝒊 Separability measure: 𝜼 𝒌 𝟏 ∗ , 𝒌 𝟐 ∗ = 𝝈 𝑩 𝟐 𝒌 𝟏 ∗ , 𝒌 𝟐 ∗ 𝝈 𝑮 𝟐 , 𝝈 𝑮 𝟐 𝒌 𝟏 ∗ , 𝒌 𝟐 ∗ = max 𝟎< 𝒌 𝟏 < 𝒌 𝟐 <𝑳−𝟏 𝝈 𝑩 𝟐 ( 𝒌 𝟏 , 𝒌 𝟐 ) Threshold image: 𝒈(𝒙,𝒚)= 𝒂 𝐢𝐟 𝒇 𝒙,𝒚 ≤ 𝒌 𝟏 ∗ 𝒃 𝐢𝐟 𝒌 𝟏 ∗ <𝒇 𝒙,𝒚 ≤ 𝒌 𝟐 ∗ 𝒄 𝐢𝐟 𝒇 𝒙,𝒚 > 𝒌 𝟐 ∗
57
Multiple Thresholds Image Segmented into Three Regions Using Dual Ostu Thresholds
58
Iterative Global Algorithm
Variable Thresholds Noisy, Shaded Image Iterative Global Algorithm Ostu’s Method Subdivided Ostu’s Method
59
Variable Thresholds Histograms of the Six Subimages
60
Variable Thresholding Based on Local Image Properties
Variable Thresholds Variable Thresholding Based on Local Image Properties 𝑻 𝒙𝒚 =𝒂 𝝈 𝒙𝒚 +𝒃 𝒎 𝒙𝒚 𝑻 𝒙𝒚 =𝒂 𝝈 𝒙𝒚 +𝒃 𝒎 𝑮 Segmented image 𝒈 𝒙,𝒚 = 𝟏 𝐢𝐟 𝒇 𝒙,𝒚 > 𝑻 𝒙𝒚 𝟎 𝐢𝐟 𝒇 𝒙,𝒚 ≤ 𝑻 𝒙𝒚 Predicts based on the parameters: 𝒈 𝒙,𝒚 = 𝟏 𝐢𝐟 𝑸 𝐥𝐨𝐜𝐚𝐥 𝐩𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬 𝐢𝐬 𝐭𝐫𝐮𝐞 𝟎 𝐢𝐟 𝑸 𝐥𝐨𝐜𝐚𝐥 𝐩𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬 𝐢𝐬 𝐟𝐚𝐥𝐬𝐞 Q 𝝈 𝒙𝒚 , 𝒎 𝒙𝒚 = 𝐭𝐫𝐮𝐞 𝐢𝐟 𝒇 𝒙,𝒚 >𝒂 𝝈 𝒙𝒚 𝐀𝐍𝐃 𝒇 𝒙,𝒚 >𝒃 𝒎 𝒙𝒚 𝐟𝐚𝐥𝐬𝐞 𝐨𝐭𝐡𝐞𝐫𝐰𝐢𝐬𝐞
61
Dual Thresholding Approach Local Standard Deviations
Variable Thresholds Original Image Dual Thresholding Approach Local Standard Deviations Local Thresholding
62
Moving Average: 10.3.7 Variable Thresholds
𝒎 𝒌+𝟏 =𝒎 𝒌 + 𝟏 𝒏 ( 𝒛 𝒌+𝟏 − 𝒛 𝒌−𝒏 ) Ostu’s Method Moving Average
63
Variable Thresholds Original Image Ostu’s Method Moving Average
64
10.4 Region-Based Segmentation
𝒊=𝟏 𝒏 𝑹 𝒊 𝑹 𝒊 𝐚𝐫𝐞 𝐜𝐨𝐧𝐧𝐞𝐜𝐭𝐞𝐝 𝐫𝐞𝐠𝐢𝐨𝐧𝐬 𝐑 𝐢 𝑹 𝒋 =∅ , 𝒊≠𝒋 𝑷 𝑹 𝒊 =𝐓𝐑𝐔𝐄 𝑷 𝑹 𝒊 𝑹 𝒋 =𝐅𝐀𝐋𝐒𝐄
65
Smallest Dual Thresholds
Initial Seed Image Final Seed Image Difference Smallest Dual Thresholds Dual Thresholds Region Growing
66
10.4 Region-Based Segmentation
Split and Merging
67
Limit the Smallest Allowed Quadregion
10.4 Region-Based Segmentation Limit the Smallest Allowed Quadregion 3232 1616 88
68
10.5 Segmentation Using Morphological Watersheds
Flooding
69
10.5 Segmentation Using Morphological Watersheds
Further Flooding Merging Water Longer Dams Final Watershed
70
Dam Construction Stage n-1 Stage n Structuring Element Result
71
10.5.3 Water Segmentation Algorithm
Image Gradient Watershed Lines Superimposed on Input
72
The Use of Markers Apply the Watershed Segmentation to the Gradient Image
73
The Use of Markers Internal Markers and External Markers
74
10.6 The Use of Motion in Segmentation
Absolute ADIs Positive ADIs Negative ADIs
75
10.6 The Use of Motion in Segmentation
Two Frames in a Sequence Result
76
10.6 The Use of Motion in Segmentation
LANDSAT frame
77
10.6 The Use of Motion in Segmentation
Intensity plot of the image LANDSAT, with the target circle
78
10.6 The Use of Motion in Segmentation
Spectrum of Eq. (10.6-8) showing a peak at 𝑢 1 =3
79
10.6 The Use of Motion in Segmentation
Spectrum of Eq. (10.6-9) showing a peak at 𝑢 2 =4
80
智能视觉理解 实验室
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.