opecv计时器功能

#include "opencv2/opencv.hpp"
#include <iostream>

using namespace std;
using namespace cv;

//opencv 计时器
int main()
{
	
	double t;
	t = (double)getTickCount();
	cout << t << endl;
	cout << getTickFrequency() << endl;  //和cpu有关
	Mat a;
	a = imread("../../lena_color.tif", IMREAD_COLOR);
	if (a.empty())
		return - 1;
	imshow("original", a);
	
	t = 1000 * ((double)getTickCount() - t) / getTickFrequency(); //转化为ms; 不乘以1000 是秒
	
	waitKey(0);
		return 0;
	}

	


猜你喜欢

转载自blog.csdn.net/qq_35508344/article/details/82816452