digital photography ii
play

Digital Photography II The Image Processing Pipeline EE367/CS448I: - PowerPoint PPT Presentation

Digital Photography II The Image Processing Pipeline EE367/CS448I: Computational Imaging and Display stanford.edu/class/ee367 Lecture 4 Gordon Wetzstein Stanford University Review Sensors are Buckets collect photons integrate


  1. Digital Photography II The Image Processing Pipeline EE367/CS448I: Computational Imaging and Display stanford.edu/class/ee367 Lecture 4 Gordon Wetzstein Stanford University

  2. Review – “Sensors are Buckets” collect photons integrate spectrum integrate incident like a bucket directions

  3. Review – Color Filter Arrays Bayer pattern wikipedia

  4. Image Formation • high-dimensional integration over angle, wavelength, time plenoptic function ( ) ( ) ∫∫∫ ≈ l x , θ , λ , t d θ d λ dt plenoptic function: i x [Adelson 1991] Ω θ , λ , t ( ) ( ) ϕ θ ( ) d θ d λ dt ∫∫∫ = l x , θ , λ , t c λ Ω θ , λ , t spectral sensitivity angle-dependent factor of sensor

  5. More Ways to Capture Color field sequential multiple sensors vertically stacked blue sensor green sensor wikipedia red sensor Foveon X3 Prokudin-Gorsky

  6. More Ways to Capture Color Alim Khahn, Emir of Bukhara, 1911 • Russian chemist and photographer • used Maxwell’s color photography technique (1855) • commissioned by Tsar Nicholas II, photo- documented diversity of Russian empire from 1909-1915 Prokudin-Gorsky • ~3500 negatives

  7. More Ways to Capture Color • notable French inventor • Nobel price for color photography in 1908 = volume emulsion capturing interference • today, this process is most similar to volume holography! Lippmann’s Gabriel Lippmann stuffed parrot • also invented integral imaging (will hear more…)

  8. Three-CCD Camera beam splitter prism Philips / wikipedia

  9. Stacked Sensor Foveon X3 Sigma SD9

  10. Other Wavelengths • OmniVision: RGB + near IR!

  11. Other Wavelengths FLIR Systems • thermal IR • often use Germanium optics (transparent IR) nostril pit organ for IR • sensors don’t use silicon: indium, mercury, lead, etc.

  12. Review: Photons to RAW Image photon fixed pattern additive noise quantization noise noise “noise” RAW image photons amplifier ADC sensor (gain,ISO) (quantization)

  13. Image Processing Pipeline RAW image JPEG image (dcraw –D)

  14. Image Processing Pipeline • • demosaicking white balancing • • denoising linear 10/12 bit to 8 bit gamma • • digital autoexposure compression

  15. Image Processing Pipeline JPEG image RAW image gamut demosaicking denoising compression mapping … … … • dead pixel removal also: • dark frame subtraction (fixed pattern / thermal noise removal) • lens blur / vignetting / distortion correction • sharpening / edge enhancement

  16. Image Processing Pipeline Marc Levoy, CS 448

  17. Image Processing Pipeline Marc Levoy, CS 448

  18. Exif Meta Data exchangeable image file format

  19. Demosaicking (CFA Interpolation) RAW image from Kodac dataset Bayer CFA

  20. Demosaicking (CFA Interpolation) RAW linear interpolation green channel g lin ( x , y ) = 1 ∑ g ( x + m , y + n ) ˆ 4 ( m , n ) ( m , n ) = {(0, − 1),(0,1),( − 1,0),(1,0)} image from Kodac dataset Bayer CFA

  21. Demosaicking (CFA Interpolation) RAW linear interpolation image from Kodac dataset

  22. image from Kodac dataset original Demosaicking (CFA Interpolation) RAW demosaicked

  23. Demosaicing – Low-pass Chroma • sampling problem (despite optical AA filter): (too) high- frequency red/blue information • simple solution: low-pass filter chrominance – humans are most sensitive to “sharpness” in luminance: 1. apply naïve interpolation Y’ 2. convert to Y’CbCr (related to YUV) Cb 3. median filter chroma channels: Cb & Cr Cr 4. convert back to RGB

  24. Demosaicing – Low-pass Chroma demosaic

  25. Demosaicing – Low-pass Chroma 1. demosaic 2. blur 3. Y’CrCb to RGB

  26. Demosaicing – Low-pass Chroma RGB to Y’CrCb: ⎛ ⎞ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎜ ⎟ Y ' 65.48 128.55 24.87 R 16 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎜ ⎟ ⋅ 257 = 65535 + − 37.80 − 74.20 Cb 112.00 G 128 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎜ ⎟ − 93.79 − 18.21 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎜ ⎟ ⎣ Cr ⎦ ⎣ 112.00 ⎦ ⎣ B ⎦ ⎣ 128 ⎦ ⎜ ! ##### " ##### $ ⎟ ⎝ ⎠ M ⎛ ⎞ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ Y’CrCb to RGB: R Y ' 16 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎟ ⋅ 65535 ⎜ ⎟ = M − 1 − G Cb 128 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎜ 257 ⎢ ⎥ ⎝ ⎢ ⎥ ⎢ ⎥ ⎠ ⎣ B ⎦ ⎣ Cr ⎦ ⎣ 128 ⎦ Matlab functions: rgb2ycbcr() and ycbcr2rgb() Pixel values for above equations between 0 and 255!

  27. Demosaicing – Low-pass Chroma linear interpolation chrominance filtered

  28. Demosaicing – Edge-Directed Interpolation • intuitive approach: consider 3x3 neighborhood • example: recover missing green pixel from Gunturk et al. 2005

  29. Demosaicing – Edge-Directed Interpolation • better: consider 5x5 neighborhood • example: recover missing green pixel on red pixel from Gunturk et al. 2005

  30. Demosaicing – Edge-Directed Interpolation • insights so far: • larger pixel neighborhood may be better, but also more costly • using gradient information (edges) may be advantageous, even if that info comes from other color channels! • nonlinear method is okay, but not great – linear would be best! • Malvar et al. 2004 – what’s the best linear filter for 5x5 neighborhood? • this is implemented in Matlab function demosaic() and part of HW2

  31. Demosaicing- Malvar et al. 2004 g ( x , y ) = ˆ g lin ( x , y ) + α Δ R ( x , y ) ˆ • interpolate G at R pixels: Δ R ( x , y ) = r ( x , y ) − 1 ∑ r ( x + m , y + n ) red gradient: 4 ( m , n ) ( m , n ) = {(0, − 2),(0,2),( − 2,0),(2,0)} r ( x , y ) = ˆ lin ( x , y ) + β Δ G ( x , y ) ˆ • r interpolate R at G pixels: r ( x , y ) = ˆ lin ( x , y ) + γ Δ B ( x , y ) ˆ • r interpolate R at B pixels: gain parameters optimized from Kodak dataset: α = 1/ 2, β = 5 / 8, γ = 3/ 4 •

  32. Demosaicing - Malvar et al. 2004 • write out math to get linear filters: • use normalized filters in practice, i.e. scale numbers by sum of filter

  33. Demosaicing - Malvar et al. 2004 linear interpolation Malvar et al.

  34. Deblurring common sources: out-of-focus blur Input geometric distortion spherical aberration chromatic aberration from Heide et al. 2013 coma Input Captured image

  35. Deblurring • solve with ADMM (read details in paper) • will discuss deconvolution in more detail next week http://www.cs.ubc.ca/labs/imager/tr/2013/SimpleLensImaging/

  36. Denoising • problem: have noisy image, want to remove noise but retain high- frequency detail noisy image (Gaussian iid noise, σ =0.2)

  37. Denoising – Most General Approach 1 ∑ i denoised ( x ) = i noisy ( ′ ⋅ w ( x , ′ x ) x ) ∑ w ( x , ′ all pixels ′ x ) x all pixels ′ x • many (not all) denoising techniques work like this • idea: average a number of similar pixels to reduce noise • question/difference in approach: how similar are two noisy pixels?

  38. Denoising – Most General Approach 1 ∑ i denoised ( x ) = i noisy ( ′ ⋅ w ( x , ′ x ) x ) ∑ w ( x , ′ all pixels ′ x ) x all pixels ′ x 1. Local, linear smoothing 2. Local, nonlinear filtering 3. Anisotropic diffusion 4. Non-local methods

  39. Denoising – 1. Local, Linear Smoothing 1 ∑ i denoised ( x ) = i noisy ( ′ ⋅ w ( x , ′ x ) x ) ∑ w ( x , ′ all pixels ′ x ) x all pixels ′ x ⎛ ⎞ x − x ′ 2 w ( x , ′ x ) = exp − ⎜ ⎟ 2 σ 2 ⎝ ⎠ • naïve approach: average in local neighborhood, e.g. using a Gaussian low-pass filter

  40. Denoising – 2. Local, Nonlinear Filtering ( ) ( ) i denoised ( x ) = median W i noisy , x small window of image centered at i noisy x • almost as naïve: use median filter in local neighborhood

  41. Denoising Gaussian Median σ =0.1 w=1 σ =0.3 w=3 noisy image (Gaussian, σ =0.2) σ =0.5 w=5

  42. Denoising – 3. Bilateral Filtering 1 ∑ i denoised ( x ) = i noisy ( ′ ⋅ w ( x , ′ x ) x ) ∑ w ( x , ′ all pixels ′ x ) x all pixels ′ x spatial distance distance of intensities ⎛ ( ) − i noisy x ( ) ⎞ 2 ⎛ ⎞ 2 ′ x − x ′ i noisy x ⎜ ⎟ w ( x , ′ x ) = exp − ⎜ ⎟ ⋅ exp − ⎜ ⎟ 2 σ 2 2 σ i ⎜ ⎟ 2 ⎝ ⎠ ⎝ ⎠ • more clever: average in local neighborhood, but only average similar intensities!

  43. Denoising – Gaussian Filter J: filtered output (is blurred) f: Gaussian convolution kernel I: step function & noise

  44. Denoising – Bilateral Filter J: filtered output (is not blurred) f: Gaussian convolution kernel I: noisy image (step function & noise) difference in intensity as scale! Tomasi & Manduchi, 1998

  45. Denoising – Bilateral Filter original image bilateral filter = “edge-aware smoothing”

  46. Denoising – Bilateral Filter noisy image bilateral filter = “edge-aware smoothing”

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend