Abi*_*n K 21
没有混淆的余地,你给出的所有参考都指向同一件事.
getTickCount给出了特定事件后的时钟周期数,例如,机器开机后.
A = getTickCount() // A = no. of clock cycles from beginning, say 100
process(image) // do whatever process you want
B = getTickCount() // B = no. of clock cycles from beginning, say 150
C = B - A // C = no. of clock cycles for processing, 150-100 = 50,
// it is obvious, right?
Run Code Online (Sandbox Code Playgroud)
现在您想知道这些时钟周期的秒数.为此,您想知道单个时钟需要多少秒,即clock_time_period.如果您发现这一点,只需乘以50即可获得总时间.
为此,OpenCV提供了第二个功能getTickFrequency().它为您提供频率,即每秒钟的时钟周期数.你拿它的倒数得到时钟的时间段.
time_period = 1/frequency.
Run Code Online (Sandbox Code Playgroud)
现在,您有一个时钟周期的time_period,将其乘以50以获得以秒为单位的总时间.
现在阅读你再次提供的所有参考资料,你会得到它.
| 归档时间: |
|
| 查看次数: |
12728 次 |
| 最近记录: |