课程主页:https://see.stanford.edu/Course/EE261

这次回顾Problem Set 9。

Problem 1

取逆变换可得

Problem 2

注意汉高变换为

考虑$g(ar)$的汉高变换

Problem 3

(a)

(b)注意到我们有

所以

从而

(c)

所以

(d)

取傅里叶变换可得

Problem 4

(a)

(b)

(c)

(d)

Problem 5

(a)考虑$f$第$m$行$f_m[l]$,我们有

那么

所以可以先利用FFT计算$\mathcal F f_m[l] $,然后再利用FFT计算二维的结果。

(b)

(c)

Problem 6

%(a)
data = imread("dog.jpg");
Max = 255;
data = im2double(data);
imshow(data);

%(b)
data_new = treat(data);
figure(1)
imshow(data_new);

%(c)
i = 2;
F = 0.5: -0.05: 0.1;
[Xmax ,Ymax] = size(data);
for f = 0.5: -0.05: 0.1
    h = LP_filter(Xmax, Ymax, f);
    data1 = real(ifft2(fft2(data) .* h));
    data_new = treat(data1);
    figure(i);
    suptitle(sprintf('Initial Image with Object Boundaries (f=%g)', f));
    imshowpair(data1, data_new, 'montage');
    i = i + 1;
end

函数treat:

function data_new = treat(data)

Max = 255;
Bx = [0, 0, 0; 1, -1, 0; 0, 0, 0];
By = [0, 1, 0; 0, -1, 0; 0, 0, 0];
datax = Max * conv2(data, Bx, 'same');
datay = Max * conv2(data, By, 'same');
data_new = data;
data_new(abs(datax) > 10) = 1;
data_new(abs(datay) > 10) = 1;