This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
%function_1
function [B, psf] = sfoca(A)
% function [B, psf] = sfoca(A)
% In input:
% A, matrice dell’immagine da sfocare
% In output:
% B, matrice dell’immagine sfocata
% psf, matrice della PSF utilizzata
% Definisco la PSF
psf=zeros(21,21);
psf(1,1)=1/61;
psf(1,2)=1/61;
psf(21,21)=1/61;
psf(21,20)=1/61;
for i=2:20
for j=i-1:i+1
psf(i,j)=1/61;
end
B = A;
% Applico la sfocatura
for j = 1 : 3
B(:,:,j) = conv2(A(:,:,j), psf, 'same');