Monday, May 2, 2011

Setting up OpenCV in Eclipse on Windows (OpenCV2.2)

The latest release of OpenCV (version 2.2) has undergone dramatic changes to the library. Because of these changes, my older guide is now outdated. For OpenCV version 2.2, please use this guide.

First download and setup the basics:
  • Get MinGW
  • Download Eclipse C/C++ IDE
Note: I have a tutorial on these two steps already so just head over HERE for more info.

  • Next download/install OpenCV 2.2
  • Now launch Eclipse and start a new project by going to:
  1. File->New->C++ Project (or File->New->C Project)
  2. Give your project a name in the "Project name" box
  3. Select the "Hello World" option under the "Project Type" section under the"Executable" folder. I recommend this over the "Empty Project" as it creates the c/c++ file for you instead of having to do it manually (it also creates a "src" folder and a"Debug" folder which helps keep things a little more organized)
  4. Make sure the "MinGW" Toolchain is selected in the "Toolchains" section
  5. Hit NEXT
  6. Fill in your Author and other file information, then hit NEXT
  7. In the next window select "Advanced settings...". This will bring you to the "Project Settings" which can always be accessed later by going to Project->Properties
  8. Under the "C/C++ Build" Section go to the "Settings" and select the "Tool Settings"Tab. Then select the "Includes" folder (on older versions of eclipse it is the "Directories" folder) in the GCC Compiler branch and add the opencv include directory to Include paths (-I): "C:\OpenCV2.2\include\". Of course, change C:\OpenCV2.2 to match the installed path that you used.
  9. Now, under the MinGW Linker select the "Libraries" folder and add the following to the Libraries (-l) section (note not all of these are necessarily needed for your project but these are all the libraries available in opencv version 2.2):
  • opencv_calib3d220
  • opencv_contrib220
  • opencv_core220
  • opencv_features2d220
  • opencv_ffmpeg220
  • opencv_flann220
  • opencv_gpu220
  • opencv_highgui220
  • opencv_imgproc220
  • opencv_legacy220
  • opencv_ml220
  • opencv_objdetect220
  • opencv_ts220
  • opencv_video220
In most cases you will only need opencv_core220 and opencv_highgui220 to get started

NOTE: Versions 2.2 and later postfix the libraries names with a three digit number that corresponds to the version of OpenCV that you are linking to.

FINALLY, under the "Library search path (-L)" section add:
  • "C:\OpenCV2.2\lib"
  1. Hit OK when done
  2. Hit Finish to create and start the Project
Write up a simple program to test if opencv works properly. You can use this EXAMPLE CODE I made to test if your video camera and environment are working properly.

NOTE: The way this guide was written will require you to use a relative path to specify the header files you wish to include. OpenCV breaks up the library into two sections, "legacy libraries" and "new libraries".

If you wish to specify one of the new opencv libraries use the following format:

#include "opencv2\[subfolder]\[library.hpp]"

ADDITIONALLY, if you wish to include all of the primary opencv2 header files in a project you can use:

#include "opencv2\opencv.hpp"

Note: opencv.hpp does not include every library in OpenCV2.2. It may be helpful for you to view the "opencv.hpp" library (located by default in: C:\OpenCV2.2\include\opencv2\opencv.hpp) to see what is included and how you can reference the new libraries in your code. To see the complete list of libraries available, go to "C:\OpenCV2.2\include\" and browse around the directory.

Legacy libraries can be defined by: #include "opencv\[library.hpp]"


If you get an error, during compile time, pertaining to:
__exchange_and_add
Then visit this page and follow the instructions under:
Building on Windows using MinGW 3.4.5

Hope this helps!

Tuesday, February 15, 2011

UWB Channel Model with People Shadowing Process


This past semester was my final semester as a Graduate at UNH. It certainly feels good to have made it this far in my education and looking back on what I have acquired in knowledge both through the University and through my own interests has astounded me. This paper was my very last paper I wrote and it was on quite an interesting topic concerning a UWB channel model with the People Shadowing Process (PSE).

Here is the abstract:
This report covers the topic described by, A Packet-Level Model for UWB Channel with People Shadowing Process Based on Angular Spectrum Analysis, written by Ruonan Zhang and Lin Cai. The presented closed-form solutions to Angular Power Spectrum Analysis, the People Shadowing Process, and the Finite State Markov Chain Model will be discussed and related to the general material learned during a graduate-level Wireless Communications course. Simulation results will be compared and analyzed. This paper will confirm that the results present by Ruonan Zhang and Lin Cai are valid methods to simulate the people shadowing process for a packet-level model for UWB channels.

Here is the link to the paper: PAPER

Friday, January 7, 2011

Dithering Methods and Applications


This is a paper I wrote during my first year as a Grad Student. It covers the topic of Digital Halftones and Dithering. The paper was written with the intention of explaining the differences and general mechanisms for different dithering algorithms and to give the reader a solid understanding of why and when dithering is desirable. Below is the abstract followed by the link to the document.

In this paper, the topic of digital halftones, or dithering, is discussed. In particular, the methods of implementation are discussed for the three classical categories which are random, ordered, and error diffusion dithering. A good understanding of dithering is necessary prior to understanding how and when dithering is necessary or beneficial to the designer. This paper includes discussions of specific types of dithering including one of the most popular techniques called Floyd-Steinberg and also includes actual implementations in MATLAB [See Appendix]. Several applications will be discussed that encompass not only image processing but audio signal processing, and optics.