Last active
July 26, 2023 05:00
-
-
Save kefir-/03cea3e3b17b7a74a7cdcf57a2159a79 to your computer and use it in GitHub Desktop.
Python cv2 show image in window with correct size
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
#!/usr/bin/env python | |
import cv2 | |
c = cv2.imread('ketil.jpg') | |
height, width = c.shape[:2] | |
cv2.namedWindow('jpg', cv2.WINDOW_NORMAL) | |
cv2.resizeWindow('jpg', width, height) | |
cv2.imshow('jpg', c) | |
r = cv2.waitKey(0) | |
print "DEBUG: waitKey returned:", chr(r) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment