Filtering and Edge Detection. Local Neighborhoods Hard to tell anything from a single pixelHard to tell anything from a single pixel – Example: you see.

Slides:



Advertisements
Similar presentations
3-D Computer Vision CSc83020 / Ioannis Stamos  Revisit filtering (Gaussian and Median)  Introduction to edge detection 3-D Computater Vision CSc
Advertisements

Boundary Detection - Edges Boundaries of objects –Usually different materials/orientations, intensity changes.
1Ellen L. Walker Edges Humans easily understand “line drawings” as pictures.
Edge and Corner Detection Reading: Chapter 8 (skip 8.1) Goal: Identify sudden changes (discontinuities) in an image This is where most shape information.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Lecture 4 Edge Detection
Filtering and Edge Detection
Computer Vision Group Edge Detection Giacomo Boracchi 5/12/2007
Canny Edge Detector.
Edge detection. Edge Detection in Images Finding the contour of objects in a scene.
Announcements Mailing list: –you should have received messages Project 1 out today (due in two weeks)
Signal Processing COS 323 COS 323. Digital “Signals” 1D: functions of space or time (e.g., sound)1D: functions of space or time (e.g., sound) 2D: often.
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Zoom Lenses – Varifocal
Introduction to Computer Vision CS / ECE 181B Thursday, April 22, 2004  Edge detection (HO #5)  HW#3 due, next week  No office hours today.
Filters and Edges. Zebra convolved with Leopard.
Lecture 2: Image filtering
Announcements Since Thursday we’ve been discussing chapters 7 and 8. “matlab can be used off campus by logging into your wam account and bringing up an.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Edge Detection.
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Neighborhood Operations
Computer Vision Spring ,-685 Instructor: S. Narasimhan WH 5409 T-R 10:30 – 11:50am.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Discrete Images (Chapter 7) Fourier Transform on discrete and bounded domains. Given an image: 1.Zero boundary condition 2.Periodic boundary condition.
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Edges. Edge detection schemes can be grouped in three classes: –Gradient operators: Robert, Sobel, Prewitt, and Laplacian (3x3 and 5x5 masks) –Surface.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection From Sandlot ScienceSandlot Science.
Edge Detection Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski, Ch 4.1.2, From Sandlot.
Lecture 6: Edge Detection CAP 5415: Computer Vision Fall 2008.
CSC508 What You Should Be Doing Code, code, code –Programming Gaussian Convolution Sobel Edge Operator.
Instructor: S. Narasimhan
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
CSE 185 Introduction to Computer Vision Edges. Scale space Reading: Chapter 3 of S.
EE 4780 Edge Detection.
Many slides from Steve Seitz and Larry Zitnick
October 7, 2014Computer Vision Lecture 9: Edge Detection II 1 Laplacian Filters Idea: Smooth the image, Smooth the image, compute the second derivative.
Edge Detection and Geometric Primitive Extraction Jinxiang Chai.
Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos VC 15/16 – TP7 Spatial Filters Miguel Tavares Coimbra.
Chapter 9: Image Segmentation
CSE 6367 Computer Vision Image Operations and Filtering “You cannot teach a man anything, you can only help him find it within himself.” ― Galileo GalileiGalileo.
Announcements Project 0 due tomorrow night. Edge Detection Today’s readings Cipolla and Gee (handout) –supplemental: Forsyth, chapter 9Forsyth For Friday.
Digital Image Processing Lecture 17: Segmentation: Canny Edge Detector & Hough Transform Prof. Charlene Tsai.
Canny Edge Detection. 5 STEPS 5 STEPS Apply Gaussian filter to smooth the image in order to remove the noise Apply Gaussian filter to smooth the image.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Instructor: Mircea Nicolescu Lecture 7
Lecture 8: Edges and Feature Detection
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
September 26, 2013Computer Vision Lecture 8: Edge Detection II 1Gradient In the one-dimensional case, a step edge corresponds to a local peak in the first.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Winter in Kraków photographed by Marcin Ryczek
Miguel Tavares Coimbra
Edge Detection slides taken and adapted from public websites:
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering Northern Arizona University.
Edge Detection CS 678 Spring 2018.
Jeremy Bolton, PhD Assistant Teaching Professor
Computer Vision Lecture 9: Edge Detection II
Edge detection Goal: Identify sudden changes (discontinuities) in an image Intuitively, most semantic and shape information from the image can be encoded.
Dr. Chang Shu COMP 4900C Winter 2008
Edge Detection Today’s reading
Edge Detection Today’s reading
Lecture 2: Edge detection
Canny Edge Detector.
Edge Detection Today’s reading
CS 565 Computer Vision Nazar Khan Lecture 9.
Edge Detection Today’s readings Cipolla and Gee Watt,
Lecture 2: Edge detection
Winter in Kraków photographed by Marcin Ryczek
IT472 Digital Image Processing
Presentation transcript:

Filtering and Edge Detection

Local Neighborhoods Hard to tell anything from a single pixelHard to tell anything from a single pixel – Example: you see a reddish pixel. Is this the object’s color? Illumination? Noise? The next step in order of complexity is to look at local neighborhood of a pixelThe next step in order of complexity is to look at local neighborhood of a pixel

Linear Filters Given an image In ( x, y ) generate a new image Out ( x, y ):Given an image In ( x, y ) generate a new image Out ( x, y ): – For each pixel ( x, y ), Out ( x, y ) is a linear combination of pixels in the neighborhood of In ( x, y ) This algorithm isThis algorithm is – Linear in input intensity – Shift invariant

Discrete Convolution This is the discrete analogue of convolutionThis is the discrete analogue of convolution Pattern of weights = “filter kernel”Pattern of weights = “filter kernel” Will be useful in smoothing, edge detectionWill be useful in smoothing, edge detection

Example: Smoothing Original: Mandrill Smoothed with Gaussian kernel

Gaussian Filters One-dimensional GaussianOne-dimensional Gaussian Two-dimensional GaussianTwo-dimensional Gaussian

Gaussian Filters

Gaussians are used because:Gaussians are used because: – Smooth – Decay to zero rapidly – Simple analytic formula – Limit of applying multiple filters is Gaussian (Central limit theorem) – Separable: G 2 (x,y) = G 1 (x) G 1 (y)

Computing Discrete Convolutions What happens near edges of image?What happens near edges of image? – Ignore ( Out is smaller than In ) – Pad with zeros (edges get dark) – Replicate edge pixels – Wrap around – Reflect – Change filter

Computing Discrete Convolutions If In is n  n, f is m  m, takes time O( m 2 n 2 )If In is n  n, f is m  m, takes time O( m 2 n 2 ) OK for small filter kernels, bad for large onesOK for small filter kernels, bad for large ones

Fourier Transforms Define Fourier transform of function f asDefine Fourier transform of function f as F is a function of frequency – describes how much of each frequency f containsF is a function of frequency – describes how much of each frequency f contains Fourier transform is invertibleFourier transform is invertible

Fourier Transform and Convolution Fourier transform turns convolution into multiplication: F ( f ( x )  g ( x ) ) = F ( f ( x ) ) F ( g ( x ) )Fourier transform turns convolution into multiplication: F ( f ( x )  g ( x ) ) = F ( f ( x ) ) F ( g ( x ) )

Fourier Transform and Convolution Useful application #1: Use frequency space to understand effects of filtersUseful application #1: Use frequency space to understand effects of filters – Example: Fourier transform of a Gaussian is a Gaussian – Thus: attenuates high frequencies = Frequency Amplitude Frequency Amplitude Frequency Amplitude

Fourier Transform and Convolution Useful application #2: Efficient computationUseful application #2: Efficient computation – Fast Fourier Transform (FFT) takes time O( n log n ) – Thus, convolution can be performed in time O( n log n + m log m ) – Greatest efficiency gains for large filters

Edge Detection What do we mean by edge detection?What do we mean by edge detection? What is an edge?What is an edge?

What is an Edge? Edge easy to find

What is an Edge? Where is edge? Single pixel wide or multiple pixels?

What is an Edge? Noise: have to distinguish noise from actual edge

What is an Edge? Is this one edge or two?

What is an Edge? Texture discontinuity

Formalizing Edge Detection Look for strong step edgesLook for strong step edges One pixel wide: look for maxima in dI / dxOne pixel wide: look for maxima in dI / dx Noise rejection: smooth (with a Gaussian) over a neighborhood Noise rejection: smooth (with a Gaussian) over a neighborhood 

Canny Edge Detector SmoothSmooth Find derivativeFind derivative Find maximaFind maxima ThresholdThreshold

Canny Edge Detector First, smooth with a Gaussian of some width First, smooth with a Gaussian of some width 

Canny Edge Detector Next, find “derivative”Next, find “derivative” What is derivative in 2D? Gradient:What is derivative in 2D? Gradient:

Canny Edge Detector Useful fact #1: differentiation “commutes” with convolutionUseful fact #1: differentiation “commutes” with convolution Useful fact #2: Gaussian is separable:Useful fact #2: Gaussian is separable:

Canny Edge Detector Thus, combine first two stages of Canny:Thus, combine first two stages of Canny:

Canny Edge Detector Original Image Smoothed Gradient Magnitude

Canny Edge Detector Nonmaximum suppressionNonmaximum suppression – Eliminate all but local maxima in magnitude of gradient – At each pixel look along direction of gradient: if either neighbor is bigger, set to zero – In practice, quantize direction to horizontal, vertical, and two diagonals – Result: “thinned edge image”

Canny Edge Detector Final stage: thresholdingFinal stage: thresholding Simplest: use a single thresholdSimplest: use a single threshold Better: use two thresholdsBetter: use two thresholds – Find chains of edge pixels, all greater than  low – Each chain must contain at least one pixel greater than  high – Helps eliminate dropouts in chains, without being too susceptible to noise – “Thresholding with hysteresis”

Canny Edge Detector Original Image Edges

Other Edge Detectors Can build simpler, faster edge detector by omitting some steps:Can build simpler, faster edge detector by omitting some steps: – No nonmaximum suppression – No hysteresis in thresholding – Simpler filters (approx. to gradient of Gaussian) Sobel:Sobel: Roberts:Roberts:

Second-Derivative-Based Edge Detectors To find local maxima in derivative, look for zeros in second derivativeTo find local maxima in derivative, look for zeros in second derivative Analogue in 2D: LaplacianAnalogue in 2D: Laplacian Marr-Hildreth edge detectorMarr-Hildreth edge detector

LOG As before, combine Laplacian with Gaussian smoothing: Laplacian of Gaussian (LOG)As before, combine Laplacian with Gaussian smoothing: Laplacian of Gaussian (LOG)

LOG

Problems with Laplacian Edge Detectors Local minimum vs. local maximumLocal minimum vs. local maximum Symmetric – poor performance near cornersSymmetric – poor performance near corners Sensitive to noiseSensitive to noise – Higher-order derivatives = greater noise sensitivity – Combines information along edge, not just perpendicular