How to find focal length and sensor height of camera

Hello!

I have recently been making an app for iOS which takes a picture and does some image recognition on it. The problem is that I need some technical details of the camera, specifically the focal length and the height of the sensor, in order to achieve this.

I have previously got these when I capture the photo. I would take the photo using AVCapturePhotoOutput and extract the EXIF tags FocalLength and FocalLenIn35mmFilm from the metadata. I would then do some calculations to find the sensor height.

The problem is that I have since moved to using a frame by frame capture using AVCaptureVideoDataOutput, which still means I can get the metadata from the CMSampleBuffer, but now the FocalLenIn35mmFilm has a value that is over two times what it should be.

So, in short, I have been trying to find a way to retrieve the focal length, and height of the sensor, of the iPhone's camera.

Any help would be very appreciated! Thanks in advance!

Hello, I'm sorry I'm unable to assist with your issue, but hopefully you have been able to resolve it by now.

I have been unable to succeed in extracting or changing EXIF metadata from AVCapturePhotoOutput. Your question indicates you have been able to do so. Could you be kind enough to share how to go about this? I'd like to be able to modify some of the tags prior to writing to the Photo Library.

Thanks for any light you can shed on this.

How to find focal length and sensor height of camera
 
 
Q