mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Loads OpenCV JNI Library in Java (#15)
This commit is contained in:
committed by
Peter Johnson
parent
468cac543f
commit
41dd9e4f06
@@ -13,9 +13,11 @@ import java.io.OutputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
import org.opencv.core.Core;
|
||||
|
||||
public class CameraServerJNI {
|
||||
static boolean libraryLoaded = false;
|
||||
static boolean cvLibraryLoaded = false;
|
||||
static File jniLibrary = null;
|
||||
static {
|
||||
if (!libraryLoaded) {
|
||||
@@ -69,6 +71,15 @@ public class CameraServerJNI {
|
||||
}
|
||||
}
|
||||
libraryLoaded = true;
|
||||
if (!cvLibraryLoaded) {
|
||||
try {
|
||||
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
|
||||
} catch (UnsatisfiedLinkError ex) {
|
||||
ex.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
cvLibraryLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user