cv2.imshow不在Visual Studio中工作(M1 Macbook)

2024-09-24 00:20:57 发布

您现在位置:Python中文网/ 问答频道 /正文

每次我尝试使用cv2.imshow,窗口图像都会出现,但我无法关闭它,然后python崩溃

我使用的是M1 MacBook Air,我不确定这是否是视觉代码的问题

我的代码:

cv2.startWindowThread() # 
cv2.imshow("img", img) # show image
# : Press any key to directly destroy all open HighGUI windows
cv2.waitKey(0) # Wait for user input, press any key
cv2.destroyAllWindows()

有什么建议吗


Tags: key代码图像imageimgshowany视觉