How filter2() is working in this code?
Show older comments
function G=costfunction(im)
G=zeros(size(im,1),size(im,2));
for ii=1:size(im,3)
G=G+(filter2([.5 1 .5; 1 -6 1; .5 1 .5],im(:,:,ii))).^2;
end
end
Answers (0)
Categories
Find more on Image Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!