Camera Not working
I am using the OpenCV-2.4.2-android-sdk and have problems with the camera on my target. On the emulator the sample color-blob-detection works for me so I know I have the sdk correctly configured. On target the application crashes and in the logs I get
E/CAMERA_ACTIVITY( 1940): Could not read /proc/self/smaps
D/CAMERA_ACTIVITY( 1940): CameraWrapperConnector::connectToLib: folderPath=/data/data/com.NativeCamera/lib/
E/CAMERA_ACTIVITY( 1940): CameraWrapperConnector::connectToLib ERROR: cannot dlopen camera wrapper library
E/CV_CAP ( 1940): Native_camera returned opening error: 4
E/Sample-ImageManipulations::SurfaceView( 1940): Failed to open native camera
I see in the code http://fossies.org/dox/OpenCV-2.4.2/camera__activity_8cpp.html that this is used in std::string CameraWrapperConnector::getPathLibFolder() as a default when /proc/self/smaps cant be opened. The path /data/data/com.NativeCamera AND /proc/self/smaps do not exist on my target, does this mean that the native camera is not supported on my target? Or do I have to change the name of /proc/self/smaps in the OpenCV code to map to a file that does exist on Android 4.0.3?
looking at the output from dumpsys run on my target ("adb shell dumpsys") I get the following interesting entry:
nativeLibraryPath=/data/data/com.ti.omap4.android.camera/lib
When I start the camera application on target I get the following in the logs:
I/ActivityManager( 312): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ti.omap4.android.camera/.Camera} from pid 525
I/ActivityManager( 312): Start proc com.ti.omap4.android.camera for activity com.ti.omap4.android.camera/.Camera: pid=2028 uid=10007 gids={1006, 1015}
So it looks like the OpenCV code is trying to find a way to locate the nativeLibraryPath using smaps.. but smaps now does not exist on Android so OpenCV must change to find a new way to locate the correct library. Has this bug already been fixed?
/proc/self/smaps does exist on Android. What device are you using?
I am using SmartQ Ten3 T15 tablet with Android 4.1 Jelly Bean. Now all the OpenCV examples work and a learnt a whole lot about android and OpenCV on Android in the process.