Converts RGB image into grayscale. :param image: RGB image. :return: Gray-scaled image.
(image: np.ndarray)
| 8 | |
| 9 | |
| 10 | def gray_scale(image: np.ndarray) -> np.ndarray: |
| 11 | # language=rst |
| 12 | """ |
| 13 | Converts RGB image into grayscale. |
| 14 | |
| 15 | :param image: RGB image. |
| 16 | :return: Gray-scaled image. |
| 17 | """ |
| 18 | return cv2.cvtColor(image, cv2.COLOR_RGB2GRAY) |
| 19 | |
| 20 | |
| 21 | def crop(image: np.ndarray, x1: int, x2: int, y1: int, y2: int) -> np.ndarray: |