Created
February 9, 2019 13:51
-
-
Save himaprasoonpt/b78cda9b964266316e5e150053d6c2ba to your computer and use it in GitHub Desktop.
OpenCV python show image
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 | |
def show_image(img, wait_key=0, text="image", fx=0.5, fy=0.3): | |
""" | |
Utility to show image | |
:param img: Image array | |
:param wait_key: Wait key to stop showing | |
:param text: Text to be displayed | |
:param fx: resize factor in x dimension | |
:param fy: resize factor in y dimension | |
:return: | |
""" | |
img = cv2.resize(src=img, dsize=(0, 0), fx=fx, fy=fy) | |
cv2.imshow(text, img) | |
cv2.waitKey(wait_key) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment