0% found this document useful (0 votes)
14 views33 pages

CE632 EdgeDetection

Uploaded by

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

CE632 EdgeDetection

Uploaded by

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

Defence Institute of Advanced Technology, Pune

CE-632 : Computer Vision


Edge-Detection Techniques
Presented by: Nilesh Nayak Guide by: Dr. Sunita V Dhavale
Mayur K Shende Assistant Professor
M-Tech 2nd Year School of Computer Engineering and
CSE(AI) Mathematical Sciences
DIAT Pune DIAT Pune

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 1


Content
Understanding Edges, Edge Generation, Edge Types, Image Function
Understanding and Characterizing Edges, Edge detection
Image Gradient
Differentiation to convolution Mapping
3-Filters
Laplacian Derivative
Effect of Noise
Laplacian of Gaussian and 2D LoG filter
Difference of Gaussian (DoG)
Canny Edge Detection

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 2


Scene
Computer Vision Enthusiast?
Objects
How to visualize digital
images? Lines

Edges

Pixels

Images
19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 3
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

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 4


Edge Generation
Edges are caused by a variety of factors

Surface normal discontinuity

Depth discontinuity

Surface color discontinuity

illumination discontinuity

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 5


Types of Edges

Step Edge Ridge Edge

Roof Edge Ramp Edge

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 6


Images as function

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 7


Edge Detection
Edge information in an image is found by looking at the relationship a pixel has with its
neighborhoods.
If a pixel’s gray-level value is similar to those around it, there is probably not an edge at that point.
If a pixel’s has neighbors with widely varying gray levels, it may present an edge point.

Methods
Many are implemented with convolution mask and based on discrete approximations to
differential operators.
Differential operations measure the rate of change in the image brightness function.
Some operators return orientation information. Other only return information about the existence
of an edge at each point.

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 8


Edge Detection (cont.)

An edge is typically extracted by computing the derivative of the image intensity function.
This consists of two parts: Magnitude of the derivative: measure of the strength/contrast of the edge
and Direction of the derivative vector: edge orientation.

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 9


Understanding and Characterizing
Edges

Edge detection: To Identify sudden changes (discontinuities) in an image


(1)Detecting the local maxima or minima of the first derivative.
(2)Detecting the zero-crossings of the second derivative.

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 10


Image Gradient
The gradient of an image : :

The gradient points in the direction of most rapid increase in intensity


The gradient direction is given by
• how does this relate to the direction of the edge?
The edge strength is given by the gradient magnitude

Source: Steve Seitz

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 11


Differentiation -> Convolution
Recall, for 2D function, f(x,y): • Approximation:

f  f x   , y f x, y  f f xn1 , y  f xn , y


 lim    
x  0     x x

This is linear and shift invariant. It is which is a convolution with the mask:
therefore the result of a convolution.
-1 1

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 12


Finite differences
filters/approximations of derivative
filters

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 13


Prewitt Filter - Example

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 14


Edge detection - 2nd derivative
Approximate finding maxima/minima of gradient
magnitude by finding places.
Can’t always find discrete pixels where the second
derivative is zero –look for zero-crossing instead.

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 15


2nd order derivative: Laplacian
It is an isotropic operator.
It is cheaper to implement than the gradient (i.e., one mask only).
It does not provide information about edge direction.
It is more sensitive to noise (i.e., differentiates twice).

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 16


Effects of Noise

Smoothing:
What to do? by forcing pixels different to

Gaussian their neighbors (=noise pixels)


to look more like neighbors

Function
 Finite difference filters respond strongly to noise.
 Image noise results in pixels that look very different from their neighbors.
 Generally, the larger the noise the stronger the response

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 17


Smooth first- look for peaks in
d(f*g)/dx

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 18


Derivative theorem of convolution

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 19


Derivative of Gaussian filter

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 20


Laplacian of Gaussian

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 21


2D LoG Filter for edge detection

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 22


 The width of the Gaussian depends on the variance σ.
 The value of σ dictates the amount of smoothing.
 “Laplacian of the Gaussian” (LOG) operator produces edges as Zero-Crossings to detect edges.

Larger values: larger scale edges detected


Smaller values: finer features detected

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 23


Effect of Sigma/Gaussian spread

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 24


Difference of Gaussian (DoG)
 Gradient works well when the image
contains sharp intensity transitions and
low noise.
 Zero-crossings of LOG offer better
localization, especially when the edges
are not very sharp

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 25


Designing an edge detector
Criteria for an “optimal” edge detector:
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
Noise suppression-localization tradeoff. Smoothing depends on mask size (e.g., depends on σ for Gaussian
filters).
Larger mask sizes reduce noise, but worsen localization (i.e., add uncertainty to the location of the edge)
and vice versa.
Choice of threshold – high threshold removes finer details/select strong edges only/ does not guarantee
continuity

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 26


Canny Edge Detector
Smoothing and derivative when applied separately, were not producing good results under noisy conditions. This is
because, one opposes the other. Whereas, when combined together produces the desired output.
Canny in 1986 suggested an optimal operator, which uses the Gaussian smoothing and the derivative function
together. The first derivative of the Gaussian function, as shown below, is a good approximation to his optimal
operator. It combines both the derivative and smoothing properties to obtain good edges.
1. Filter image with derivative of Gaussian
2. Find magnitude and orientation of gradient
3. Non‐maximum suppression: – To find the edge points, we need to find the local maxima of the gradient magnitude.
Broad ridges must be thinned so that only the magnitudes at the points of greatest local change remain. All values along
the direction of the gradient that are not peak values of a ridge are suppressed.
4. Linking and thresholding (hysteresis):
– Define two thresholds: low and high
– Use the high threshold to start edge curves and the low threshold to continue them

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 27


Non-maximal suppression

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 28


Hysteresis thresholding
Hysteresis thresholding uses two
thresholds:
 low threshold tl
 high threshold th (usually, th= 2tl)

For “maybe” edges, decide on the edge


if neighboring pixel is a strong edge.

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 29


Edge linking

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 30


Canny Algorithm

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 31


Summary
 Edge detection operators are often implemented with convolution masks and most are based on discrete
approximations to differential operators.
 Differential operations measure the rate of change in a function, in this case, the image brightness function
 Preprocessing of image is required to eliminate or at least minimize noise effects
 There is tradeoff between sensitivity and accuracy in edge detection
 The parameters that we can set so that edge detector is sensitive include the size of the edge detection
mask and the value of the gray level threshold
 A larger mask or a higher gray level threshold will tend to reduce noise effects, but may result in a loss of
valid edge points

19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 32


Thank
You
19/05/2024 COMPUTER VISION: EDGE DETECTION TCHNIQUES 33

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