views:

4293

answers:

8

I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot.

I found some instructions for building the release using cmake at http://opencv.willowgarage.com/wiki/InstallGuide . I downloaded the latest and greatest cmake, and tried to follow the instructions, but I was guessing. No joy.

I specified VC++9 when I did the "configure," but cmake built a VC++ 6 dsw file. No vcproj. I converted the dsw into a vc++9 vcproj anyway, just to see if it would work. Nope. It compiled lots of files, but many failed because it could not find omp.h. Sure enough, it's not there, anywhere. The build log said, 'A tool returned an error code from "Performing Custom Build Step".'

I am lost.

Ideally, I would like to find a full installation with all the files pre-built for Win32 vc++ 2008. Failing that, I need instructions that even I can follow. Short sentences and small words, but lots of them.

Please help!

UPDATE: I tried to build just CXCORE. It complained, "cannot open file 'VCOMPD.lib'" There's that OMP again.

+1  A: 

If you've installed OpenCV-2.0.0a-win32.exe then it will install pre-built DLLs and libs. Then you just have to follow the instructions in this tutorial.

I recommend that you wipe the folder you previously installed OpenCV2.0 in and reinstall it.

Update:

Well sorry it didn't work out. I suggest the following then: check out the latest version from the SVN repository, https://code.ros.org/svn/opencv/trunk/opencv with any SVN client - I use TortoiseSVN.

Then run CMake (I see you've already installed it) on the source folder and then compile the Solution file. This should work - it does for me.

I apologize for my old answer - I had started off with OpenCV a few months ago in the same way and assumed that downloading the Gold version would still work - apparently not.

OMP

The OMP issue may arise from the checked Enable OpenMP in the CMake config. Try unchecking that .. might solve your initial problem.

Jacob
I did as you said, up to a point. I had to stop where it said to put "C:\Program Files\OpenCV\cv\include" into the INCLUDE directories list. There is no such directory. Actually, I took the default and installed it in C:\OpenCV2.0. But there is no cv directory there either. Also, there is no cv.lib anywhere.
Jive Dadson
I did it again. I ran the uninstall.exe, which completely emptied the installation directory. I removed the directory. I went to the registry and found two keys for OpenCV and removed them. I re-installed. Still no cv/include or other include directories specified. Still no cv.lib anywhere.
Jive Dadson
I found this: 2. Due to many technical problems the installation package does not include pre-compiled OpenCV libraries for Visual Studio users. Instead, it includes libraries built with MinGW 4.3.3 TDM-SJLJ. They are good enough to run the C/C++ and Python samples and tests, but for developing your OpenCV-based applications using Visual Studio, Borland IDE etc., or even a different version of MinGW, you need to build the libraries with your compiler using CMake, as explained here: http://opencv.willowgarage.com/wiki/InstallGuide. So I am back to that.
Jive Dadson
Jacob, please remove this answer, okay?
Jive Dadson
I've updated my answer - it may prove useful.
Jacob
You are forgiven. Thanks for hanging in with me. ONWARD THROUGH THE FOG!
Jive Dadson
A: 

Hi guys, so I installed OpenCV2.0 and I am using MSV C++ 2008 v9. Now, I was trying to test the following:

http://opencv.willowgarage.com/wiki/FaceDetection#HowtomaketheFaceDetectorworkinMFCApplication.3A

  • TITLE: How to make the Face Detector work in MFC Application:

which doesn't work for me. The problem might come from the following, because when I try these, I do not see what they are asking me to look for and add.

Step 3 In Project Settings (Alt+F7), go to the C/C++ tab, then select Category Preprocessor, and for Additional Include directories, add the following: C:\Program Files\opencv\cv\include,C:\Program Files\opencv\otherlibs\highgui,C:\Program Files\opencv\cxcore\include,C:\Program Files\opencv\cvaux\include

Step 4 In Project Settings (Alt+F7), go to the Link tab, then select Category "Input", and for "Object/library modules:", add the following: cxcored.lib cvd.lib highguid.lib (see that there are no commas like in Step 3 above)

Step 5 While staying in the Link tab, and Category "Input", for the "Additional Library path:", add the following: C:\Program Files\opencv\lib

CAN SOMEONE SEE IF THEY CAN FIGURE OUT WHAT THE HECK IS WRONG?

thanks!!!

Bc
I tried this http://opencv.willowgarage.com/wiki/VisualC%2B%2B before, but the problem is that a lot of these screen shots are from previous versions of MVS and don't apply to OpenCV2.0. Anyone else working on MSV C++ 2008 v9 that can give me some info about the installation as well as how to start testing the examples?
Bc
"Doesn't work for me" is not a very thorough description of the problem. :-) Did you follow the directions verbatim, and if so, did you install in "Program Files\opencv"? I take it you cannot get it to link. What are the error messages?
Jive Dadson
@Bc, you have posted THREE QUESTIONS as ANSWERS to another persons question. Don't be such a noob. I would downvote you but you cannot lose points when you only have one. Pitty.
typoknig
A: 
  1. Download OpenCV installer for Windows
  2. Read OpenCV-2.0.0a-win32.Readme.Please.txt
  3. Follow OpenCV with Visual C++ 6.0, 2005 Express, and 2008 Express in order to create project using OpenCV
mloskot
As noted elsewhere in this thread, if one is using the free vc++ 2008 Express edition, the instructions in step (2) are not sufficient. The Express version does not support OpenMP. When using Cmake to build the project files, it is necessary in that case to UN-check the ENABLE_OPENMP box.
Jive Dadson
@Jive Dadson Thanks for pointing on this issue.
mloskot
A: 

I tried this http://opencv.willowgarage.com/wiki/VisualC%2B%2B before, but the problem is that a lot of these screen shots are from previous versions of MVS and don't apply to OpenCV2.0. Anyone else working on MSV C++ 2008 v9 that can give me some info about the installation as well as how to start testing the examples?

Bc
This is not an answer, it is a question.
typoknig
A: 

After reinstalling openCV2.0 using CMake on windows for MSV C++ 2008 v9, I did uncheck the ENABLE_OPENMP in cMake and then went to add a whole bunch of stuff on the project and Tools>Options. I couldn't get some sample code to work, but I tried a image code here.

and I was successful. I got an inverted image, which is what the code is supposed to do. I just wanted to know if the installation was working properly and after all these trials, the sample code above worked. However, I was trying the code the opencv wiki has instructions for, and I keep getting some memory allocation error. HAS ANYONE TRIED THIS YET?

Thanks,

Bc

Bc
Also not an answer. Read FAQ:http://stackoverflow.com/faq
typoknig
+3  A: 

For version 2.0, you must build the project from source.

Here's what you will need:

  1. The OpenCV installer.
  2. CMake. Here's the CMake installer.
  3. Instructions for using CMake to install OpenCV-2.0.01-win32. Those instructions need an extra step if you are using a vc++ Express edition. In that case you must un-check ENABLE_OPENMP when running the CMake GUI. See the image below.
  4. Instructions for setting up an application project. (Thanks to mloskot for this find.)

alt text

Jive Dadson
A: 

Hi, I followed Jive Dadson's procedure to get OpenCV2.0 to work on Visual Studio 2010 Express (disabled OMP). All went good until compilation of the generated stuff in Debug and Release. In both cases got this error: "LINK : fatal error LNK1181: cannot open input file '../../lib/Release/cv200.lib'" in debug the only difference is that the library is cv200d.lib.

EDIT: I solved by downloading the latest svn snapshot for OpenCV2.0. One additional thing on Vista/7: it may be good to execute CMake as administrator.

Dan
A: 

Let me make your life MUCH MUCH easier. Abandon OpenCV and use EmguCV instead. Easier to install, easier to use in Visual Studio, and easier to debug. Additionally any apps you make with EmguCV will be much more distributable as they will be based in .NET, thus much easier to run on Windows and Linux (in Mono).

typoknig