Measure OpenCV FPS

后端 未结 4 1266
别那么骄傲
别那么骄傲 2021-02-08 19:32

I\'m looking for a correct way to measure openCV FPS. I\'ve found several ways to do it. but none of them looks right for me.

The first one I\'ve tested, uses ti

4条回答
  •  忘掉有多难
    2021-02-08 20:19

    You can use OpenCV's API to get the original FPS if you are dealing with video files. The following method will not work when capturing from a live stream:

    cv::VideoCapture capture("C:\\video.avi");
    if (!capture.isOpened())
    {
        std::cout  << "!!! Could not open input video" << std::endl;
        return;
    }
    
    std::cout << "FPS: " << capture.get(CV_CAP_PROP_FPS) << std::endl;
    

    To get the actual FPS after the processing, you can try Zaw's method.

提交回复
热议问题