简体   繁体   中英

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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