我收到这样的错误在我的控制台中:
:CGBitmapContextCreate:无效数据字节/行:对于8个整数位/组件,3个组件,kCGImageAlphaPremultipliedFirst,至少应为1920.:CGBitmapContextCreateImage:无效的上下文0x0
我使用下面的代码:
- (UIImage *) imageFromSampleBuffer:(CMSampleBufferRef) sampleBuffer
{
// Get a CMSampleBuffer's Core Video image buffer for the media data
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
// Lock the base address of the pixel buffer
CVPixelBufferLockBaseAddress(imageBuffer, 0);
// Get the number of bytes per row for the pixel buffer
void *baseAddress = CVPixelBufferGetBaseAddress(imageBuffer);
// Get the number of bytes per row for the pixel buffer
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer);
// Get the pixel buffer width and height
size_t width = CVPixelBufferGetWidth(imageBuffer); …Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用bellow link来安装opencv但是我们如何在终端中生成命令我不知道有人可以帮助我吗? http://aptogo.co.uk/2011/09/opencv-framework-for-ios/