Page MenuHomec4science

hwIP.tex
No OneTemporary

File Metadata

Created
Wed, Mar 12, 23:41

hwIP.tex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% COMPILE WITH PDFLaTeX!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12pt,a4paper,fleqn]{article}
\usepackage{../styles/defsDSPcourse}
\title{COM-303 - Signal Processing for Communications}
\author{Image Processing Homework}
\date{}
\begin{document}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{2D filtering}
Consider a 2D signal with a $8\times 8$ square support (all dots represent nonzero values for the signals):
\begin{center}
\psfig{figure=1a.png, width=4cm,height=4cm}
\end{center}
Consider now a set of 2D FIR filters whose impulse responses are shown (in support only) in the following figure:
\begin{center}
\psfig{figure=1-2b.png, width=12cm,height=8cm}
\end{center}
The given 2D signal is filtered with each FIR filter in turn. For each case, choose among the possibilities below the support of the resulting signal:
\begin{center}
\psfig{figure=1c.png, width=12cm,height=8cm}
\end{center}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{bilinear interpolation}
Let $A$ be a square image with resolution equal to $N\times N$ pixels. The image $A$ is built as follows:
\begin{itemize}
\item set $A[0, N-1]$ (upper left corner) and $A[N-1, 0]$ (lower right corner) to 255 (white)
\item set $A[N-1, N-1]$ (upper right corner) and $A[0, 0]$ (lower left corner) to 0 (black)
\item compute all remaining pixel values using bilinear interpolation between the corners
\end{itemize}
Which one of the following plots is the image $A$?
\begin{center}
\psfig{figure=5-1.png, width=12cm,height=8cm}
\end{center}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Noise reduction}
If you take a picture in low light conditions using a digital camera, the required longer exposure time will cause a form of image degradation called ``salt and pepper noise''. This causes isolated random pixels in the image to take the wrong value, usually saturating to their maximum (white) or minimum (black) values -- hence the name of the noise.
Which of the following impulse responses would you use for a filter that reduces the noise in images taken under low light conditions? Choose all the possible answers.
\centering
\begin{tabular}{ccccc}
%
(a) & (b) & (c) & (d) & (e) \\
%
$\begin{bmatrix}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1
\end{bmatrix}$
&
$\begin{bmatrix}
1 & 1 & 1 \\
1 & -3 & 1 \\
1 & 1 & 1
\end{bmatrix}$
&
$\begin{bmatrix}
0 & 1 & 0 \\
1 & 1 & 1 \\
0 & 1 & 0
\end{bmatrix}$
&
$\begin{bmatrix}
-1 & 0 & 1 \\
-1 & 0 & 1 \\
-1 & 0 & 1
\end{bmatrix}$
&
$\begin{bmatrix}
-1 & -1 &- 1 \\
-1 & 8 & -1 \\
-1 & -1 & -1
\end{bmatrix}$
\end{tabular}
\vspace{2em}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Edge detection}
Which of the following filters can be used for edge detection?
\centering
\begin{tabular}{ccccc}
%
(a) & (b) & (c) & (d) & (e) \\
%
$\begin{bmatrix}
0 & 1 & 0 \\
1 & -4 & 1 \\
0 & 1 & 0
\end{bmatrix}$
&
$\begin{bmatrix}
-1 & -1 &- 1 \\
-1 & 8 & -1 \\
-1 & -1 & -1
\end{bmatrix}$
&
$\begin{bmatrix}
1 & 0 & 1 \\
0 & -4 &0 \\
1 & 0 & 1
\end{bmatrix}$
&
$\begin{bmatrix}
0 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 0
\end{bmatrix}$
&
$\begin{bmatrix}
1 & 1 & 1 \\
1 & 1 & 1 \\
1 & 1 & 1
\end{bmatrix}$
\end{tabular}
\vspace{2em}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Image filtering}
Consider the following image:
\begin{center}
\psfig{figure=1.png, width=4cm,height=4cm}
\end{center}
and consider the following six 2D impulse responses:
\begin{center}
\begin{tabular}{ccc}
%
(a) & (b) & (c) \\
%
$\begin{bmatrix}
1 & 1 &1 \\
1 & 1 & 1 \\
1 & 1& 1
\end{bmatrix}$
&
$\begin{bmatrix}
1 & 1 &1 \\
0 & 0 & 0 \\
-1 & -1& -1
\end{bmatrix}$
&
$\begin{bmatrix}
1 & 0 & -1 \\
1 & 0 & -1 \\
1 & 0 & -1
\end{bmatrix}$
\\ \\
(d) & (e) & (f) \\
$\begin{bmatrix}
-1 & -1 &-1 \\
-1 & 8 & -1 \\
-1 & -1& -1
\end{bmatrix}$
&
$\begin{bmatrix}
0 & -1 &0 \\
-1 & 0 & 1 \\
0 & 1& 0
\end{bmatrix}$
&
$\begin{bmatrix}
0 & 1 &0 \\
-1 & 0 & 1 \\
0 & -1& 0
\end{bmatrix}$
\end{tabular}
\end{center}
\vspace{2em}
Associate to each impulse response the result of filtering the original image with it, choosing among the possibilities shown below. Assume that all images are renormalized before plotting, i.e., the pixels with the smallest values are mapped to black while the pixels with the largest value are mapped to white; all intermediate values are mapped to grayscale levels.
\begin{center}
\psfig{figure=2.png, width=10cm,height=7cm}
\end{center}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Prefix-free code}
Which of the following codes are prefix-free codes for four symbols A, B, C, and D?
\begin{enumerate}
\item $ A: 111, B: 110, C: 10, D: 0$
\item $A: 01, B: 11, C: 00, D: 10$
\item $A: 00, B: 01, C: 10, D: 11$
\item $A: 0, B: 10, C: 101, D: 11$
\item $A: 11, B: 101, C: 01, D: 111$
\item $A: 1, B: 010, C: 101, D: 01$
\end{enumerate}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Huffman coding}
Five symbols, $A$, $B$, $C$, $D$, and $E$, have the following probabilities:
\begin{itemize}
\item $p(A) = 0.1$
\item $p(B) = 0.23$
\item $p(C) = 0.2$
\item $p(D) = 0.15$
\item $p(E) = 0.32$
\end{itemize}
There is a single Huffman tree associated to these probabilities, as shown in this figure
\begin{center}
\psfig{figure=3.jpg, width=7cm,height=5cm}
\end{center}
however you are free to associate a symbol of `0' or `1' to each branch.
Which of the following codes are valid instances of Huffman coding?
\begin{enumerate}
\item $A: 010, B: 11, C: 10, D: 011, E: 00$
\item $A: 011, B: 10, C: 11, D: 010, E: 00$
\item $A: 111, B: 00, C: 01, D: 110, E: 10$
\item $A: 001, B: 10, C: 101, D:00, E: 11$
\item $A: 11, B: 010, C: 011, D: 10, E: 00$
\item $A: 00, B: 01, C: 111, D: 110, E: 10$
\end{enumerate}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{zigzag scan}
You are given the following $8\times 8$ data matrix:
\[
\mathbf{A} = \begin{bmatrix}
80 & 0 & 0 &2 & 0& 0& 0& 0\\
-10 & 0 & 1 &0 &0 &0 &0 &0 \\
0 & 0 &0 &0 & 0& 0& 0& 0 \\
-2 & 0 &0 &0 & 0& 0&0& 0 \\
0 & 0& 0& 0& 0& 0& 0& 0 \\
1 &0 &0 & 0& 0& 0& 0& 0 \\
0 &0 & 0 & 0& 0& 0& 0& 0 \\
0 & 0 &0 &0 & 0& 0& 0& 0
\end{bmatrix}
\]
What is the result if we implement zigzag scan and runlength encoding on matrix $\mathbf{A}$?
Note: each symbol in the runlength encoding is composed of two numbers, where the first number denotes the run length, i.e., the number of zeros before the current value, and the second number is the actual value.
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{exercise}{Compression schemes}
Which of the steps in the JPEG image compression algorithm are lossy, i.e. which steps introduce loss of information. Note: assume that the DCT transform is computed with infinite precision.
\begin{enumerate}
\item Splitting the image into $8\times 8$ blocks
\item DCT transform on $8\times 8$ blocks
\item Quantization
\item Zig-zag scan
\item Run-length encoding
\item Hufman coding
\end{enumerate}
Select all that applies.
\end{exercise}
\end{document}

Event Timeline