This site is being phased out.

How do you count holes in a binary image?

From Mathematics Is A Science
Jump to navigationJump to search

Question: How do you count holes in a binary image?

One can simply invert the image and then count the objects in the negative.

You can still count the objects in the original image. The problem is that you can't easily associate an object and its holes. For that consider the algorithm here.