1 / 63

Image Filtering

02/02/10. Image Filtering. Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem. Questions about HW 1?. Questions about class?. Room change starting thursday : Everitt 163, same time. Key ideas from last class. Lighting Ambiguity between light source and albedo

Télécharger la présentation

Image Filtering

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. 02/02/10 Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem

  2. Questions about HW 1?

  3. Questions about class? • Room change starting thursday: Everitt 163, same time

  4. Key ideas from last class • Lighting • Ambiguity between light source and albedo • Shading is a strong cue for shape • Interreflections, multiple sources, ambient light, etc. make lighting and shadows complicated • Color constancy • Color can be rebalanced by making assumptions (e.g., average pixel is gray)

  5. Lightness Perception from Ted Adelson

  6. Lightness Perception from Ted Adelson

  7. By nickwheeleroz, on Flickr

  8. By nickwheeleroz, on Flickr

  9. Karsch et al. in review

  10. Today’s class • How can we represent color? • What is image filtering and how do we do it? • What are some useful filters and what do they do? • What is linear separability? • Thinking in the frequency domain

  11. Color spaces • How can we represent color? http://en.wikipedia.org/wiki/File:RGB_illumination.jpg

  12. Color spaces: RGB 0,1,0 • Some drawbacks • Strongly correlated channels • Non-perceptual 1,0,0 0,0,1 Image from: http://en.wikipedia.org/wiki/File:RGB_color_solid_cube.png

  13. Color spaces: HSV

  14. Color spaces: L*a*b* “Perceptually uniform” color space

  15. If you had to choose, would you rather go without luminance or chrominance?

  16. If you had to choose, would you rather go without luminance or chrominance?

  17. Most information in intensity Only color shown – constant intensity

  18. Most information in intensity Only intensity shown – constant color

  19. Most information in intensity Original image

  20. The raster image (pixel matrix)

  21. The raster image (pixel matrix)

  22. Image filtering • Image filtering: compute function of local neighborhood at each position • Why bother? • Modify images • Denoise, resize, enhance contrast, etc. • Extract information from images • Edge detection, matching, find distinctive points, etc.

  23. Example: box filter 1 1 1 1 1 1 1 1 1 Slide credit: David Lowe (UBC)

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

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

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

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

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

  29. Image filtering Q? 1 1 1 1 1 1 1 1 1 Credit: S. Seitz

  30. Box Filter 1 1 1 1 1 1 1 1 1 • What does it do? • Replaces each pixel with an average of its neighborhood • Achieve smoothing effect (remove sharp features) Slide credit: David Lowe (UBC)

  31. Smoothing with box filter

  32. Practice with linear filters 0 0 0 0 1 0 0 0 0 ? Original Source: D. Lowe

  33. Practice with linear filters 0 0 0 0 1 0 0 0 0 Original Filtered (no change) Source: D. Lowe

  34. Practice with linear filters 0 0 0 0 0 1 0 0 0 ? Original Source: D. Lowe

  35. Practice with linear filters 0 0 0 0 0 1 0 0 0 Original Shifted left By 1 pixel Source: D. Lowe

  36. Practice with linear filters 0 1 0 1 0 1 1 0 2 1 0 1 1 0 1 0 0 1 - ? (Note that filter sums to 1) Original Source: D. Lowe

  37. Practice with linear filters 0 1 0 1 0 1 1 0 2 1 0 1 1 0 1 0 0 1 - Original • Sharpening filter • Accentuates differences with local average Source: D. Lowe

  38. Sharpening Source: D. Lowe

  39. Other filters 1 0 -1 2 0 -2 1 0 -1 Sobel Vertical Edge (absolute value)

  40. Other filters Q? 1 2 1 0 0 0 -1 -2 -1 Sobel Horizontal Edge (absolute value)

  41. Filtering vs. Convolution • 2d filtering • h=filter2(f,g); or h=imfilter(f,g); • 2d convolution • h=conv2(f,g);

  42. Key properties of linear filters • Linearity: filter(f1 + f2 ) = filter(f1) + filter(f2) • Shift invariance: same behavior regardless of pixel location: filter(shift(f)) = shift(filter(f)) • Any linear shift-invariant operator can be represented as a convolution Source: S. Lazebnik

  43. More properties • Commutative: a * b = b * a • Conceptually no difference between filter and signal • Associative: a * (b * c) = (a * b) * c • Often apply several filters one after another: (((a * b1) * b2) * b3) • This is equivalent to applying one filter: a * (b1 * b2 * b3) • Distributes over addition: a * (b + c) = (a * b) + (a * c) • Scalars factor out: ka * b = a * kb = k (a * b) • Identity: unit impulse e = [0, 0, 1, 0, 0],a * e = a Source: S. Lazebnik

  44. Important filter: Gaussian • Weight contributions of neighboring pixels by nearness 0.003 0.013 0.022 0.013 0.003 0.013 0.059 0.097 0.059 0.013 0.022 0.097 0.159 0.097 0.022 0.013 0.059 0.097 0.059 0.013 0.003 0.013 0.022 0.013 0.003 5 x 5,  = 1 Slide credit: Christopher Rasmussen

  45. Gaussian filters • Remove “high-frequency” components from the image (low-pass filter) • Convolution with self is another Gaussian • So can smooth with small-width kernel, repeat, and get same result as larger-width kernel would have • Convolving two times with Gaussian kernel of width σ is same as convolving once with kernel of width σ√2 • Separable kernel • Factors into product of two 1D Gaussians Source: K. Grauman

  46. Separability of the Gaussian filter Source: D. Lowe

  47. Separability example * = = * 2D convolution(center location only) The filter factorsinto a product of 1Dfilters: Perform convolutionalong rows: Followed by convolutionalong the remaining column: Source: K. Grauman

  48. Separability • Why is separability useful in practice?

  49. Smoothing with Gaussian filter

  50. Smoothing with box filter

More Related