Docsity

Computer Vision: Gaussian Filters & Canny Edge Detector for Edge Detection & Noise Reducti, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
ECE 516 / CS 532
Computer Vision
Pradeep Sen
Advanced Graphics Lab
Class 9
February 23, 2009
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
Announcements
๎šƒHW2 will be posted today
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
Last time
๎šƒLinear filters and Fourier transforms
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
Today
๎šƒEdge detection
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
Edge detection
ECE516 / CS532 Computer Vision
Pradeep Sen Class 9 โ€“ February 23, 2008
Noise
๎šƒNoise can affect edge detection algorithms
because they look for sharp changes in the
image, and noise creates these sharp
changes were none exist
๎šƒOne common model for noise is additive
stationary Gaussian noise
pf3
pf4
pf5

Partial preview of the text

Download Computer Vision: Gaussian Filters & Canny Edge Detector for Edge Detection & Noise Reducti and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

ECE 516 / CS 532

Computer Vision

Pradeep Sen Advanced Graphics Lab

Class 9 February 23, 2009

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Announcements

ยƒ HW2 will be posted today

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Last time

ยƒ Linear filters and Fourier transforms

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Today

ยƒ Edge detection

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Edge detection

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Noise

ยƒ Noise can affect edge detection algorithms because they look for sharp changes in the image, and noise creates these sharp changes were none exist ยƒ One common model for noise is additive stationary Gaussian noise

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Additive stationary Gaussian noise

ยƒ Each pixel has a value chosen from a Gaussian probability distribution added to it

ยƒ The probability distribution of all pixels are the same

ยƒ The Gaussian distribution has a given standard deviation ฯƒ and a mean ฮผ, typically which is zero

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Example

ฯƒ = 1/256 ฯƒ = 4/256 ฯƒ = 16/

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Problems with noise model

ยƒ Allows for negative pixel values

ยƒ Every pixel is independent, does not allow for noise correlation across pixels

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Finite difference filters on noisy images

ยƒ By applying a finite difference โ€œderivativeโ€ filter to itself, we can generate a whole family of derivative filters ยƒ However, these filters increase the standard deviation of the Gaussian noise

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Increasing standard deviation

Original ฯƒ = 4/256^ ฮผ^ = 0^3

rd (^) derivative 6 th (^) derivative

derivative

standard deviation

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Smooth to reduce noise

ยƒ So we must smooth the signal to reduce the noise problems ยƒ We typically use a Gaussian to do thisโ€ฆ

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Example

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Bad behavior

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Gradient-based edge detectors

ยƒ Compute the image gradient

ยƒ From this, calculate the magnitude of the gradient at every pixel

ยƒ Identify points where the magnitude is maximal in the direction perpendicular to the edge (in direction of gradient)

ยƒ Label these as โ€œedge pixelsโ€

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Gradient magnitude

original Gradient magnitude after filtering with Gaussian with ฯƒ = 1 Gradient magnitude after filteringwith Gaussian with ฯƒ = 2

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Non-maximum suppression

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Edge following

ยƒ During non-maximum suppression we determine: ยƒ Is a given point an edge point?

  • We do this by comparing it to its neighbors and checking that it is maximal ยƒ If so, where is the next edge point to check?
  • Follow the direction perpendicular to the gradient to find the possible continuation of edge
  • Check these points to see if they are the local maximum along gradient

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Hysteresis

ยƒ We use two different thresholds:

  1. For starting an edge, which is larger
  2. For continuing an edge, which is smaller

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Implementation

ยƒ We now look at the details of implementing a gradient-based edge detection algorithm ยƒ Perhaps the best known is the Canny edge detector, introduced in 1986

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Canny Edge Detector

ยƒ Canny, J. โ€œA computational approach to edge detection,โ€ IEEE Trans. Pattern Analysis and Machine Intelligence, 8: 679 โ€“ 714, 1986

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Cannyโ€™s goals

ยƒ Good detection โ€“ the algorithm should mark as many real edges in the image as possible ยƒ Good localization โ€“ the edges marked should be close to the true edges ยƒ Minimal response โ€“ the edges should only be marked once and image noise should be suppressed

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Step 1 โ€“ Noise reduction

ยƒ Convolve with a Gaussian to reduce noise

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Example

source: wikipedia

ยƒ Applying a 5x5 Gaussian kernel to an image

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Step 4 โ€“ Tracing edges

ยƒ Follow the edge (perpendicular to the gradient) from identified points and determine if those pixels are also part of the edge

ยƒ Use a lower threshold than before

ยƒ This is the application of hysteresis

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Canny edge detector results

source: wikipedia

ECE516 / CS532 Computer Vision Pradeep Sen Class 9 โ€“ February 23, 2008

Reading

ยƒ Forsyth, Ch 8