0% found this document useful (0 votes)
49 views45 pages

Lecture 3 of Computer Vision

Uploaded by

mohamed fikry
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)
49 views45 pages

Lecture 3 of Computer Vision

Uploaded by

mohamed fikry
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/ 45

Computer Vision

Dr. Sameh Zarif

Lecture #3
General Rules

2
Computer Vision Systems Functions

Image acquisition

Pre-processing

Detection/segmentation

Feature extraction

High-level processing

Decision making
Edge Detection
Edge Detection

❖ Convert a 2D image into a set of curves


▪ Extracts salient features of the scene
▪ More compact than pixels
Edge Detection

❖ An edge may be defined as a local discontinuity


in the pixel values which exceeds a given
threshold.

❖ Edges are significant local changes of intensity in


an image.

❖ Edges contain some of the most useful


information in an image.
Edge Detection

❖ Important features can be extracted from the edges of


an image (e.g., corners, lines, curves). These
features are used by higher-level computer vision
algorithms (e.g., recognize or classify objects).

❖ We may use edges to measure:


❖ The size of objects in an image;
❖ To isolate particular objects from their background;
❖ To recognize or classify objects.
Measure the size of the objects in an Isolate particular objects from their
image. background.

Recognize or classify objects


Edge Detection
❖ Edge detection is used to find object boundaries
by marking potential edge points corresponding
to places in an image where rapid changes in
brightness occur.
Origin of Edges

❖ Edges are caused by a variety of factors


Origin of Edges
Type of Edges
Designing an edge detector

• Criteria for a good edge detector:


– Good detection: the optimal detector should find
all real edges, ignoring noise or other artifacts
– Good localization
• the edges detected must be as close as
possible to the true edges
• the detector must return one point only for
each true edge point
How to Find Edge

❖ Edge is Where Change Occurs


❖ Change is measured by derivative in 1D
❖ Biggest change, derivative has maximum
magnitude Or 2nd derivative is zero.
Characterizing edges

• An edge is a place of rapid change in


the image intensity function
intensity function
image (along horizontal scanline) first derivative

edges correspond to
extrema of derivative
Image Gradient
Image Gradient
Image Gradient
Practical Gradient Algorithm
Example
The discrete gradient

How can we differentiate a digital image f[x,y]?


• Option 1: reconstruct a continuous image, then take
gradient
• Option 2: take discrete derivative (finite difference)

How would you implement this as a convolution?


Discrete Gradient Operators
Simple Filtering Example in 1-D

Convolving −1 1 with

[ 5 5 5 8 20 25 25 22 12 4 3 3 ]
−1 1

[ 0]
Simple Filtering Example in 1-D

Convolving −1 1 with

[ 5 5 5 8 20 25 25 22 12 4 3 3 ]
−1 1

[ 0 0]
Simple Filtering Example in 1-D

Convolving −1 1 with

[ 5 5 5 8 20 25 25 22 12 4 3 3 ]
−1 1

[ 0 0 3]
Simple Filtering Example in 1-D

Convolving −1 1 with

[ 5 5 5 8 20 25 25 22 12 4 3 3 ]
−1 1
produces:

[ 0 0 3 12 5 0 -3 -13 -8 -1 0 ]
Gradient Estimation

3/2/2024
Roberts Operator
Prewitt Operator
Prewitt Operator
Sobel Operator
Gradient Operators

Prewitt and Sobel Edge Detector


1. Perform image smoothing.
2. Compute derivative.
• In x and y direction
3. Compute the gradient magnitude.
4. Threshold the gradient magnitude.
Gradient Operators
Prewitt Edge Detector

Smoothing Derivative Gradient fx


Image Blurred x in x Edge
s
and
Gradient
magnitude
Thresholding

Derivative Gradient Smoothing


Image y in y Blurred f
y
and
Gradient Operators
Prewitt Edge Detector
Gradient Operators
Sobel Edge Detector

Smoothing Derivative Gradient fx


Image Blurred x in x Edges

and
Gradient
magnitude
Thresholding

Derivative Gradient Smoothing


Imag in y Blurred
y fy
e
and
Gradient Operators
Sobel Edge Detector

Original Image
gradient magnitude
Discrete Operators Compared
Applications Finger Print
• Edge detection techniques enhance the quality
of image and cause the improvement in the
image recognition.

40
Applications Satellite Image

Satellite image Canny based edge map of


satellite image

41
Applications Robotics vision

42
Applications Medical Image

Original MRI Scan from Sobel operator from Canny operator

43
Assignment 1
(a) Use the given templates A and B to detect Edges in the original image shown below.
0 0 0 0 0 0
−1 −1 −1 1 0 0 0 0 0 0
and
1 1 −1 1 0 0 0 0 0 0
0 0 3 3 3 3
A B
0 0 3 3 3 3
0 0 3 3 3 3
0 0 3 3 3 3

44

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