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

Function binary_image

bindsnet/datasets/preprocess.py:36–44  ·  view source on GitHub ↗

Converts input image into black and white (binary) :param image: Gray-scaled image. :return: Black and white image.

(image: np.ndarray)

Source from the content-addressed store, hash-verified

34
35
36def 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
47def subsample(image: np.ndarray, x: int, y: int) -> np.ndarray:

Callers 1

preprocessMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected