AVCaptureSession is not giving a good photo quality and good resolution

前端 未结 3 538
粉色の甜心
粉色の甜心 2021-02-02 14:44

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 Came

3条回答
  •  不知归路
    2021-02-02 14:48

    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.

    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.

    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:

    AVCaptureStillImageOutput image

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

    Built-in Photos image

    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.

    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.

提交回复
热议问题