Hello, I am trying to count the number of objects(that has "ones") in a binary array. Of course I do not expect to count holes. But when I run the below code, file1='4.csv' a=np.loadtxt(open(file1,'rb'),delimiter=',',dtype=int) #print (a.shape) img=measure.label(a) propsa = measure.regionprops(img) length = len(propsa) print ('length='+str(length)) for label in propsa: print (label.centroid) returns length=2 (214.23444957510378, 505.25546156532539) (238.77173913043478, 740.28260869565213) I get two objects. From reading the centroid coordinates(above), it seems it is counting the center of the white object and the cavity (can be seen in the image bellow). Why is this algorithm counting cavities and not only objects that are of "ones"? Is there an argument to enforce only objects and not cavities? Attached is the csv file if you want to try for yourself. Thanks