\documentclass[11pt]{article} 

\usepackage[dvips]{graphicx}
\DeclareGraphicsExtensions{ps,eps,pdf}

\topmargin=-0.25in 
\textheight=8.5in 

\textwidth=6.30in
\oddsidemargin=0.0in 

\begin{document} 

\noindent{\bf Math 155: Homework \# 8, due on Friday, March 8}

\medbreak 

\noindent{\bf [6] } {\bf Periodic Noise Reduction Using a Notch Filter} 

(a) Write a program that implements sinusoidal noise of the form: 

$n(x,y)=A\sin(2\pi u_0 x+2\pi v_0y)$.  

The input to the program must be the amplitude, A, and the two frequency components $u_0$ and $v_0$.

 (b) Download image 5.26(a) of size $M\times N$ and add sinusoidal noise to it, with $v_0 = 0$.  The value of A must be high enough for the noise to be quite visible in the image (for example, you can take $A=100$, $u_0=134.4$, $v_0=0$). 

 (c) Compute and display the degraded image and its spectrum (you may need to apply a log transform to visualize the spectrum).  

 (d) Notch-filter the image using a notch filter of the form shown in Fig. 5.19(c) to remove the periodic noise. 

\medbreak 

\noindent{\bf [7] } (a) Recall the definition of the convolution $f*g(x,y)$ in continuous variables in two dimensions. 

(b) Show that $\nabla ^2(f*g)=f*(\nabla ^2g)$, where $\nabla ^2$ denotes the Laplace operator in $(x,y)$.

%\noindent{\bf [1] } The two subimages shown were extracted from the top, right corners 
%of Figs. 5.7(c) and (d), respectively. Thus, the subimage on the left is the
%result of using an arithmetic mean filter of size 3x3; the other subimage is
%the result of using a geometric mean filter of the same size. 

%(a) Explain why the subimage obtained with geometric mean filtering is less
%blurred. {\it Hint:} Start your analysis by examining a 1-D step edge profile.

%(b) Explain why the black components in the right image are thicker. 

%\begin{figure}
%\begin{center}
%\includegraphics[scale=1]{Prob5.10left.ps}
%\includegraphics[scale=0.62]{Prob5.10right.ps}
%\end{center} 
%\end{figure}

\noindent{\bf [1] } Download from the class web page the image Fig5.07(b).jpg 
(X-Ray image corrupted by Gaussian noise). 

(a) Write a computer program to implement the arithmetic mean filter of size 3x3. Apply the program to the image Fig5.07(b).jpg  

(b) Write a computer program to implement the geometric mean filter of size 3x3. Apply the program to the image Fig5.07(b).jpg  

(c) Explain your results. Evaluate the SNR (signal-to-noise-ratio) for both results in (a) and (b) (before denoising and after denoising). Note, higher SNR, better denoised image. Let $\hat f$ be the denoised image, and $f$ the clean true image. Then $SNR=10\log_{10}\frac{\sum_{x,y}(\hat f)^2}{\sum_{x,y}(f-\hat f)^2}$. To evaluate the SNR before denoising, substitute $\hat f$ by $g$ in the above formula. 

\noindent{\bf [2] } Refer to the contraharmonic filter given in Eq. (5.3-6).

(a) Explain why the filter is effective in eliminating pepper noise when $Q$
is positive. 

(b) Explain why the filter is effective in eliminating salt noise when $Q$
is negative. 

(c) Explain why the filter gives poor results (such as the results shown in 
Fig. 5.9) when the wrong polarity is chosen for $Q$. 

(d) Discuss the behavior of the filter when $Q=-1$. 

(e) Discuss (for positive and negative $Q$) the behavior of the filter in areas
of constant gray levels. 

\noindent{\bf [3] } (a) Download from the class web page the image Fig5.08(a).jpg 
(X-Ray image corrupted by pepper noise). Write a computer program that will 
filter this image with a 3x3 contraharmonic filter of order 1.5. 

(b) Download from the class web page the image Fig5.08(b).jpg 
(X-Ray image corrupted by salt noise). Write a computer program that will 
filter this image with a 3x3 contraharmonic filter of order -1.5. 

\noindent{\bf [4]} Consider a linear, position-invariant image degradation system with impulse response 
$$h(x-\alpha,y-\beta)=e^{-[(x-\alpha)^2+(y-\beta)^2]}.$$
Suppose that the input to the system is an image consisting of a line of infinitesimal width located at $x=a$, and modeled by $f(x,y)=\delta(x-a)$, where $\delta$ is the impulse function. Assuming no noise, what is the output image $g(x,y)$ ? 

Hint: Use equation (5.5-13) and also that 
$$\int_{-\infty}^{+\infty}\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(z-\mu)^2}{2\sigma^2}}\ d z=1,$$ 
where $\mu$ and $\sigma$ are constants. 

\end{document} 
