Digital Image Processing Assign9-1

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

1.

Estimating Noise PDFs and Their Parameters

The image in Fig. P5.1(a)(noisy_superconductor_image).tif is corrupted by noise.


(a) Download this image and extract its noise histogram. Display the histogram
(using function bar) and indicate (by name) what you think the noise PDF is.
Determine the relevant noise parameter(s) using the histogram you extracted.
(Hint: Use function roipoly to extract the data you think will help you identify the
noise.)

(b) Use function imnoise or imnoise2, as appropriate, to generate X samples of the


noise type and parameter(s) you determined in (a). Generate the histogram of the
samples using function hist, and display the histogram. Here, X is the number of
pixels in the ROI in (a). Compare with the corresponding histogram from (a).

Solution for (a): (Refer to the matlab window in the next page for the implementation of the
ff. steps):
1. Checking for the file in the current directory.
2. Reading the image FigP5.1(a) (Noisy_superconductor_mage).tif to “a”.
3. Extracting the region of interest by using the fnction ROI.
Note: To obtain the PDF of the noise, we use the roipoly to extract data from region
with relatively constant background. Figure 2 in page 3 shows this region.
4. Determining the relevant noise parameter(s) using the histogram of ROI.
5. Setting the axis limits for the plot.
6. Obtaining the mean and variance of the histogram.

Solution for (b):

Note: Comparing figure 3 (in page 3) to the histogram of random numbers in Fig. 5.2 p.151
in our text book, we note that the nearest match is that of Figure 5.2(e), the histogram for
an exponential function. This PDF start as 0 while that of figure 3 in p. 3 starts at 64
(approx.). If we subtract 64 to PDF, we make them similar, thus, mean becomes 82.36 – 64
= 18.36 or approximately 18. We then generate npix exponential random variables using
function imnoise2 with a = 1/18 (see Table 5.1) and add 64 back so that the resulting
histogram can be compared with p from (a):

7. Generating npix exponential random variables using function imnoise2.


8. generating histogram
1

4
5
6

Figures for Prob. 1


Figure 1: Original Image(Noisy image of a super conductor)

Figure 2: ROI obtained using the function roipoly.

Figure 3: Histogram of the ROI (region of interest)

Figure 4: Histogram of the exponential random variables generated using the variables
obtained from the ROI data
2. Spatial Noise Reduction

(a) Use function spfilt to denoise image FigP5.2(a)(salt_only).tif. This is an optical


microscope image of a nickel-oxide thin film specimen magnified 600X. The
image is heavily corrupted by salt noise.

(b) Use function spfilt to denoise image FigP5.2(b)(pepper_only).tif. This is the


same nickel oxide image, but corrupted this time by pepper noise only.

The tradeoff in your selection of a filter in (a) and (b) should be to produce the cleanest
image possible with as little image distortion (e.g., blurring) as possible.

Solution for (a):

8
The best choices in spfilt for the elimination of salt noise are median and
contraharmonic mean filters. We give solutions for both..

Reading the image to “g”

Median filter

Contraharmonic filter

OriginalSolution for (b):


image corrupted Result of filtering using 5 Result of contraharmonic
By salt noise x 5 median filter filter size 3 x 3 and Q = -5
Original image corrupted Result of filtering using 5 Result of contraharmonic
By pepper noise x 5 median filter filter size 3 x 3 and Q = 1.5

You might also like