computer vision basics & setting up opencv 2.0 for msvc++
TRANSCRIPT
Computer Vision Basics & Setting Up OpenCV 2.0 for MSVC++
Demo images are cited from, http://www.societyofrobots.com/programming_computer_vision_tutorial.shtml and www.wikipedia.org
Biological Vision .VS. Computer Vision
Sensor
• CCD or CMOS
Digital Image Representation
Binary Grayscale RGB Color
Basic Operations
• Decrease Resolution
Basic Operations
• Threshold
Basic Operations
• Filtering
Setting Up OpenCV
• Follow the installation guide:
– http://opencv.willowgarage.com/wiki/InstallGuide
• Or, we’ll go through an example installation for Windows and Visual Studio.
Install OpenCV
• Download and Install OpenCV 2.0 from
– http://opencv.willowgarage.com/wiki/
• If it is a lab machine, it will say C:\Users\duhao\Documents\OpenCV2.0 Keep that in mind as the basepath for later use.
Install CMake
• Download & Install CMake2.8.0 binary distribution from
– http://www.cmake.org/cmake/resources/software.html
Build the OpenCV package
• Step 1:
– Start Menu -> Run -> cmd.exe
• C:\Users\xxxxx>cd \OpenCV2.0
• C:\OpenCV2.0>mkdir release
• C:\OpenCV2.0>cd release
• C:\OpenCV2.0\release>"\Program Files\CMake 2.8\bin\cmake" -D:CMAKE_BUILD_TYPE=RELEASE C:\OpenCV2.0
Build the OpenCV package
• Step 2:
– Open at C:\OpenCV2.0\release using Visual Studio
– Build a version.
Ready to Roll
• INCLUDES: – C:\OpenCV2.0\include\opencv
• E.g. cv.h cvaux.h cxcore.h highgui.h
• LIBS: – C:\OpenCV2.0\release\lib\Release
• E.g. cv200.lib cvaux200.lib cxcore200.lib highgui200.lib
• DLLS: – C:\OpenCV2.0\release\bin\Release
• E.g. cv200.dll cvaux200.dll cxcore200.dll highgui200.dll
Starting a VC++ Project
• File -> New -> Project
Adding PATHS : INCLUDES • Right click project name -> Property
Adding PATHS : LIBS
Adding LIB Files
DLLS
• Copy all DLLS at C:\OpenCV2.0\release\bin\Release to a BIN path, for example C:\Windows\System32
• or copy them to the same path as your .EXE file.
Test a simple program