我需要每秒大约 30 次从网络摄像头捕获帧。本质上,我正在寻找一种方法来实现以下内容:
mainloop:
while( // scan is in process )
{
// process current image
// discard current image and dequeue next image (pop it off the front of the queue)
}
interrupt routine: // execute 30 times per second
{
// capture newImage with webcam
// enqueue newImage (push it onto the back of the queue)
// reset timer and return from interrupt
}
恐怕我没有足够的经验来确切地知道我在寻找什么。如果有人对如何每 30 秒在背景中拍照有更好的建议,我会很高兴听到它。我是 OpenCV 的新手,尽管我在课堂环境中拥有相当多的 C++ 经验。我项目的最终目标是使用特征检测和匹配来提取每两帧之间的帧到帧转换矩阵(换句话说,跟踪相机在表面上的运动)。
目标操作系统:OSX Yosemite 10.10.4,运行 XCode 6.3.1 * 最终此解决方案将移至 Windows 平台,因此我很想找到一个不是平台(或计算机)特定的解决方案。