Pages

Wednesday, 22 January 2014

JavaCV Installation


JavaCV setup with Eclipse on Windows 7
              JavaCV provides wrappers for OpenCV. so you can directly use OpenCV functions in Java. JavaCV also provides hardware accelerated full screen Image display with CanvasFrame and GLCanvasFrame.
                  JavaCV provides jar files which can be used with OpenCV installation. Following steps can be followed to setup JavaCV with Eclipse on Windows 7.


1.Install Java Development Kit (JDK) from the link below. Make sure to install 32bit or 64 bit as per your processor.
2. Install Microsoft Visual C++ redistributable package
For 32 bit: http://www.microsoft.com/download/en/details.aspx?id=5555
For 64 bit: http://www.microsoft.com/download/en/details.aspx?id=14632
3. Download OpenCV super-pack from Sourceforge and extract it in you C:\Opencv
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/
4. Set OpenCV .dll in systems path so that JavaCV can access it.
Set up your Path environment variable so that Eclipse can find the OpenCV libraries (which, from above, are in C:\opencv).


   4.1 Right click on "Computer" in the Windows Explorer and select "Properties".
   


       4.2 Click "Advanced system settings", go to the "Advanced" tab, and select                      "Environment Variables".

         


       4.3  In the "System variables" panel, go down to "Path" and select "Edit”.
In System variable select path and click on Edit. Now add following address in Variable address. I have extracted opencv package in C:\ directory. If you have installed at different location please update address accordingly.
      

     
For OpenCV 2.4.3 and later version
4.4 Add to the end of the list (don't overwrite what's already there!), separated by semicolons, two folders — for OpenCV and Tbb (you can browse in the Windows Explorer to double check that these folders exist):
  1. 32 bit:
;C:\opencv\build\x86\vc10\bin;C:\opencv\build\common\tbb\ia32\vc10
  1. 64 bit:
;C:\opencv\build\x64\vc10\bin;C:\opencv\build\common\tbb\intel64\vc10
5. Download JavaCV- bin from link below and extract it.
http://code.google.com/p/javacv/downloads/list

6. Create New Java Project 'demo' in Eclipse.
Once created, go to Project > Properties > Java Build Path > Libraries > Add External JARs .
Go to your JavaCV Extracted folder and add all jar files. It should look like the pic below.


   




No comments:

Post a Comment