I need to fill holes in images using python. This is the image with objects that I managed to get - they are really edges of object I want, so I need to fill them. 
It seemed very straightforward using ndimage.binary_fill_holes(A), but the problem is that it produces this (manually filled with red colour):
But I need this:
Any way this can be solved?
This is the first image without the axes if you want to give it a try: 


