Friday, 14 January 2022

How to calculate the module time in C++ OpenCV?

method1

         double t = (double)cv::getTickCount();
        bool status = weightedMovingVariance(frame, output, count);
        t = ((double)cv::getTickCount() - t)/cv::getTickFrequency();
        std::cout << "Times passed in seconds: " << t << std::endl;


method2:

cv::TickMeter tm;
tm.start();
// do something ...
tm.stop();
std::cout << "Total time: " << tm.getTimeSec() << std::endl;

No comments:

Post a Comment