DETECTION TECHNIQUES
The Canny and the Shen - Castan
Methods
Edge Detection
• An edge is a boundary between an object
and the background, and indicates the
boundary between overlapping objects.
• Edges form the outline of an object, so if
the edges are identified in an image
accurately, then all the objects can be
located and basic properties such as area,
perimeter can be measured.
• Edge detection is based on the
relationship a pixel has with its neighbors.
Edge Detection
• Edges, in an image are defined as
locations where there is a significant
variation in the gray level or color of pixel
in some direction.
• Edge detection extracts and localizes
points (pixels) around which a large
change in image brightness has occurred.
• This can help in the process of
segmentation
Traditional Approaches
Ideal Step Edge :-
(The most common definition of an edge)
• In 1-d the edge is simply a change in
gray level occurring at one specific
location (fig.1a).
• The greater the change in the level, the
easier the edge is to detect.
Step Edge Detection
Problems in Edge Detection
• Problems:-
1)Because of digitization:-The image may be
sampled in such a way so that change in
gray level may extend across some
number of pixels. Fig 1b-d.
2)Because of noise:-Due to factors such as
light intensity, type of camera and lens,
motion, temperature, dust and others.
Noise
Problem with this operator:- It does not compute the gradient at the
point (x, y), but at (x-1/2, y-1/2)
Assumption:- the grey levels vary linearly between the pixels.
Gradient operators
A better choice for an approximation is
Δx2 A(x, y) = A(x+1, y) – A(x-1 ,y)
E1 =∑(1/(1+αd(i)2)) / max(IA,II)
IA = the number of edge pixels found by the edge detector
II= the number of edge pixels in the test image
d(i)=the distance between the actual ith pixel and the one
found by the edge detector
α is used for scaling
Measures of Performance
• Evaluation scheme based on local edge coherence (Kitchen
and Rosenfeld)
(a) It measures how well an edge pixel is continued on the left;
this function is
L(k) =a(d,dk) a(kπ/4,d+π/2) if neighbor k is an edge pixel
0 otherwise
where d is the edge direction at the pixel being tested
d0 is the edge direction at its neighbor to the right
d1 is the direction of the upper-right neighbor, and so on
Counterclockwise about the pixel involved
a= the measure of the angular difference between any two angles
Measures…
a(α,β) = π -|α-β| ⁄ π
(b) A similar function measures directional continuity on the
right of the pixel being evaluated:
R(k) = a(d,dk) a(kπ/4,d+π/2) if neighbor k is an edge
pixel
0 otherwise
(c) C= Overall continuity measure
= average(L(k), R(k))
(d) Then measure of thinness (T) is applied.
(e) The overall evaluation of the edge detector is:
(f) E2 = γC + (1-γ) T
Template-Based Edge Detection
-1 -2 -1 -1 0 1
0 0 0 = SY -2 0 2 = Sx
1 2 1 -1 0 1
SY = I[i+1][j+1]+2I[i+1][j]+I[i+1][j-1]-(I[i-1][j+1]+
2I[i-1][j]+I[i-1][j-1])
• After SX Sy are computed for each pixel, resulting
magnitude must be thresholded
Figure
Kirsch Edge Detector
• These templates has different motivation than
Sobel’s.
• For the 3X3 case the templates are:
-3 -3 5 -3 5 5 5 5 5 5 5 -3
K0= -3 0 5 K1=-3 0 5 K2= -3 0 -3 K3= 5 0 -3
-3 -3 5 -3 -3 -3 -3 -3 -3 -3 -3 -3
5 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
K4=5 0 -3 K5= 5 0 -3 K6= -3 0 -3 K7= -3 0 5
5 -3 -3 5 5 -3 5 5 5 -3 5 5
Kirsch Edge Detector
•These masks are to observe the grey level change near an edge
having various orientations, rather than approximation to the
gradient.
•There are one mask for each of eight compass directions.
•For example, a large response to mask K0 implies a vertical edge
(horizontal gradient) at the pixel corresponding to the center of the
mask.
Method:-
•To find the edges, an image I is convolved with all of the masks at
each pixel position. The response of the operator at a pixel is the
maximum of the responses of any of the eight masks. The direction
of the edge pixel is quantized into eight possibilities and is π /4 *I
where I is the number of the mask having the largest response.
EDGE MODELS : Marr- Hildreth
Edge Detection
Marr studied the literature on mammalian
visual systems and summarized these in five
major points:-
1. In natural images, features of interest occur at
a variety of scales. No single operator can
function at all of these scales, so the result of
operations at each of scales should be
combined.
2. Diffraction patterns does not occur in a natural
scene, so some local averaging (smoothing)
must take place.
Marr-Hildreth Edge Detection
3.The optimal smoothing filter that matches the
observed requirements of biological vision is the
Gaussian.
4. When a change in intensity (edge) occurs, there
is an extreme value in the first derivative or
intensity. This corresponds to a zero crossing in
the second derivative.
5. The orientation-independent differential operator
of lowest order is the Laplacian.
Marr-Hildreth Edge Detection
Algorithm
1. Convolve the image I with a two-
dimensional Gaussian function.
2. Complete the Laplacian of the convolved
image; call this L
3. Edge pixels are those for which there is a
zero crossing in L.
Marr…
• A convolution in two dimensions is given by:
H = ∫ G(-x)f(x)dx
W
Canny…
•The filter is assumed to be zero outside of the region
[-W, W].
•Mathematically the three criteria are expressed as:
0 W
∞ ∞