Reputation: 7343
I am building an android application using OpenCV when I noticed some discrepancies in how the OpenCV library takes the video input of the Android Device. I am using a Nexus 5 Second Generation.
Below, I have a screenshot from the OpenCV Application, showing a square:
And as you can see, the square seems to be stretched, and is now a rectangle. For comparison, here is a screenshot from the Camera application:
However, from this screenshot taken from the native camera application, the squares are really squares. I then changed my code from:
<org.opencv.android.JavaCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/color_blob_detection_activity_surface_view" />
to
<org.opencv.android.NativeCameraView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/color_blob_detection_activity_surface_view" />
This works fine on devices running Android 4.0-4.4, however, when I ran it on my Nexus 5 running on Lollipop (5.0), it gave me the "It seems that your device does not support camera (or it is locked)."
error. I have the camera permissions in my Android Manifest. I then checked the files in the libs folders, and then I noticed that I had the libnative_camera_r2.2.0.so until libnative_camera_r4.4.0.so, I inferred that the rx.x.x.so refers to the version number, and the reason why it does not work is because there's no native camera library for Android 5.0.
My question now is:
When will a libnative_camera_r5.0.0.so be released? I just can't use a lower version because I am also using some features unique to Android Lollipop.
Upvotes: 1
Views: 1250
Reputation: 81
The OpenCV change log for version 3.0 lists the native camera as being dropped
"The other, a bit sad but inevitable news – we had to drop support for nativecamera on Android. It used some undocumented API and never worked stable."
from: https://github.com/Itseez/opencv/wiki/ChangeLog (post dated June 2015)
Upvotes: 1