cv2.imshow image window placement is outside of viewable screen cv2.imshow image window placement is outside of viewable screen python python

cv2.imshow image window placement is outside of viewable screen


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


wrapped answer by Kinght in a function for easy calling

def showInMovedWindow(winname, img, x, y):    cv2.namedWindow(winname)        # Create a named window    cv2.moveWindow(winname, x, y)   # Move it to (x,y)    cv2.imshow(winname,img)img = cv2.imread('path.png')showInMovedWindow('named_window',img, 0, 200)