0% found this document useful (0 votes)
25 views6 pages

EDGE DETECTION

The document discusses edge detection in images, defining edges as boundaries where pixel brightness changes abruptly. It explains various edge detection algorithms, including Roberts, Prewitt, Sobel, and Canny, highlighting their principles, advantages, and disadvantages. The Canny edge detector is emphasized for its multi-stage algorithm that effectively detects edges while minimizing errors and noise.

Uploaded by

adrijazen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views6 pages

EDGE DETECTION

The document discusses edge detection in images, defining edges as boundaries where pixel brightness changes abruptly. It explains various edge detection algorithms, including Roberts, Prewitt, Sobel, and Canny, highlighting their principles, advantages, and disadvantages. The Canny edge detector is emphasized for its multi-stage algorithm that effectively detects edges while minimizing errors and noise.

Uploaded by

adrijazen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

EDGE DETECTION

What are edges in an image?

Edges are those places in an image that correspond to object boundaries.


Edges are pixels where image brightness changes abruptly.
An edge is a property attached to an individual pixel and is calculated from the image
function behavior in a neighborhood of the pixel.
It is a vector variable (magnitude of the gradient, direction of an edge) .

Brightness vs. Spatial Coordinates

Edge is a set of connected pixels that lie on the boundary between two regions.

When pixel intensity is plotted along a particular spatial dimension, the existence of edge
should mean sudden jump or step.

Fig 1 is the signal f(x) with edge.


Fig 2 is the first derivative of f(x). This magnitude is maximum.
+ve at leading edge -ve at trailing edge
Fig 3 is the second derivative of f(x). This crosses the zero at the edge point.

+ve on dark side -ve on bright side


Zero crossing at mid point of transition

All edge detection algorithms are based on the above two principles. The 1st derivative is
used to find the edge pixel and the sign of the second derivative can be used to determine
whether the edge pixel lies on the dark side or the light side.

The gradient of an image f(x,y) at location (x,y) is defined as

𝜕𝑓/𝜕𝑥
∆𝑓(𝑥, 𝑦) = ) ,
𝜕𝑓/𝜕𝑦

The gradient magnitude gives the edge location

|∆𝑓(𝑥, 𝑦)| = .(𝜕𝑓/𝜕𝑥)/ + (𝜕𝑓/𝜕𝑦)/

For simplicity of implementation the gradient magnitude is taken as


|∆𝑓(𝑥, 𝑦)| = |𝜕𝑓/𝜕𝑥| + |𝜕𝑓/𝜕𝑦|

The direction of the normal to the edge is obtained by

𝜕𝑓/𝜕𝑦
tan45 ) ,
𝜕𝑓/𝜕𝑥

Differentiation is implemented as finite difference operation.


Three types of differences are

Forward Difference = 𝑓(𝑥 + 1) − 𝑓(𝑥)

Backward difference= 𝑓(𝑥) − 𝑓(𝑥 − 1)

Centre difference = [𝑓(𝑥 = 1) − 𝑓(𝑥 − 1)]/2

Most common kernels used for the gradient edge detector are th Roberts, Prewitt and Sobel
edge operators.

Robert Edge Operator:

1 0 0 1
𝑓; = < > 𝑓? = < >
0 −1 −1 0

|∆𝑓| = |𝑓(𝑥, 𝑦) − 𝑓(𝑥 + 1, 𝑦)| + |𝑓(𝑥 + 1, 𝑦) − 𝑓(𝑥, 𝑦 + 1)|

Mark edge point only.


No information about edge orientation
Work best with binary images
Primary disadvantage: High sensitivity to noise, few pixels are used to approximate the
gradient

Prewitt Edge Operator

−1 −1 −1 −1 0 1
𝑓; = @ 0 0 0A 𝑓? = @−1 0 1A
1 1 1 −1 0 1

Sobel Edge Operator

Relies on central differences. It is an approximation of the first gaussian derivative.

−1 −2 −1 −1 0 1
𝑓; = @ 0 0 0A 𝑓? = @−2 0 2A
1 2 1 −1 0 1

3X3 approximation of Sobel Edge operator is given is fiven by

|∆𝑓| = |(𝑧C + 2𝑧D + 𝑧E ) − (𝑧5 + 2𝑧/ + 𝑧F )| + |(𝑧F + 2𝑧G + 𝑧E ) − (𝑧5 + 2𝑧H + 𝑧C )|

Steps:

Find 𝑓; and 𝑓? using suitable operator.


Compute gradient:
|∆𝑓(𝑥, 𝑦)| = |𝜕𝑓/𝜕𝑥| + |𝜕𝑓/𝜕𝑦|

Edge pixels are those for which |∆𝑓| > 𝑇 where 𝑇 is a suitable threshold.

Second Derivative Based Edge Detectors:

Consider the orientation free Laplacian Operator as the second derivative.

The Laplacian of an image f is given by

𝜕/𝑓 𝜕/𝑓
∇/ 𝑓 = +
𝜕𝑥 / 𝜕𝑦 /

MN
Now, M;
= 𝑓 [𝑥 + 1, 𝑦] − 𝑓[𝑥, 𝑦]

MO N M MN M
And M; O = M; M; = M; (𝑓 [𝑥 + 1, 𝑦] − 𝑓[𝑥, 𝑦])
𝜕/𝑓
= (𝑓[𝑥 + 1, 𝑦] − 𝑓[𝑥, 𝑦]) − (𝑓 [𝑥, 𝑦] − 𝑓(𝑥 − 1, 𝑦])
𝜕𝑥 /

𝜕/𝑓
= 𝑓[𝑥 + 1, 𝑦] − 2𝑓[𝑥, 𝑦] + 𝑓(𝑥 − 1, 𝑦]
𝜕𝑥 /

Similarly,
𝜕/𝑓
= 𝑓[𝑥, 𝑦 + 1] − 2𝑓[𝑥, 𝑦] + 𝑓(𝑥, 𝑦 − 1]
𝜕𝑦 /

Thus,

∇/ 𝑓 = 𝑓 [𝑥 + 1, 𝑦] − 2𝑓 [𝑥, 𝑦] + 𝑓(𝑥 − 1, 𝑦] + 𝑓 [𝑥, 𝑦 + 1] − 2𝑓 [𝑥, 𝑦] + 𝑓(𝑥, 𝑦 − 1]

∇/ 𝑓 = 𝑓[𝑥 + 1, 𝑦] + 𝑓(𝑥 − 1, 𝑦] + 𝑓 [𝑥, 𝑦 + 1] + 𝑓(𝑥, 𝑦 − 1] − 4𝑓(𝑥, 𝑦)

Thus Laplacian Operator is

0 1 0
@1 −4 1A
0 1 0

Laplacian mask including diagonal pixels:

1 1 1
@1 −8 1A
1 1 1

Advantage: No thresholding, symmetric operation

Disadvantage: Noise is more amplified


Gives no information about edge orientation

Model Based Edge Detection:

Five major points of Human Visual Systems:

1) In natural images , features of interest occurs at variety of scales. No single operator can
function at all these scales. So the results of the operators at each of the many scales should
be combined.

2) A natural scene does not consist of diffraction pattern or other wavelike effects, so some
sort of local averaging must take place

3) The optimal smoothing filter that matches the observed requirements is Gaussain

4) when a change in intensity (edge) occurs, there is an extreme value in the first derivative
for intensity. This corresponds to a zero crossing in the second derivative
5) the orientation independent differential operator of lowest order is Laplacian

Based on the above, edge detection algorithm is proposed as:

• Convolve the image with a two dimensional Gaussian Function


• Compute the Laplacian of the convolved image
• Edge pixels are those for which there is a zero crossing in the second derivative

1 𝑥 / + 𝑦 / 4; O Z?O O
𝐿𝑂𝐺(𝑥, 𝑦) = − / W1 − X 𝑒 /[
𝜋𝜎 2𝜎 /
Canny Edge Detector:

The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to
detect a wide range of edges in images. Canny edge detection is a technique to extract useful
structural information from different vision objects and dramatically reduce the amount of
data to be processed. It has been widely applied in various computer vision systems. The
general criteria for edge detection include:

1. Detection of edge with low error rate, which means that the detection should
accurately catch as many edges shown in the image as possible
2. The edge point detected from the operator should accurately localize on the
centre of the edge.
3. A given edge in the image should only be marked once, and where possible,
image noise should not create false edges.

Algorithm:

• Smooth the image with Gaussain filter : If more detail of image is required then the
variance of the filter is made large. For less details, variance is made small.
• Gradient Operation: Find the intensity gradients of the image
• Non-Maximal Suppression: Consider the pixel in the neighbourhood of the current
pixel. If the gradient magnitude of either pixel is greater than the current pixel, mark
current pixel as non edge.
• Thresholding with hysteresis:

Mark all pixels with ∇𝑓 > 𝑇\ as edge

Mark all pixels with ∇𝑓 < 𝑇^ as non edge

A pixel with 𝑇^ < ∇𝑓 < 𝑇\ is marked as edge only if it is connected to a strong edge

• Edge linking: After labelling the edges, we have to link the similar edges to get the
object boundary. Two neighbouring points (𝑥5 , 𝑦5 ) and (𝑥/ , 𝑦/ ) are linked if the two
conditions are satisfied
∇𝑓(𝑥5 , 𝑦5 ) − ∇𝑓(𝑥/ , 𝑦/ ) < 𝑇/
|∇𝑓(𝑥5 , 𝑦5 ) − ∇𝑓(𝑥/ , 𝑦/ )| < 𝑇5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy