简体   繁体   English

CV2 图像和网络摄像头在运行程序时始终最小化

[英]CV2 image and webcam always minimized when running a program

cap = cv2.VideoCapture(0)

and

img = cv2.imread(/users/..../jumpingjacks.jpeg, 1)
cv2.imshow('Jumping Jacks', img)

when my prog run these two codes, the webcam feed and image doesn't pop out, but instead, it shows as minimized version, which requires me to press the icon at the bottom of the screen to bring it forward.当我的程序运行这两个代码时,网络摄像头提要和图像不会弹出,而是显示为最小化版本,这需要我按下屏幕底部的图标才能将其向前移动。 anyidea what caused this ?知道是什么原因造成的吗?

Found the answer by trying out this code:通过尝试以下代码找到了答案:

img = cv2.imread('/users/..../jumpingjacks.jpeg', 1)
cv2.imshow('Jumping Jacks', img)
cv2.setWindowProperty("Jumping Jacks", cv2.WND_PROP_TOPMOST, 1)
cv2.waitKey(5000)
cv2.destroyAllWindows()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM