OpenCV 2.0 Installation on Windows XP and Visual Studio 2008

Jan 13, 2010 | Tags: OpenCV | del.icio.us del.icio.us | digg Digg

Many of us thought of doing project in computer vision using OpenCV library. But beginners find it difficult to use the OpenCV library because of the installation problem. So here is quick tutorial to install OpenCV 2.0. This tutorial assumes that you use windows XP and Visual Studio 2008 Express Edition. Send your questions and feedback to shrinivas [at] iitg.ernet.in

Related Articles

Recommended Books

The Downloads

61 Comments

Y-axeln on Jan 14, 2010:

Wow, what a coincidence! I was struggling with this for an hour earlier today, and you posted this just yesterday!

I ended up using MinGW and Eclipse CTD instead however (which was even more complicated to get working, since it will only build using GCC 4.4.0, not 3.x.x or 4.4.1..)

Awesome site! I am just starting my final year project now, which is a robotics/machine vision/control theory project that will use OpenCV in part. Your tutorials and guides have made it a lot easier to get started with the library!

And it is terribly inspiring, now i've got tons of crazy projects I feel like doing involving webcams and image processing.

Y-axeln on Jan 16, 2010:

There are some slight typos in the pdf that any reader should take notice of:
on page 5 it says

C:/OpenCV2.0/vs2008/debug
C:/OpenCV2.0/vs2008/Release

when it refers to the dll directories where it is supposed to say

C:/OpenCV2.0/vs2008/lib/debug
C:/OpenCV2.0/vs2008/lib/Release

respectively.

shri on Jan 18, 2010:

Y-axeln,
thanks
thats right I am sorry,
and the correction is:

C:/OpenCV2.0/vs2008/lib/debug
C:/OpenCV2.0/vs2008/lib/Release

as you rightly pointed out
thank you.

shri on Jan 19, 2010:

I am trying out svm for facial expression classification
any help about training and prediction using svm

thanks in advance

Cosmin on Jan 23, 2010:

Hello, i followed your tutorial and i installed opencv with visual studio 2008, but when i debug and run the program it says highgui200.dll not found. This only happens when i have to include the highgui.h header file.
Any ideas?

PS: i get no errors at building process.

Thanks.

shri on Jan 25, 2010:

Cosmin,

check in the properties of the project (linker option) is set perfectly,(19th step) (not .dll but .lib)

if it is perfect, then check the as explained at step 13. if in this step if you cannot see the highgui200.lib then goto cmake process.

Joseph on Feb 1, 2010:

Hi,
Thank you for the instructions, they are very helpful. I had the same problem as Cosmin. I can build several projects just fine, and when I take out the commands from highgui200, it works fine. If I use the highgui200 commands, it will build and says no errors, but when I run the program it gives a message highgui200.dll not found.

I double checked that the folders were all generated correctly and it looks just like the document described. And the linker is the same too. And I set the paths correctly. I even tried dropping a copy of the dll in my working directory, and it gives the same message.

I am using windows 7 x32, I dont know if this is something pertaining to the operating system.

shri on Feb 1, 2010:

joseph

in the linker option don't include highgui200.dll but highgui200.lib then recompile (in the linker option check names of the file it should be .lib not .dll

i have not tried on window 7

SiddeeqHssn on Feb 1, 2010:

hi all thank you very much for this paper. i have the same problem with Joseph & Cosmin but i solve it by make a copy of these files: cv200.dll, cvaux200.dll, cxcore200.dll, cxts200.dll, highgui200.dll, ml200.dll and opencv_ffmpeg200.dll from E:\OpenCV2.0\xyz\bin\Release to Debug directory of the project and everything's ok.

Eduardo on Feb 11, 2010:

Iīm facing the same problem...
highgui200.dll not found
Copying files from release to debug didnīt solve!

deufrai on Feb 12, 2010:

Thank you for sharing all this about OpenVC.
I'm just starting investingating it and most gledly found your site.

Y-axeln : please would there be a chance for you to share your experience with CDT to set you up with OpenCV ?

AGK on Feb 14, 2010:

Hi have the same problem as joseph highgui200.dll not found error!
(I have set it as .lib in Linker...)
I have also done what SiddeeqHssn has done, but of no use.
Windows Vista, VS2008 Professional

Honza on Feb 15, 2010:

Thx SiddeeqHssn. I had the same problem, now it works fine. Is possible to make it working without copy of files to project Debug folder?? Thanks a lot.

Dhanushka on Feb 19, 2010:


Hi ,
I have same proble. highgui200.lib not found error...please can you explain little how did you came up with your solution Honza.....

Abhi on Feb 19, 2010:

Thanks yaar, it was a great help. I was dying since the last few days to get it working. The VS2008 integration problem even forced me to migrate to linux (was hassle free).
There is still a small mistake:
PATH should be
C:/OpenCV2.0/vs2008/bin/Debug
C:/OpenCV2.0/vs2008/bin/Release
instead of
C:/OpenCV2.0/vs2008/lib/Debug
C:/OpenCV2.0/vs2008/lib/Release

Saqib on Feb 21, 2010:

The same installation guide works fine for Windows 7 too except for highgui200.dll error which can be soloved by following the solution suggested by SiddeeqHssn. Thanx a lot every1 it gve me a good start....

Mark on Feb 23, 2010:

Yes, i had the same highgui problem. You must change the path directories.

Thank you so much for this tutorial !!!

Mark

bangonkali on Feb 27, 2010:

dude, i have to thank you! thank you very much! and to all those who solved that linker problem. i had the same problem. anyway, it's solved now. i've been doing this for hours already. thanks!

Mark on Mar 2, 2010:

I have been using the above PDF to install OpenCV. Thankyou very much - I found it incredibly useful.

Unfortunately the last instruction 22 is unclear.

21. Then open command prompt by Start->Run->cmd,

22. Change dir to the project debug folder and execute the .exe file by giving the image file
as the argument ( make sure that the file is in debug folder for simplicity )

What am I meant to type in the command prompt here? I know "cd" changes the directory.
But where is the debug folder?
And how do I give the image file as the argument? (Does that mean typing the name of the image file before or after)
What is the image file I am looking for? Is that "imageload.cpp", or is it some *.img file?

Sorry to bother you, but could you please help me here?

Nash on Mar 3, 2010:

'cd' to where imageload.exe is located, and run it like this:

imageload.exe C:\photos\myphoto.jpg

Lucas on Mar 5, 2010:

I followed SiddeeqHssn explanation but didn't solve it. It would still ask me for the same library but with a 'd' at the end. (example: 'cxcore200d.dll' instead of 'cxcore200.dll'). I just made a copy of the 'cxcore200' file, changed its name (added a 'd') and also pasted it in the Debug folder of the project. Not an elegant solution but it solved the problem.

Termos on Mar 18, 2010:

Hi

I am trying to figure out how to install openCV as php extension under Windows so i could use openCV from php.

Have you tried doing this ? I cannot find any tutorial on the net on how to do this. I appreciate if you could help with advice.

ulZy on Mar 19, 2010:

Lumayan repot pak..harus compile sendiri..untung sekarang dah jalan nih..kemaren pake yang versi 1.0 terus coba yang 2.0 eh ternyata lumayan ribet installnya..lagi ngebet banget belajar computer vision soalnya..
Hehehe..salam kenal pak..

Schidlo on Mar 22, 2010:

Hello,
problem with *.dll can be solved by adding
C:/OpenCV2.0/vs2008/bin/Debug
C:/OpenCV2.0/vs2008/bin/Release
to PATH

kokomelan on Mar 23, 2010:

Thanks for this useful tutorial..

sny on Apr 11, 2010:

if you still have highgui200.dll error, you should try to run the program by dragging a picture to the .exe file instead of using ctrl+F5 in the vs2008.... hope it will help...

Daniel on Apr 14, 2010:

1 - thanks for the tutorial
2 - thanks SiddeeqHssn i copy the dll files and its ok now !

i also add
C:/OpenCV2.0/vs2008/bin/Debug
C:/OpenCV2.0/vs2008/bin/Release
to PATH

winXP 32b

Maan on Apr 16, 2010:

Hello Shri and all..great wrk done..thanks a lot...

Singgih on Apr 21, 2010:

hello,, i try to train the clasifier using haartraining.exe from opencv2,training proccess is very slow,when the train goes to stage 6 it's stopped,
how to use traincascade.exe from opencv2???

Simon on Jun 15, 2010:

Hi everyone,

Just wanted to throw out a huge thanks to the author, this saved me and got me running in OpenCV after a couple frustrating days. It's ridiculous that there is no document like this on the Open CV wiki. Have you thought about posting it there or on Willow Garage?

Anyway, I am using Windows 7 64 bit with VS2008 Pro, and OpenCV 2.0. I followed the PDF guide precisely, then ran into the missing highgui200.dll run-time error.

I fixed this by adding the following items to the System Path (not the user path), as per the suggestions of several other commentors:

C:\OpenCV2.0\vs2008\bin\Debug;
C:\OpenCV2.0\vs2008\bin\Release;

Thanks again.

rawks on Jun 21, 2010:

very consistent guide Mr. Nash of all the google I've made yours is very helpful and concise, Thank you.

now looking and testing your tuts.

Tharindu Adhikari on Jul 3, 2010:

Hello,
problem with *.dll can be solved by copying
all the *.dll files in the "C:\OpenCV2.0\vs2008\bin" folder to the "C:\Windows\System32" folder.
Now your program should work fine...

Robert on Jul 11, 2010:



You have the best tutorial that I have ever seen and I have seen thousands of them. Your tutorials actually works! I went to other opencv installation tutorials and they are crap! absolute crap! They can't even compare to your tutorials. Keep up the good work! I bow down to you.

milad soltany on Jul 12, 2010:

hi

thank you

I'm working on "eye tracking"

if i have question can i ask you ? OR in another hand
if i have problem, do you help me ?

Joy on Jul 23, 2010:

Thank you for the tutorial, this has really been a great help.
I also experienced the missing dll files but solved it by replacing ...lib... with ...bin... in the Path (as sugg by other commenters) no need to copy the files to the project folder anymore.

mohd zhafri on Jul 29, 2010:

at the last step of openCV installation, i get an error say like this
"this application failed to start because highgui200.dll was not found.Re-installing the application may fix the problem"

can u help me?

mohd zhafri on Jul 30, 2010:

i had follow everything suggestion in the comment above but until tharinda suggestion in become OK if i drag the picture to the *.exe file.. but when directly build the project it show me "violation reading location 0x00000000."

Payman on Aug 18, 2010:

Thanks a lot!

Eduard on Sep 1, 2010:

Hi,

I have used Microsoft Visual C++ 2008 and OpenCV 2.0.
To install OpenCV 2.0 I have used the procedure described in
file OpenCV_2_0_Installation.pdf.

When I run my simple program which uses cvExtractSURF function,

next error appears:

Unhandled exception at 0x10010bf6 (cv200.dll) in ExtractSURF_2_0.exe:
0xC000001D: Illegal Instruction.

and points to the cvRound function.

The same program runs without problem when I used OpenCV 2.1.

Can somebody help me with this problem?

Thank you very much in advance,

Eduard

Himanshu Bugalia on Sep 3, 2010:

How to install Opencv without CMAKE, as I dont have cmake and i cant even get cmake . Also there was no "vs2008" folder in the Opencv folder. Please help me out . I m working with Opencv 2.0 and visual studio 2008

Lou Arnold on Sep 15, 2010:

1) I'm curious: If I download and install OpenCV-2.0.0a-win32.exe, then why do I need to "Make" the software. All the include files, DLL, include files, and source files are already there. All I have to do is tell VS2008 where to find them.

2) Also, when I create an project and build it, I have to supply two sets of information to VS2008, one for Debug and one for release builds. I don't need to include the full list of lies and folders in both property sets, do I?

ciranmc on Oct 3, 2010:


Please note !!!!! If using a 64bit machine, Something with windows 7 perhaps, put the .dll files in the "C:WindowsSysWOW64" folder!!!
Not the system32 folder.

Nas on Nov 27, 2010:


how opencv is installed for eclipse c/c++ cdt

Vidya Chantique on Jan 24, 2011:

Hey!! It's work!!!
Thank you very much for the tutorial, I am using Windows 7, Visual Studio C++ 2008 Express Edition, CMake 2.8.1-win32-x86 and OpenCV-2.0.0a-win32

I change the path, also copy .dll file to System 32 and finally its work!!! Now I am having Final Project with OpenCV about Image Processing, hope it will work good..^_^ Keep writing.
Thank you very much!!!

Classix on Jan 24, 2011:

The same problem with mohd zhafri, I've got "violation reading location 0x00000000."

Is there anyone can help??

vikram on Feb 9, 2011:

Thanks lot to the author for the very detailed tutorial.
Searched for two days in the net to get my opencv working,couldnt until i found this site.
All the *.dll errors got fixed once i copied the *.dll files from "C:\OpenCV2.0\vs2008\bin" to "C:\Windows\System32" as Tharindu Adhikari pointed out.
Thanks again.

Nadeee on Feb 10, 2011:

I installed VS2008, OpenCV 2.0 and CMAKE. After building it shows C:/OpenCV2.0/vs2008/lib/Debug. But does not show .../Release. What should I do?

timmi on Feb 20, 2011:

general error c10100b1: Failed to load file "..Debugopencv.exe". The system cannot find the path specified.
can sum1 help in correcting this error?

jai on Mar 3, 2011:

Hi,
Does anyone here knows how to work with cvblobslib library.
I am using openCV 2.2 n visual C 2010.

Thank u.

Abder-Rahman on Mar 10, 2011:

Thanks so much for this excellent tutorial.

alim on Apr 4, 2011:

Hi,
Is opencv supports Gabor filter implementation? i am working in opencv 1.0 on visual studio 6.0. Whats are the advantage of opencv 2.0 on VS2008. Help me.

aytac on Apr 23, 2011:

Hi, I got the .dll issue. It says highgui200.dll has not found. No solutions worked for me beside copying .dll files to system32: "I copied all .dll files under the directory: ...opencv2.0vs2008binrelease to ...windowssystem32 . I also need to change system path from lib to bin. Maybe there are others likes me, so i hope this will be helpful. By the way, thx for tutorial and suggestions, great job.

Caiden on Apr 30, 2011:

Taknhs alot - your answer solved all my problems after several days struggling

zakwan on May 6, 2011:

i am using cmake 2.8.4 and at step 5 there was no "opencv_whole_program_optimization" option.i cant build and debug open.cv (step 9). every time i debug error will come out. please help me (using window XP)

muhammed asif k t on May 10, 2011:

Hi,

I have developed an openCv application for 32 bit machines and is working without any issue. I need to buid the same for 64 bit machines. I changes the configurations for a 64 bit machine as target machine(x64) and preprocessor definition(AMD64). When I am building this, I get an error and says "fatal error: cannot open file cv210d.lib". I am using vs2008 and opencv2.1. Anybody please help me to solve this issue..

muhammed asif k t on May 10, 2011:

Hi,

I have developed an openCv application for 32 bit machines and is working without any issue. I need to buid the same for 64 bit machines. I changes the configurations for a 64 bit machine as target machine(x64) and preprocessor definition(AMD64). When I am building this, I get an error and says "fatal error: cannot open file cv210d.lib". I am using vs2008 and opencv2.1. Anybody please help me to solve this issue..

sahasrara on May 22, 2011:

i am not able to find the ''src'' folder in opencvvs2010 directory
plz help me out
thnks in advance

sara on Jun 14, 2011:

hi,

when i configure the CMake, the option for OPENCV_WHOLE_PROGRAM_OPTIMIZATION is not there.
so, what should i do?

Bikka on Jul 3, 2011:

Thank You very much for the tutorial and thank you SiddeeqHssn.Solved the highgui200.dll problem.

As he has mentioned highgui200.dll problem can be solved by simply copy and pasting the - cv200.dll, cvaux200.dll, cxcore200.dll, cxts200.dll, highgui200.dll, ml200.dll and opencv_ffmpeg200.dll files

from C:\OpenCV2.0\vs2008\bin\Release
to C:\Your solution path\Debug (E.g: C:\Documents and Settings\User\My Documents\My Work\opencv\Debug)

Tunai Porto on Aug 4, 2011:

Hi there Shirinivas!

Great tutorial, found it very useful and simple. Really helped a lot.
For the ones that are still having problems with the higui200.dll question, here's the solution:

1. Go to Mycomputer->properties->Advanced-> Environment variable-
>PATH->edit (care, not user variables), and change "C:/OpenCV2.0/vs2008/lib/Debug; C:/OpenCV2.0/vs2008/lib/Release" for "C:/OpenCV2.0/vs2008/bin/Debug; C:/OpenCV2.0/vs2008/bin/Release"

2. Copy the .dll files found on C:\OpenCV2.0\vs2008\bin (both release and debug) to C:\Windows\System32 (for 32 bit OS) or C:\Windows\sysWOW64 (for 64-bitOS).

Thank you!

Andy on Aug 13, 2011:

I have recently been applying the OpenCV and cvBlobsLib libraries to a problem encountered in bioscience industry - that of creating images of sample spots printed on microarray slides. It has greatly improved our quality control processes in that it can reliably be used to extract an image taken from a Flea2 digital camera, using the FlyCapture SDK, and then uses OpenCV to convert to greyscale and then black and white (binary) and finally use cvBlobsLib to detect the presence/absence of microarray spots.

Previously this was very labour intensive, with slides having to be examined individually under the microscope or using GenePix scanning software etc.

Some results and tips on setting up OpenCV and cvBlobsLib on my blog:

http://andyuk2010.blogspot.com/2011/07/object-detection-using-opencv.html

Leave a comment

Name (required)
Email (will not be published) (required)
Website

Characters left = 1000