【发布时间】:2011-03-03 03:05:42
【问题描述】:
我正在编写一个使用 OpenCV 进行某种实时图像检测的 iPhone 应用程序。将相机中的 CMSampleBufferRef 图像(我使用 AVFoundation 的 AVCaptureVideoDataOutputSampleBufferDelegate)转换为 OpenCV 可以理解的 IplImage 的最佳方法是什么?转换需要足够快才能实时运行。
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// Convert CMSampleBufferRef into IplImage
IplImage *openCVImage = ???(sampleBuffer);
// Do OpenCV computations realtime
// ...
[pool release];
}
提前致谢。
【问题讨论】:
标签: iphone opencv real-time avfoundation