Skip to contents

Fast internal hole filling (with optional maximum hole size and neck distance check)

Usage

fill_holes_cpp(img, max_size = -1, min_neck_dist = 0)

Arguments

img

A logical matrix representing the binary image.

max_size

Maximum area (in pixels) of internal holes to fill. If <= 0 (default), fills all holes.

min_neck_dist

Minimum foreground thickness (distance to background) surrounding a hole to allow filling. Default = 0.0 (fill all internal holes).