Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DnnSuperResImpl throws java.lang.UnsatisfiedLinkError #1396

Closed
cansik opened this issue Apr 2, 2020 · 4 comments
Closed

DnnSuperResImpl throws java.lang.UnsatisfiedLinkError #1396

cansik opened this issue Apr 2, 2020 · 4 comments
Labels

Comments

@cansik
Copy link
Member

cansik commented Apr 2, 2020

When I try to use DnnSuperResImpl with the current snapshot (1.5.3-SNAPSHOT) I immediately get the following error:

java.lang.UnsatisfiedLinkError: no jniopencv_dnn_superres in java.library.path

Here is an example code:

DnnSuperResImpl net = new DnnSuperResImpl();
net.readModel(model.toAbsolutePath().toString());
net.setModel("fsrcnn", 2);

I have even tried to load the library with:

Loader.load(opencv_java.class);
Loader.load(opencv_dnn_superres.class);

Is this library not bundled in the opencv preset build or am I using it the wrong way?

@cansik cansik changed the title DnnSuperResImpl leads to java.lang.UnsatisfiedLinkError DnnSuperResImpl throws to java.lang.UnsatisfiedLinkError Apr 2, 2020
@cansik cansik changed the title DnnSuperResImpl throws to java.lang.UnsatisfiedLinkError DnnSuperResImpl throws java.lang.UnsatisfiedLinkError Apr 2, 2020
@saudet
Copy link
Member

saudet commented Apr 3, 2020

Works fine here on Linux. What's your platform?

@saudet
Copy link
Member

saudet commented Apr 3, 2020

It looks like there is a missing inheritance on opencv_quality here though:
https://github.com/bytedeco/javacpp-presets/blob/master/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_dnn_superres.java#L36
Please let me know if it helps to call Loader.load(opencv_quality.class) before. Thanks!

@saudet saudet added the bug label Apr 3, 2020
@cansik
Copy link
Member Author

cansik commented Apr 3, 2020

Perfect, using Loader.load(opencv_quality.class) fixed it. I am working on MacOS (Catalina 10.15.3).

saudet added a commit to bytedeco/javacpp-presets that referenced this issue Apr 3, 2020
@saudet
Copy link
Member

saudet commented Apr 15, 2020

Fix included in just released version 1.5.3. Thanks for reporting and for testing!

@saudet saudet closed this as completed Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants