Simple Eclipse Configuration OpenCV method

Source: Internet
Author: User

Download Opencv2.4.4.exe (other also available)

Unzip and install to d:/. The root directory. I named it for d:/opencv244, which contains a folder such as build.

Create a new project in Eclipse HELLOCV

(You can refer to the website steps

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

I am a little bit different from the official website configuration. Two steps in the countdown.

The steps are as follows:

Right-click on Project--build path--configure build Path

Select the user library after selecting the Add library.

Next follow the instructions in user libraries

Select New

The name of your own version is 2.4.4, so take a name ~

Select the red circle option below

This time select Opencv-244.jar this thing under the OpenCV folder you installed. For me it is under the d:/opencv244.

The specific path is D:\opencv244\opencv\build\Java inside

Then select Native Library location Select Edit

Next Select D:/opencv244/build\java\x86

Note here the path must be careful, is the build of the Java x86. My classmates saw the x86 on the bottom of the build, and then the old error.

Note that if it is a 64-bit machine, choose x64, which is d:/opencv244/build\java\x64

My machine is 64-bit, the beginning of the selection of x86 error.

Then ok ok ok.

Then create a new test file Main.java

[Java]View PlainCopy
  1. Import org.opencv.core.*;
  2. public class Main {
  3. public static void Main (string[] args) {
  4. System.out.println ("Welcome to OpenCV" + core.version);
  5. System.loadlibrary (Core.native_library_name);
  6. Mat m = Mat.eye (3, 3, CVTYPE.CV_8UC1);
  7. System.out.println ("m =" + M.dump ());
  8. }
  9. }


Run to see the output

Proved successful ...

Finally, thanks to Sina netizens http://blog.sina.com.cn/s/blog_7b4a5b550101ifi7.html

Simple Eclipse Configuration OpenCV method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.