Sunday, 11 January 2015

I recently viewed a wonderful tutorial on YouTube titled
"Open CV Tutorial: Real-Time Object Tracking Without Color"  by Kyle Hounslow
at https://www.youtube.com/watch?v=X6rPdRZzgjg

Decided to make a Java implementation of the C++ code because Open CV on java is quite different, primarily due to absence of inbuilt GUI in Open CV.

I have made my project available at the following link :

https://drive.google.com/open?id=0B9i5XieNCJrETUpsLWQyeVFUUTQ&authuser=0

Published as an Eclipse Project. However you can go to /src folder, If you do not want to use Eclipse


Thursday, 1 January 2015

Some users do not know how to setup OpenCV in Eclipse (A pre requisite to Object tracking OpenCV tutorial I published earlier) , so I decided to make a small tutorial.

STEPS

1.Create a Java Project from "New"

2. Right click on the project and select "Properties"


3.Navigate to "Java Build path" section, and select the "Libraries" tab.

4. Click "Add External Jar"
5. Navigate to "Your OpenCV directory\build\java" and select "opencv-249.jar"

6. Not done yet, You have to set path to native library.
7. Expand the opencv-249.jar as shown and select "Native library location". Click Edit button.

8. Point to  "Your OpenCV directory\build\java\x86" for 32Bit Processor OR "Your OpenCV directory\build\java\x64" for 64Bit Processor



Native libary must be set, else it will generate an "UnsatisfiedLinkException" .


 

9. "System.loadLibrary(Core.NATIVE_LIBRARY_NAME);"  must be used for every OpenCV java program written. To make Eclipse load OpenCV libraries.


Done !