System information (version)
- OpenCV => python-opencv/bionic-updates,bionic-security,now 3.2.0+dfsg-4ubuntu0.1 amd64 [installed]
- Operating System / Platform => Ubuntu 18.04
- EDIT: GTK backend, I use Xubuntu.
- EDIT: I didn't build opencv, I just installed the python-opencv package through APT.
Detailed description
WINDOW_NORMAL does not work when image is higher than display resolution.
I have two images: the big one is 2560x2048, the small one is 750x600. My display is set to 1920x1080 resolution.
When I load the small one using the code below, everything works as expected: I can resize and maximize the window, and image "scales" to window size.
Now I load the big one (which is exactly the same image, just bigger). Resize doesn't work (it just moves the window instead). Maximize sets the window and the image to the original resolution, which is much bigger than my display resolution, and can't see the whole image on my screen.
One thing that I noticed is that in version 2.4 I could resize the window to a size lower than the image resolution. This doesn't work anymore in version 3.2 and might be key to the problem.
Note: This seems a similar issue, but is not. I can't resize the image because I'm interested in the coordinates of the user when he clicks on the image.
Steps to reproduce
import cv2
path="/tmp/img.jpg" # or small_img.jpg
img = cv2.imread(path, 1)
cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()