如何将 openCV 中的 imshow() 和 moveWindow() 与 python 组合?
How to combine imshow() and moveWindow() in openCV with python?
我正在无限循环中更新 cv2.imshow() 命令,我想操纵 window 位置,因为 window 始终位于我的显示顶部,并且一小部分是看不见的。
cv2.moveWindow() 命令对我的任务来说是一个很好的解决方案,但是有没有其他方法可以只设置一次 window 位置而不是在每次迭代中重复该命令?
我想每 500 毫秒更新一次 window。有没有更好的方法来显示具有固定 window 位置的图像流?
while true:
(...)
img = cv2.imread('test.jpg', cv2.IMREAD_COLOR)
cv2.imshow('image',img)
cv2.moveWindow('image',200,200)
(...)
根据 Summer Fang 的评论,我想展示如何将 window 移到循环外对我有用:
test_img = np.zeros(shape=(height,width,3)).astype('uint8')
cv2.imshow('image',test_img)
cv2.moveWindow('image',200,200)
cv2.waitKey(1)
while true:
(...)
img = cv2.imread('test.jpg', cv2.IMREAD_COLOR)
cv2.imshow('image',img)
(...)
我正在无限循环中更新 cv2.imshow() 命令,我想操纵 window 位置,因为 window 始终位于我的显示顶部,并且一小部分是看不见的。
cv2.moveWindow() 命令对我的任务来说是一个很好的解决方案,但是有没有其他方法可以只设置一次 window 位置而不是在每次迭代中重复该命令?
我想每 500 毫秒更新一次 window。有没有更好的方法来显示具有固定 window 位置的图像流?
while true:
(...)
img = cv2.imread('test.jpg', cv2.IMREAD_COLOR)
cv2.imshow('image',img)
cv2.moveWindow('image',200,200)
(...)
根据 Summer Fang 的评论,我想展示如何将 window 移到循环外对我有用:
test_img = np.zeros(shape=(height,width,3)).astype('uint8')
cv2.imshow('image',test_img)
cv2.moveWindow('image',200,200)
cv2.waitKey(1)
while true:
(...)
img = cv2.imread('test.jpg', cv2.IMREAD_COLOR)
cv2.imshow('image',img)
(...)