From 68e8758b8ca203772d7c7450fe9306a39556503b Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 23 Mar 2020 19:41:22 +0100 Subject: [PATCH] removed javacv and added native library loading --- build.gradle | 1 - src/main/java/gab/opencv/OpenCV.java | 50 +++++++++++++++------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/build.gradle b/build.gradle index 1466d85..a93687e 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,6 @@ dependencies { testCompile group: 'junit', name: 'junit', version: '4.11' // opencv - compile group: 'org.bytedeco', name: 'javacv', version: "$javaCvVersion" compile group: 'org.bytedeco', name: 'opencv-platform', version: "4.1.2-$javaCvVersion" compile group: 'org.bytedeco', name: 'openblas-platform', version: "0.3.7-$javaCvVersion" diff --git a/src/main/java/gab/opencv/OpenCV.java b/src/main/java/gab/opencv/OpenCV.java index f436275..8700b8f 100644 --- a/src/main/java/gab/opencv/OpenCV.java +++ b/src/main/java/gab/opencv/OpenCV.java @@ -1,26 +1,26 @@ -/** - * ##library.name## - * ##library.sentence## - * ##library.url## - * - * Copyright ##copyright## ##author## - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA - * - * @author ##author## +/* + ##library.name## + ##library.sentence## + ##library.url## + + Copyright ##copyright## ##author## + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + @author ##author## * @modified ##date## * @version ##library.prettyVersion## (##library.version##) */ @@ -47,6 +47,8 @@ import java.util.ArrayList; import java.util.Collections; +import org.bytedeco.javacpp.Loader; +import org.bytedeco.opencv.opencv_java; import org.opencv.bgsegm.BackgroundSubtractorMOG; import org.opencv.core.Core; import org.opencv.core.CvType; @@ -396,7 +398,7 @@ private String getLibPath() { private void initNative(){ if(nativeLoaded) return; - System.loadLibrary(Core.NATIVE_LIBRARY_NAME); + Loader.load(opencv_java.class); nativeLoaded = true; }