OpenCV imshow()之後沒有waitKey()無法顯示圖像

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

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()無法顯示圖像

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章