Created
February 7, 2019 23:09
-
-
Save pknowledge/ce4fa9e544fd96dcf549a6c1d7746da9 to your computer and use it in GitHub Desktop.
OpenCV Python Tutorial For Beginners - How to Read, Write, Show Images in OpenCV
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 | |
img = cv2.imread('lena.jpg', -1) | |
cv2.imshow('image', img) | |
k = cv2.waitKey(0) & 0xFF | |
if k == 27: | |
cv2.destroyAllWindows() | |
elif k == ord('s'): | |
cv2.imwrite('lena_copy.png', img) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment