Ask Your Question
0

can't create BackgroundSubtractorMOG in java/android

asked 2013-07-01 04:06:23 -0500

berak gravatar image

tried all 3 constructors but it always throws java.lang.UnsatisfiedLinkError.

public void onResume() {;
    super.onResume();    
    boolean r = OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5,this, mLoaderCallback);
    Log.e("MJPG", "opencv onboard : " + r);
    BackgroundSubtractorMOG bgm0 = new BackgroundSubtractorMOG() ;
}

07-01 10:43:50.282: W/dalvikvm(6889): No implementation found for native Lorg/opencv/video/BackgroundSubtractorMOG;.BackgroundSubtractorMOG_0 ()J
07-01 10:43:50.292: E/AndroidRuntime(6889): FATAL EXCEPTION: main
07-01 10:43:50.292: E/AndroidRuntime(6889): java.lang.UnsatisfiedLinkError: BackgroundSubtractorMOG_0
07-01 10:43:50.292: E/AndroidRuntime(6889):     at org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG_0(Native Method)
07-01 10:43:50.292: E/AndroidRuntime(6889):     at org.opencv.video.BackgroundSubtractorMOG.<init>(BackgroundSubtractorMOG.java:39)

----------------------------------------------------------------------------------------

public void onResume() {;
    super.onResume();
    boolean r = OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5,this, mLoaderCallback);
    Log.e("MJPG", "opencv onboard : " + r);
    BackgroundSubtractorMOG bgm1 = new BackgroundSubtractorMOG(1000,3,1.0) ;
}



07-01 10:41:56.742: E/MJPG(6828): opencv onboard : true
07-01 10:41:56.742: W/dalvikvm(6828): No implementation found for native Lorg/opencv/video/BackgroundSubtractorMOG;.BackgroundSubtractorMOG_2 (IID)J
07-01 10:41:56.752: E/AndroidRuntime(6828): FATAL EXCEPTION: main
07-01 10:41:56.752: E/AndroidRuntime(6828): java.lang.UnsatisfiedLinkError: BackgroundSubtractorMOG_2
07-01 10:41:56.752: E/AndroidRuntime(6828):     at org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG_2(Native Method)
07-01 10:41:56.752: E/AndroidRuntime(6828):     at org.opencv.video.BackgroundSubtractorMOG.<init>(BackgroundSubtractorMOG.java:83)

--------------------------------------------------------------------------------

public void onResume() {;
    super.onResume();
    boolean r = OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5,this, mLoaderCallback);
    Log.e("MJPG", "opencv onboard : " + r);
    BackgroundSubtractorMOG bgm2 = new BackgroundSubtractorMOG(1000,3,1.0,0.6) ;
}


07-01 10:45:25.682: E/MJPG(6949): opencv onboard : true
07-01 10:45:25.682: W/dalvikvm(6949): No implementation found for native Lorg/opencv/video/BackgroundSubtractorMOG;.BackgroundSubtractorMOG_1 (IIDD)J
07-01 10:45:25.692: E/AndroidRuntime(6949): FATAL EXCEPTION: main
07-01 10:45:25.692: E/AndroidRuntime(6949): java.lang.UnsatisfiedLinkError: BackgroundSubtractorMOG_1
07-01 10:45:25.692: E/AndroidRuntime(6949):     at org.opencv.video.BackgroundSubtractorMOG.BackgroundSubtractorMOG_1(Native Method)
07-01 10:45:25.692: E/AndroidRuntime(6949):     at org.opencv.video.BackgroundSubtractorMOG.<init>(BackgroundSubtractorMOG.java:64)
07-01 10:45:25.692: E/AndroidRuntime(6949):     at com.example.blank.MainActivity.onResume(MainActivity.java:54)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-07-24 05:44:49 -0500

You tries to use OpenCV library before it is ready. All OpenCV functions including constructors are available after onManagerConnected(LoaderCallbackInterface.SUCCESS) callback.

edit flag offensive delete link more

Comments

yes, you're right. misinterpreted the situation there

berak gravatar imageberak ( 2013-07-24 05:49:40 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-07-01 04:06:23 -0500

Seen: 1,170 times

Last updated: Jul 24 '13