SlideShare a Scribd company logo
CSE4227 Digital Image Processing
Chapter 10 – Image Segmentation (Part I)
CSE | AUST Spring 2024
Dr. Kazi A Kalpoma
Professor, Department of CSE
Ahsanullah University of Science & Technology (AUST)
Contact: kalpoma@aust.edu
Google Class code: fmxdafw
Today’s Contents
❑Image Segmentation
• Definition
• Goal
• Application
❑Types of Segmentation Algorithms
❑Detection Of Discontinuities
• Points
• Lines
❑Concept of Edge Detection
❑Canny Edge Detection Algorithm
•Chapter 10 from R.C. Gonzalez and R.E. Woods, Digital Image Processing
(3rd Edition), Prentice Hall, 2008 [ Section 10.1, 10.2 (excluding 10.2.7) ]
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
What does Image Segmentation do?
❑ Divide the image into different regions.
❑ Separate objects from background and give them individual
ID numbers (labels).
❑ Purpose is to partition an image into meaningful regions with
respect to a particular application.
For example, it allows us to:
• Count the number of objects of a certain type.
• Measure geometric properties (e.g., area, perimeter) of
objects in the image.
• Study properties of an individual object (intensity,
texture, etc.)
Principle Approaches of
Segmentation
Segmentation Algorithms are based on one of the two
basic properties of intensity values:
❑Similarity
⮚Partitioning an image into regions that are similar
according to a set of predefined criteria.
❑Discontinuity
⮚Partitioning an image based on sharp changes in
intensity (such as edges in an image).
Types of Segmentation Algorithms
❑Similarity
⮚Thresholding – based on pixel intensities
⮚Region based – grouping similar pixels
⮚Match based – comparison to a given template
❑Discontinuity
⮚Edge based – detection of edges that separate regions
from each other
⮚Watershed – find regions corresponding to local minima
in intensity
Detection Of Discontinuities
❑There are three basic types of gray-level
discontinuities:
* points * lines * edges
❑We are interested in the behavior of the
derivatives in these discontinuities.
❑The common way of achieving this
detection is to run a mask through the
image.
w1 w2 w3
w4 w5 w6
w7 w8 w9
Detection of Isolated Points
❑ Point detection can be achieved simply using the
Laplacian mask.
Points are detected at those pixels in the subsequent filtered image
that are above a set threshold
-1 -1 -1
-1 8 -1
-1 -1 -1
Isolated Point Detection (example)
X-ray image of
a turbine blade
Result of point
detection
Result of
thresholding
Line Detection
❑ The masks below will extract lines that are one pixel
thick and running in a particular direction
❑ Note: preferred direction of each mask is weighted
with a larger coefficient (i.e.,2) than other possible
directions.
R1 R2 R3 R4
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
Line Detection
CSC447: Digital Image
Processing
Prof. Dr. Mostafa
GadalHaqq.
1
4
❑ Apply every masks on the image
❑ let R1, R2, R3, R4 denotes the response of
the horizontal, +45 degree, vertical and -45
degree masks, respectively.
❑ if, at a certain point in the image
|Ri| > |Rj|, for all j≠i,
❑ that point is said to be more likely
associated with a line in the direction of
mask i.
Line Detection
CSC447: Digital Image
Processing
Prof. Dr. Mostafa
GadalHaqq.
1
5
❑ Alternatively, if we are interested in detecting all
lines in an image in the direction defined by a
given mask, we simply run the mask through the
image and threshold the absolute value of the
result.
❑ The points that are left are the strongest
responses, which, for lines one pixel thick,
correspond closest to the direction defined by
the mask.
Edges
❑Edge is the boundary between
two homogeneous regions.
Edge Detection
Edge Detection - Identifying sudden
change in image intensity.
Edge Types
Edges & Derivatives
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
2nd
Derivative -1 0 0 0 0 1 0 6 -12 6 0 0 1 1 -4 1 1 0 0 7 -7 0 0
-1 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0
1st
Derivative
Edges & Derivatives
❑Derivatives are used to
find discontinuities
❑1st
derivative tells us
where an edge is
❑2nd
derivative can
be used to show
edge direction too
Zero crossing
Characteristics of First and
Second Order Derivatives
Example Signal 1st Derivative of Signal 2nd Derivative of Signal
▪ 1ST
DERIVATIVE SHOWS A MAXIMUM AT THE CENTER OF THE EDGE SIGNAL.
▪ 2ND
DERIVATIVE PASSES THROUGH ZERO (CHANGES ITS SIGN) AT THE CENTER
OF THE EDGE SIGNAL.
Zero-crossing Feature
❖ A zero crossing is a point where the sign of a
mathematical function changes in the graph of the
function.
❖ In image processing, the edge detection using
Laplacian filter takes place by marking the points
that leads to zero in graph as potential edge points.
❖ This method works fine on images for finding edges
in both directions, but it works poorly when noises
are found in the image.
Derivatives & Noise
❑Derivative based edge detectors are extremely
sensitive to noise
❑We need to keep this in mind
Methods of Edge Detection
❑ The majority of different edge detection methods may be grouped
into two categories:
⮚ Gradient based Edge Detection:
The gradient method detects the edges by looking for the
maximum and minimum in the first derivative of the image.
⮚ Laplacian based Edge Detection:
The Laplacian method searches for zero crossings in the second
derivative of the image to find edges. An edge has the one-
dimensional shape of a ramp and calculating the derivative of the
image can highlight its location.
Edge Detection Algorithms
Three main steps in Edge Detection
1. Filtering (Smoothing)
In this stage image is pass through a filter to remove
the noise.
2. Differentiation (Edge sharpening using derivatives)
this stage highlights the location in the image where
intensity changes i.e. detects discontinuities.
3. Detection (Thresholding)
this stage take decision on the edge pixel i.e. where
the changes are significant.
4. Localization
determine the exact location of an edge.
❖ The direction of an edge θ is orthogonal to the
direction of a gradient vector α
Gradient based Edge Detection
Gradient – Prewitt Operator
-1 -1 -1
0 0 0
1 1 1
-1 0 1
-1 0 1
-1 0 1
Gradient – Sobel Operator
-1 0 1
-2 0 2
-1 0 1
-1 -2 -1
0 0 0
1 2 1
Basic Edge Detection by Sobel
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
Gradient based Edge Detection
cont.
Edge Detection Example
Original Image Horizontal Gradient Component
Vertical Gradient Component Combined Edge Image
Edge Detection Problems
Edge Detection Problems
❑Often, problems arise in edge detection in that
there are too much details
❑For example, the brickwork in the previous
example
❑One way to overcome this is to smooth images
prior to edge detection
Laplacian of Gaussian – LOG
We usually smooth the image applying Gaussian
filter prior to Laplacian filter.
Laplacian Of Gaussian
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
Laplacian of Gaussian - LOG
Laplacian of Gaussian – LOG
(Marr Hildreth Algorithm)
Marr-Hildreth Algorithm
Canny Edge Detection
Canny Edge Detection Algorithm
Canny Edge Detection Algorithm
(step 1: smoothing/noise reduction)
Result after step 1
f(x,y) fs(x,y)
❑ Compute the derivative of smoothed image fs(x,y)
❑ Calculate the Gradient Magnitude and Direction.
❑ Any of the filter mask pairs can be use to get the derivatives.
gy gx
(step 2: finding gradient operator)
Canny Edge Detection Algorithm
Result after step 2
fs(x,y) M(x,y)
(step 3: Non-Max Suppression)
Canny Edge Detection Algorithm
▪ Fro each pixel, the neighboring pixels are located in horizontal, vertical,
and diagonal directions (0°, 45°, 90°, and 135°).
▪ Thus we need to round off the gradient direction at every pixel to one of
these directions as shown below.
(step 3: Non-Max Suppression)……
Example:
▪Suppose for a pixel ‘A’, the gradient direction comes out to be 17 degrees.
▪Since 17 is nearer to 0, we will round it to 0 degrees.
▪Then we select neighboring pixels in the rounded gradient direction (See B
and C in below figure).
▪If the magnitude value M(x,y) of A is greater than that of B and C, it is
retained as an edge pixel otherwise suppressed.
(step 3: Non-Max Suppression)……
(step 3: Non-Max Suppression)……
(step 3: Non-Max Suppression)……
Result after step 3
gN(x,y)
M(x,y)
❑Final operation is to threshold gN(x,y) to reduce false
edge points.
▪ Non-max suppression outputs a more accurate
representation of real edges in an image.
▪ But you can see that some edges are more bright than
others.
▪ The brighter ones can be considered as strong edges but
the lighter ones can actually be edges or they can be
because of noise.
▪ To solve the problem of “which edges are really edges and
which are not” Canny uses the Hysteresis Thresholding.
(step 4: Hysteresis Thresholding)
Canny Edge Detection Algorithm
The ratio of the high and low threshold should be
two or three to one.
(step 4: Hysteresis Thresholding)…
Canny Edge Detection Algorithm
➔ Using two thresholds, a low threshold and a high
threshold.
❑In Hysteresis thresholding, we set two thresholds
‘High’ and ‘Low’.
❑If the threshold is set too low, there will still be
some false edge which is called false positive.
❑If the threshold is set too high, then actual valid
edge points will be eliminated which is called
false negative.
(step 4: Hysteresis Thresholding)…
Canny Edge Detection Algorithm
❑Connectivity analysis to detect and link edges
❑For the edge pixels values of gNH(x,y) and gNL(x,y).
– Any edges with intensity greater than ‘High’ are the sure
edges.
– Any edges with intensity less than ‘Low’ are sure to be non-
edges.
– The edges between ‘High’ and ‘Low’ thresholds are
classified as edges only if they are connected to a sure
edge otherwise discarded.
(step 5: connectivity analysis)
Canny Edge Detection Algorithm
❖ Here, A and B are sure-edges as they are above ‘High’
threshold.
❖ Similarly, D is a sure non-edge.
❖ Both ‘E’ and ‘C’ are weak edges
❖ Since ‘C’ is connected to ‘B’ which is a sure edge, ‘C’ is
also considered as a strong edge.
❖ Using the same logic ‘E’ is discarded. This way we will get
only the strong edges in the image.
❖ This is based on the assumption that the edges are long
lines.
Example
(step 5) cont…
200 0 0
0 0 101
0 0 0
gnH(x,y)
0 0 57
0 45 0
50 0 0
gnL(x,y)
200 0 57
0 45 101
0 0 0
g(x,y)
Example
Final Result after step 5
g(x,y)
gN(x,y)
08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx
Canny Edge Detection: Summary
• Smooth the input image with a Gaussian filter
• Compute the gradient magnitude and angle images
• Apply non maxima suppression to the gradient
magnitude image
• Use double thresholding and connectivity analysis to
detect and link edges
Edge detection in noisy images using different
differentiation

More Related Content

PDF
Biomedical engineering 20231023-segmentation-1.pdf
PPTX
Lecture 06 - image processingcourse1.pptx
PPTX
Fuzzy Logic Based Edge Detection
PPTX
Edge Detection
PDF
Module-5-1_230523_171754 (1).pdf
PPTX
Computer vision - edge detection
DOCX
EDGE DETECTION
PDF
Lec06 edge
Biomedical engineering 20231023-segmentation-1.pdf
Lecture 06 - image processingcourse1.pptx
Fuzzy Logic Based Edge Detection
Edge Detection
Module-5-1_230523_171754 (1).pdf
Computer vision - edge detection
EDGE DETECTION
Lec06 edge

Similar to 08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx (20)

PPT
IVP_segmentation ppt for image segmentation used in computer graphics
PPTX
Edge detection
PDF
Ijarcet vol-2-issue-7-2246-2251
PDF
Ijarcet vol-2-issue-7-2246-2251
PPTX
Notes on image processing
PPTX
image segmentation image segmentation.pptx
PPT
Feature Detection and Matching
PDF
A NOBEL HYBRID APPROACH FOR EDGE DETECTION
DOCX
Edge detection
PPT
Chapter10 image segmentation
PPTX
Canny Edge Detection
PDF
Real time Canny edge detection
PPTX
Edge detection of video using matlab code
PDF
Ex4301908912
PPTX
Introduction to Edges Detection Techniques
PDF
Study of Various Edge Detection Techniques and Implementation of Real Time Fr...
PDF
Edge detection
PDF
ALGORITHM AND TECHNIQUE ON VARIOUS EDGE DETECTION: A SURVEY
PPT
Image processing9 segmentation(pointslinesedges)
PPTX
Canny Edge & Image Representation.pptx
IVP_segmentation ppt for image segmentation used in computer graphics
Edge detection
Ijarcet vol-2-issue-7-2246-2251
Ijarcet vol-2-issue-7-2246-2251
Notes on image processing
image segmentation image segmentation.pptx
Feature Detection and Matching
A NOBEL HYBRID APPROACH FOR EDGE DETECTION
Edge detection
Chapter10 image segmentation
Canny Edge Detection
Real time Canny edge detection
Edge detection of video using matlab code
Ex4301908912
Introduction to Edges Detection Techniques
Study of Various Edge Detection Techniques and Implementation of Real Time Fr...
Edge detection
ALGORITHM AND TECHNIQUE ON VARIOUS EDGE DETECTION: A SURVEY
Image processing9 segmentation(pointslinesedges)
Canny Edge & Image Representation.pptx
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Empathic Computing: Creating Shared Understanding
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
cuic standard and advanced reporting.pdf
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
Empathic Computing: Creating Shared Understanding
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I
Ad

08_Lecture -Chapter 10- Image Segmentation_Part I_Edge Detection.pptx

  • 1. CSE4227 Digital Image Processing Chapter 10 – Image Segmentation (Part I) CSE | AUST Spring 2024 Dr. Kazi A Kalpoma Professor, Department of CSE Ahsanullah University of Science & Technology (AUST) Contact: kalpoma@aust.edu Google Class code: fmxdafw
  • 2. Today’s Contents ❑Image Segmentation • Definition • Goal • Application ❑Types of Segmentation Algorithms ❑Detection Of Discontinuities • Points • Lines ❑Concept of Edge Detection ❑Canny Edge Detection Algorithm •Chapter 10 from R.C. Gonzalez and R.E. Woods, Digital Image Processing (3rd Edition), Prentice Hall, 2008 [ Section 10.1, 10.2 (excluding 10.2.7) ]
  • 5. What does Image Segmentation do? ❑ Divide the image into different regions. ❑ Separate objects from background and give them individual ID numbers (labels). ❑ Purpose is to partition an image into meaningful regions with respect to a particular application. For example, it allows us to: • Count the number of objects of a certain type. • Measure geometric properties (e.g., area, perimeter) of objects in the image. • Study properties of an individual object (intensity, texture, etc.)
  • 6. Principle Approaches of Segmentation Segmentation Algorithms are based on one of the two basic properties of intensity values: ❑Similarity ⮚Partitioning an image into regions that are similar according to a set of predefined criteria. ❑Discontinuity ⮚Partitioning an image based on sharp changes in intensity (such as edges in an image).
  • 7. Types of Segmentation Algorithms ❑Similarity ⮚Thresholding – based on pixel intensities ⮚Region based – grouping similar pixels ⮚Match based – comparison to a given template ❑Discontinuity ⮚Edge based – detection of edges that separate regions from each other ⮚Watershed – find regions corresponding to local minima in intensity
  • 8. Detection Of Discontinuities ❑There are three basic types of gray-level discontinuities: * points * lines * edges ❑We are interested in the behavior of the derivatives in these discontinuities. ❑The common way of achieving this detection is to run a mask through the image.
  • 9. w1 w2 w3 w4 w5 w6 w7 w8 w9
  • 10. Detection of Isolated Points ❑ Point detection can be achieved simply using the Laplacian mask. Points are detected at those pixels in the subsequent filtered image that are above a set threshold -1 -1 -1 -1 8 -1 -1 -1 -1
  • 11. Isolated Point Detection (example) X-ray image of a turbine blade Result of point detection Result of thresholding
  • 12. Line Detection ❑ The masks below will extract lines that are one pixel thick and running in a particular direction ❑ Note: preferred direction of each mask is weighted with a larger coefficient (i.e.,2) than other possible directions. R1 R2 R3 R4
  • 14. Line Detection CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 1 4 ❑ Apply every masks on the image ❑ let R1, R2, R3, R4 denotes the response of the horizontal, +45 degree, vertical and -45 degree masks, respectively. ❑ if, at a certain point in the image |Ri| > |Rj|, for all j≠i, ❑ that point is said to be more likely associated with a line in the direction of mask i.
  • 15. Line Detection CSC447: Digital Image Processing Prof. Dr. Mostafa GadalHaqq. 1 5 ❑ Alternatively, if we are interested in detecting all lines in an image in the direction defined by a given mask, we simply run the mask through the image and threshold the absolute value of the result. ❑ The points that are left are the strongest responses, which, for lines one pixel thick, correspond closest to the direction defined by the mask.
  • 16. Edges ❑Edge is the boundary between two homogeneous regions.
  • 17. Edge Detection Edge Detection - Identifying sudden change in image intensity.
  • 19. Edges & Derivatives 5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7 2nd Derivative -1 0 0 0 0 1 0 6 -12 6 0 0 1 1 -4 1 1 0 0 7 -7 0 0 -1 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0 1st Derivative
  • 20. Edges & Derivatives ❑Derivatives are used to find discontinuities ❑1st derivative tells us where an edge is ❑2nd derivative can be used to show edge direction too Zero crossing
  • 21. Characteristics of First and Second Order Derivatives Example Signal 1st Derivative of Signal 2nd Derivative of Signal ▪ 1ST DERIVATIVE SHOWS A MAXIMUM AT THE CENTER OF THE EDGE SIGNAL. ▪ 2ND DERIVATIVE PASSES THROUGH ZERO (CHANGES ITS SIGN) AT THE CENTER OF THE EDGE SIGNAL.
  • 22. Zero-crossing Feature ❖ A zero crossing is a point where the sign of a mathematical function changes in the graph of the function. ❖ In image processing, the edge detection using Laplacian filter takes place by marking the points that leads to zero in graph as potential edge points. ❖ This method works fine on images for finding edges in both directions, but it works poorly when noises are found in the image.
  • 23. Derivatives & Noise ❑Derivative based edge detectors are extremely sensitive to noise ❑We need to keep this in mind
  • 24. Methods of Edge Detection ❑ The majority of different edge detection methods may be grouped into two categories: ⮚ Gradient based Edge Detection: The gradient method detects the edges by looking for the maximum and minimum in the first derivative of the image. ⮚ Laplacian based Edge Detection: The Laplacian method searches for zero crossings in the second derivative of the image to find edges. An edge has the one- dimensional shape of a ramp and calculating the derivative of the image can highlight its location.
  • 26. Three main steps in Edge Detection 1. Filtering (Smoothing) In this stage image is pass through a filter to remove the noise. 2. Differentiation (Edge sharpening using derivatives) this stage highlights the location in the image where intensity changes i.e. detects discontinuities. 3. Detection (Thresholding) this stage take decision on the edge pixel i.e. where the changes are significant. 4. Localization determine the exact location of an edge.
  • 27. ❖ The direction of an edge θ is orthogonal to the direction of a gradient vector α Gradient based Edge Detection
  • 28. Gradient – Prewitt Operator -1 -1 -1 0 0 0 1 1 1 -1 0 1 -1 0 1 -1 0 1
  • 29. Gradient – Sobel Operator -1 0 1 -2 0 2 -1 0 1 -1 -2 -1 0 0 0 1 2 1
  • 30. Basic Edge Detection by Sobel -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 -1 0 1
  • 32. Gradient based Edge Detection cont.
  • 33. Edge Detection Example Original Image Horizontal Gradient Component Vertical Gradient Component Combined Edge Image
  • 35. Edge Detection Problems ❑Often, problems arise in edge detection in that there are too much details ❑For example, the brickwork in the previous example ❑One way to overcome this is to smooth images prior to edge detection
  • 36. Laplacian of Gaussian – LOG We usually smooth the image applying Gaussian filter prior to Laplacian filter.
  • 40. Laplacian of Gaussian – LOG (Marr Hildreth Algorithm)
  • 43. Canny Edge Detection Algorithm
  • 44. Canny Edge Detection Algorithm (step 1: smoothing/noise reduction)
  • 45. Result after step 1 f(x,y) fs(x,y)
  • 46. ❑ Compute the derivative of smoothed image fs(x,y) ❑ Calculate the Gradient Magnitude and Direction. ❑ Any of the filter mask pairs can be use to get the derivatives. gy gx (step 2: finding gradient operator) Canny Edge Detection Algorithm
  • 47. Result after step 2 fs(x,y) M(x,y)
  • 48. (step 3: Non-Max Suppression) Canny Edge Detection Algorithm
  • 49. ▪ Fro each pixel, the neighboring pixels are located in horizontal, vertical, and diagonal directions (0°, 45°, 90°, and 135°). ▪ Thus we need to round off the gradient direction at every pixel to one of these directions as shown below. (step 3: Non-Max Suppression)……
  • 50. Example: ▪Suppose for a pixel ‘A’, the gradient direction comes out to be 17 degrees. ▪Since 17 is nearer to 0, we will round it to 0 degrees. ▪Then we select neighboring pixels in the rounded gradient direction (See B and C in below figure). ▪If the magnitude value M(x,y) of A is greater than that of B and C, it is retained as an edge pixel otherwise suppressed. (step 3: Non-Max Suppression)……
  • 51. (step 3: Non-Max Suppression)……
  • 52. (step 3: Non-Max Suppression)……
  • 53. Result after step 3 gN(x,y) M(x,y)
  • 54. ❑Final operation is to threshold gN(x,y) to reduce false edge points. ▪ Non-max suppression outputs a more accurate representation of real edges in an image. ▪ But you can see that some edges are more bright than others. ▪ The brighter ones can be considered as strong edges but the lighter ones can actually be edges or they can be because of noise. ▪ To solve the problem of “which edges are really edges and which are not” Canny uses the Hysteresis Thresholding. (step 4: Hysteresis Thresholding) Canny Edge Detection Algorithm
  • 55. The ratio of the high and low threshold should be two or three to one. (step 4: Hysteresis Thresholding)… Canny Edge Detection Algorithm ➔ Using two thresholds, a low threshold and a high threshold.
  • 56. ❑In Hysteresis thresholding, we set two thresholds ‘High’ and ‘Low’. ❑If the threshold is set too low, there will still be some false edge which is called false positive. ❑If the threshold is set too high, then actual valid edge points will be eliminated which is called false negative. (step 4: Hysteresis Thresholding)… Canny Edge Detection Algorithm
  • 57. ❑Connectivity analysis to detect and link edges ❑For the edge pixels values of gNH(x,y) and gNL(x,y). – Any edges with intensity greater than ‘High’ are the sure edges. – Any edges with intensity less than ‘Low’ are sure to be non- edges. – The edges between ‘High’ and ‘Low’ thresholds are classified as edges only if they are connected to a sure edge otherwise discarded. (step 5: connectivity analysis) Canny Edge Detection Algorithm
  • 58. ❖ Here, A and B are sure-edges as they are above ‘High’ threshold. ❖ Similarly, D is a sure non-edge. ❖ Both ‘E’ and ‘C’ are weak edges ❖ Since ‘C’ is connected to ‘B’ which is a sure edge, ‘C’ is also considered as a strong edge. ❖ Using the same logic ‘E’ is discarded. This way we will get only the strong edges in the image. ❖ This is based on the assumption that the edges are long lines. Example
  • 60. 200 0 0 0 0 101 0 0 0 gnH(x,y) 0 0 57 0 45 0 50 0 0 gnL(x,y) 200 0 57 0 45 101 0 0 0 g(x,y) Example
  • 61. Final Result after step 5 g(x,y) gN(x,y)
  • 63. Canny Edge Detection: Summary • Smooth the input image with a Gaussian filter • Compute the gradient magnitude and angle images • Apply non maxima suppression to the gradient magnitude image • Use double thresholding and connectivity analysis to detect and link edges
  • 64. Edge detection in noisy images using different differentiation