AVCaptureSession不能提供良好的照片质量和良好的分辨率 [英] AVCaptureSession is not giving a good photo quality and good resolution

查看:112
本文介绍了AVCaptureSession不能提供良好的照片质量和良好的分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与AVCaptureSession一起捕获图像.工作正常 但没有给出好的分辨率.我将它与iPhone相机捕获的图像进行了比较,发现iPhone相机图像比AVCaptureSession图像要好得多.

I'm working with AVCaptureSession for capturing the image. Its working fine but not giving a good resolution. I compared it with the image captured by iPhone Camera and I found that the iPhone Camera Image is much better than AVCaptureSession image.

我在stackOverflow上看到了3-4个链接,但是找不到任何解决方案.

I have seen 3-4 links on stackOverflow about this but could not find any solution.

我也尝试了所有预设

AVCaptureSessionPresetPhoto, 
AVCaptureSessionPresetHigh, 
AVCaptureSessionPresetMedium, 
AVCaptureSessionPresetLow, 
AVCaptureSessionPreset352x288, 
AVCaptureSessionPreset640x480, 
AVCaptureSessionPreset1280x720, 
AVCaptureSessionPreset1920x1080, 
AVCaptureSessionPresetiFrame960x540, 
AVCaptureSessionPresetiFrame1280x720, 

,但是静止图像质量较差.如果我的问题不清楚或我错过了什么,请告诉我.

but still image is of lesser quality. Please let me know if my question is not clear enough or I missed something.

推荐答案

将预设的AVCaptureSessionPresetPhoto与AVCaptureStillImageOutput一起使用时,我能够以3268x2448的分辨率在iPhone 4S上捕获图像,该分辨率与内置摄像头应用程序可以产生收益. iPhone 4,Retina iPad等也是如此,因此,如果将该预设与静止图像输入一起使用,则将从-captureStillImageAsynchronouslyFromConnection:completionHandler:返回的样本缓冲区是原始相机分辨率.

When using the preset AVCaptureSessionPresetPhoto with an AVCaptureStillImageOutput, I'm able to capture images on an iPhone 4S at a resolution of 3268x2448, which is the exact same resolution that the built-in camera application yields. The same is true for the iPhone 4, Retina iPad, etc., so if you use that preset with a still image input, you will get a sample buffer back from -captureStillImageAsynchronouslyFromConnection:completionHandler: that is the native camera resolution.

关于照片质量,请记住,内置相机应用程序能够通过快速获取不同曝光水平的图像来捕获高动态范围(HDR)照片.我们无法通过标准的AV Foundation API来访问此图像,因此,我们得到的只是一张在定义的曝光级别下的图像.

In regards to photo quality, remember that the built-in camera application has the ability to capture high-dynamic-range (HDR) photos by the quick acquisition of images at different exposure levels. We do not have access to this via the standard AV Foundation APIs, so all we get is one image at a defined exposure level.

如果关闭HDR,图像质量看起来和我一样.这是使用AVCaptureStillImageOutput捕获的照片的放大部分:

If you turn HDR off, the image quality looks identical to me. Here is a zoomed-in portion of a photo captured using an AVCaptureStillImageOutput:

这是内置的照片应用程序中的一个:

and here is one from the built-in photo application:

忽略由于相机方向上的微小变化而导致的照明方面的细微差别,两种方式捕获的图像的分辨率和保真度似乎是相同的.

Ignoring the slight differences in lighting due to a little shift in camera direction, the resolution and fidelity of images captured both ways appear to be the same.

我使用SimplePhotoFilter示例应用程序从我的开源GPUImage框架捕获了第一张图像,替换了默认图像具有不调整伽玛值的GPUImageGammaFilter的GPUImageSketchFilter,只是充当传递对象.

I captured the first image using the SimplePhotoFilter example application from my open source GPUImage framework, replacing the default GPUImageSketchFilter with a GPUImageGammaFilter that didn't adjust the gamma any, just acted as a passthrough.

这篇关于AVCaptureSession不能提供良好的照片质量和良好的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆