0% found this document useful (0 votes)
8 views37 pages

lecture2s

Uploaded by

Fatima
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)
8 views37 pages

lecture2s

Uploaded by

Fatima
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/ 37

CS 477: Computer Vision

Lecture 2:

Features Extraction: Edge Detection


and Feature Point Detection

Computer Vision CS 477 1


Gradient Operators

 In practice, we use discrete approximations of the partial


derivatives, which are implemented using the masks.
 The size of mask is determined by type of edges to be detected:
Small mask: detects fine variation
Large mask: detects coarse variations
Computer Vision CS 477 2
Gradient Operators

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.

Computer Vision CS 477 3


Sobel Edge Detector

Computer Vision CS 477 4


Gradient Operators (Examples)

Computer Vision CS 477 5


Sobel Edge Detector (Example)

d
I
dx
I

d
I
dy

Computer Vision CS 477 6


Sobel Edge Detector (Example)

2 2
  d    d I 
 I   dy 
 dx


Threshold100 Computer Vision CS 477 7
Laplacian
 Some times it is desired to construct derivative
operators, which are isotropic (rotation invariant
 This can be accomplished by the Laplacian of the 2-D
function.
 The Laplacian of a 2-D function f(x,y) is given by:

Computer Vision CS 477 8


Laplacian

Laplacian Masks

 The zero crossings of the Laplacian of an image are used to


detect edges.
Example:

Computer Vision CS 477 9


Laplacian of a Gaussian (LoG)
 Edge detection by Laplacian operators has bad response to noise.
 Since Laplacian is linear function,
– applying a smoothing filter followed by the Laplacian filter on
an image = applying the Laplacian on the smoothing filter and
then convolving the combined filter on the image.
 A filter which combines the smoothing function (Gaussian) with
the Laplacian is called Laplacian of a Gaussian (LoG) filter.
 Much robust against noise.

Computer Vision CS 477 10


Laplacian of a Gaussian (LoG) Filter

Computer Vision CS 477 11


Edge detection by LoG
 A discrete approximation of LoG function gives the
LoG filter.
 Due the shape of this function it is also called Mexican
hat function (or Mexican hat filters).
 The zero crossings of the Laplacian of an image are
used to detect edges.
 Better performance against noise.
 It is particularly useful when the gray-level transition
at the edge is not abrupt but gradual.

Computer Vision CS 477 12


Marr and Hildreth Edge Operator
Image I 2G * I Zero Crossings Edge
*  G
2
Image Detection

2G * I Zero Crossings


Computer Vision CS 477 13
Edge detection by LoG (Example)
Original Sobel
image gradient

Spatial Gaussian
smoothing function Laplacian Mask

LoG Thresholded LoG Zero Crossings


Computer Vision CS 477 14
Quality of an Edge Detector

 Robustness to Noise and good response to


actual edge
 Localization
 Too Many/Too less Responses True Edge

Too many responses


Poor robustness to noise Poor localization
Computer Vision CS 477 15
Canny Edge Detector
 Criterion 1: Signal to noise ratio: The optimal
detector should respond more strongly to true
edge as compared to noise.
 Criterion 2: Good Localization: The edges
detected must be as close as possible to the
true edges.
 Single Response Constraint: The detector must
return one point only for each edge point.

Computer Vision CS 477 16


Canny Edge Detector
 Canny modeled the above two criteria and the
constraint, by mathematical parameters.
 It was attempted to maximize the SNR and the
Localization parameters subject to the
constraint defined mathematically.
 An efficient approximation of the filter which
gives required optimality turns out to be first
order derivative of the Gaussian function.

Computer Vision CS 477 17


Canny Edge Detector

Canny edge detector includes:


 Convolution with derivative of Gaussian
 Non-maximum Suppression
 Hysteresis Thresholding

Computer Vision CS 477 18


Canny Edge Detector
 Smooth by Gaussian
1 
x2  y2
S  G * G  e 2 2
2 2
I
 Compute x and y derivatives


T
   S Sy T
S   S
 x
 y
S 
x

 Compute gradient magnitude and


orientation
S  Sx 2  Sy S
2
  tan 1 S y
x

Computer Vision CS 477 19


Canny Edge Operator

S  G * I  
G * I
T
 G G 
G     
 x y 

 G
G 
T

S     * I 
y * I 
 x

Computer Vision CS 477 20


Canny Edge Detector

Sx

Sy

Computer Vision CS 477 21


Canny Edge Detector

S  S 2  S
2
x
y
I

S  Threshold 
25
Computer Vision CS 477 22
Canny Edge Detector
Non-Maximum Suppression

Purpose:
 To mark the maximums along normal to the edge direction
Connecting these maximum to give a single edge
There are then two algorithmic issues:
 at which point is the maximum,
 where is the next one?
Computer Vision CS 477 23
Canny Edge Detector
Non-Maximum Suppression
M

S  Sx 2  Sy
2

M  Threshold 25
Computer Vision CS 477 27
Hysteresis Thresholding
 The output of the non-maximum suppressed image are edges but
since they are thresholded with single value there may be
disconnected edges.
To overcome this problem Hysterisis thresholding is used.
Steps:
 If the gradient at a pixel is above ‘High’, declare it an
‘edge pixel’
 If the gradient at a pixel is below ‘Low’, declare it a ‘non-edge-
pixel’
 If the gradient at a pixel is between ‘Low’ and ‘High’ then declare
it an ‘edge pixel’ if and only if it is connected to an ‘edge pixel’
directly or via pixels between ‘Low’ and ‘ High’

Computer Vision CS 477 29


Hysteresis Thresholding (Example)

M M  Threshold
25

High  35
Low  15
Computer Vision CS 477 30
Hysteresis Thresholding (Example)

Computer Vision CS 477 31


Corner Points Detection: Motivation

Example: Build a Panorama

M. Brown and D. G. Lowe. Recognising Panoramas. ICCV 2003

Computer Vision CS 477 32


How do we build panorama?
 We need to match (align) images

Computer Vision CS 477 33


Matching with Features
Detect feature points in both
images

Computer Vision CS 477 34


Matching with Features
Detect feature points in both
images Find corresponding pairs

Computer Vision CS 477 35


Matching with Features
Detect feature points in both
images Find corresponding pairs
Use these pairs to align images

Computer Vision CS 477 36


Matching with Features
 Problem 1:
– Detect the same point independently in both images

no chance to match!

We need a repeatable
detector
Computer Vision CS 477 37
Matching with Features
 Problem 2:
– For each point correctly recognize the corresponding one

We need a reliable and distinctive


descriptor
Computer Vision CS 477 38
More motivation…
 Feature points are used also for:
– Image alignment (homography, fundamental matrix)
– 3D reconstruction
– Motion tracking
– Object recognition
– Indexing and database retrieval
– Robot navigation
– … other

Computer Vision CS 477 39


How to determine landmarks

 By unique
intensity/color
structure of
neighborhood

 By geometry or
Image Image
topology of
1 2
neighborhood Vectors show how
intensity
neighborhoods
moved: similar
vectors are colored
the same

Computer Vision CS 477 41


Salient point selection
Algorithms:
 Moravec (1977 & 1979):
– was the first that developed the idea of using “points of
interest”
– took the minimum local autocorrelation out of four
directions
 Harris and Stephens (1988) also called Plessey Feature point
detector
– Based on Moravec interest operator, but the measurement of
local correlation is valuated from first order image derivatives.
 Förstner and Gülch (1987)
– Similar to Plessey but the detection and localization stages are
separated into selection of window in which features belong
 Smith (1995)
– use of small circular pixel mask of which a small area, called
Computer Vision CS 477 42

You might also like