vuba.contour_mask

vuba.contour_mask(img, contours)[source]

Create a contour mask at the dimensions of contour(s).

Parameters
  • img (ndarray) – Grayscale image to produce circular mask for.

  • contours (list or ndarray) – Contour(s) to create mask with.

Returns

mask – Contour mask at the dimensions of the contour(s) supplied.

Return type

ndarray

Raises

ValueError – If the supplied image is not grayscale.