0% found this document useful (0 votes)
7 views

7 Edge Detection

The document discusses edge detection in image processing, focusing on features such as isolated points, lines, and edges. It explains the use of first and second order derivatives for detecting edges, highlighting the sensitivity of these methods to noise and the importance of image smoothing. Various gradient operators and masks, including Roberts and Sobel, are introduced for effective edge detection.

Uploaded by

taif afridi
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)
7 views

7 Edge Detection

The document discusses edge detection in image processing, focusing on features such as isolated points, lines, and edges. It explains the use of first and second order derivatives for detecting edges, highlighting the sensitivity of these methods to noise and the importance of image smoothing. Various gradient operators and masks, including Roberts and Sobel, are introduced for effective edge detection.

Uploaded by

taif afridi
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/ 31

Edge Detection

Edge Detection
• Interested in three types of image features
• Isolated points
• Lines
• Edges
Some Common Terms
• Edge Pixels: Pixels at which the intensity of an image function
changes abruptly.
• Edges: Set of connected edge pixels.
• Edge Detectors: local image processing methods designed to detect
edge pixels.
• Line: an edge segment in which the intensity of the background on
either side of line is much higher or much lower than the intensity of
line pixels.
• Isolated points: a line whose length and width is equal to one pixel.
Background
• Averaging (smoothing) is analogous to integration.
• Sharpening could be accomplished by differentiation
• Derivatives of a digital function are defined in terms of differences.
• First Order Derivative:
• Must be zero in the areas of constant intensity
• Must be nonzero at the onset of a gray-level step or ramp; and
• Must be nonzero along ramps.
• A basic definition of the first-order derivative of a one-dimensional function
f(x) is
𝜕𝑓
= 𝑓 𝑥 + 1 − 𝑓(𝑥)
𝜕𝑥
• Second Order Derivative:
• Must be zero in the areas of constant intensity
• Must be nonzero at the onset and end of a gray-level step or ramp;
• Must be zero along ramps of constant slope
• We define a second-order derivative as the difference
𝜕2𝑓
2
= 𝑓 𝑥 + 1 + 𝑓 𝑥 − 1 − 2𝑓(𝑥)
𝜕𝑥
Edge Detection
• First order derivatives produce thick edges while second order derivatives
produce finer ones. (See ramp edge on previous slide)
• Second order derivatives enhance sharp changes and fine details more
aggressively than first order derivatives (see the isolated point and the line
in the same figure). This can be a problem if the noise is present in the
image
• Second derivative changes its sign as it transitions into and out of a ramp or
step edge. See the step edge. This “double edge” effect can be used to
locate edges.
• The sign of the second derivative is also used to determine whether an
edge is a transition from light to dark (-ve value) or from dark to light (+ve
value). See step edge
Edge Detection
• Spatial filters are used to compute first and second order derivatives
at each pixel location.
• Compute the sum of products of mask coefficients with intensity
values encompassed by the mask.
A general 3x3 spatial filter mask
• The response of mask at center point is
𝑅 = 𝑤1𝑧1 + 𝑤2𝑧2 + ⋯ + 𝑤9𝑧9 w1 w2 w3

9
w4 w5 w6

𝑅 = ෍ 𝑤𝑘 𝑧𝑘
𝑘=1 w7 w8 w9
Detection of Isolated Points
Detection of Isolated Points
• Point detection should be based on second derivative.
𝛻2𝑓
= 𝑓 𝑥 + 1, 𝑦 + 𝑓 𝑥 − 1, 𝑦 + 𝑓 𝑥, 𝑦 + 1 + 𝑓 𝑥, 𝑦 − 1 − 4𝑓 𝑥, 𝑦

1 1 1

1 -8 1

1 1 1
Detection of Isolated Points
• A point has been detected at location (x, y) on which the mask is
centered if the absolute value of response of the mask at that point
exceeds a specified threshold.
• Such points are labelled 1 in the output image and all others are
labelled 0.
1 𝑖𝑓 𝑅(𝑥, 𝑦) ≥ 𝑇
𝑔 𝑥, 𝑦 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Line Detection
Line Detection
• For line detection we can expect second order derivatives to result in
a stronger response and to produce thinner lines than first order
derivatives.
Original Image Laplacian Image

Positive values of
Absolute value of Laplacian
Laplacian

Lines separated by Lines separated by


zero “valley” zero “valley”
Line Detection
• The Laplacian mask is isotropic (response independent of direction)
• When interest lies in detecting lines at particular direction
Edge Models

1. Step Edge: transition between two intensity levels


occurring ideally over the distance of 1 pixel.
2. Ramp Edge: blurred and noisy edges, slope of ramp is
inversely proportional to the degree of edge blurring
3. Roof Edge: model of lines through regions, width
determined by thickness and sharpness of lines
Results of first and second order
derivatives for edges with
Gaussian noise of 0 mean and
standard deviations of 0.0, 0.1,
1.0 and 10.0
Sensitivity of Derivatives to Noise
• Noise has significant impact on edge detection
• Image smoothing should be considered prior to use of derivatives in
presence of noise.
• Second order derivative is more sensitive to noise.
Fundamental Steps for Edge Detection
1. Image smoothing for noise reduction
2. Detection of edge points
3. Edge localization
Gradient Operators
• First Derivatives in image processing are implemented using the magnitude of the
gradient.
• The gradient of function f(x,y) is
𝜕𝑓
𝐺𝑥 𝜕𝑥
𝛻𝑓 = 𝐺 = 𝜕𝑓
𝑦
𝜕𝑦
• The magnitude of this vector is given by
𝑚𝑎𝑔 𝛻𝑓 = 𝐺𝑥2 + 𝐺𝑦2 ≈ 𝐺𝑥 + 𝐺𝑦
• This mask is simple, and non isotropic. It results in only horizontal and vertical.
1
Gx -1 1 Gy
-1
Gradient Operators
• 2D mask, when diagonal edge direction is of interest.
• Roberts-cross gradient operators
Gx = (z9-z5) , Gy=(z8-z6)
-1 0 0 -1

0 1 1 0
Gradient Operators
• Use of masks/filters that are symmetric about the center point
• The smallest filter mask should be 3x3.
• The difference between the third and first rows of the 3x3 mage
region approximate derivative in x-direction, and the difference
between the third and first column approximate derivative in y-
direction.
gx= 𝑧7 + 𝑧8 + 𝑧9 − 𝑧1 + 𝑧2 + 𝑧3
gy= 𝑧3 + 𝑧6 + 𝑧9 − (𝑧1 + 𝑧4 + 𝑧7)
Some common gradient operators

• Roberts and Prewitt masks are the simplest but


not robust against noise

• Sobel edge detection masks are the most


common and give satisfactory results in
presence of noise

2 in the center
location provides the
image smoothing

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