Issue
Is there a way to force the window displayed by OpenCV (cv2.imshow()
)when displaying an image to fit to the width and height of the image without the need to resize by the mouse it for that ?
Solution
You need to pass CV_WINDOW_AUTOSIZE when creating the namedWindow (or WINDOW_AUTOSIZE
if you import cv2
instead of cv
)
Here is an example:
cv2.namedWindow("window", cv2.WINDOW_AUTOSIZE)
# or cv.namedWindow("window",cv.CV_WINDOW_AUTOSIZE)
cv2.imshow("window", yourimage)
Answered By - tux3
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.