Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture 5MP Image in iPhone devices with 8MP camera?

I want to capture images with 5 MP resolution in an iOS device where maximum image sensor capture resolution is 8 MP.

The presets provided in Avfoundations AVCaptureSessionPresetPhoto gives - 3264x2448 - 8 MP resolution VCaptureSessionPresetHigh gives - 1920x1080 - 2 MP resolution

Is there any way/workaround for capturing 5MP directly, instead of capturing 8MP and then downscaling?

like image 365
thar_bun Avatar asked Jan 31 '14 06:01

thar_bun


2 Answers

iOS gives very limited output resolutions from Camera.

You mentioned correctly that largest size is 8MP and next preset goes down to 1080p or ~2MP. The expectation it seems is to downscale/crop the image as the application requires, however the SDK doesn't give a single API to get required resolution or output image.

Hope this helps.

like image 154
poloolop Avatar answered Oct 02 '22 03:10

poloolop


AVCaptureSessionPreset gives only constants resolutions (You can see API references). If you want to save image in custom resolution, you can find here Save image with custom resolution

like image 40
GMJigar Avatar answered Oct 02 '22 03:10

GMJigar