bwarea & area, white/black ratio
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
dan kin
il 3 Ott 2012
Commentato: Image Analyst
il 22 Dic 2017
Hi,
Can someone please explain me what is the difference of bwarea & area.
I have an image which is black and white (after segmentation and fill) & I wish to calculate the area of an object (as I understand done by bwarea) relative to the image area (imageArea = regionprops(image_name, 'Area')), more or less calculating the white/black ratio.
Any other ideas is welcome.
Thanks.
0 Commenti
Risposta accettata
Image Analyst
il 3 Ott 2012
Modificato: Image Analyst
il 3 Ott 2012
They use different algorithms. regionprops gives the number of pixels while bwarea gives some kind of weighted area that depends on the shape of the boundary. This is described in the documentation for bwarea
The white to black ratio is
totalPixels = numel(binaryImages);
numWhitePixels = sum(binaryImage(:));
numBlackPixels = totalPixels - numWhitePixels;
ratio = numWhitePixels / numBlackPixels;
0 Commenti
Più risposte (1)
dan kin
il 3 Ott 2012
3 Commenti
shivam sahil
il 21 Dic 2017
Hey! I want to implement the same code for RGB to get pixel count of particular rgb index, please guide me with the code for the same.
Image Analyst
il 22 Dic 2017
See attached demo. Also see the function colorcloud().
Vedere anche
Categorie
Scopri di più su Signal Modeling in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!