Tuesday, February 16, 2010

OpenCV 2.0, Windows and Eclipse Setup Instructions

This blog involves the latest release of OpenCV 2.0.  I have concentrated most of my time into developing OpenCV applications in the Linux environment.  This time I wanted to learn how to set it up in Windows with the latest stable release of OpenCV.

Documentation:

This following document involves the setup of Eclipse for OpenCV2.0 in Windows, the installation of all necessary programs to be installed to run OpenCV2.0 in Eclipse, and how to add an existing project.  This document was originally designed for my Professor's Digital Image Processing class at the UNH ECE Department.  The basic setup procedure was created by Jon Carrier over at Carrier Frequency.  This document incorporates images for ease of understanding.

Document: OpenCV2.0 Project Setup in Eclipse.pdf

Sample Code:

This sample code is for someone that wants to get into Image Processing with a minimal setup.  Students of Image Processing classes are encouraged to utilize this code.  I ask that you do not remove the citation information in order to preserve the originality of the work.

What it is:
   This is code that can be imported into Eclipse and run and modified without much effort.

What is does:
   The code opens a camera capture and allows the user to press certain keyboard numbers to toggle between algorithms.  By default the program has 5 settings.
  1. Press the number 1 button to run the Canny edge detector with a specified threshold
  2. Press the number 2 button to run the Canny edge detector with a threshold value of 1
  3. Press the number 3 button to run an algorithm that manipulates at the pixel level to remove the green channel.
  4. Press the ESC key to exit the program
  5. Press any other key to undo all editing settings (default case)
What to do with it:
   Edit the code and make it your own.  For users that do not know much about OpenCV and/or C++ programming the code is very simple and there are great instructions included.  

How to add your own code:
   In the Laboratory.cpp file add a new case to the switch statement.  Just increment the case number and the ASCII value for that value is the button you press to call your function.  Then edit VisionJobs.h to declare a new function.  Then edit VisionJobs.cpp and add your new function there and modify the frames as necessary.

Code:
   Ok lets get to it and let you download the code.

Download location is here (zip file containing all .c and .h files and Eclipse .cproject and .project files)

1 comment: