Miguel Tavares Coimbra

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.
Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Spatial Filtering (Chapter 3)
CS 4487/9587 Algorithms for Image Analysis
Edge Detection CSE P 576 Larry Zitnick
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
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)
Edges and Scale Today’s reading Cipolla & Gee on edge detection (available online)Cipolla & Gee on edge detection Szeliski – From Sandlot ScienceSandlot.
Lecture 2: Edge detection and resampling
Edge Detection Today’s reading Forsyth, chapters 8, 15.1
Convolution and Edge Detection : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz.
Lecture 2: Image filtering
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.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
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.
Digital Image Processing
Lecture 2: Edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Image Processing Edge detection Filtering: Noise suppresion.
Lecture 3: Edge detection CS4670/5670: Computer Vision Kavita Bala From Sandlot ScienceSandlot Science.
Introduction to Image Processing
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.
Instructor: S. Narasimhan
Chapter 5: Neighborhood Processing
Spatial Filtering.
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
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
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.
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.
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities May 2, 2005 Prof. Charlene Tsai.
Announcements Project 0 due tomorrow night. Edge Detection Today’s readings Cipolla and Gee (handout) –supplemental: Forsyth, chapter 9Forsyth For Friday.
Lecture 04 Edge Detection Lecture 04 Edge Detection Mata kuliah: T Computer Vision Tahun: 2010.
Machine Vision Edge Detection Techniques ENT 273 Lecture 6 Hema C.R.
Last Lecture photomatix.com. Today Image Processing: from basic concepts to latest techniques Filtering Edge detection Re-sampling and aliasing Image.
Edges Edges = jumps in brightness/color Brightness jumps marked in white.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Enhancement in the Spatial Domain.
Winter in Kraków photographed by Marcin Ryczek
EDGE DETECTION Dr. Amnach Khawne. Basic concept An edge in an image is defined as a position where a significant change in gray-level values occur. An.
Edge Detection slides taken and adapted from public websites:
Image Filtering Spatial filtering
Edge Detection Phil Mlsna, Ph.D. Dept. of Electrical Engineering Northern Arizona University.
Miguel Tavares Coimbra
Digital Image Processing Lecture 16: Segmentation: Detection of Discontinuities Prof. Charlene Tsai.
Miguel Tavares Coimbra
Spatial Filtering - Enhancement
Edge Detection CS 678 Spring 2018.
Lecture 2: Edge detection
Jeremy Bolton, PhD Assistant Teaching Professor
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 CSE 455 Linda Shapiro.
Edge Detection Today’s reading
Lecture 2: Edge detection
Edge Detection Today’s reading
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
IT472 Digital Image Processing
Presentation transcript:

Miguel Tavares Coimbra VC 17/18 – TP7 Spatial Filters Mestrado em Ciência de Computadores Mestrado Integrado em Engenharia de Redes e Sistemas Informáticos Miguel Tavares Coimbra

Outline Spatial filters Frequency domain filtering Edge detection VC 17/18 - TP7 - Spatial Filters

Topic: Spatial filters Frequency domain filtering Edge detection VC 17/18 - TP7 - Spatial Filters

Images are Discrete and Finite Convolution Fourier Transform Inverse Fourier Transform VC 17/18 - TP7 - Spatial Filters

Convolution – Mask ‘slides’ over the image Spatial Mask Simple way to process an image. Mask defines the processing function. Corresponds to a multiplication in frequency domain. Mask Image Convolution – Mask ‘slides’ over the image VC 17/18 - TP7 - Spatial Filters

Example Each mask position has weight w. The result of the operation for each pixel is given by: 1 2 -1 -2 2 4 5 6 Mask Image =1*2+2*2+1*2+… =8+0-20 =-12 VC 17/18 - TP7 - Spatial Filters

Definitions Spatial filters Advantages Use a mask (kernel) over an image region. Work directly with pixels. As opposed to: Frequency filters. Advantages Simple implementation: convolution with the kernel function. Different masks offer a large variety of functionalities. VC 17/18 - TP7 - Spatial Filters

Averaging Let’s think about averaging pixel values For n=2, convolve pixel values with 1 2 Which is faster? 2D images: 1 2 (a) use then 1 2 or (b) use 4 VC 17/18 - TP7 - Spatial Filters

Averaging Repeated averaging Gaussian smoothing The convolution kernel large Repeated averaging Gaussian smoothing VC 17/18 - TP7 - Spatial Filters

Use two 1D Gaussian Filters! Gaussian Smoothing Gaussian kernel pixels Filter size …can be very large (truncate, if necessary) Use two 1D Gaussian Filters! 2D Gaussian is separable! VC 17/18 - TP7 - Spatial Filters

Gaussian Smoothing A Gaussian kernel gives less weight to pixels further from the center of the window This kernel is an approximation of a Gaussian function: 1 2 4 VC 17/18 - TP7 - Spatial Filters

original VC 17/18 - TP7 - Spatial Filters

Mean Filtering We are degrading the energy of the high spatial frequencies of an image (low-pass filtering). Makes the image ‘smoother’. Used in noise reduction. Can be implemented with spatial masks or in the frequency domain. 1/9 VC 17/18 - TP7 - Spatial Filters

Mean filter Gaussian filter VC 17/18 - TP7 - Spatial Filters

VC 17/18 - TP7 - Spatial Filters http://www.michaelbach.de/ot/cog_blureffects/index.html

VC 17/18 - TP7 - Spatial Filters http://www.michaelbach.de/ot/cog_blureffects/index.html

Median Filter Smoothing is averaging (a) Blurs edges (b) Sensitive to outliers (a) (b) Median filtering sort median Sort values around the pixel Select middle value (median) Non-linear (Cannot be implemented with convolution) VC 17/18 - TP7 - Spatial Filters

Salt and pepper noise Gaussian noise 3x3 5x5 7x7 VC 17/18 - TP7 - Spatial Filters

How do we apply our mask to this pixel? Border Problem What a computer sees 1 2 4 How do we apply our mask to this pixel? VC 17/18 - TP7 - Spatial Filters

Border Problem Ignore Pad with constant values Pad with reflection Output image will be smaller than original Pad with constant values Can introduce substantial 1st order derivative values Pad with reflection Can introduce substantial 2nd order derivative values VC 17/18 - TP7 - Spatial Filters

Topic: Frequency domain filtering Spatial filters Frequency domain filtering Edge detection VC 17/18 - TP7 - Spatial Filters

Image Processing in the Fourier Domain Magnitude of the FT Does not look anything like what we have seen VC 17/18 - TP7 - Spatial Filters

Convolution in the Frequency Domain f(x,y) |F(sx,sy)| h(x,y) |H(sx,sy)| g(x,y) |G(sx,sy)| VC 17/18 - TP7 - Spatial Filters

Low-pass Filtering Lets the low frequencies pass and eliminates the high frequencies. Generates image with overall shading, but not much detail VC 17/18 - TP7 - Spatial Filters

High-pass Filtering Lets through the high frequencies (the detail), but eliminates the low frequencies (the overall shape). It acts like an edge enhancer. VC 17/18 - TP7 - Spatial Filters

Boosting High Frequencies VC 17/18 - TP7 - Spatial Filters

VC 17/18 - TP7 - Spatial Filters

VC 17/18 - TP7 - Spatial Filters

An ideal low-pass filter causes ‘rings’ in the spatial domain! The Ringing Effect An ideal low-pass filter causes ‘rings’ in the spatial domain! http://homepages.inf.ed.ac.uk/rbf/HIPR2/freqfilt.htm VC 17/18 - TP7 - Spatial Filters

Topic: Edge detection Spatial filters Frequency domain filtering VC 17/18 - TP7 - Spatial Filters

Edge Detection Convert a 2D image into a set of curves Extracts salient features of the scene More compact than pixels VC 17/18 - TP7 - Spatial Filters

Origin of Edges Edges are caused by a variety of factors surface normal discontinuity depth discontinuity surface color discontinuity illumination discontinuity Edges are caused by a variety of factors VC 17/18 - TP7 - Spatial Filters

How can you tell that a pixel is on an edge? VC 17/18 - TP7 - Spatial Filters

Edge Types Step Edges Roof Edge Line Edges VC 17/18 - TP7 - Spatial Filters

Real Edges Noisy and Discrete! We want an Edge Operator that produces: Edge Magnitude Edge Orientation High Detection Rate and Good Localization VC 17/18 - TP7 - Spatial Filters

Gradient Gradient equation: Represents direction of most rapid change in intensity Gradient direction: The edge strength is given by the gradient magnitude VC 17/18 - TP7 - Spatial Filters

Theory of Edge Detection Ideal edge Unit step function: Image intensity (brightness): VC 17/18 - TP7 - Spatial Filters

Theory of Edge Detection Partial derivatives (gradients): Squared gradient: Edge Magnitude: Edge Orientation: Rotationally symmetric, non-linear operator (normal of the edge) VC 17/18 - TP7 - Spatial Filters

Theory of Edge Detection Laplacian: Rotationally symmetric, linear operator zero-crossing VC 17/18 - TP7 - Spatial Filters

Discrete Edge Operators How can we differentiate a discrete image? Finite difference approximations: Convolution masks : VC 17/18 - TP7 - Spatial Filters

Discrete Edge Operators Second order partial derivatives: Laplacian : Convolution masks : or (more accurate) VC 17/18 - TP7 - Spatial Filters

The Sobel Operators Better approximations of the gradients exist The Sobel operators below are commonly used -1 1 -2 2 1 2 -1 -2 VC 17/18 - TP7 - Spatial Filters

Comparing Edge Operators Good Localization Noise Sensitive Poor Detection Gradient: Roberts (2 x 2): 1 -1 1 -1 Sobel (3 x 3): -1 1 -2 2 1 2 -1 -2 Sobel (5 x 5): -1 -2 2 1 -3 3 -5 5 1 2 3 5 -2 -3 -5 -1 Poor Localization Less Noise Sensitive Good Detection VC 17/18 - TP7 - Spatial Filters

Effects of Noise Consider a single row or column of the image Plotting intensity as a function of position gives a signal Where is the edge?? VC 17/18 - TP7 - Spatial Filters

Solution: Smooth First Where is the edge? Look for peaks in VC 17/18 - TP7 - Spatial Filters

Derivative Theorem of Convolution …saves us one operation. VC 17/18 - TP7 - Spatial Filters

Laplacian of Gaussian (LoG) Laplacian of Gaussian operator Where is the edge? Zero-crossings of bottom graph ! VC 17/18 - TP7 - Spatial Filters

2D Gaussian Edge Operators Derivative of Gaussian (DoG) Laplacian of Gaussian Gaussian Mexican Hat (Sombrero) is the Laplacian operator: VC 17/18 - TP7 - Spatial Filters

Canny Edge Operator Smooth image I with 2D Gaussian: Find local edge normal directions for each pixel Compute edge magnitudes Locate edges by finding zero-crossings along the edge normal directions (non-maximum suppression) VC 17/18 - TP7 - Spatial Filters

Non-maximum Suppression Check if pixel is local maximum along gradient direction requires checking interpolated pixels p and r VC 17/18 - TP7 - Spatial Filters

original image VC 17/18 - TP7 - Spatial Filters

magnitude of the gradient VC 17/18 - TP7 - Spatial Filters

After non-maximum suppression VC 17/18 - TP7 - Spatial Filters After non-maximum suppression

Canny Edge Operator The choice of depends on desired behavior original Canny with Canny with The choice of depends on desired behavior large detects large scale edges small detects fine features VC 17/18 - TP7 - Spatial Filters

Difference of Gaussians (DoG) Laplacian of Gaussian can be approximated by the difference between two different Gaussians VC 17/18 - TP7 - Spatial Filters

DoG Edge Detection (a) (b) (b)-(a) VC 17/18 - TP7 - Spatial Filters

Unsharp Masking – = + a = VC 17/18 - TP7 - Spatial Filters

Resources Gonzalez & Woods – Chapter 3 VC 17/18 - TP7 - Spatial Filters