I read an image with ndimage, which results in a binary image like this:
numpy.invert(close_img)
I use invert array. It works for me.