EE499 – Digital Image Processing HW 3A: 3.1, 3.3 HW 3B: 3.8 3.1)

advertisement
EE499 – Digital Image Processing
HW 3A: 3.1, 3.3
HW 3B: 3.8
3.1)
One possible solution:
s=(L−1)log(1+ r )/log( L)
3.3)
(a) It looks like a tan-1 function. The function
1 −1
1
y (x )= π tan ( E (x−m)/ L)+
2
is close to the desired function, but is not equal to 0 at x = 0 or equal to 1 at x = (L – 1).
Defining a new function, in terms of y(x) as
T ( x )=[ y ( x)−y ( 0)]/[ y( L−1)− y(0)]
gives a function with the desired properties.
The slope at x = m is
dT
E
∣x=m =
dx
π L[ y ( L−1)− y (0)]
and is proportional to E. Empirically y(L – 1) – y(0) ≈ 1 for E > 8 so
dT
E
∣x=m ≈
for E >8
dx
πL
(b) Transfer function is shown for E = [ 2, 4, 8, 16, …, 512] and L = 256. The lower values of E
correspond to curves that are closer to the diagonal.
(c) An E = 16384 value results T(127) 256 – 1 = 0.263 and T(129) 256 – 1 = 253.7 so should
effectively act as a thresholding function with 256 output levels.
3.8)
m
[ ( r−m
σ )+Φ ( σ )−1 ]
s=( L−1) Φ
where Φ ( x) is the CDF of the standard normal distribution.
Alternatively, in terms of the error function
m
σ )+ erf ( σ ) ]
( L−12 )[erf ( r−m
s=
Octave has a normcdf function which evaluates the CDF of an arbitrary (non-standard) normal
distribution. So this equalization method can be implemented in a single line of Octave code:
function b = xx_imgaussianeq(a)
b = uint8(255*normcdf(double(a),mean(a(:)), std(a(:))));
end
Here are the original washed-out pollen image, the image after processing using the function
above, and the before-and-after histograms:
Download