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

时间:2021-05-02 02:27:41

标签: python opencv visual-studio-code apple-silicon

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

我使用的是 M1 MacBook Air,我不确定这是否是 Visual Code 的问题。

我的代码:

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

有什么建议吗?

0 个答案:

没有答案