RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 407 forks source link

Obtain horizontal field of view #353

Open nickw1 opened 5 years ago

nickw1 commented 5 years ago

Really nice API, makes it very easy to display a preview and take photos. Was easy to figure out how to stream the camera feed to an OpenGL texture too.

One thing which appears to be missing at the moment is an API call to obtain the field of view (or the focal length and sensor size, which can be used to calculate it). I'm developing an augmented reality app at the moment and would be really nice to get the FOV so this can be used to properly align the AR data with the camera view. My work-round is to use Camera2's CameraCharacteristics just for this feature, which seems to work (on my device) but necessitates minSdk of 21 so would be nice (if no technical obstacles) to see this in FA.

Many thanks for your work though! :-)

Diolor commented 5 years ago

Hey, I see [getFocalLength](https://developer.android.com/reference/android/hardware/Camera.Parameters.html#getFocalLength()) from Camera 1. Not sure if that gives you enough info to work with. If you like to implement it in FA, feel free to PR us! :)

nickw1 commented 5 years ago

Hello Dionysis,

OK - thanks. Will try to if I have the time!

On Sat, Mar 2, 2019 at 1:31 PM Dionysis Lorentzos notifications@github.com wrote:

Hey, I see getFocalLength https://developer.android.com/reference/android/hardware/Camera.Parameters.html#getFocalLength() from Camera 1. Not sure if that gives you enough info to work with. If you like to implement it in FA, feel free to PR us! :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RedApparat/Fotoapparat/issues/353#issuecomment-468920951, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjurD5xI0SLl9LIXdCh5ssJDPA01em4ks5vSn08gaJpZM4bZioo .