
%clear all; close all;
img = imread('cameraman.tif'); figure; imshow(img,[]);
img = double(img);

h = fspecial('gaussian',[7 7],1.0);
%h = ones(3,3)/9;

g = imfilter(img,h);  
g = g + 0.1*randn(size(g)); 
figure; imshow(g,[]); title('Blurred and noisy image');


n=20;
t=3;
f=pocs(g,h,t,n);
figure; imshow(uint8(f)); title('Restored image');
