Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenCV Python Tutorial For Beginners - How to Read, Write, Show Images in OpenCV
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
You can’t perform that action at this time.