





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






Dear EECS 556 Class – Thank you for your and participation in class. Please accept my best wishes for an enjoyable summer. – Doug Noll
Final Exam Scores: Median = 91, 1st quartile = 94, 3rd quartile = 85 Overall Grade Ranges: 97 and up: A+; 91-96: A; 85-90: A-; 80-84: B+; 79 and below: B
f kl S n k m l f kl hnmk l
f nm S f nm S f nm nm S f k l n k m l
k l k l
k l
blur
∑ ∑ ∑ ∑
∑ ∑
= − − =
δ
δ δ
We now column stack all quantities in ( n , m ) and we’ll get: f ( p ) f ( k , l ) h ( p ; k , l ) k l
blur =∑ ∑
and by letting q = k*M +1 (sorry – typo in the problem statement – should have been M not N ), we get: f ( p ) f ( q ) h ( p ; q ) q
blur =∑
which is just the matrix multiplication Hf where the elements of H are h ( p ; q ), where q is the column index and p is the row index. b. I did the “brute force” method, but there are lots of more elegant ways. See code. c. f is a zero-mean, unit variance point Bernoulli process: R (^) f ( n , m )= δ ( n , m ), so K f is the identity matrix. v is a white Gaussian process convolved by a rect function: Rv ( n , m )= δ ( n ) tri 3 ( m ). See code for implementation of K v.
d. We implement f ˆ^ = ( H ' K − v^1 H^ + K − f^1 )−^1 H ' K − v^1 g. See code. e. B ( ω (^) x , ωy )= 1 + 2 cos ωx
f. P (^) f ( ω (^) x , ωy )= 1 and Pv ( ω (^) x , ωy )=( nsd )^2 ( 1 + 2 cos ωy )^2
g. ( , ) ( , ) ( , )
f x y x y v x y
f x y x y x y P B P
ω ω ω ω ω ω
ω ω ω ω ω ω
=. See code for implementation and
plots for results. MSE for Part d. is better, but not by much.
h. After reducing the noise variance, we can see more substantial differences between the standard (Fourier) Wiener filter and the statistical MMSE estimator.
At low noise levels, the filter is doing mainly deblurring. The statistical MMSE estimator is better because it properly models the spatially variant behavior at the edges of the object. The Wiener filter assumes circulant behavior or zeros in the case of zero padding
Code: % eecs 556, 2003, final exam, problem 1 rand('state',0);randn('state',0); nx = 16; ny = 16; nsd = 1;
title(sprintf('Statistical MMSE Estimator, MSE = %.2f',msew)); subplot(224); imagesc(fhat2,clim); colormap gray; colorbar; axis('image') title(sprintf('Wiener Filtered Image (Fourier), MSE = %.2f',msew2)); figure(2) subplot(221); imagesc(H); colormap gray; colorbar; axis('image'); title('H') subplot(222); imagesc(kf); colormap gray; colorbar; axis('image'); title('Kf') subplot(223); imagesc(kv); colormap gray; colorbar; axis('image'); title('Kv, \sigma = 1') subplot(224); imagesc(kv); colormap gray; colorbar; axis('image'); axis([1 35 1 35]); title('Kv, \sigma = 1 - zoomed')
Images:
Code: % eecs 556, 2003, final exam, problem 2 load hw7image; f0 = hw7image; f0(end+1,end+1)=0; % make filter a = .4; h1 = [(.25-a/2) .25 a .25 (.25-a/2)]; h = h1'h1; f0l = conv2(f0,h,'same'); f1 = f0l(1:2:end,1:2:end); f1l = conv2(f1,h,'same'); f2 = f1l(1:2:end,1:2:end); % linear interp kernel h2 = [1 2 3 4 3 2 1]/4; hh = h2'h2; % build estimate f0lhat = zeros(size(f0)); f0lhat(1:4:end,1:4:end) = f2; f0lhat = conv2(f0lhat,hh,'same'); e0 = f0 - f0lhat; subplot(421); imagesc(f0); colormap(gray); colorbar; title('f0'); subplot(422); imagesc(e0); colormap(gray); colorbar; title('e0'); subplot(423); imagesc(f2); colormap(gray); colorbar; title('f2'); % variances and bit rates ve0 = var(e0(:)); vf2 = var(f2(:)); vm = (ve0^(16)vf2).^(1/(16+1)); tmpbpp = 1.5prod(size(f0))/(prod(size(e0))+prod(size(f2))); be0 = (tmpbpp + 0.5*log2(ve0/vm))
T ( θ , a , b ), the rotation happens first followed by translation. One inverse would be to translate by – a and – b the rotate by – θ. a ' ≠ a and b ' ≠ b because in implementing as another matrix in the form T , we do the operations as rotation then translation, so the inverse translations have to be projected through the – θ rotation matrix:
− − − θ θ
θ θ θ θ
θ θ θ θ θ sin cos
cos sin sin cos
cos sin a b
a b y
x b
a y
x y b
x a R R R
c. We know from sampling theory that ( , ) ( , ) d
l d
k k l
∑ ∑
∑ ∑
d
l
d
k
d
l
d
k
k l
d
l d
k k l
s
v
u i a b v
u F
G uv Gu v
R θ π R θ
d. To reconstruct the f from gs , we first can consider that the relationship between f and g is known and invertible. Thus, we can consider what properties of g can be reconstructed and relate those back to f. g can be reconstructed from gs if G ( u , v ) is non-zero only for u (^) 2 d < 1 and v (^) 2 d < 1. Our conditions on f are then that F ( u , v ) must be non-zero only for
u v 2 d cos θ − sin θ <^1 and v u 2 d cos θ + sin θ <^1 , as shown below. This particular distribution does not allow reconstruction from fs. To allow reconstruction from both gs and fs we would need to add these conditions: d u 2 < 1 and d v 2 < 1 (an octagonal shaped
region). To handle an arbitrary angle θ , the condition is u^2 + v^2 < 21 d.
1/d 1/d
u
v F(u,v)
2
2
(^1) −. Since we are doing the transform in both x and y, the
output of haar2.m must be divided by 2. See haar2new.m below. d. Basis functions, by region: a. ax (0) and ay (0) b. ax (1) and ay (0) c. ax (0) and ay (1) d. ax (1) and ay (1) e. ax (2) and by (0), ax (3) and by (0), ax (2) and by (1), ax (3) and by (1) f. ay (2) and bx (0), ay (3) and bx (0), ay (2) and bx (1), ay (3) and bx (1) g. ax (2) and ay (2), ax (3) and ay (2), ax (2) and ay (3), ax (3) and ay (3)
2
1 2
1 2
bd. We can see these visually in the following figure. This was generated by running “ihaar2.m” from part f. on a 4x delta function image with the delta function moved to all 16 possible locations specified by a-g. This is close, but not exactly a 4x4 2D Haar transform.
e. They are all orthogonal, as can be readily seen from the above figure. It is true that the b bases are not orthogonal with ad (0) and ad (1), but the b bases are always in combination with a bases in the orthogonal direction so the 2D bases are orthogonal. f. “haar2new.m” implements a 2x2 2D Haar transform. It turns out that the inverse transform is exactly the same for the 2x2 case, e.g. A T= A. The real challenge here is just the reordering of the transformed image pixels. See code and “ihaar2.m”.