how to do the distance transform
Afficher commentaires plus anciens
Hi,all.I am processing a image. I need to do the distance transformation.This is my code:
myImage=imread('EarImage_1.tif');
I = rgb2gray(myImage);
whitePart = I > 220;
blackPart = I < 110;
imshow(whitePart);
I2=1-blackPart;
figure,imshow(I2);
D=bwdist(I2);
figure,imshow(~D);
This is my original picture:
After this process,I got an image just the same as "I2",which is the binary image before. I didn't get the picture as expected. I am a beginner of matlab. If anyone could tell me the solution of that, I would appreciate very much.
Thank you.
1 commentaire
Walter Roberson
le 12 Déc 2011
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 12 Déc 2011
0 votes
Do not subtract blackPart from 1 if you want to see white pixels for the locations selected by blackPart.
1-(I<110) is the same as (I>=110) which could look very similar to (I>220) that you are already plotting. All of the (I>220) would be included within the (I>=110)
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!