How to interpret lens distortion coefficients in iOS Portrait mode EXIF data
Asked Answered
S

0

6

iOS provides lens distortion information for images obtained with the iPhone depth cameras, specifically the front-facing TrueDepth camera and the rear-facing Portrait mode camera. These lens distortion coefficients are stored in the AVCameraCalibrationData class's lensDistortionLookupTable instance. This lookup table has 42 values and the interpretation of this lookup table is explained clearly Apple's documentation and in AVCameraCalibrationData.h.

I have observed that there is also a set of 8 coefficients in the Lens Distortion Coefficients EXIF field in the captured HEIC file. I haven't found any documentation of these coefficients and haven't been able to make sense of them. I tried assuming that they are polynomial coefficients (as described here) or using them as coefficients in OpenCV's camera calibration model, to no avail. Can anyone shed light on how to use these coefficients?

I've plotted the two sets of values below.Plot comparing AVCameraCalibrationData lookup table values to EXIF Lens Distortion Coefficients

EDIT: A tantalizing hint in an old Apple Developer Forum post, but not enough to get the answer.

The lens distortion coefficients stored in HEIF files are not the same as the lensDistortionLookupTable. They are a more compact way of storing the data needed to generate the lookup table.

Stenger answered 15/5, 2020 at 15:19 Comment(1)
Where does Apple explain how to use these 42 parameters? (I just want to correct barrel distortion from a 2D image.)Plutonic

© 2022 - 2024 — McMap. All rights reserved.