小编Nim*_*ims的帖子

CGBitmapContextCreateImage错误

我收到这样的错误在我的控制台中:

: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)

iphone avfoundation uiimage ios

7
推荐指数
1
解决办法
4479
查看次数

OpenCV安装在xcode中

我在我的项目中使用bellow link来安装opencv但是我们如何在终端中生成命令我不知道有人可以帮助我吗? http://aptogo.co.uk/2011/09/opencv-framework-for-ios/

iphone opencv ios4 ios xcode4

3
推荐指数
1
解决办法
6703
查看次数

标签 统计

ios ×2

iphone ×2

avfoundation ×1

ios4 ×1

opencv ×1

uiimage ×1

xcode4 ×1