Static Initialization on OpenCV Android
Hi I am using OpenCV face-detection sample(OpenCV 2.4.2). I have changed the face-detection sample to OpenCV static initialization. I changed the below code in my FdActivity.java file. But I am not able to open native camera. when I call the "openCamera()" method it shows "Fatal error: can't open camera!" alert box. what seems to be the problem?
@Override
public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "onCreate");
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
Log.i(TAG, "Trying to load OpenCV library");
if (!OpenCVLoader.initDebug()) {
Log.e(TAG, "Cannot connect to OpenCV Manager");
} else {
mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
}
logcat:
10-12 09:44:01.604: I/Sample::Activity(676): Instantiated new class org.opencv.samples.fd.FdActivity
10-12 09:44:01.654: I/Sample::Activity(676): onCreate
10-12 09:44:01.704: I/Sample::Activity(676): Trying to load OpenCV library
10-12 09:44:01.704: D/OpenCV/StaticHelper(676): Trying to get library list
10-12 09:44:01.895: E/OpenCV/StaticHelper(676): OpenCV error: Cannot load info library for OpenCV
10-12 09:44:01.895: D/OpenCV/StaticHelper(676): Library list: ""
10-12 09:44:01.895: D/OpenCV/StaticHelper(676): First attempt to load libs
10-12 09:44:01.895: D/OpenCV/StaticHelper(676): Trying to init OpenCV libs
10-12 09:44:01.895: D/OpenCV/StaticHelper(676): Trying to load library opencv_java
10-12 09:44:01.895: D/dalvikvm(676): Trying to load lib /data/data/com.face.conf/lib/libopencv_java.so 0x411e3cc0
10-12 09:44:02.134: D/dalvikvm(676): Added shared lib /data/data/com.face.conf/lib/libopencv_java.so 0x411e3cc0
10-12 09:44:02.164: D/OpenCV/StaticHelper(676): OpenCV libs init was ok!
10-12 09:44:02.164: D/OpenCV/StaticHelper(676): First attempt to load libs is OK
10-12 09:44:02.164: I/Sample::Activity(676): OpenCV loaded successfully
10-12 09:44:02.164: I/Sample::Activity(676): OpenCV loaded successfully
10-12 09:44:02.174: D/dalvikvm(676): Trying to load lib /data/data/com.face.conf/lib/libdetection_based_tracker.so 0x411e3cc0
10-12 09:44:02.185: D/dalvikvm(676): Added shared lib /data/data/com.face.conf/lib/libdetection_based_tracker.so 0x411e3cc0
10-12 09:44:02.185: D/dalvikvm(676): No JNI_OnLoad found in /data/data/com.face.conf/lib/libdetection_based_tracker.so 0x411e3cc0, skipping init
10-12 09:44:02.394: I/Sample::SurfaceView(676): Instantiated new class org.opencv.samples.fd.FdView
10-12 09:44:02.654: I/Sample::FdView(676): Loaded cascade classifier from /data/data/com.face.conf/app_cascade/lbpcascade_frontalface.xml
10-12 09:44:02.654: D/dalvikvm(676): Trying to load lib /data/data/com.face.conf/lib/libdetection_based_tracker.so 0x411e3cc0
10-12 09:44:02.654: D/dalvikvm(676): Shared lib '/data/data/com.face.conf/lib/libdetection_based_tracker.so' already loaded in same CL 0x411e3cc0
10-12 09:44:02.924: I/Sample::SurfaceView(676): openCamera
10-12 09:44:02.924: I/Sample::SurfaceView(676): releaseCamera
10-12 09:44:02.934: D/CAMERA_ACTIVITY(676): Library name ...