Prerequisites
- Download the latest JDK.
- Install the downloaded application.
- Follow the installation instructions.
Installing Apache Ant
- Download the latest binary distribution of Apache Ant.
- Extract the downloaded compressed file to a directory (e.g. C:\Users\mizuki\Documents\apache-ant-1.9.1).
- Set the following environmental variables to their corresponding directories: JAVA_HOME (e.g. C:\Program Files\Java\jdk1.7.0_21\), ANT_HOME (e.g. C:\Users\mizuki\Documents\apache-ant-1.9.1\), and add %ANT_HOME%/bin to PATH.
- Open the command prompt and from the ANT_HOME directory, run ant -f fetch.xml -Ddest=system to get the library dependencies of most Ant tasks. (I am not sure if this step is needed but I just did this based on the Apache Ant installation guide)
Installing Python
- Download Python v2.6 or higher.
- Install the downloaded application.
- Follow the installation instructions.
Installing OpenCV
- Download OpenCV.
- Extract the downloaded file to a directory (e.g. C:\Users\mizuki\Documents\opencv\).
Installing the Eclipse IDE
- Download the latest Eclipse IDE.
- Extract the downloaded compressed file to a directory (e.g. C:\Users\mizuki\Documents\eclipse-SDK-4.2.2-win32\).
Creating a Simple Java Project
- Start the Eclipse IDE and create a new workspace.
- Create a new Java project.
- Name the project "HelloCV".
- Open Properties of the created project and click on Java Build Path to configure the needed OpenCV libraries.
- Go to the directory where OpenCV was extracted and find the jar file under build > java.
- Select the Native library location.
- For its location path, the dll file will be under the folder x86 for 32-bit processor and x64 for 64-bit processor still under the build > java folder.
- Create a new Java class Main.java with code shown in: OpenCV tutorial. However, use the string "opencv_java245" for the library.
No comments:
Post a Comment