Noisy / Grainy photos on iPhone 12 series when setting exposure duration and ISO

Viewed 750

When capturing photos of with the iPhone 12 series with custom exposure durations and ISO, the results contain a significant amount of noise compared to the iPhone 11 & X series.

Setting a custom exposure duration & ISO can be done in one of the following ways:

  • capturing using bracketed settings:
AVCapturePhotoOutput *photoOutput;
// ...
NSArray *bracketedSettings = @[[AVCaptureManualExposureBracketedStillImageSettings manualExposureSettingsWithExposureDuration:CMTimeMake(1, 7000) ISO:50]];
AVCapturePhotoBracketSettings *photoSettings = [AVCapturePhotoBracketSettings photoBracketSettingsWithRawPixelFormatType:0 processedFormat:nil bracketedSettings:bracketedSettings];
[photoOutput capturePhotoWithSettings:photoSettings delegate:self];
  • setting the exposure & ISO on the capture device:
AVCaptureDevice *captureDevice;
// ...
[captureDevice setExposureModeCustomWithDuration:CMTimeMake(1, 7000) ISO:50 completionHandler:^(CMTime syncTime) {
   // capture photo
}];

Any of these methods will result in noisier photos on iPhone 12 series. Using the ultra wide angle lens will achieve the worst results.

This example project captures 9 photos using bracketed settings with different exposure durations (1/7200, 1/1600, 1/400, 1/100, 1/24, 1/12, 1/6, 1/3, 1/2) and ISO set to 50. The noisiest are 1/100 and 1/24:

iPhone 11 Pro 1/24 enter image description here

iPhone 12 Pro 1/24 iPhone 12 Pro

Things that I've tried so far:

  • capturing in RAW format, compressed format (JPEG/HEIC) and 3 uncompressed supported formats (875704422, 875704438, 1111970369).
  • setting the photo settings quality to AVCapturePhotoQualityPrioritizationSpeed, AVCapturePhotoQualityPrioritizationBalanced and AVCapturePhotoQualityPrioritizationQuality (always set to speed when setting the exposure duration & ISO on the capture device, otherwise the set shutter speed & ISO may be ignored as per documentation - online documentation doesn't specify this, but the XCode documentation does)
  • applying noise reduction CIFilter, but it barely improves the results.
  • delaying capturing by 0.5-1 seconds when setting the exposure mode & ISO on the capture device, since I've noticed that starting capturing as soon as the completion handler is called will result in images that don't seem to respect the set parameters.
  • writing the images on disk in any of the following ways:
    • NSData writeToFile:atomically: for photo.fileDataRepresentation
    • Create a UIImage from photo.fileDataRepresentation and write it with different compression levels with UIImageJPEGRepresentation(UIImage *, CGFloat)
    • Create a CIImage and write it with different compression levels with CIContext writeJPEGRepresentationOfImage:toURL:colorSpace:options:error:

How can the noise issue be fixed?

1 Answers

This has nothing to do with the coding side but rather a hardware limitation.

The ISO refers to the sensitivity of the camera's sensor (CMOS) to capture the light. Higher the ISO setting, the higher the voltage running in the CMOS chip which captures light, amplifies them and generates a digital signal which we get as a RAW image or some processed image.

While working with high voltage, there will be the noise as a byproduct. This is like increasing the audio volume of a faint sound clip, where we will hear more noise than what we hear before increasing the volume.

Generally, some clever denoising algorithms can help to digitally reduce the noise, but the image quality may get degraded or appear artificial. Here is an article which covers some of them, if you are interested: https://towardsdatascience.com/introduction-to-image-denoising-3e269f176483

According to the article, probably these noise are considered Gaussian Noise and restoration involves estimation of the original image. It says,

Gaussian filter is a linear filter that can effectively suppress noise and smooth the image. Its working principle is similar to that of an average filter, and both take the average value of the pixels in the filter window as the output.

The photo will appear slightly blur though.

Related