imgcv.quantization.to_binary

Functions

check_image(image)

Check if the input is a numpy array

to_binary(im[, threshold])

Converts an image to binary image

Module Contents

imgcv.quantization.to_binary.check_image(image)

Check if the input is a numpy array

Parameters:

image (np.ndarray) – Input image to be transformed

Raises:
  • TypeError – If the input is not a numpy array

  • ValueError – If the input is not a grayscale or color image

imgcv.quantization.to_binary.to_binary(im, threshold=127)

Converts an image to binary image

Parameters:
  • im (np.ndarray) – Input image

  • threshold (int) – Threshold value

Returns:

Binary image

Return type:

np.ndarray