Hi Sam and thanks to reply me.
The .m code is:
close all;
clear all;
I = imread('cameraman.tif');
PSF = fspecial('motion',13,45);
Blurred = imfilter(I,PSF,'circ','conv');
INITPSF = ones(size(PSF));
[J P]= deconvblind(Blurred,INITPSF,30);
WEIGHT = edge(I,'sobel',.28);
se1 = strel('disk',1);
se2 = strel('line',13,45);
WEIGHT = ~imdilate(WEIGHT,[se1 se2]);
WEIGHT = padarray(WEIGHT(2:end-1,2:end-1),[2 2]);
WEIGHT(:,size(WEIGHT,2)) = [];
WEIGHT(:,size(WEIGHT,2)-1) = [];
WEIGHT(size(WEIGHT,1),:) = [];
WEIGHT(size(WEIGHT,1)-1,:) = [];
WS = double(WEIGHT);
P1 = P;
P1(find(P1 < 0.01))=0;
[J2 P2] = deconvblind(Blurred,P1,50,[],WS);
save -ASCII -tabs PSF.txt PSF;
imwrite (Blurred,'blurredprova.jpeg');
imwrite (WS,'WSprova.jpeg');
"fspecial" is a function of the MATLAB Image Processing Toolbox and it' s used to create special filters to process image.
Is not possible to work with this function without calling of MATLAB editor?
Thanks a lot for your time.
Bye
Andrea.