Hi,
First of all i am a newbie, trying to learn machine vision...

I am trying to use opencv 2.3 in visual studio 2010 on windows 7 ultimate(64bit).
I tried in various ways like pre-built versions, built using vs 2010 from SVN source and not even a single attempt is succeeded. I searched all over the web for some way to do this, but nothing helped me.

I don't know what is the reason i m failing,

  • may be it is with my laptop's webcam which is Acer Aspire 5738's Crystal Eye webcam
  • it is incompatibility b/w windows 7 64bit, visual studio 2010 and opencv

Please give me some suggestions to solve this.

Note: I got lucky with ubuntu 10.10 and opencv, that i managed to run a mini project of mine.

Thanks in advance

How did you specify the header's and library's directories in the Visual Studio settings?

After you built the source, you should have had the static libraries (.lib) files and the DLLs (which I think come prebuilt with the installer if you go that route).

You don't have to go into excruciating detail, but it will be helpful to find out more about what you tried, so you don't have to start over from the very beginning.

How did you specify the header's and library's directories in the Visual Studio settings?

After you built the source, you should have had the static libraries (.lib) files and the DLLs (which I think come prebuilt with the installer if you go that route).

You don't have to go into excruciating detail, but it will be helpful to find out more about what you tried, so you don't have to start over from the very beginning.

Hi jonsca,
Thanks for the reply.
I did specify those headers and libraries in project properties > vc++ directories > Include directories & library directories

that i did in both cases (pre-built & svn build).

I'll give you full details of what i did, if you want to know.

Thanks

Try n go for EmguCV ..Its a wrapper for OpenCV for VS
may be that will help

Try n go for EmguCV ..Its a wrapper for OpenCV for VS

Emgu is a .NET wrapper for the OpenCV library. I don't believe that is what the OP is after in this case.

I'll give you full details of what i did, if you want to know.

Like I had said, just the broad strokes, but slightly more specific than you were.

The exact error messages would be helpful. I'm assuming you used CMake or something on the source files. Were there any errors with dependencies, etc? In other words, did you get a project which you then opened with Visual Studio? Did you build all of the projects successfully? Were there any errors during compilation(there are usually a boatload of warnings with this type of thing, unfortunately)?

If the static libraries were successful, did you have the .dlls in a place where the program could find them?

Try n go for EmguCV ..Its a wrapper for OpenCV for VS
may be that will help

hi djsan,
i tried emgu cv already, after i got problem with opencv,
but no success.

i think since emgu cv is just wrapper for opencv, the real deal is with opencv.

Like I had said, just the broad strokes, but slightly more specific than you were.

The exact error messages would be helpful. I'm assuming you used CMake or something on the source files. Were there any errors with dependencies, etc? In other words, did you get a project which you then opened with Visual Studio? Did you build all of the projects successfully? Were there any errors during compilation(there are usually a boatload of warnings with this type of thing, unfortunately)?

If the static libraries were successful, did you have the .dlls in a place where the program could find them?

Hi jonsca,
sorry for the delay.,
once again, i started from scratch and did all the building and configuring things
just to make sure i didn't slipped anything. But the outcome is same... there are no errors during building opencv or during building my project.

But the problem comes when i run the project (debug/release modes) ... it is showing the following error.

<img src="http://www.daniweb.com/forums/attachment.php?attachmentid=21782&stc=1&d=1311914325"/>

thank you

There are two ways to fix that. The first would be to go to Project/<myproject>Properties/Configuration Properties/Debugging and specify the working directory as `c:\<pathtoyourDLLs>. The only downside to this is, if you program writes out any files, they will end up cluttering your dll directory.

A more permanent solution is to copy the necessary .dll files into your <myprojfolder>/<myprojfolder>/debug and <myprojfolder>/<myprojfolder>/release directories. Copy over the .dlls associated with the header files that you have included.

commented: Good effort in this thread +16

There are two ways to fix that. The first would be to go to Project/<myproject>Properties/Configuration Properties/Debugging and specify the working directory as `c:\<pathtoyourDLLs>. The only downside to this is, if you program writes out any files, they will end up cluttering your dll directory.

A more permanent solution is to copy the necessary .dll files into your <myprojfolder>/<myprojfolder>/debug and <myprojfolder>/<myprojfolder>/release directories. Copy over the .dlls associated with the header files that you have included.

hi jonsca,
wow! thats worked, you made my day.
even though it is so basic and simple step i missed it ...

thank you very much for the advice, finally i am able to run my little test program (showing an image).

but i am still unable to access my webcam.

i am getting this message in console window at output.

warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:477)
Error opening camera!

can you help me on this one too, please.

Thank you

You said you ran a project under Ubuntu. Were you able to access the camera from there?

Update: It looks like there were some significant changes to that file in the last month. You may want to pop over to the official user group on Yahoo (you have to join, but if you're getting into this, it's not a bad idea, and it's an active group) http://tech.groups.yahoo.com/group/OpenCV/messages. I put in that source filename as a query and didn't get anything, but someone might know right off the bat.

You said you ran a project under Ubuntu. Were you able to access the camera from there?

Update: It looks like there were some significant changes to that file in the last month. You may want to pop over to the official user group on Yahoo (you have to join, but if you're getting into this, it's not a bad idea, and it's an active group) http://tech.groups.yahoo.com/group/OpenCV/messages. I put in that source filename as a query and didn't get anything, but someone might know right off the bat.

hi jonsca,

yes, i was able to access the camera in ubuntu 10.10 using opencv 2.1.

thanks for the link jons, i 'll join that group.

thank you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.