From: <Saved by Windows Internet Explorer 7>
Subject: 
Date: Tue, 11 Dec 2007 15:47:58 -0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Content-Location: http://www.stanford.edu/class/ee263/matlab/smooth_interpolation.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY><PRE>% smooth_interpolation.m
% Defines m, n, wknown, Zknown, Zunknown, Dx, Dy.

% Create an interesting image.
[X,Y] = meshgrid(-2:.15:2, -2:.15:2);
Uorig = sin(-X+Y-1).^2.*cos(X+Y+1) + 1;
[m, n] = size(Uorig);
Dx = [zeros(m*(n-1),m) eye(m*(n-1))] - [eye(m*(n-1)) zeros(m*(n-1),m)];
Dy = kron(eye(n), diff(eye(m)));

% Create and apply a mask to create Uboscured.
rand('seed', 263); W = rand(m,n) &gt; 0.5;
Uboscured = W.*Uorig;

% Form Zunknown and Zknown.
tm = diag(1-W(:)); tminv = diag(W(:));
Zunknown = tm(find(sum(tm,2)~=0),:)';
Zknown = tminv(find(sum(tminv,2)~=0),:)';

wknown = Zknown'*Uboscured(:);

% Graph the original and obscured images.
figure;
subplot(221);
imagesc(Uorig)
title('Original image');

subplot(222);
imagesc(Uboscured);
title('Obscured image');
</PRE></BODY></HTML>
