OpenCV imshow()之後沒有waitKey()無法顯示影象

masikkk發表於2013-11-10

今天突然遇到了這麼個奇怪的問題,之前一直沒有注意到。

imshow()之後要加waitKey()才能正確顯示影象。

官方說明如下:

A common mistake for opencv newcomers is to call cv::imshow() in a loop through video frames, without following up each draw with cv::waitKey(30). In this case, nothing appears on screen, because highgui is never given time to process the draw requests from cv::imshow(). 

參考

OpenCV imshow()之後沒有waitKey()無法顯示影象

相關文章