Number of pixel, image outline and image processing
Mostrar comentarios más antiguos
I'm still new in Matlab. I had segmented gray scale image into four regions like this.
I would like to calculate area/no. of pixel for each region within each human image. My idea is drawing outline of each human images and then calculate no. of pixel for white, light gray and dark gray regions in the image. Is there any idea to do that, or better idea? What i learnt and found only the method for binary image, not same with this one.
Thanks in advance.
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 1 de Feb. de 2012
0 votos
See my image segmentation tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. I do that exact thing, except for coins instead of humans.
8 comentarios
Syahrul Niezam
el 2 de Feb. de 2012
Image Analyst
el 2 de Feb. de 2012
Yes.
Syahrul Niezam
el 2 de Feb. de 2012
Image Analyst
el 2 de Feb. de 2012
It is not for a binary image. It uses a gray scale image, just like you do. There is a binary image that defines where you look in the gray scale image to compute areas and intensities, etc. but the original image is still gray scale and you should be able to adapt it very easily to your image. Very easily.
Syahrul Niezam
el 2 de Feb. de 2012
Image Analyst
el 2 de Feb. de 2012
You can't do labeling on a non-binary image. It doesn't make sense. You have to have an image that separates your image into foreground and background, and that is a binary image. How can you do anything without deciding what is foreground and background? Tell me, does your image have a foreground? Of course it does.
Syahrul Niezam
el 2 de Feb. de 2012
Image Analyst
el 2 de Feb. de 2012
First use bwareaopen() to get rid of small regions. Then say
binaryImage = yourImage >= 100 & yourImage <= 150; % Or whatever it needs for the range you're interested in.
labeledImage = bwlabel(binaryImage);
measurements = regionprops(labeledImage, 'area');
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!