0

I recently moved my Android project from OpenCV 2.4.10 to OpenCV 3.0.

I statically initialize OpenCV using this code:

OpenCVLoader.initDebug();

When I run my app, I get this exception:

java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.imgcodecs.Imgcodecs.imread_1:(Ljava/lang/String;)J

Imgcodecs is a new module in OpenCV 3.0 which replaces Highgui from OpenCV 2.4.* if I am right.

I can see following output in logs from OpenCV when it initializes:

Version control:               2.4.10
...
To be built:                 core androidcamera flann imgproc highgui features2d calib3d ml objdetect video contrib photo java legacy ocl stitching superres ts videostab

From the information above I guess that the OpenCVLoader of OpenCV 3.0 initializes only the old modules from 2.4.10. You can see that it loads highgui module which should not be needed anymore.

Is this a bug of new OpenCV or am I missing something? Is there some workaround how to load also the new modules? Thanks.

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Potass
  • 237
  • 3
  • 8

2 Answers2

1

Seems working now using the updated version from 23.6.2015.

The error seems to have been fixed by this commit, so the answer is that the problem was probably caused by an OpenCV bug.

anderas
  • 5,744
  • 30
  • 49
Potass
  • 237
  • 3
  • 8
0

I suggest that make a new project, add opencv static version, import build.gradle and change the version from 2.4.* to 3.0.* I did the same, my previous version was 2.4.9 and after migration this is 3.0.0

To be Built: hal core flann imgproc ml photo video ***imgcodecs*** shape videoio ..

As this is obvious in your project, you are still on version 2.4.*

Davood Falahati
  • 1,474
  • 16
  • 34