Edge Detection
Edge Detection
Edge Detection
(ME-4201)
Edge detection
Phung Thanh Huy
Department of Mechatronics
Ho Chi Minh City University of Technology
Vietnam National University Ho Chi Minh City
Ver2024.1
Edge Detection|2
Edge and edge detection
Edges
• Sudden changes in an image’s intensity
• Edges usually appear at objects’ boundaries.
• From edges, we can take information about the objects.
• Edges could be used for segmentation, object detection…
Edge Detection|3
Edge and edge detection
Edges
• Results of different reasons Color,
Differences in Depth Illumination,
and Orientation Reflectance
Edge Detection|4
Edge and edge detection
Edges
• Results of different reasons
Edge Detection|5
Edge and edge detection
Edges
• Change of intensity
Edge Detection|6
Basic edge detectors
Derivatives – Gradient and Edges
Images and Edges
Edge Detection|8
Basic edge detectors
Laplacian +45 deg -45 deg
Edge Detection|9
Basic edge detectors
Derivatives – Gradient and Edges
1-D Function Derivative
Descrete: Δ𝑥 = 1 𝑓𝑛′ = Δ × 𝑓𝑛
Δ
Forward
Backward
Central
Edge Detection|10
Basic edge detectors
Derivatives – Gradient and Edges
2-D function
Edge Detection|11
Basic edge detectors
Derivatives – Gradient and Edges
Extract Edges from derivatives
- Gradient x and y
Gradient kernels by 𝑥 and 𝑦
−1 1 −1 0 1
−1
−1 0
1 1
- Robert kernel (Robert cross): Gradient based on diag.
Edge Detection|12
Basic edge detectors
Derivatives – Gradient and Edges
Extract Edges from derivatives
- Prewitt Operator Sum of a row/ column.
Edge Detection|13
Basic edge detectors
Noise and edges
Due to noise, the edges could be eliminated
Edge Detection|14
Basic edge detectors
Noise and edges
Filtering and detecting edges
Edge Detection|15
Basic edge detectors
Noise and edges
Filtering and detecting edges
Edge Detection|16
Basic edge detectors
Noise and edges
Filtering and detecting edges
Sobel Operator
Prewitt Operator
Edge Detection|17
Basic edge detectors
Noise and edges Sobel 𝑔𝑥 , 𝑔𝑦 , 𝑔𝑥 + 𝑔𝑦
Edge Detection|18
Basic edge detectors
Sobel’s problems Sobel 𝑔𝑥 , 𝑔𝑦 , 𝑔𝑥 + 𝑔𝑦
Edge Detection|19
Basic edge detectors
Noise and edges
Edge Detection|20
Basic edge detectors
Direction
Edge Detection|21
Advanced edge detectors
Marr-Hildreth Edge Detector – LoG (Laplacian of Gaussian)
Basics
- Intensity changes are not independent of image scale. Determination of
edges needs operators of different sizes
- Changes of intensity causes peaks (1st deviation) or zero-crossing (2nd
deviation)
Space constant
Edge Detection|22
Advanced edge detectors
Marr-Hildreth Edge Detector – LoG (Laplacian of Gaussian)
Edge Detection|23
Advanced edge detectors
Marr-Hildreth Edge Detector – LoG (Laplacian of Gaussian)
Gaussian 1 - Gaussian 2
Edge Detection|24
Advanced edge detectors
Marr-Hildreth Edge Detector – LoG (Laplacian of Gaussian)
Zero crossing
Edge Detection|25
Advanced edge detectors
Canny Edge Detector
• The Canny operator maps a scalar image into a binary edge map of “thin”
(i.e. having the width of one pixel only) edge segments.
• The output is not uniquely defined; it depends on two thresholds Tlow and
Thigh with 0 < Tlow < Thigh < Gmax, not counting a fixed scale used for
Gaussian smoothing.
• Criteria for an “optimal” edge detector [Canny 1986]:
• Good detection: the optimal detector must minimize the probability
of false positives (detecting spurious edges caused by noise), as well
as that of false negatives (missing real edges).
• Good localization: the edges detected must be as close as possible
to the true edges.
• Single response: the detector must return one point only for each
true edge point; that is, minimize the number of local maxima around
the true edge.
Edge Detection|26
Advanced edge detectors
Canny Edge Detector
Edge Detection|27
Advanced edge detectors
Canny Edge Detector
Direction of each pixel
Edge Detection|28
Advanced edge detectors
Canny Edge Detector
Magintude
Edge Detection|29
Advanced edge detectors
Canny Edge Detector
1. Smooth the image with Gaussian Filter
Edge Detection|31
Advanced edge detectors
Canny Edge Detector
Non-maximum suppression
At q, we have a
maximum if the
value is larger
than those at
both p and at r.
Interpolate to get
these values.
Source: D. Forsyth
Edge Detection|32
Advanced edge detectors
Canny Edge Detector
4. Use double thresholding and connectivity analysis to detect and link edges.
Source: S. Seitz
Edge Detection|33