1
Introduction to OpenCV
David Stavens
Stanford Artificial Intelligence Lab
Aside: Histogram Equalization
Images are from Wikipedia.
2
Today we’ll code:
A fully functional sparse optical flow algorithm!
Plan
OpenCV Basics
What is it?
How do you get started with it?
Feature Finding and Optical Flow
A brief mathematical discussion.
OpenCV Implementation of Optical Flow
Step by step.
3
What is OpenCV?
Created/Maintained by Intel.
Really four libraries in one:
“CV” – Computer Vision Algorithms
All the vision algorithms.
“CVAUX” – Experimental/Beta
“CXCORE” – Linear Algebra
Raw matrix support, etc.
“HIGHGUI” – Media/Window Handling
Read/write AVIs, window displays, etc.
Check out the samples directory!
Installing OpenCV
Download from:
http://sourceforge.net/projects/opencvlibrary/
Be sure to get Version 1.0.0.
Windows version comes with an installer.
Linux: (Install ffMPEG first!)
gunzip opencv-1.0.0.tar.gz; tar –xvf opencv-1.0.0.tar
cd opencv-1.0.0; ./configure --prefix=/usr; make
make install [as root]
4
Copy all the DLLs in \OpenCV\bin to \WINDOWS\System32.
Tell Visual Studio where the includes are. (Import a C file first.)
5
Tell Visual Studio to link against cxcore.lib, cv.lib, and highgui.lib.
Tell Visual Studio to disable managed extensions.