Determine angle of view of smartphone camera
Unless there's some API call for that (I'm not an Android programmer, I wouldn't know), I would just snap a picture of a ruler from a known distance away, see how much of the ruler is shown in the picture, then use trigonometry to find the angle like this:
now you have the two distances l and d from the figure. With some simple goniometry, one can obtain:
tan(α/2) = (l/2)/d,
hence
α = 2*atan(l/2d)
So with this formula you can calculate the horizontal field-of-view of your camera. Of course measuring the vertical f.o.v. goes exactly the same way except that you then need to view the object in its vertical position.
Then you can hard-code it as a constant in your program. (A named constant, of course, so it'd be easy to change :-p)
What is the angle the WP7 Camera sees?
Please see this post
How to find out the aperture angle of an android camera
in WP7, there is no API function to get that, and no other option than
- Ask user introduce it (they never know)
- Make a list of phones you support and obtain/measure it for each one. Store it in your app. (crazy!)
(I am doing the same kind of stuff and we invested a lot in finding automatic calibration methods, without success.)
EDIT
Cheers and love for bill and microsoft co.
How can i calculate the field of view of the camera of a phone?
I think you will never match the FOV definition for every device. (Compare this answer for iPhone.)
Every device is different when using android. Take your device, do the math (or take the results from anywhere else) and decide yourself to choose a reasonable FOV angle.
Maybe you could take account of Camera.Parameters.getSupportedPictureSizes() for getting the camera ratio, but that should be all you can do.
camera: image projection
Web search shows that the values returned by getVerticalViewAngle() cannot be blindly trusted on all devices; also note that you should take into account the zoom level and aspect ratio, see Determine angle of view of smartphone camera
Related Topics
How to Remove Extra Padding or Margin in Material Design Button
Force a Camera to Always Open in Portrait Mode in Android
How to Import Contacts from Phonebook to Our Application
Out of Memory While Creating Bitmaps on Device
Implementing a Simple Dagger2 Sample
Could Not Launch Emulator in Android Studio
Checkbox Gets Unchecked on Scroll in a Custom Listview
Getactionview() of My Menuitem Return Null
Google Play Services Out of Date. Requires 11011000 But Found 10289574
Android Datepickerdialog: Set Min and Max Date for Selection
Does the Android Emulator Support Opengl Es 3.0
How to Get Email Id from Facebook Sdk in Android Applications
Should Accessing Sharedpreferences Be Done Off the UI Thread
Failure [Install_Failed_Update_Incompatible] Even If App Appears to Not Be Installed
Elevation on Android Lollipop Not Working
Recycle-View Inflating Different Row :- Getting Exception While Binding the Data
App Getting Stuck with E/Com.Facebook.Internal.Attributionidentifiers