
[[self currentCaptureOutput] captureStillimageAsynchronouslyFromConnection:[[self currentCaptureOutput].connections lastObject] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer,NSError *error) { [[[blockSelf currentPrevIEwLayer] session] stopRunning]; if (!error) { NSData *data = [AVCaptureStillimageOutput jpegStillimageNSDataRepresentation:imageDataSampleBuffer]; CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef) data,NulL); if (source) { UIImage *image = [blockSelf imageWithSource:source]; [blockSelf updateWithCapturedImage:image]; CFRelease(source); } } }]; 有什么可能导致图像不包括闪光灯吗?
解决方法 如果AVCaptureSession在此呼叫之前立即设置,我发现我有时会看到较暗的图像.也许需要一段时间的自动曝光和白平衡设置调整自己.解决方案是设置AVCaptureSession,然后在调用之前等待AVCaptureDevice的adjustExposure和adjustWhiteBalance属性都为NO(在KVO中观察这些属性) – [AVCaptureStillimageOutput captureStillimageAsynchronouslyFromConnection:completionHandler:].
总结以上是内存溢出为你收集整理的ios – 即使使用闪光灯,AVCaptureOutput会拍摄暗色的图像全部内容,希望文章能够帮你解决ios – 即使使用闪光灯,AVCaptureOutput会拍摄暗色的图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)