How to get Object to Background pixel ratio OBR) of an image
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;
Answers (0)
Categories
Find more on Image Category Classification 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!