Converts input image into black and white (binary) :param image: Gray-scaled image. :return: Black and white image.
(image: np.ndarray)
| 34 | |
| 35 | |
| 36 | def binary_image(image: np.ndarray) -> np.ndarray: |
| 37 | # language=rst |
| 38 | """ |
| 39 | Converts input image into black and white (binary) |
| 40 | |
| 41 | :param image: Gray-scaled image. |
| 42 | :return: Black and white image. |
| 43 | """ |
| 44 | return cv2.threshold(image, 0, 1, cv2.THRESH_BINARY)[1] |
| 45 | |
| 46 | |
| 47 | def subsample(image: np.ndarray, x: int, y: int) -> np.ndarray: |