简体   繁体   中英

Get camera focal length OpenCV Android

I can obtain focal length using the camera parameters in Android like this:

Camera.Parameters parameters = camera.getParameters();
Log.d(TAG, "Focal length:"+parameters.getFocalLength());

It gives me 3.97 (correct). Since I use OpenCV for my project, I want to use the variable already provided, which is:

Log.d(TAG, "Focal length:"+Highgui.CV_CAP_PROP_ANDROID_FOCAL_LENGTH);

But it gives me a result of 8005. I'm new to OpenCV, so if anyone could give me a hint, I would really appreciate it.

The one you use from Highgui is Constant. It is the same whatever the camera is. I think you to stick to the android camera parameter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM