Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 opencv 处理来自我的网络摄像头的图像。我怎么知道我的处理器需要多少时间来读取矩阵的每个像素并显示出来?使用的算法无关紧要,我需要图像分辨率与处理时间之间的一般关系。对不起英语。谢谢。
计算时间的一般方法(在 vc9 中):
#include <time.h> main(){ clock_t t = clock(); //Some Code //.. t = clock() - t; printf ("\tRuntime: %f seconds.\n",((float)t)/CLOCKS_PER_SEC); }