Professional Documents
Culture Documents
The term spatial domain refers to the image plane itself, and image
processing methods in this category are based on direct manipulation of
pixels in an image.
❑ The identity function is the trivial case in which output intensities are
identical to input intensities.
3.2.1 Image Negatives
❑ The negative of an image with intensity levels in the range [0, L-1] is
obtained by using the negative transformation, which is given by the
expression:
s=L–1–r
❑ This type of processing is particularly suited for enhancing white or
gray detail embedded in dark regions of an image, especially when the
black areas are dominant in size.
3.2.2 Log and Inverse-log Transformations
❑ With reference to the curve, such display systems would tend to produce
images that are darker than intended.
Continued:
❑ It is not unusual that images created for a popular Web site will be
viewed by millions of people, the majority of whom will have different
monitors and/or monitor settings.
❑ Some computer systems even have partial gamma correction built in.
Contrast Manipulation
(a) (b)
(c) (d)
✓ Histogram Equalization
✓ Histogram Specification
3.3.1 Histogram Equalization
Figure 3.17 (a) Monotonically increasing function, showing how multiple values can map to a single value.
(b) Strictly monotonically increasing function. This is a one-to-one mapping, both ways.
Continued:
Q: Suppose that a 3-bit image (L=8) of size 64×64 pixels (MN=4096) has
the intensity distribution shown in the following table, where the intensity
levels are integers in the range [0, L-1]=[0,7]. Draw the histogram
corresponding to these intensity levels. And then, Perform the histogram
equalization and draw the resulting histogram.
Example 3.5 Solution
For a 3-bit image (L=8) of size 64×64 pixels, the total number of pixels is
MN=4096.
Example 3.5 Solution
Matching Table between r (original image pixel) and s (image pixel after
processing histogram equalization )
r s
0 1
1 3
2 5
3 6
4 6
5 7
6 7
7 7
Example 3.5 Solution (Continued:)
rk nk sk nk (for sk ) ps (sk)=nk/(MN)
r0 =0 790 s0 =1 790 0.19
r1 =1 1023 s1 =3 1023 0.25
r2 =2 850 s2 =5 850 0.21
r3 =3 656 s3 =6
985 0.24
r4 =4 329 s4 =6
r5 =5 245 s5 =7
r6 =6 122 s6 =7 448 0.11
r7 =7 81 s7 =7
Example 3.5 Solution (Continued:)
1. The following table gives the number of pixels at each of the grey levels 0-7
in an image with those grey values only:
0 1 2 3 4 5 6 7
3244 3899 4559 2573 1428 530 101 50
Draw the histogram corresponding to these grey levels, and then perform a
histogram equalization and draw the resulting histogram.
2. The following table gives the number of pixels at each of the grey levels 0-15
in an image with those grey values only. In each case draw the histogram
corresponding to these grey levels, and then perform a histogram equalization
and draw the resulting histogram.
Problems
(a)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
20 40 60 75 80 75 65 55 50 45 40 35 30 25 20 30
(b)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0 0 40 80 45 110 70 0 0 0 0 0 0 0 0 15
Problems
3. The following small image has grey values in the range 0 to 19. Compute the
grey level histogram and the mapping that will equalize this histogram.
Produce an 8×8 grid containing the grey values for the new
histogram-equalized image.
12 6 5 13 14 14 16 15
11 10 8 5 8 11 14 14
9 8 3 4 7 12 18 19
10 7 4 2 10 12 13 17
16 9 13 13 16 19 19 17
12 10 14 15 18 18 16 14
11 8 10 12 14 13 14 15
8 6 3 7 9 11 12 12
3.3.2 Histogram Matching (Specification)
Histogram Matching (Histogram Specification)
Matching Table between r (original image pixel) and s (image pixel after
processing histogram equalization )
r s
0 1
1 3
2 5
3 6
4 6
5 7
6 7
7 7
Example 3.8 Solution (Continued:)
rk nk sk nk (for sk ) ps (sk)=nk/(MN)
r0 =0 790 s0 =1 790 0.19
r1 =1 1023 s1 =3 1023 0.25
r2 =2 850 s2 =5 850 0.21
r3 =3 656 s3 =6
985 0.24
r4 =4 329 s4 =6
r5 =5 245 s5 =7
r6 =6 122 s6 =7 448 0.11
r7 =7 81 s7 =7
Example 3.8 Solution (Continued:)
Step 2
Calculation of all possible values of transformation function G:
Where q= 0,1,2,…,L-1
Example 3.8 Solution (Continued:)
Step 3
Matching Table between s (image pixel after processing histogram
equalization ) and z (the image pixel we specified).
s z
1 3
3 4
5 5 or
6 6
6 6
7 7
7 7
7 7
Example 3.8 Solution (Continued:)
Step 4
Calculation of Specified Histogram:
0 0 1 1 2
1 2 3 0 1
3 3 2 2 0
2 3 1 0 0
1 1 3 2 2
Compute the histogram statistics values: mean and variance.
Example 3.11 Solution
The pixels are represented by 2 bits; therefore, L = 4 and the intensity levels
are in the range [0, 3]. The total number of pixels is 25.
Example 3.11 Solution
Two uses of Mean and Variance
❑ There are two uses of the mean and variance for enhancement purposes.
❑ The global mean and variance are computed over an entire image and are
useful for gross adjustments in overall intensity and contrast.
>> p=imread('Fig0320(4)(bottom_left).tif');
>> imshow(p)
>> imhist(p)
>> ph=histeq(p);
>> imshow(ph)
>> imhist(ph)
Any Questions!!!