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

Function subsample

bindsnet/datasets/preprocess.py:47–57  ·  view source on GitHub ↗

Scale the image to (x, y). :param image: Image to be rescaled. :param x: Output value for ``image``'s x dimension. :param y: Output value for ``image``'s y dimension. :return: Re-scaled image.

(image: np.ndarray, x: int, y: int)

Source from the content-addressed store, hash-verified

45
46
47def subsample(image: np.ndarray, x: int, y: int) -> np.ndarray:
48 # language=rst
49 """
50 Scale the image to (x, y).
51
52 :param image: Image to be rescaled.
53 :param x: Output value for ``image``'s x dimension.
54 :param y: Output value for ``image``'s y dimension.
55 :return: Re-scaled image.
56 """
57 return cv2.resize(image, (x, y))
58
59
60""" Below is the implementation of necessary preprocessing for the dataset ALOV300 """

Callers 1

preprocessMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected