Python OpenCV open window on top of other applications

前端 未结 3 1126
南旧
南旧 2020-12-17 09:57

When executing an OpenCV python script containing: cv2.imshow(img) the resulting window opens behind my terminal window. This is a mild irritation - is there an

3条回答
  •  没有蜡笔的小新
    2020-12-17 10:33

    Open a namedWindow before imshow, for instance:

    cv2.namedWindow('ImageWindowName', cv2.WINDOW_NORMAL)
    cv2.imshow('ImageWindowName',img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
    

    Comment if this makes any different.

提交回复
热议问题