Help explain a portion of a code
古いコメントを表示
Hi, I need help in explaining what the bolded part of the code does. I understand the rest but I'm having a hard time figuring out what the bolded code means. If possible can someone simplify the code to make it easier to understand. Thank you.
file=input('Enter filename: ','s');
im=imread(file);
newim=uint8((zeros(size(im))));
for k=1:3
for i=2:size(im,1)-1
for j=2:size(im,2)-1
pixel=-4*double(im(i,j,k))+double(im(i+1,j,k))+double(im(i-1,j,k))+double(im(i,j+1,k))+double(im(i,j-1,k));
newim(i,j,k)=pixel;
end
end
end
newName=[file(1:find(file=='.')-1),'Outline',file(find(file=='.'):end)];
imwrite(newim,newName);
fprintf('Outline saved to %s\n',newName)
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!