image_to_be_labeled = ((difference_image > threshold) * 255).astype('uint8')
labelarray, particle_count = scipy.ndimage.measurements.label(
    image_to_be_labeled)
Counting particles using image processing in python