Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
I'm new to image processing and cannot trace this code?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
hi I'm new to image processing and I can not trace this code,can any body say a brief explanation about what is that function?? thanks
function H = circconvmatx2(h, M,N)
[mh, nh] = size(h);
if mh~=nh,
error('blur kernel must be square');
end
blockheight = N;
blockwidth = M;
for i=((nh+1)/2):nh,
%Take the kernel
h0 = h(:,i);
h0 = h0(:)';
h0 = fliplr(h0);
h0 = circshift( padarray( h0, [0 N-nh], 'post' ), [0 -(nh+1)/2+1] );
if sum(find(abs(h0)>0)) == 0,
H0 = sparse(M,M);
else
H0 = sparse(circulant(h0'));
end
if i==(nh+1)/2,
H = H0;
else
H = [H H0];
end
end
for i=(nh+1)/2-1:-1:1,
%Take the kernel
h0 = h(:,i);
h0 = h0(:)';
h0 = fliplr(h0);
h0 = circshift( padarray( h0, [0 N-nh], 'post' ), [0 -(nh+1)/2+1] );
if sum(find(abs(h0)>0)) == 0,
H0 = sparse(M,M);
else
H0 = sparse(circulant(h0'));
end
H = [H0 H];
end
H = [H, sparse(zeros(N,N*(N-nh)))];
H = circshift( H, [0 -N*((nh+1)/2-1)] );
H0 = H;
for i=1:N-1,
H = [H; circshift( H0, [0 N*i] )];
end
1 Commento
Walter Roberson
il 8 Giu 2015
Some kind of 2D circular convolution. circulant() is not a Mathworks-provided function but might be http://www.mathworks.com/matlabcentral/fileexchange/22858-circulant-matrix
Risposte (0)
Questa domanda è chiusa.
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!