hellojoshhhy
hellojoshhhy

Reputation: 958

opencv-python namedWindow() can't resize window

I am using namedWindow() function in my code to resize the image's window. The mouse cursor showing i can resize the windows, but it actually can't. Here is my code

import numpy as np
import cv2

img=cv2.imread('/home/jeff/Downloads/iphone.png', 1)
cv2.namedWindow('image',cv2.WINDOW_NORMAL)
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()

Please assist. Thanks.

Upvotes: 4

Views: 9715

Answers (2)

luator
luator

Reputation: 5017

There is a bug (at least in v3.2.0) that the resizing does not work if the image is bigger than the screen resolution. See the issue on GitHub.

Upvotes: 0

Jazz
Jazz

Reputation: 946

Replace code line cv2.namedWindow('image',cv2.WINDOW_NORMAL) with following:

cv2.namedWindow('image',cv2.WINDOW_AUTOSIZE)

Upvotes: 1

Related Questions