Last active
February 22, 2021 09:11
-
-
Save anupam-io/63924a6285af96db3dcaebd2892a0886 to your computer and use it in GitHub Desktop.
Flattening a colored image by converting into grayscale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 | |
img = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE) | |
img = cv2.resize(img, (20, 20)) | |
img = np.array(img).ravel() | |
img = img.reshape(-1) | |
print(img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment