MCPcopy Create free account
hub / github.com/BindsNET/bindsnet / gray_scale

Function gray_scale

bindsnet/datasets/preprocess.py:10–18  ·  view source on GitHub ↗

Converts RGB image into grayscale. :param image: RGB image. :return: Gray-scaled image.

(image: np.ndarray)

Source from the content-addressed store, hash-verified

8
9
10def 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
21def crop(image: np.ndarray, x1: int, x2: int, y1: int, y2: int) -> np.ndarray:

Callers 1

preprocessMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected