Hi, im trying to get the number of objects in an binary image but it return the wrong answer (it should be 6 but it return 31). here is the code and the image:
I=imread('2.jpg');I_BW=im2bw(I,0.87);I1=imcomplement(I_BW);[L,n]=bwlabel(I1);
binarybinary imagedigital image processingimage analysisimage processingImage Processing Toolboximage segmentationnumber of objectsobject count in binary image
I=imread('2.jpg');I_BW=im2bw(I,0.87);I1=imcomplement(I_BW);[L,n]=bwlabel(I1);
Best Answer