Effacer les filtres
Effacer les filtres

I have a binary image and want to find the area of white in the image

2 vues (au cours des 30 derniers jours)
MJ Thangaraj
MJ Thangaraj le 8 Mar 2016
Commenté : Image Analyst le 8 Mar 2016
I used rgb2gray(), im2bw and I have a Binary Image all is to find the area of the white portion

Réponses (1)

Image Analyst
Image Analyst le 8 Mar 2016
There are 3 ways
area1 = bwarea(binaryImage)
area2 = sum(binaryImage(:))
measurements = regionprops(logical(binaryImage), 'Area');
area3 = sum([measurements.Area])
The first one uses a different algorithm than the other two and will give different results depending on the shape of the boundary. The second two are just pixel counting.
  2 commentaires
MJ Thangaraj
MJ Thangaraj le 8 Mar 2016
But the Answer is in Pixels.What should I do to get it in cm2 or some other world units?
Image Analyst
Image Analyst le 8 Mar 2016
See my attached spatial calibration demo. If that answers all your questions, can you mark it as Accepted?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by