Hw2 Solution
Hw2 Solution
CH. 3
Problem 6.
Histogram equalization: Remap histogram components on the intensity scale.
To obtain the uniform (flat) histogram: Pixel intensities actually be redistributed so that there
are L groups of n/L pixels with the same intensity, where L is the number of allowed discrete
intensity levels, and n=MN is the total number of pixels in the input image.
The histogram equalization method has no provisions for this type of (artificial) intensity
redistribution process.
Problem 9.
Consider the probability density function (pdf) shown in (a)
(b) gives the 𝑇(𝑟)
Because 𝑝𝑟 (𝑟) is a pdf, we know that the transformation 𝑇(𝑟)
satisfies conditions (a) and (b).
However, the inverse transformation from s back to r is not single
1
valued, as there are infinite mappings possible from 𝑠 = 2 back to r
Problem 14.
(a) The histograms of the two blurred images will be different.
The number of boundary points between the black and white regions is much larger in the
image on the right. When the images are blurred, the boundary points will give rise to a
larger number of different values for the image on the right.
(b) The histogram of the blurred version of the left image:
The histogram of the blurred version of the right image:
Problem 17.
If the low-pass spatial filter is applied to a digital image repeatedly, the image may be blurred
a lot.
If a 5 × 5 filter is applied instead of a 3 × 3 filter, the blurring increases at a faster rate than
in the 3 × 3 filter.
Problem 21.
The fact that the number of bar pixels under the mask does not change is due to the peculiar
separation between bars and the width of the lines in relation to the 25-pixel width of the mask.
This constant response is the reason why no white gaps are seen in the image shown in the
problem statement. Note that this constant response does not happen with the 23 × 23 or the
45 × 45 masks because they are not “synchronized” with the width of the bars and their
separation.
Problem 23.
Both the Laplacian and the averaging process are linear operations, so it makes no difference
which one is applied first.
MATLAB task
% read the PGM image into MATLAB
name='zelda.pgm';
x=imread(name);
whos x
% display the image
figure, imshow(x,[]); % use >help imshow to find out the option '[]'
% histogram equalization
help histeq
y=histeq(x);
figure, imshow(y,[]);
% histogram matching
target_h = [1:128 128:-1:1];
figure, plot(target_h);
y = histeq(x, target_h);
figure, imshow(y,[]);