Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 537
springrolls Avatar asked Nov 14 '22 04:11

springrolls


1 Answers

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

like image 167
Thesane Avatar answered Nov 16 '22 04:11

Thesane