0

For use OpenCV in my app with Android Studio I complete the following instructions to Step 6. But I don't know how and where include

static { System.loadLibrary("opencv_java"); }

?

Community
  • 1
  • 1
Eric Mbatchou
  • 69
  • 1
  • 2
  • 10

1 Answers1

0

In main activity, like this:

public class MainActivity extends AppCompatActivity implements CameraBridgeViewBase.CvCameraViewListener2{

    static {
        if(!OpenCVLoader.initDebug())
            Log.d(sLog, "OpenCv load fail!");
        else
            Log.d(sLog, "OpenCv succes.");
    }

   @Override
   protected void onCreate(Bundle savedInstanceState)
   {
       ...
   }

    ...
}

instead of using System.loadLibrary(...), you can use OpenCVLoader.initDebug() which is suggested by OpenCv

Petar P
  • 368
  • 4
  • 13