Last active
August 13, 2017 13:25
-
-
Save vsanse/5e501a1a6baeafb51c9b2d0470dbe3a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# loading as default colored image | |
img1 = cv2.imread("watch.jpg") | |
# loading image as grayscale image | |
img2 = cv2.imread('watch.jpg', cv2.IMREAD_GRAYSCALE) | |
#IMREAD_COLOR=1,IMREAD_UNCHANGED=-1,IMREAD_GRAYSCALE=0 | |
#loading unchanged image | |
img3 = cv2.imread('watch.jpg', cv2.IMREAD_UNCHANGED) | |
# showing images | |
cv2.imshow('COLORED_IMAGE', img1) | |
cv2.imshow('GRAYSCALE_IMAGE', img2) | |
cv2.imshow('UNCHANGED_IMAGE', img3) | |
# output window wait infinitely for a key press | |
cv2.waitKey(0) | |
# closes all output windows on keypress | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment