Get angle of view of android camera device

后端 未结 3 2058
说谎
说谎 2021-02-15 15:08

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.

3条回答
  •  清酒与你
    2021-02-15 16:12

    I search the google a person show possibility which he calculate FOV by Camera2 api

    https://photo.stackexchange.com/questions/54054/calculating-the-field-of-view-for-a-nexus-5

    and found the equation

    http://www.bobatkins.com/photography/technical/field_of_view.html

    FOV (rectilinear) = 2 * arctan (frame size/(focal length * 2))

    thus, we need to know frame size and focal length

    the frame size is size of camera you can find the code on below link

    https://stackoverflow.com/a/30403558

    also, focal length you can find below link

    Manual focus in camera2, android

    and i combine the code like this

    A function calculateFOV() calculate FOV angle

    https://github.com/pchan1401-ICIL/Camera2FOV

提交回复
热议问题