我在为正在进行的项目使用OpenCV和QCamera之间感到困惑。
基本上,我希望用户输入要捕获的帧数,然后相机将使用我用CUDA和CPU实现编写的高斯滤镜拍摄该数量的图像。
然后将数据返回并放入图表中,以便我可以分析性能差异。
我已经设置了大部分应用程序,但是我在最后的障碍中挣扎,我创建了QCameraViewFinder
,QCameraImageCapture
和QCamera
对象。然后在我的while循环中,调用以下代码:
do
{
imageCapture->capture();
//cpu method call here
// Emit the frame number from the thread back to GUI for update
emit frameProcessed(QString::number(currFrame));
currFrame++;
frames--;
} while(frames > 0);
我如何提取
imageCapture->capture
创建的图像而不将其保存到计算机中?我所关心的唯一数据是函数计算所需的时间(以毫秒为单位),因此无需保存原始图像数据。 最佳答案
imageCapture.
isCaptureDestinationSupported(QCameraImageCapture::CaptureToBuffer)
imageAvailable(int, const QVideoFrame &)
信号的插槽中接收捕获的帧。 关于c++ - Qt:捕获图像而不保存-QCameraImageCapture,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27431119/