Professional Documents
Culture Documents
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
r0
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
s0
0 r0 L
Chapter 3
Intensity Transformations & Spatial Filtering
s c log(1 r)
s0
r0
© 1992–2008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
s cr
Where c and γ are positive constants.
s c(r )
Chapter 3
Intensity Transformations & Spatial Filtering
Gamma correction
Gamma correction aims to improve
the correctness of an image when
display on a screen.
Gamma correction controls the
overall brightness of an image.
Incorrect images can look
either bleached out, or too
dark.
Chapter 3
Intensity Transformations & Spatial Filtering
Gamma correction
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Image Histogram
The image histogram of a digital image with intensity
levels in the range [0,L-1] is a discrete function
h(rk) =nk , where rk is the kth intensity value and nk is
the number of pixels in the image with the intensity rk
Histogram Normalization
It is common to normalize the histogram by dividing
nk by the number of pixels in the image.
The normalized intensity p(rk)= nk /MN estimates the
probability of occurrence of intensity level rk in an
image
Chapter 3
Intensity Transformations & Spatial Filtering
Histogram Equalization
In general we assume
1. T(r) is monotonically increasing
2. 0 ≤ T(r) ≤ L-1 for 0 ≤ r ≤ L-1
dr
p s(s) p r(r) ds
Chapter 3
Intensity Transformations & Spatial Filtering
r
ds dT (r) d pr (w)dw (L
dr dr (L 1)
r
dr 0 1) p (r)
Use the previous formulation yields, a uniform
probability density function
1 1
dr
ps(s) p r(r) ds p r(r)
(L 1) pr (r) L
Histogram equalization 1 determine the
transformation that seek to produce an
output image that has a uniform histogram.
Chapter 3
Intensity Transformations & Spatial Filtering
Histogram Equalization
In the discrete case
k k
k k r j (L 1) j
s T (r ) (L 1)j
0 p (r ) MN
j n ; k 0,1,2,.., L
0
1
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Histogram Matching
Let us assume histograms are continuous functions, and let T(r) defined as earlier and G(z)
defined similarly, then
r z
s T (r) (L 1) pr And s G(z) (L
(w)dw 1) pz (t)dt
0 0
Since T(r) = G(z), then
z Gshows
This 1
[T (r)]
thatthat
G 1an
(s)image whose intensity levels have a specific probability density
function can be obtained as follow:
1. Obtain pr(r) from the input image and determine the value of s (as above)
2. Use a specified PDF to obtain the transformation function G(z)
3. Compute the inverse transformation z=G-1(s)
4. Obtain the output image by first equalizing the input image (intensity are the s values)
for each intensity (s value) perform the inverse mapping z = G-1(s) to obtain the
corresponding pixel in the output image
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 3
Intensity Transformations & Spatial Filtering
Spatial Filtering
Applying a 3x3 filter ,w, on the image f
1 1
g(x, y) w(i, j) f (x i, y j)
i1 j 1
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Correlation
Is the process of moving a filter mask
over the image and computing the sum
of products at each location.
Convolution
moves the reversed filter mask over
the image and computing the sum of
products at each location.
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
• Second Derivative
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering
Chapter 3
Intensity Transformations & Spatial Filtering