Last active
January 14, 2019 05:35
-
-
Save vihar/15bc7bb87efa103c57dd14e63e89698f to your computer and use it in GitHub Desktop.
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 cv2 | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
img_path = 'dog.jpg' | |
bgr_img = cv2.imread(img_path) | |
gray_img = cv2.cvtColor(bgr_img, cv2.COLOR_BGR2GRAY) | |
# Normalise | |
gray_img = gray_img.astype("float32")/255 | |
plt.imshow(gray_img, cmap='gray') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment