image processing i
play

Image Processing I Computer Vision Fall 2018 Columbia University - PowerPoint PPT Presentation

Image Processing I Computer Vision Fall 2018 Columbia University Homework 1 Posted online today Due September 24 before class starts Turn in PDF and your code online Office Hours Carl: Monday 4:30pm to 5:30pm, CSB 502 Oscar:


  1. Image Processing I Computer Vision Fall 2018 Columbia University

  2. Homework 1 • Posted online today • Due September 24 before class starts • Turn in PDF and your code online

  3. Office Hours • Carl: Monday 4:30pm to 5:30pm, CSB 502 • Oscar: Thursday 3-4pm, Mudd 500 • Xiaoning: Monday, 5-6pm, CS TA Room • Bo: Tuesday, 3-4pm, CS TA Room • James: Thursday 12-1pm, CS TA Room • Luc: Tuesday 4-5pm, CS TA Room

  4. Image Formation Object Film Slide credit: Steve Seitz

  5. Image Formation Object Barrier Film Add a barrier to block off most of the rays Slide credit: Steve Seitz

  6. Image denoising Slide credit: S. Lazebnik

  7. Average many photos! Time Slide credit: S. Lazebnik

  8. What if just one? Slide credit: S. Lazebnik

  9. Reminder: Images as Functions F [ x , y ]

  10. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  11. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  12. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  13. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  14. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  15. Moving Average F [ x , y ] 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 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 Source: S. Seitz

  16. Moving Average F [ x , y ] 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 0 0 90 90 90 90 90 0 0 0 20 30 50 50 60 40 20 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 Source: S. Seitz

  17. Filtering Filter Output Image Input Image We want to remove unwanted sources of variation, and keep the information relevant for whatever task we need to solve Source: Bill Freeman

  18. Linear Filtering Filter Output Image Input Image For a filter to be linear, it must satisfy two properties: • filter(im, f1 + f2) = filter(im, f1) + filter(im, f2) • C * filter(im, f1) = filter(im, C * f1) Source: Bill Freeman

  19. Convolution F [ x , y ] 0 0 0 0 0 0 0 0 0 0 G [ x , y ] 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 1 1 1 0 30 60 90 90 90 60 30 1 * 0 0 0 90 90 90 90 90 0 0 0 30 50 80 80 90 60 30 1 1 1 0 0 0 90 0 90 90 90 0 0 0 30 50 80 80 90 60 30 9 1 1 1 0 0 0 90 90 90 90 90 0 0 0 20 30 50 50 60 40 20 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

  20. Convolution • Let f be an image/function, and g is the kernel/filter • The convolution is defined as: ( f * g )[ x , y ] = ∑ f [ x − i , y − j ] g [ i , j ] i , j

  21. Convolution ( f * g )[ x , y ] = ∑ f [ x − i , y − j ] g [ i , j ] i , j g f

  22. Convolution ( f * g )[ x , y ] = ∑ f [ x − i , y − j ] g [ i , j ] i , j g Flip LR, UD f

  23. Convolution Practice 0 0 0 ? 0 1 0 0 0 0 Source: D. Lowe

  24. Convolution Practice 0 0 0 0 1 0 0 0 0 Source: D. Lowe

  25. Convolution Practice 0 0 0 ? 0 0 1 0 0 0 Source: D. Lowe

  26. Convolution Practice Translation Filter 0 0 0 0 0 1 0 0 0 Source: D. Lowe

  27. Convolution Practice 1 1 1 ? 1 1 1 1 9 1 1 1 Source: D. Lowe

  28. Convolution Practice Blur Filter 1 1 1 1 1 1 1 9 1 1 1 Source: D. Lowe

  29. Convolution Practice ? Source: D. Lowe

  30. Convolution Practice 0 0 0 1 1 1 ? − 1 0 2 0 1 1 1 9 0 0 0 1 1 1 Source: D. Lowe

  31. Convolution Practice Sharpening Filter 0 0 0 1 1 1 − 1 0 2 0 1 1 1 9 0 0 0 1 1 1 Source: D. Lowe

  32. Sharpening Source: D. Lowe

  33. Sharpening - = Image Blurred Detail + = Image Detail Sharpened

  34. Convolution Properties Commutative: F ∗ H = H ∗ F Associative: ( F ∗ H ) ∗ G = F ∗ ( H ∗ G ) Distributive: ( F ∗ G ) + ( H ∗ G ) = ( F + H ) ∗ G

  35. Convolution Properties Scale: filter(A * f) = A * filter(f) Shift Invariance: filter(shift(f)) = shift(filter(f))

  36. Cross-Correlation • Conceptually simpler, but not as nice properties: ( f * g )[ x , y ] = ∑ f [ x + i , y + j ] g [ i , j ] i , j g f

  37. Boundary Issues full same valid g g g g g g f f f g g g g g g Slide credit: S. Lazebnik

  38. Border Padding Zero Pad Circular Replicate Symmetric

  39. Box Filter

  40. Gaussian Filter

  41. Gaussian Filter 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 Constant factor at front makes volume sum to unity Source: C. Rasmussen

  42. Standard Deviation σ = 2 with σ = 5 with 30 x 30 30 x 30 kernel kernel Standard deviation σ : determines extent of smoothing Source: K Grauman

  43. Changing Sigma

  44. Kernel Width The Gaussian function has infinite support, but discrete filters use finite kernels Rule of thumb: set filter half-width to about 3 σ Source: K Grauman

  45. Complexity What is the complexity of filtering an n × n image with an m × m kernel?

  46. Complexity What is the complexity of filtering an n × n image with an m × m kernel? O(n 2 m 2 )

  47. Separable Convolution Two dimensional Gaussian is product of two Gaussians: 2 πσ 2 exp ( − x 2 + y 2 ) 1 G ( x , y ) = 2 σ 2 exp ( − x 2 exp ( − y 2 2 σ 2 ) 2 σ 2 ) 1 1 = 2 πσ 2 πσ Take advantage of associativity: f = f * * *

  48. Complexity What is the complexity of filtering an n × n image with an m × m kernel? O(n 2 m 2 ) What if kernel is separable?

  49. Complexity What is the complexity of filtering an n × n image with an m × m kernel? O(n 2 m 2 ) What if kernel is separable? O(n 2 m)

  50. Denoising Additive Gaussian Noise Gaussian Filter (sigma=1)

  51. What’s wrong? Salt and Pepper Noise Gaussian Filter (sigma=1)

  52. 
 
 
 
 
 
 Median Filter • A median filter operates over a window by selecting the median intensity in the window 
 Is median filtering linear? Source: Kristen Grauman

  53. Why use median? Source: Kristen Grauman

  54. What’s wrong? Salt and Pepper Noise Median Filter 3x3

  55. Median Filtering Median 3x3 Median 5x5 Median 9x9

  56. Image Gradients

  57. Image Gradients How does intensity change as you move left to right? How do you take the derivative of an image?

  58. First Derivative ∂ I * [ − 1,1] = ∂ x ∂ I * [ − 1,1] T = ∂ y

  59. Second Derivative ∂ 2 I * [ − 1,1] = ∂ x 2 ∂ 2 I * [ − 1,1] T = ∂ y 2

  60. Image Gradients Source: Seitz and Szeliski

  61. What causes an edge? Source: G Hager

  62. What causes an edge? Surface normal discontinuities Source: G Hager

  63. What causes an edge? Boundaries of material properties Source: G Hager

  64. What causes an edge? Boundaries of material properties Source: G Hager

  65. What causes an edge? Boundaries of lighting Source: G Hager

  66. Edge Types Source: G Hager

  67. What is an edge? Source: G Hager

  68. What about noise? Source: G Hager

Recommend


More recommend