cv::imshow sometimes is very slow

前端 未结 1 1959
离开以前
离开以前 2020-12-31 22:22

I\'ve got a problem with cv::imshow. It normally consumes about 1-2 ms processing time for my image size but at some point in my processing-pipeline it uses 4-8

1条回答
  •  遥遥无期
    2020-12-31 22:46

    This is a typical problem with OpenGL, and the OpenCV windows can be created using OpenGL. There is a problem with SwapBuffers (see SDL_GL_SwapBuffers() is intermittently slow and others), which is often solved by adding a small sleep before it.

    • Disabling vertical synchronization in the video drivers may help.
    • Not having too many image windows opened (a typical plague of many OpenCV programs) helps.
    • Using a different API than OpenGL to create the windows may help (will likely require recompiling highgui).

    0 讨论(0)
提交回复
热议问题