Closed gingerbraden closed 1 year ago
Why do you say they are missing? We can use them if you want to: https://github.com/bytedeco/javacpp-presets/tree/master/opencv#documentation
I see that, but I checked the Java API documentation and all three of the classes I mentioned are missing.
Those classes are in the org.opencv package, not the org.bytedeco.opencv one.
That is true, but I have problems combining them - f.e. passing a org.bytedeco.opencv.opencv_core.Mat into a org.opencv.core.Core
(combining them is necessary as Saliency requires a Mat, and that has to come from the same package - org.bytedeco.opencv...
We can use OpenCVFrameConverter for that.
Yes! That's it, that works like a charm, thank you so much. Now I have to solve the "No implementation found for org.opencv....."
Please make sure that Loader.load(opencv_java.class)
has been called:
https://github.com/bytedeco/javacpp-presets/tree/master/opencv#documentation
It has been, and now I'm digging through old issues to solve the _java.lang.UnsatisfiedLinkError: dlopen failed: library "libjniopencvcore.so" not found error
EDIT trying the solution from issue #386 EDIT2 still missing jniopencv_core.so. Added relinker, added splits to gradle.build as in issue #906, but no luck
Are you trying this on Android? The plugin doesn't support native libraries in JAR files but we can work around that: https://github.com/bytedeco/gradle-javacpp#the-platform-plugin
Yes, I am trying this on Android. After adding the code from the Platform Plugin chapter to build.gradle file, I am getting a The 'java' plugin has been applied, but it is not compatible with the Android plugins. error
That's correct, the Java plugin doesn't work with Android. That bit isn't for Android. Please read below that.
Shoot... So there is no way of using OpenCV's Saliency modules on Android, even with using ByteDeco/JavaCPP ?
Yes, it should work fine. If you're looking for an existing sample project to use as template, there's this one: https://github.com/bytedeco/sample-projects/tree/master/JavaCV-android-example
Managed to make it work, all fault was on my side.
I am trying to build an app in Java which uses saliency implementations from OpenCV, but while using bytedeco I've come to some problems:
My dependencies in Gradle are set like this:
implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.8'
implementation group: 'org.bytedeco', name: 'javacpp-presets', version: '1.5.8'
implementation group: 'org.bytedeco', name: 'javacv', version: '1.5.8'
And the code I'm trying to run is as simple as:
But I can't get Imgcodecs, Imgproc and Core to work...