cse 152 computer vision
play

CSE 152: Computer Vision Hao Su Filters and Features Diffuse - PowerPoint PPT Presentation

CSE 152: Computer Vision Hao Su Filters and Features Diffuse reflection: Lamberts cosine law Intensity does not depend on viewer angle. Amount of reflected light proportional to cos( ) Visible solid angle also proportional to cos(


  1. CSE 152: Computer Vision Hao Su Filters and Features

  2. Diffuse reflection: Lambert’s cosine law Intensity does not depend on viewer angle. – Amount of reflected light proportional to cos( 𝜄 ) – Visible solid angle also proportional to cos( 𝜄 )

  3. Intensity and Surface Orientation Intensity depends on illumination angle because less light comes in at oblique angles. 𝜍 = albedo 𝑻 = directional source 𝑶 = surface normal reflected intensity I = 𝐽 ( 𝑦 ) = 𝜍 ( 𝑦 ) ( 𝑻 ⋅ 𝑶 ( 𝑦 ) ) Slide: Forsyth

  4. Perception of Intensity from Ted Adelson

  5. Perception of Intensity from Ted Adelson

  6. Darkness = Large Difference in Neighboring Pixels

  7. Why should we care? Input Smoothing Sharpening https://en.wikipedia.org/wiki/Albert_Einstein_in_popular_culture#/media/ File:Einstein_tongue.jpg

  8. Why should we care? Image interpolation/resampling Image Pyramid Source: D Forsyth Source: N Snavely

  9. Why should we care? LM filter bank. Code here Representing textures with filter banks

  10. The raster image (pixel matrix) 0.92 0.93 0.94 0.97 0.62 0.37 0.85 0.97 0.93 0.92 0.99 0.95 0.89 0.82 0.89 0.56 0.31 0.75 0.92 0.81 0.95 0.91 0.89 0.72 0.51 0.55 0.51 0.42 0.57 0.41 0.49 0.91 0.92 0.96 0.95 0.88 0.94 0.56 0.46 0.91 0.87 0.90 0.97 0.95 0.71 0.81 0.81 0.87 0.57 0.37 0.80 0.88 0.89 0.79 0.85 0.49 0.62 0.60 0.58 0.50 0.60 0.58 0.50 0.61 0.45 0.33 0.86 0.84 0.74 0.58 0.51 0.39 0.73 0.92 0.91 0.49 0.74 0.96 0.67 0.54 0.85 0.48 0.37 0.88 0.90 0.94 0.82 0.93 0.69 0.49 0.56 0.66 0.43 0.42 0.77 0.73 0.71 0.90 0.99 0.79 0.73 0.90 0.67 0.33 0.61 0.69 0.79 0.73 0.93 0.97 0.91 0.94 0.89 0.49 0.41 0.78 0.78 0.77 0.89 0.99 0.93

  11. Image filtering • For each pixel, compute function of local neighborhood and output a new value • Same function applied at each position • Output and input image are typically the same size 10 5 3 Some function 4 5 1 7 1 1 7 Local image data Modified image data Slide Credit: L. Zhang

  12. Image filtering • Linear filtering • function is a weighted sum/difference of pixel values 10 5 3 0 0 0 4 6 1 0 0.5 0 8 1 1 8 0 1 0.5 • Really important! Local image kernel Modified image data data • Enhance images • Denoise, smooth, increase contrast, etc. • Extract information from images • Texture, edges, distinctive points, etc. • Detect patterns • Template matching Slide credit: Derek Hoiem

  13. Question: Noise reduction • Given a camera and a still scene, how can you reduce noise? Take lots of images and average them! What’s the next best thing? Source: S. Seitz

  14. First attempt at a solution •Let’s replace each pixel with an average of all the values in its neighborhood •Assumptions: • Expect pixels to be like their neighbors • Expect noise processes to be independent from pixel to pixel Slide credit: Kristen Grauman

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

  16. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  17. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 0 0 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  18. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 0 0 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  19. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 0 0 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  20. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  21. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 ? 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  22. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 ? 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 50 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

  23. Image filtering 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 20 10 0 0 0 90 90 90 90 90 0 0 0 20 40 60 60 60 40 20 0 0 0 90 90 90 90 90 0 0 0 30 60 90 90 90 60 30 0 0 0 90 90 90 90 90 0 0 0 30 50 80 80 90 60 30 0 0 0 90 0 90 90 90 0 0 0 30 50 80 80 90 60 30 0 20 30 50 50 60 40 20 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 30 20 10 0 0 90 0 0 0 0 0 0 0 10 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Credit: S. Seitz

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

  25. Smoothing with box filter James Hays

  26. Properties of smoothing filters • Smoothing • Values positive • Sum to 1 � constant regions same as input • Amount of smoothing proportional to mask size • Remove “high-frequency” components; “low-pass” filter Slide credit: Kristen Grauman

  27. Correlation filtering Say the averaging window size is 2k+1 x 2k+1: Attribute Loop over all pixels in uniform weight neighborhood around image to each pixel pixel F[i,j] Now generalize to allow different weights depending on neighboring pixel’s relative position: Non-uniform weights Slide credit: Kristen Grauman

  28. Correlation filtering This is called cross-correlation, denoted Filtering an image: replace each pixel with a linear combination of its neighbors. The filter “kernel” or “mask” H [ u,v ] is the prescription for the weights in the linear combination. Slide credit: Kristen Grauman

  29. Filtering an impulse signal What is the result of filtering the impulse signal (image) F with the arbitrary kernel H ? 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ? a b c 0 0 0 0 0 0 0 d e f 0 0 0 1 0 0 0 g h i 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Slide credit: Kristen Grauman

  30. Convolution • Convolution: • Flip the filter in both dimensions (bottom to top, right to left) • Then apply cross-correlation F H Notation for convolution operator Slide credit: Kristen Grauman

Recommend


More recommend