How can i check in numpy if a binary image is almost all black?
Assuming that all the pixels really are ones or zeros, something like this might work (not at all tested):

def is_sorta_black(arr, threshold=0.8):
    tot = np.float(np.sum(arr))
    if tot/arr.size  > (1-threshold):
       print "is not black" 
       return False
    else:
       print "is kinda black"
       return True
How can i see in if a binary image is almost all black or all white in numpy or scikit-image modules ?
I thought about numpy.all function or numpy.any but i do not know how neither for a total black image nor for a almost black image.