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"); }
?
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"); }
?
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