-
Notifications
You must be signed in to change notification settings - Fork 747
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
opencv_cudaoptflow produces no jniopencv_ximgproc in java.library.path #911
Comments
You might not have the right version of CUDA installed. Please add a dependency on cuda-redist-platform. |
Thank you for quick reply. As you said, my CUDA version (10.2.89) is different from javacpp-cuda version (10.2.76).
my <project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.bytedeco.opencv</groupId>
<artifactId>optflowcuda</artifactId>
<version>1.5.3</version>
<properties>
<exec.mainClass>Main</exec.mainClass>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>opencv-platform</artifactId>
<version>4.3.0-1.5.3</version>
</dependency>
<!-- Additional dependencies required to use CUDA and cuDNN -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>opencv-platform-gpu</artifactId>
<version>4.3.0-1.5.3</version>
</dependency>
<!-- Additional dependencies to use bundled CUDA and cuDNN -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>cuda-platform-redist</artifactId>
<version>10.2-7.6-1.5.3</version>
</dependency>
<!-- Additional dependencies to use bundled full version of MKL -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>mkl-platform-redist</artifactId>
<version>2020.1-1.5.3</version>
</dependency>
<!-- Optional dependencies to load the Python module -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>numpy-platform</artifactId>
<version>1.18.2-1.5.3</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>.</sourceDirectory>
</build>
</project> |
We don't need to install CUDA with cuda-redist-platform. Maybe there's some other dependency missing. Please let me know what the Dependencies tool says: https://github.com/bytedeco/javacpp-presets/wiki/Debugging-UnsatisfiedLinkError-on-Windows |
Nice tool, thank you! I tested like below and it's not working yet... It seemed to load my prebuilt OpenCV libraries that are different version from javacpp-opencv.
I have 2 questions.
|
Those are probably the files that have issues loading. Please check the dependencies of those modules. |
I totally forgot the documentation saying (https://github.com/bytedeco/javacpp-presets/tree/master/opencv#documentation).
Finally my fixed code works well. import org.bytedeco.javacpp.Loader;
import org.bytedeco.opencv.global.opencv_core;
import org.bytedeco.opencv.global.opencv_cudaimgproc;
import org.bytedeco.opencv.global.opencv_imgproc;
import org.bytedeco.opencv.opencv_core.GpuMat;
import org.bytedeco.opencv.opencv_cudaoptflow.FarnebackOpticalFlow;
import org.bytedeco.opencv.opencv_cudafeatures2d.ORB;
import org.bytedeco.opencv.opencv_cudaimgproc.TemplateMatching;
import org.bytedeco.opencv.opencv_java;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
Loader.load(opencv_java.class);
try {
Loader.load(org.bytedeco.opencv.opencv_cudaoptflow.FarnebackOpticalFlow.class);
} catch (UnsatisfiedLinkError e) {
try {
String path = Loader.cacheResource(org.bytedeco.opencv.opencv_cudaoptflow.FarnebackOpticalFlow.class, "windows-x86_64/jniopencv_ximgproc.dll").getPath();
new ProcessBuilder("c:/DependenciesGui.exe", path).start().waitFor();
} catch (IOException|InterruptedException e1) {
e1.printStackTrace();
}
}
GpuMat mat_cuda = new GpuMat();
System.out.println("mat_cuda succeed");
ORB orb_cuda = ORB.create();
System.out.println("orb_cuda succeed");
TemplateMatching temp_cuda = opencv_cudaimgproc.createTemplateMatching(opencv_core.CV_8UC1, opencv_imgproc.TM_SQDIFF);
System.out.println("temp_cuda succeed");
FarnebackOpticalFlow optflow_cuda = FarnebackOpticalFlow.create();
System.out.println("optflow_cuda succeed");
}
} and run
Thank you for your help @saudet !! |
We shouldn't need to load |
Fix included in version 1.5.4! Thanks for reporting |
I make a opencv + cuda test code like below and confirmed to success of
opencv_cudafeatures2d
andopencv_cudaimgproc
, butopencv_cudaoptflow
failed withjava.lang.UnsatisfiedLinkError: no jniopencv_ximgproc in java.library.path: [...]
.Does anybody know why?
run
The text was updated successfully, but these errors were encountered: