Download Presentation
## 2009.10.22

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Digital Image Processing (Digitaalinen**kuvankäsittely)Exercise 3 2009.10.22**1. Filter the following image with adaptive, local noise**reduction filter in 3×3 window with estimated noise variance 0.5. Process only such pixels that have all the needed neighbors. The adaptive, local noise reduction filter is defined as : ( )**( )**Take point (1, 1) for example:**The Wiener filter is (Page 263):**Thus, the equation becomes:**∵H(u,v) is a complex number**∴modulus2 = real part×imaginary part ∵ Real and positive with all u, v. ∴ imaginary part = modulus = real part Plug into the Wiener filter equation:**a) nearest neighbor interpolation**The coordinates are rounded to the nearest integer coordinates. (0.4,0.4) (0,0) 2 (1.4,1.7) (1,2) 5 0 1 2 0 1 2 (0.4, 0.4): interpolated value is 2. (1.4, 1.7): interpolated value is 5.**b) bilinear interpolation**The interpolated value (in red) is computed using values of four neighbors. Weights of the neighbors (in yellow) are proportional to overlapping area. (One way) 0 1 2 • (0.4, 0.4): • 0.6×0.6×2+ • 0.6×0.4×3+ • 0.4×0.6×3+ • 0.4×0.4×4 = • 2.8≈3 0 1 2 (0.4,0.4) ∑Areai×Weighti, i=1,2,3,4 2 3 3 4 • (1.4, 1.7): • 0.3×0.6×4+ • 0.7×0.6×5+ • 0.3×0.4×7+ • 0.7×0.4×3 = • 4.5≈5 (1.4,1.7) 4 5 7 3**If the color balance is correct, rR ≈ rG ≈ rB for white**and black test targets. In our case, histogram peak corresponding to black target is rR = 62; rG = 31; rB = 12, so the color balance correction is needed.**Let us use a linear transformation:**Take the red channel for example, in the input image, the black peak for red: rR = 62 And we want to get: sR = 16 For the white peak, rR = 242 and sR = 242 We get the equation pair: sR rR Solve this, gives:**Next, check limits so that the output sR is in [0,255] ,**when input rR is between 0 and 255. sR = 1.2556 rR - 61.8444 [0,255] [0,255] sR (252.354,255) 255 So the color transformation for red channel: (0,0) rR (49.2566,0) Similarly, get green and blue channels:**The Bayer array consists of alternating rows of red-green**and green-blue filters.**First,separate color channels.**2m+1 2m+1 2n+1 2n 2m 2m**After the 1st phase, we have three separated channels:**Second, interpolate the missing values by linear filtering. (Demo)