Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set the focal length of iphone camera programmatically?

Tags:

iphone

camera

Hey therer, I am wondering whether I could fix the focal length of iPhone camera to certain distance, such as 120mm. Is it possible to achieve this programmatically?

Thank you for your time and help :D

like image 202
Nihao Avatar asked Dec 01 '25 20:12

Nihao


1 Answers

No, the iPhone camera is fixed focal length (5.4mm for the iPhone 4) and cannot zoom - perhaps you mean focal distance which is the distance from the lens at which an image is in focus? If you mean focal distance, then this answer is of no use to you. :-(

If you want to simulate the effect of different focal length (i.e. zoom), you can simply crop the image, although your cropped image will be of lower resolution than the uncropped original.

The iPhone 4 has a real focal length of 5.4mm, and a full-frame equivalent focal length of 29.4mm. Your desired 120mm focal length is also full-frame equivalent.

120/29.4 is about 4. So crop out the middle 1/4 (25%) of the height and width of the iPhone photo using your application, and you have simulated the Field of View of a 120mm lens.

The iPhone 4 takes photos at 2592x1936, so the cropped photo will be 648x484. That's approximately VGA resolution.

like image 198
Alex Brown Avatar answered Dec 04 '25 13:12

Alex Brown



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!