Eclipse中配置OpenCV

Assume you have installed OpenCV Pack @ D:\opencv\

 

Firstly , New-->Java Project . Assume the project name is cv_helloworld

Then right click on the project "cv_helloworld" , click Properties

In the new window , select "Java Build Path" on the left , select "Libraries" on the right , then click "Add External JARs"

select D:\opencv\build\java\opencv-2410.jar , OK

then dobule-click "Native library location" , select D:\opencv\build\java\x64 , OK

 

Demo :

package cv_helloworld;

import org.opencv.core.CvType;
import org.opencv.core.Mat;

public class Main {
    public static void main(String[] args) {
        System.loadLibrary("opencv_java2410");
        Mat m  = Mat.eye(3, 3, CvType.CV_8UC1);
        System.out.println("m = " + m.dump());
    }
}

 

enjoy it~

 

 

 

Reference:

http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。