我知道AVFoundation及其捕获支持(虽然不太熟悉).但是,我没有看到任何易于访问的API来获取逐像素数据(每像素RGB或类似数据).我记得在文档中读到这是可能的,但我真的不知道如何.所以:
我正在尝试TIFF从a 创建一个图像UIImage.我查看了Apple的文档,但找不到任何信息.
任何人都可以帮我解释如何TIFF在iPad上创建图像?
我一直在搜索这个论坛,但我找不到我真正需要的东西.我想从相机获取原始图像数据.到目前为止,我试图从该方法中获取imageDataSampleBuffer中的数据 captureStillImageAsynchronouslyFromConnection:completionHandler: 并将其写入NSData对象,但这不起作用.也许我走错了路线或者说我做错了.我不想要的是以任何方式压缩图像.
简单的方法是使用jpegStillImageNSDataRepresentation: from AVCaptureStillImageOutput,但就像我说我不希望它被压缩.
谢谢!
我需要从CMSampleBufferRef 获取UIImage来自未压缩的图像数据.我正在使用代码:
captureStillImageOutput captureStillImageAsynchronouslyFromConnection:connection
completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
// that famous function from Apple docs found on a lot of websites
// does NOT work for still images
UIImage *capturedImage = [self imageFromSampleBuffer:imageSampleBuffer];
}
Run Code Online (Sandbox Code Playgroud)
http://developer.apple.com/library/ios/#qa/qa1702/_index.html是imageFromSampleBuffer功能链接.
但它不能正常工作.:(
有一种jpegStillImageNSDataRepresentation:imageSampleBuffer方法,但它提供压缩数据(好吧,因为JPEG).
UIImage捕获静止图像后,如何使用最原始的非压缩数据创建?
也许,我应该为视频输出指定一些设置?我目前正在使用这些:
captureStillImageOutput = [[AVCaptureStillImageOutput alloc] init];
captureStillImageOutput.outputSettings = @{ (id)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA) };
Run Code Online (Sandbox Code Playgroud)
我注意到,输出有一个默认值AVVideoCodecKey,即AVVideoCodecJPEG.是否可以以任何方式避免,或者甚至在拍摄静止图像时是否重要?
我在那里找到了一些东西:来自相机的原始图像数据,如"645 PRO",但我只需要一个UIImage,而不使用OpenCV或OGLES或其他第三方.
ios ×4
avfoundation ×2
camera ×2
iphone ×2
objective-c ×2
image ×1
ipad ×1
pixel ×1
tiff ×1
uiimage ×1