Question: Use the function imread, rgb2gray and double to read the color image peppers.png. Convert it into a gray level image I[m, n] with double precision.
Use the function imread, rgb2gray and double to read the color image peppers.png. Convert it into a gray level image I[m, n] with double precision. Add noise to it using the function randn (Gaussian number generator) multiplied by 40. Create a onedimensional moving average filter with impulse response
![]()
Letting a second filter have the same impulse response, i.e, h2[n] = h1[n] create a separable two dimensional filter h[m, n] = h1[m]h2[n]. Convolve the image with the two-dimensional filter to obtain an image y[m, n].
(a) Use the function histogram to look at the distribution of the pixel values of the two images. Explain the effect of the moving average filtering on the image I[m, n].
(b) Binarizing an image consists in using a gray-level threshold to convert the given image into one that has two levels only. The threshold can be chosen from a histogram of the image to be binarized. We wish to binarize the y[m, n] to obtain two images: y1[m, n] with gray-level of 250 whenever the y[m, n] > 100 and 0 otherwise; y2[m; n] with gray-level of 200 whenever y[m; n] ≥ 100 and 0 otherwise. Use imshow to display these image, and histogram to display their gray levels distributions.
8 n – 1] + o[n – 2] + 8[n – 3). h[n] = 0.25(8[n] + d[n – 1] + d[n – 2] + ő[n – 3]).
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
Pr 942 clear all clf Images AimreadpepperspngBrgb2grayAIdo... View full answer
Get step-by-step solutions from verified subject matter experts
