How after ndimage.find_object ... color functions?

I have a large image, which after marking has about 500 functions. I know how to get them in slices using find_object, but I want to color them so that I can see the result. Any quick suggestion for this?

+4
source share
1 answer

You can use matplotlib as follows:

import scipy from scipy import ndimage import matplotlib.pyplot as plt im = scipy.misc.imread('all_blobs.png',flatten=1) im, number_of_objects = ndimage.label(im) blobs = ndimage.find_objects(im) plt.imsave('blobs.png', im) for i,j in enumerate(blobs): plt.imsave('blob'+str(i)+'.png',im[j]) 

source image:

enter image description here

tagged image:

enter image description here

slices containing drops:

enter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description hereenter image description here

+7
source

All Articles