2

My question is simple.

I have a large binary image, and I would like to fill the holes in the objects. Iv'e tried using binary_fill_holes, but since the image is so big, I have to tile it, so only a small part of the image is loaded into a numpy array at a time. Therefore holes may be divided over several tiles, and are not filled by binary_fill_holes.

Here is an example of one of the tiles: enter image description here

The white is the object, and all the black pixels are actually part of a hole that is also present in some of the neighbouring tiles. However, in this single tile it does not look like a hole, and is therefore not filled by the function.

I think maybe something with connected components could be used, but it gets the same tiling issues, and I am hoping there may be some easy, pythonic way.

Little geek
  • 592
  • 8
  • 22
  • Enlarging on your connected components idea. I think you could try and use `scipy.ndimage.label` for that. You'd need a bit of overlap between your tiles and would have to find a way to make the labeling consistent but that should be doable. How pythonic that would be is outside my field of expertise. – Paul Panzer Apr 11 '17 at 19:22

0 Answers0