MATLAB: Number of pixel, image outline and image processing

areaboundaryimageimage processingpixels

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.

Best Answer

doc bwconncomp
doc regionprops
doc bwarea