1 / 44

Templates, Image Pyramids, and Filter Banks

09/19/11. Templates, Image Pyramids, and Filter Banks. Computer Vision James Hays, Brown. Slides: Hoiem and others. Review. Match the spatial domain image to the Fourier magnitude image. 2. 3. 1. 4. 5. B. C. E. A. D. Slide: Hoiem. Reminder . Project 1 due in one week.

bcartwright
Download Presentation

Templates, Image Pyramids, and Filter Banks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Reminder • Project 1 due in one week

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

  5. 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

  6. Matching with filters • Goal: find in image • Method 0: filter the image with eye patch f = image g = filter What went wrong? Filtered Image Input Slide: Hoiem

  7. Matching with filters • Goal: find in image • Method 1: filter the image with zero-mean eye mean of f True detections False detections Thresholded Image Filtered Image (scaled) Input Slide: Hoiem

  8. Matching with filters • Goal: find in image • Method 2: SSD True detections Thresholded Image 1- sqrt(SSD) Input Slide: Hoiem

  9. Matching with filters What’s the potential downside of SSD? • Goal: find in image • Method 2: SSD 1- sqrt(SSD) Input Slide: Hoiem

  10. Matching with filters • Goal: find in image • Method 3: Normalized cross-correlation mean template mean image patch Matlab: normxcorr2(template, im) Slide: Hoiem

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

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

  13. 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

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

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

  16. Gaussian pyramid Source: Forsyth

  17. 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

  18. 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

  19. Laplacian filter unit impulse Gaussian Laplacian of Gaussian Source: Lazebnik

  20. 2D edge detection filters Laplacian of Gaussian is the Laplacian operator: Gaussian derivative of Gaussian

  21. Laplacian pyramid Source: Forsyth

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

  23. Hybrid Image Slide: Hoiem

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

  25. 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

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

  27. Denoising Gaussian Filter Additive Gaussian Noise Slide: Hoiem

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

  29. Reducing salt-and-pepper noise by Gaussian smoothing 3x3 5x5 7x7

  30. Alternative idea: Median filtering • A median filter operates over a window by selecting the median intensity in the window • Is median filtering linear? Source: K. Grauman

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

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

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

  34. 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

  35. Review of last three days

  36. Review: Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz

  37. Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz

  38. Image filtering 1 1 1 1 1 1 1 1 1 Credit: S. Seitz

  39. Filtering in spatial domain 1 0 -1 2 0 -2 1 0 -1 * =

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

  41. 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

  42. Review of Last 3 Days • Derivative of Gaussian Slide: Hoiem

  43. 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

  44. Next Lectures • Machine Learning Crash Course

More Related