我正在使用 openCV python 绑定(bind)。我正在尝试使用以下列表显示输出图像:
cv.NamedWindow('display')
cv.MoveWindow('display', 10, 10)
cv.ShowImage('display', cvImage)
但是我没有看到任何窗口。
我的平台是 Linux (openSuse 11.4)、python-opencv 版本 2.1 和 python 2.7。
最佳答案
需要调用WaitKey函数来处理事件。查看文档:http://opencv.willowgarage.com/documentation/python/highgui_user_interface.html#waitkey
This function is the only method in HighGUI that can fetch and handle events, so it needs to be called periodically for normal event processing, unless HighGUI is used within some environment that takes care of event processing.
只需在您的代码末尾添加一个 WaitKey(0),它就可以正常工作。
关于python - 无法在openCV中显示图像显示窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6225508/