Fill Holes

Function

This Step is used to fill the holes in the non-zero pixel regions in the input binary image.

Note

  • The binary image means that each pixel on the image has only two possible values. Common binary images include black and white images, monochrome images, etc.

  • In this step, the non-zero pixel is a pixel with a pixel value of 255.

Usage Scenario

This step is usually used for image segmentation. It obtains a complete image of the target area and avoids interference caused by missing images in the hole section.

Input and Output

../../../../_images/input_and_output4.png

Parameter Description

Holes

Explanation: This parameter is used to select the type of holes to be filled.
Options:
  • Complete: only the complete holes surrounded by non-zero pixels will be filled.

  • All: both the complete holes surrounded by non-zero pixels and incomplete holes that are not entirely surrounded by non-zero pixels will be filled.

Please refer to Parameter tuning example for more information.

Default setting: Complete.
Instruction: Select the type of hole according to the actual situation.

Parameter Tuning

Fill Complete Holes

The effect of filling complete holes is shown in the right figure below. Only complete holes surrounded by non-zero pixels are filled, and incomplete holes at the edge of the image (as shown in the yellow frame) that are not entirely surrounded by non-zero pixels are not filled.

../../../../_images/fill_complete_hole.png

Fill All Holes

The effect of filling all holes is shown in the right figure below. Both complete holes surrounded by non-zero pixels and incomplete holes at the edge of the image that are not entirely surrounded by non-zero pixels are filled.

../../../../_images/fill_all_hole.png