Templates, Image Pyramids, and Filter Banks

Slides:



Advertisements
Similar presentations
CSCE 643 Computer Vision: Template Matching, Image Pyramids and Denoising Jinxiang Chai.
Advertisements

Lecture 2: Convolution and edge detection CS4670: Computer Vision Noah Snavely From Sandlot ScienceSandlot Science.
Spatial Filtering (Chapter 3)
Motion illusion, rotating snakes. Slide credit Fei Fei Li.
Ted Adelson’s checkerboard illusion. Motion illusion, rotating snakes.
CS 691 Computational Photography
CS 4487/9587 Algorithms for Image Analysis
Computational Photography CSE 590 Tamara Berg Filtering & Pyramids.
Digital Image Processing In The Name Of God Digital Image Processing Lecture3: Image enhancement M. Ghelich Oghli By: M. Ghelich Oghli
Templates, Image Pyramids, and Filter Banks Slides largely from Derek Hoeim, Univ. of Illinois.
Templates and Image Pyramids Computational Photography Derek Hoiem, University of Illinois 09/06/11.
1 Image filtering Hybrid Images, Oliva et al.,
Computer Vision - A Modern Approach
Texture Reading: Chapter 9 (skip 9.4) Key issue: How do we represent texture? Topics: –Texture segmentation –Texture-based matching –Texture synthesis.
15-463: Computational Photography Alexei Efros, CMU, Fall 2011 Many slides from Steve Marschner Sampling and Reconstruction.
1 Image filtering
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
Convolution and Edge Detection : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz.
Templates, Image Pyramids, and Filter Banks Computer Vision James Hays, Brown Slides: Hoiem and others.
Linear filtering.
Edge Detection Today’s readings Cipolla and Gee –supplemental: Forsyth, chapter 9Forsyth Watt, From Sandlot ScienceSandlot Science.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
ECE 472/572 - Digital Image Processing Lecture 4 - Image Enhancement - Spatial Filter 09/06/11.
CSC589 Introduction to Computer Vision Lecture 9 Sampling, Gaussian Pyramid Bei Xiao.
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5409 T-R 10:30am – 11:50am.
2D Image Fourier Spectrum.
Computer Vision – Lecture 3
Applications of Image Filters Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/04/10.
Templates, Image Pyramids, and Filter Banks Computer Vision Derek Hoiem, University of Illinois 01/31/12.
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008.
Edge Detection Computer Vision (CS 543 / ECE 549) University of Illinois Derek Hoiem 02/02/12 Many slides from Lana Lazebnik, Steve Seitz, David Forsyth,
Local invariant features Cordelia Schmid INRIA, Grenoble.
CS 1699: Intro to Computer Vision Texture and Other Uses of Filters Prof. Adriana Kovashka University of Pittsburgh September 10, 2015 Slides from Kristen.
Templates, Image Pyramids, and Filter Banks
Templates and Image Pyramids Computational Photography Derek Hoiem, University of Illinois 09/03/15.
Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/02/10.
Why is computer vision difficult?
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm – 4:20pm.
Linear filtering. Motivation: Noise reduction Given a camera and a still scene, how can you reduce noise? Take lots of images and average them! What’s.
Machine Vision ENT 273 Image Filters Hema C.R. Lecture 5.
COMP322/S2000/L171 Robot Vision System Major Phases in Robot Vision Systems: A. Data (image) acquisition –Illumination, i.e. lighting consideration –Lenses,
Recap of Monday linear Filtering convolution differential filters filter types boundary conditions.
Edges.
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.
2D Image Fourier Spectrum.
Pixels and Image Filtering Computational Photography Derek Hoiem 08/26/10 Graphic:
Lecture 5: Fourier and Pyramids
Linear filtering. Motivation: Image denoising How can we reduce noise in a photograph?
Lecture 8: Edges and Feature Detection
CSE 185 Introduction to Computer Vision Image Filtering: Spatial Domain.
Grauman Today: Image Filters Smooth/Sharpen Images... Find edges... Find waldo…
Non-linear filtering Example: Median filter Replaces pixel value by median value over neighborhood Generates no new gray levels.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Filtering in Spatial domain
Miguel Tavares Coimbra
Prof. Adriana Kovashka University of Pittsburgh September 14, 2016
Program Studi S-1 Teknik Informatika FMIPA Universitas Padjadjaran
Sampling, Template Matching and Pyramids
CS 4501: Introduction to Computer Vision Sparse Feature Detectors: Harris Corner, Difference of Gaussian Connelly Barnes Slides from Jason Lawrence, Fei.
Linear Filters T-11 Computer Vision University of Houston
Image Pyramids and Applications
Convolution.
Image gradients and edges
Computer Vision Jia-Bin Huang, Virginia Tech
Sampling and Reconstruction
Motion illusion, rotating snakes
Digital Image Processing Week IV
Lecture 4 Image Enhancement in Frequency Domain
Convolution.
Templates and Image Pyramids
Presentation transcript:

Templates, Image Pyramids, and Filter Banks 09/19/11 Computer Vision James Hays, Brown Slides: Hoiem and others

Review Match the spatial domain image to the Fourier magnitude image 2 1 3 4 5 B 1 - D 2 – B 3 – A 4 - E 5 - C C E A D Slide: Hoiem

Reminder Project 1 due in one week

Today’s class Template matching Image Pyramids Filter banks and texture Denoising, Compression

Template matching Goal: find in image Main challenge: What is a good similarity or distance measure between two patches? Correlation Zero-mean correlation Sum Square Difference Normalized Cross Correlation Slide: Hoiem

Matching with filters Goal: find in image Method 0: filter the image with eye patch f = image g = filter Problem: response is stronger for higher intensity What went wrong? Input Filtered Image Slide: Hoiem

Matching with filters Goal: find in image Method 1: filter the image with zero-mean eye mean of f True detections Likes bright pixels where filters are above average, dark pixels where filters are below average. Problems: response is sensitive to gain/contrast, pixels in filter that are near the mean have little effect, does not require pixel values in image to be near or proportional to values in filter. False detections Input Filtered Image (scaled) Thresholded Image Slide: Hoiem

Matching with filters Goal: find in image Method 2: SSD True detections Problem: SSD sensitive to average intensity Input 1- sqrt(SSD) Thresholded Image Slide: Hoiem

Matching with filters Can SSD be implemented with linear filters?

What’s the potential downside of SSD? Matching with filters What’s the potential downside of SSD? Goal: find in image Method 2: SSD Problem: SSD sensitive to average intensity Input 1- sqrt(SSD) Slide: Hoiem

Matching with filters Goal: find in image Method 3: Normalized cross-correlation mean template mean image patch Invariant to mean and scale of intensity Matlab: normxcorr2(template, im) Slide: Hoiem

Matching with filters Goal: find in image Method 3: Normalized cross-correlation True detections Input Thresholded Image Normalized X-Correlation Slide: Hoiem

Matching with filters Goal: find in image Method 3: Normalized cross-correlation True detections Input Thresholded Image Normalized X-Correlation Slide: Hoiem

Q: What is the best method to use? A: Depends SSD: faster, sensitive to overall intensity Normalized cross-correlation: slower, invariant to local average intensity and contrast

Q: What if we want to find larger or smaller eyes? A: Image Pyramid

Low-Pass Filtered Image Review of Sampling Gaussian Filter Sample Image Low-Pass Filtered Image Low-Res Image Slide: Hoiem

Gaussian pyramid Source: Forsyth

Template Matching with Image Pyramids Input: Image, Template Match template at current scale Downsample image Repeat 1-2 until image is very small Take responses above some threshold, perhaps with non-maxima suppression Slide: Hoiem

Coarse-to-fine Image Registration Compute Gaussian pyramid Align with coarse pyramid Successively align with finer pyramids Search smaller range Why is this faster? Are we guaranteed to get the same result? Slide: Hoiem

Laplacian filter unit impulse Gaussian Laplacian of Gaussian Source: Lazebnik

2D edge detection filters Laplacian of Gaussian Gaussian derivative of Gaussian How many 2nd derivative filters are there? There are four 2nd partial derivative filters. In practice, it’s handy to define a single 2nd derivative filter—the Laplacian is the Laplacian operator:

Laplacian pyramid Source: Forsyth

Computing Gaussian/Laplacian Pyramid Can we reconstruct the original from the laplacian pyramid? http://sepwww.stanford.edu/~morgan/texturematch/paper_html/node3.html

Perception Why do we get different, distance-dependent interpretations of hybrid images? ? Slide: Hoiem

Hybrid Image Slide: Hoiem

Hybrid Image in Laplacian Pyramid High frequency  Low frequency Slide: Hoiem

Question Can you align the images using the FFT?

Image representation Pixels: great for spatial resolution, poor access to frequency Fourier transform: great for frequency, not for spatial info Pyramids/filter banks: balance between spatial and frequency information Slide: Hoiem

Major uses of image pyramids Compression Object detection Scale search Features Detecting stable interest points Registration Course-to-fine Slide: Hoiem

Denoising Gaussian Filter Additive Gaussian Noise Slide: Hoiem

Reducing Gaussian noise Smoothing with larger standard deviations suppresses noise, but also blurs the image Source: S. Lazebnik

Reducing salt-and-pepper noise by Gaussian smoothing 3x3 5x5 7x7 What’s wrong with these results?

Alternative idea: Median filtering A median filter operates over a window by selecting the median intensity in the window Better at salt’n’pepper noise Not convolution: try a region with 1’s and a 2, and then 1’s and a 3 Is median filtering linear? Source: K. Grauman

Median filter What advantage does median filtering have over Gaussian filtering? Robustness to outliers Source: K. Grauman

Salt-and-pepper noise Median filter Salt-and-pepper noise Median filtered MATLAB: medfilt2(image, [h w]) Source: M. Hebert

Median vs. Gaussian filtering 3x3 5x5 7x7 Gaussian Median

Other non-linear filters Weighted median (pixels further from center count less) Clipped mean (average, ignoring few brightest and darkest pixels) Bilateral filtering (weight by spatial distance and intensity difference) Bilateral filtering Image: http://vision.ai.uiuc.edu/?p=1455

Review of last three days

Review: Image filtering 1 90 90 ones, divide by 9 Credit: S. Seitz

Image filtering 1 90 90 10 ones, divide by 9 Credit: S. Seitz

Image filtering 1 90 90 10 20 ones, divide by 9 Credit: S. Seitz

Filtering in spatial domain -1 1 -2 2 * =

Filtering in frequency domain FFT FFT = Inverse FFT Slide: Hoiem

Review of Last 3 Days Filtering in spatial domain Slide filter over image and take dot product at each position Remember linearity (for linear filters) Examples 1D: [-1 0 1], [0 0 0 0 0.5 1 1 1 0.5 0 0 0] 1D: [0.25 0.5 0.25], [0 0 0 0 0.5 1 1 1 0.5 0 0 0] 2D: [1 0 0 ; 0 2 0 ; 0 0 1]/4

Review of Last 3 Days Filtering in frequency domain Can be faster than filtering in spatial domain (for large filters) Can help understand effect of filter Algorithm: Convert image and filter to fft (fft2 in matlab) Pointwise-multiply ffts Convert result to spatial domain with ifft2

Review of Last 3 Days Linear filters for basic processing Edge filter (high-pass) Gaussian filter (low-pass) [-1 1] Gaussian FFT of Gradient Filter FFT of Gaussian Slide: Hoiem

Review of Last 3 Days Derivative of Gaussian Slide: Hoiem

Review of Last 3 Days Applications of filters Template matching (SSD or Normxcorr2) SSD can be done with linear filters, is sensitive to overall intensity Gaussian pyramid Coarse-to-fine search, multi-scale detection Laplacian pyramid More compact image representation Can be used for compositing in graphics Downsampling Need to sufficiently low-pass before downsampling

Next Lectures Machine Learning Crash Course