Java OpenCV from Maven

后端 未结 8 1971
别那么骄傲
别那么骄傲 2020-12-01 20:59

Is there any way to get OpenCV from repository? Which artifact should I add to pom.xml? Every tutorial I\'d found is from \'14 and it seems like something chang

8条回答
  •  被撕碎了的回忆
    2020-12-01 21:38

    Just use it nu.pattern.OpenCV.loadShared();

    write a class with this static void method

    class Test {
    public static void loadOpenCVNativeLibrary() {
    nu.pattern.OpenCV.loadShared();
    }
    }
    

    and after call it in your application class (with static main) for web application (spring boot for example) like this

    static {
    Test.loadOpenCVNativeLibrary();
    }
    ...
    public static void main(String[] args) throws UnknownHostException {
    }
    

提交回复
热议问题