Help explain a portion of a code
Afficher commentaires plus anciens
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)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Filtering dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!