How to get Object to Background pixel ratio OBR) of an image
6 views (last 30 days)
Show older comments
I am new in matlab,I am confused how to get value Object to background pixel ratio(OBR) of an image.This is my code.Please Help me.Thank you..
Image = imread('1.jpg');
BW = im2bw(Image);
[labeled,num] = bwlabel(BW,4);
nBlack = sum(BW(:));
nWhite = numel(BW) - nBlack;
OBR=num/nBlack;
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!