I want to know the angle of view from the camera, just like in this question but using android.hardware.camera2. How can I reproduce the next code using the new camera2 library.
You could do it mathematically.
You have:
L
, the width of an objectd
, the distance to the objectYou want to calculate the angle a
(alpha), the field of view.
Doing some trig:
tan(a/2) = (L/2)/d
tan(a/2) = L/2d
a/2 = atan(L/2d)
a = 2*atan(L/2d)
You can do that to calculate the horizontal field of view. Good luck!