OpenCV is one kind of library designed for Computer Vision and is released by Intel Corp. . It includes more than 300 most usually used algorithm in Image Processing, but from now on, it only supports C/C++. The related information is below:
And the related Chinese link:
Download OpenCV Lib
The first step you need to do is to download the OpenCV Lib, also you can download here:
or you can download from my website: OpenCV Beta4.0 [Now is OpenCV Beta5.0 ]
The second step you need to do is download the DirectX form the Microsoft website:
or you can download form my website: DirectX 9.0c (It's a little big.)
After installing the Lib, you may go to the root folder of the OprnCV, and if you didn't change any kind of configuration, the destination may be here:
C:\Program Files\OpenCVThen go to the C:\Program Files\OpenCV\docs\faq.htm
You can solve lots of question by your self from here, but......not sure for every problem....
Recompile OpenCV Lib
Go to the C:\Program Files\OpenCV\_make and you will find opencv.dsw (opencv.sln). Open it and recompile it in Win32 Debug and Release mode and you will get
the lib you need in C:\Program Files\OpenCV\lib
* Don't know how to compile? Just ask your friends or your classmates.
Set the Environment Variable
In the "System Environment Variable" table find the "Path" variable and add this "C:\Program Files\OpenCV\bin" in it.
*The environment variable can be found in "My Computer" .
Customize your project
Whenever you create a new project, you should do follow customization by yourself, or you can't use the OpenCV Lib.
The steps below are collected in faq.htm and plus my little modification.
Customize project settings:
Activate project setting dialog by choosing menu item "Project"->"Settings...".
Select your project in the right pane.
Tune settings, common to both Release and Debug configurations:
Select "Settings For:"->"All Configurations"
Choose "C/C++" tab -> "Preprocessor" category -> "Additional Include Directories:". Add comma-separated relative (to the .dsp file) or absolute paths: (C:\Program Files\OpenCV\cxcore\include,C:\Program Files\OpenCV\cv\include,C:\Program Files\OpenCV\otherlibs\highgui,C:\Program Files\OpenCV\cvaux\include)
Choose "Link" tab -> "Input" category -> "Additional library path:". Add the paths to all neccessary import libraries (cxcore[d].lib cv[d].lib hihghui[d].lib cvaux[d].lib) like: (C:\Program Files\OpenCV\lib\CVd.lib,C:\Program Files\OpenCV\lib\cxcore.lib,C:\Program Files\OpenCV\lib\cxcored.lib,C:\Program Files\OpenCV\lib\cv.lib,C:\Program Files\OpenCV\lib\highgui.lib,C:\Program Files\OpenCV\lib\highguid.lib,C:\Program Files\OpenCV\lib\cvaux.lib,C:\Program Files\OpenCV\lib\cvauxd.lib)
Tune settings for "Debug" configuration
Select "Settings For:"->"Win32 Debug".
Choose "Link" tab -> "General" category -> "Object/library modules". Add "C:\Program Files\OpenCV\lib\CVd.lib" "C:\Program Files\OpenCV\lib\HighGUId.lib" "C:\Program Files\OpenCV\lib\cvauxd.lib" "C:\Program Files\OpenCV\lib\cxcored.lib" (optionally)
You may also want to change location and name of output file. For example, if you want the output .exe file to be put into the project folder, rather than Debug/ subfolder, you may type ./
Tune settings for "Release" configuration
Select "Settings For:"->"Win32 Release".
Choose "Link" tab -> "General" category -> "Object/library modules". Add "C:\Program Files\OpenCV\lib\cv.lib" "C:\Program Files\OpenCV\lib\HighGUI.lib" "C:\Program Files\OpenCV\lib\cvaux.lib" "C:\Program Files\OpenCV\lib\cxcore.lib" (optionally)
Optionally, you may change name of the .exe file: type ./
Add dependency projects into workspace:
Choose from menu: "Project" -> "Insert project into workspace".
Select "C:\Program Files\OpenCV\cv\src\cv.dsp".
Do the same for "C:\Program Files\OpenCV\cxcore\src\cxcore.dsp", "C:\Program Files\OpenCV\cvaux\src\cvaux.dsp", "C:\Program Files\OpenCV\otherlibs\highgui\highgui.dsp".
Choose from menu: "Project" -> "Dependencies..."
For "cv" choose "cxcore",
For "cvaux" choose "cv", "cxcore",
for "highgui" choose "cxcore",
for your project choose all: "cxcore", "cv", "cvaux", "highgui".
After above tedious configuration, now you can finally enjoy the convenience of the OprnVC now. Just go to the C:\Program Files\OpenCV\samples\c to get some sample program.
If you don't know how to set up your sample program, here is my test using the sample program provided by OpenCV.
This program doing morphology algorithm: my test file
Here is the sample program's Screen Shot:
Hope this file can do help to you. If you get any problem during your settlement, just go to Google to get the answer, and if you deal the trouble you bumped, you might
mail to me how you solved your problem and I can add it in my page and share to others. Thanks you very much.
You can contact me through: email@example.com
Q: I can't run the file in test.rar!
My Solution: Although I didn't have this kind of problem, but I solved this problem for my friend by adding the dll files in the Debug folder. You can find the dll you need in
C:\Program Files\OpenCV\bin or you might download the dll files from here : dll
Another Solution: You also can add the dll files in C:\Program Files\Microsoft Visual Studio\VC98\Bin
Another link is http://graphics.csie.ntu.edu.tw/~jean/graphix/tech/25/
A entry-level tutorial by Robert Laganièr
The latest (draft) version of documentation