% Kronecker blur. % An example for computer lab. % Load the image of the moon and plot it. clear all, close all xtrue = imread('moon.tif'); xtrue = double(xtrue); figure(1), imagesc(xtrue), axis image, colormap(gray), colorbar % Create the first type of blur. % Here Ac corresponds to the column blur % and Ar corresponds to the row blurr. [m,n] = size(xtrue); c = zeros(m,1); c(1:5) = [5:-1:1]'/25; Ac = toeplitz(c); c = zeros(n,1); c(1:10) = [5:-.5:.5]'/50; Ar = toeplitz(c); % Create blurred noise data and plot it. noise = 5;%input(' The standard deviation of the noise = '); b = Ac*xtrue*Ar' + noise*randn(m,n); figure(2), imagesc(b), axis image, colormap(gray), colorbar % Compute naive solution and plot it. xnaive = Ac\b/Ar'; figure(3), imagesc(xnaive), axis image, colormap(gray), colorbar