Area/Number of pixel in gray-scale image
2 views (last 30 days)
Show older comments
I'm sorry for asking the same question as previous. I'm trying to calculate area/no. of pixel in this image.
I want to calculate no of pixel in white, light gray and dark gray regions separately. I'm very thankful that some of people for some tips. I had tried using bwconncomp and regionprops after binarizing the image. However, error came out for the bwconncomp line.
I'm also trying the labeling process to find area, but the labeling process is failed too.
I hope anybody can help to solve my problems. Thanks in advance.
0 Comments
Answers (1)
Image Analyst
on 8 Feb 2012
Did you try something like
binaryImage = grayImage == 200; % Or whatever
measurements = regionprops(binaryImage, 'area');
allAreas = [measurements.Area];
bwconncomp is done implicitly inside regionprops if you pass regionprops a logical image instead of a labeled image or connected components structure.
2 Comments
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!