Chapter 03
Chapter 03
Chapter 03
NaïveImage
BayesEnhancement
Analysis(單純貝氏)
(I)
Dr. Tun-Wen Pai
1) Concept of image enhancement
2) Intensity Transformation
3) Histogram Transformation
4) Histogram Equalization
5) Histogram Matching (Specification)
s T (r ) c log(1 | r |)
Gamma correction:
s1 0, s 2 1, and
0, r r1
g
r r1
T(r) , r1 r r2
r2 r1
1, r r
2
Original image Gamma Correction Original image as viewed on a monitor with
a gamma of 2.5
• Note that (r2-r1) < (s2 –s1). The grayvalues in the range [r1 , r2] is stretched
into the range [s1, s2]
• Special cases:
□ Thresholding or binarization
r1 = r2, , s1 = 0 and s2 = 1
Image Enhancement: Histogram-
based methods
• The histogram of a digital image with grayvalues r0 ,r1 ,…, rL-1 is the
discrete funciotn
# pixels with value rk
nk
p(rk )
n Total # pixels in image
• The function p(rk) represents the fraction of the total number of pixels with
grayvalue rk.
pout ( s) 1, 0 s 1
• Note that this is the cumulative distribution function (CDF) if pin(r) and
satisfies the previous two conditions.
j 0 n j 0
Histogram Specification
• Histogram equalization yields an image whose pixels are (in theory) uniformly
distributed among all graylevels.
• Sometimes, this may not be desirable. Instead, we may want a transformation that
yields an output image with a pre-specified histogram. This technique is called
histogram specification.
• Suppose, the input image has probability density pin(r). We want to find a
transformation z = H(r), such that the probability density of the new image obtained
by this transformation is pout(z), which is not necessarily uniform.
• If the desired output image were available, then the following transformation would
generate an image with uniform density
z
v G( z ) pout ( w)dw, 0 z 1 (**)
0
• From the grayvalues v we can obtain the grayvalues z by using the inverse
tranformation , z = G-1(v).
• If instead of using the grayvalues v obtained from (**), we use the grayvalues s
obtained from (*) above (both are uniformly distributed!), then the point
transformation will generate an image with the specified density p out(z), from an
input image with density pin(r)!
Image Subtraction
• In this case, the difference between two “similar” images is compute to
highlight or enhance the differences between them:
• Usually, η(m, n) has zero-mean and the noise values at different pixels are
uncorrelated.
• Suppose we have M observations {gi (m, n)}, i=1, 2, …, M, we can (partially)
mitigate the effect of noise by “averaging”
M
1
g (m, n)
M
g (m, n)
i 1
i