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

Lab6 Vision (1)

The document outlines the Canny Edge Detection algorithm, detailing its steps including noise reduction, gradient extraction, and edge classification. It also discusses image transformation techniques in spatial and frequency domains, highlighting the properties and applications of low-pass and high-pass filters. Additionally, it provides a practical example of computing gradient magnitude and orientation for a specific pixel in a grayscale image.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab6 Vision (1)

The document outlines the Canny Edge Detection algorithm, detailing its steps including noise reduction, gradient extraction, and edge classification. It also discusses image transformation techniques in spatial and frequency domains, highlighting the properties and applications of low-pass and high-pass filters. Additionally, it provides a practical example of computing gradient magnitude and orientation for a specific pixel in a grayscale image.

Uploaded by

salmamaher2323
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

COMPUTE

VISION
R
ENG/TA : MAiADA ALAA
Canny Edge
Detection
• algorithm is a powerful tool for extracting edges from
images.

• STEPS

1- Noise reduction - Apply Gaussian Filter for Smoothing


2. Extract the Gradient in x and y Directions
3. Compute the Gradient's Magnitude and Direction
4. Apply Hysteresis Thresholding
5. Apply Non-Maximum Suppression
Noise Reduction
• Apply Gaussian Filter for Smoothing
• A Gaussian filter is applied to the image to reduce noise
and prepare the image for gradient calculations.
Extract the Gradient in x
and y
Directions
• filters are typically Sobel or prewitt filters, one for
the x direction and one for the y direction.
Prewitt
Sobel
1 0 -1
1 0
Gx -1
Gx 1 0 -1
1 0 -1
2 0
-2 1 1 1
1 2 1
1 0 Gy 0 0 0
Gy -1
0 0 0
-1 -2 -1 -1 -1 -1
Gradient's
Magnitude
and Direction
Non-Maximum
Suppression
• ensure that the edges are thin
Hysteresis
Thresholding
• classify pixels into strong edges, weak edges, or non-
edges.
• It refines the edge detection result by ensuring that weak
edges are only retained if they are connected to strong edges,

• discarding weak pixels that are not connected to strong ones


• helping reduce noise and define edges.
Image Transform
Enhance image in two ways:

Spatial Domain
Frequency Domain

• In spatial access pixels.


• In frequency convert image into fourier transform to
change domain.
Properties of fourier
Transform
The result shows that the image contains components of all
frequencies.

magnitude gets smaller for higher frequencies. Hence, low


frequencies contain more image information than the
higher ones.

we typically display log(1 + |F(u,v)|) to better visualize the


range of values, than using |F(u,v)| onlyy
Fourier transform with low Apply shifting that make low frequencies

frequencies on the corners centered in the image


Low pass & High pass filters

Low-pass filter:
A filter that drop high frequencies while passing low
frequencies.- used for blurring (smoothing)

High-pass filter:
A filter that drop low frequencies while passing high
frequencies. used for sharpening
Ideal Low Pass filter
Butterworth Low
Pass filter
Gaussian Low Pass
Filter
Ideal High Pass Filter
Butterworth High
Pass Filter
Gaussian High Pass
Filter
Spacial representation of Ideal
, Butterworth and gaussian
high pass filters
• Q1) For the grayscale image below, compute the gradient
magnitude and orientation at pixel [3,3]. Use the filter [−1,0
1] to compute gradients, assuming that the positive part of
the filter is assigned to the pixel at which we want to compute
the gradient. If pixel [3,3] lies on an edge in the image, what is
the orientation of the edge at this location?
•Solution

• Use Filter [ -1 0 1] at pixel [3,3]


• We will calculate Gx and Gy :

• Gx = -1 x100 +0x117 +1x 110 = 10


• Gy = -1x107 + 0x117 + 1x111 = 4

• |G| = = 10.77

• 21 degree
•Solution

• b) Orientation of the Edge= 90 + angle = 90 + 21 =


111

21
C, smooth
image
B , more details D0
=
A,100
more define
edges
Image A FT-2, No filter
Image B FT-4,Ideal High
Pass Filter
Image C FT-1, Ideal Low
Pass Filter
Image D FT-3, Bandpass
filter
THANK
YOU

You might also like