Cv2.imshow placing the image window outside the visible screen

I am starting Anaconda installation from python35 with cv2 installation from menpo. I am having problems with the cv2.imshow()inconsistent placement of the image window outside the visible screen when I run the code, similar to the one indicated below both in the stand-alone script and in the line in the console (cmd, spyder, ipython) ...

import cv2
img = cv2.imread('Image71.jpg',0)
cv2.startWindowThread()
cv2.namedWindow('image')
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()

I also tried above, without cv2.starWindowThread()and cv2.namedWindow()with the same result. A window appears on my taskbar, but does not appear, cv2.waitKey(0)responds to a keystroke, and I can’t imagine the window in the field of view using any combination of shortcuts to the window for Windows 10 (for example, alt + tab, Winkey + on the left, etc.) d.). My OS is Win10 version 1709. Any help is greatly appreciated, thanks!

+4
1
img = cv2.imread("test.png")
winname = "Test"
cv2.namedWindow(winname)        # Create a named window
cv2.moveWindow(winname, 40,30)  # Move it to (40,30)
cv2.imshow(winname, img)
cv2.waitKey()
cv2.destroyAllWindows()
+4

Source: https://habr.com/ru/post/1689099/


All Articles