Java Configuration opencv-in eclipse

Source: Internet
Author: User


  java configuration opencv-in EclipseCategory: OpenCV2014-01-17 11:11 2002 People readComments (5)CollectionReport

Download Opencv2.4.4.exe

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
  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 = "
  8. }
  9. }

Run to see the output



From for notes (Wiz)

Java Configuration opencv-in eclipse

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.