edge detection summary - icarus.csd.auth.gr
TRANSCRIPT
Edge Detection
summaryS. Vartalami, Prof. Ioannis Pitas
Aristotle University of Thessaloniki
www.aiia.csd.auth.gr
Version 3.8.1
Edge Detection Overview
β’ Introduction
β’ Edge detection
β’ Edge thresholding
β’ Hough transform
β’ Edge following algorithms
β’ Contour detection
β’ Active Contours
β’ Neural Edge detection
β’ Neural Contour detection.
2
An image edge can be considered as the border between two
homogeneous image regions having different illumination
intensities.
Edges are useful for:
β’ image analysis, object recognition and
β’ image filtering, image compression.
Introduction
3
Edge types
Horizontal image edges
4
Edge types
Vertical image edges
5
Image intensity gradient:
βπ(π₯, π¦) =Ξ[ππ
ππ₯
ππ
ππ¦]π =
Ξ[ππ₯ ππ¦]
π .
Gradient magnitude can be used as edge detector:
π π₯, π¦ = ππ₯2 π₯, π¦ + ππ¦
2 π₯, π¦ .
Edge detection
6
Gradient masks examples:
1 1 10 0 0β1 β1 β1
β1 0 1β1 0 1β1 0 1
1 2 10 0 0β1 β2 β1
β1 0 1β2 0 2β1 0 1
Prewitt edge detector masks. Sobel edge detector masks.
β’ They can be used for horizontal (left) or vertical (right) edge
detection.
β’ No or trivial (by 2) multiplications are involved.
Edge detection
7
Edge detection
a) Lenna image; b) Sobel edge detector output ; c) horizontal edges; d) vertical edges.
8
Edge detection
First and second order differentiation. Zero crossing.
9
Zero crossing
π¦ = π(π₯)
y
y
y
y
y y
x
x
x
x
x
x
[DECETI]
Edge detection
Negative LoG function [LOG].
10
Edge detection
β’ Local image range:
π€ π, π = maxπ΄
π π, π β minπ΄
π π, π
β’ π΄: Local π Γπ image window.
11
Canny edge detector
β’ This is probably the most widely used edge detector in
computer vision.
β’ Canny has shown that the first derivative of a Gaussian filter
kernel closely approximates the operator that optimizes the
product of signal-to-noise ratio and localization.
β’ This analysis is based on step edges corrupted by additive
Gaussian noise.
12
When the edge detector output is large, a local edge is
present. This can be found by thresholding:
πΈ π, π = α1, if π π, π β₯ π,0, otherwise.
β’ Threshold π can be chosen using edge detector output
histogram, so that it exceeds only a small percentage of
edge pixels.
β’ Thresholding is global.
β’ Edge detector output thresholding produces a binary image.
13
Edge thresholding
Hough Transform uses a parametric description of simple
geometrical shapes (curves), in order to reduce the
computational complexity of the search space.
β’ The parametric description a straight line is a linear equation:
π¦ = ππ₯ + π.
14
Hough transform
a) Image plane; b) parameter space.
15
Hough transform
Upper row: a) Original image; b) Hough polar parameter space;
Lower row: c) detected straight lines; d) lines overlaid on original image.
Hough Transform in Byzantine iconography analysis.
16
Hough transform
Boundary-following algorithms follow the local edge elements,
ensuring local edge continuity.
Edge continuity features:
β’ π(π±) = π(π₯, π¦): edge magnitude at location π± = π₯, π¦ π΅.
β’ π(π±) = π(π₯, π¦): edge direction.
β’ |π(π±π) β π(π±π)|: similarity measure for neighboring edge
magnitude.
β’ |π(π±π) β π(π±π)|: direction difference similarity measure.
Edge-following algorithms
17
Heuristic contour following in subtractive angiography [Wikipedia].
18
Edge-following algorithms
Edge following can be based on graph search:
β’ Edge elements at position π±π can be considered as graph
nodes.
β’ The nodes are connected to each other, if local edge linking
rules are satisfied.
19
Edge-following algorithms
I.Pitas Digital Image Processing FundamentalsEdge Detection Algorithms
20
Edge-following algorithms
Edge following based on dynamic programming: a) original
image; b) edge followed.
Contour detection
β’ Contour detection is more difficult than edge detection.
β’ It is useful for shape analysis and object recognition.
β’ Simplest contour description: ordered list of contour pixels
π₯π , π¦ππ , π = 1, β¦π.
21
Contour following
22
a) Tooth cross-section mosaic; b) tooth and oral cavity contour following.
Square Tracing Algorithm
β’ Start at start pixel π© at the bottom left corner of
image π³.
β’ Scan each pixel column from bottom to top and left
to right until encounter a black pixel π± belonging to
π« and insert π± in β¬. Now the start pixel π© is π±. Then:
β’ If you find black pixel π±, turn right, until you
encounter the start pixel again. The black pixels
you walked over will be the contour of the pattern.
23
On a black pixel,
turn left, on a white
pixel, turn right..
Contour following algorithms
[GHU2000]
Active Contoursβ’ Active contours or snakes are deformable models of an
image contour.
β’ They describe object boundaries/contours by a parametric
curve.
β’ An energy functional is always associated with an active
contour.
β’ The desired contour is obtained by defining energy
functional minimization.
24
Active Contours
25
Active contour on a brain CT image.
[HEM2018]
NN Edge detection
β’ A Neural Network (NN) edge detector can be considered
as a nonlinear filter: it can have a built-in thresholding
capability.
β’ Thus, the filtering, thresholding operation of edge detection
is a natural application for neural network processing.
Convolutional Neural networks (CNN) have convolutional
layers and nonlinear activation functions interspersed with
pooling (subsampling) layers.
β’ Typical CNN convolution kernels perform edge detection
(learned only by training).
26
ZFNet convolution kernels that have been produced by training to perform
edge/line detection.
orientation selectivity
found in V1 simple cells
green/red color opponency
observed in retinal neurons
and human visual perception
blue/yellow color opponency
observed in retinal neurons
and human visual perception
NN Edge detection
NN Edge detection
28
SVM Edge Detection
β’ SVM classification
β’ βthe pixel is part of an edge β or β the pixel is not part of an edgeβ
βBinary classification.
29
a) Edge image with SVM method; b) Edge image by using the Sobel operator.
[GOH2000]
NN Contour detection
30
Contour detection results comparison in Cassini ISS images by using different methods
a) Original Image; b) CNN.
[LI2019]