smooth_mask

formatreader.smooth_mask(img, n_iter=1, circle_size=5)

Smooths the input image via erosion/dilation operations.

Parameters:
  • img (Numpy array) – A 2D binarized image.

  • n_iter (int) – Number of erosion/dilation operations to be performed.

  • circle_size (int) – Size of the structuring element to perform the erosion/dilation operations.

Returns:

The smoothed version of the input image.

Return type:

Numpy array