My developing environment: Windows 7 64 bit, Visual Studio 2008 32bit, OpenCV 2.2 2010-12-05 Package from official website.
My webcam, which works fine in OpenCV 2.1, could not even be launched in OpenCV 2.2. After some google work, it seems to be a known Bug of 2.2 version and has been solved in the branch but not in the package.
So, just DIY! Only one file needs to be modified: $(OpenCV Folder)\modules\highgui\src\precomp.hpp
Find:
#if !defined WIN32 && !defined _WIN32 #include "cvconfig.h" #else void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ); #endif
Replace:
#include "cvconfig.h" #if defined WIN32 || defined _WIN32 void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ); #endif
Re-compile OpenCV project, and done.
8 Comments
Thanks! With your help my isight webcam can work in OpenCV now!
Was the webcam able to display properly with this bug fix?
When I did this a blank grey screen popped up instead of the video stream.
I am using Windows 7 64-bit in opencv 2.2 64 bit in visual studios 2008
In my case, it works. I am also working in Win7 64bit. Maybe you can debug into your code to see what the exception is.
hi..
i changed precomp.hpp just like you say but it didn’t work.nothing changed..How can i solve this problem?
en, without more details I am afraid that I can not offer much help. But maybe you can check the coder in your environment, or just change another version of OpenCV for testing.
Hi
I am using OpenCV in Ubuntu-11.04
My webcam works properly with Cheese.But it is not working with cvCreateFromCAM().
Can you please help me out in this matter?
Thanks.
Hello,thx for sharing, I changed the code in precomp.hpp in VS2010, then rebuild, but nothing changed. My envirement is WIN 7 32bit +VS2010+openCV 2.2.0, it is still a blank gray window. when I tried again, there is a worse situation,the blank gray window appeared just for a second and then disappeared…
Could you help me with solving this problem?
the grey window appears for me too, i did the above changes u have shared, but the problem remains the same. any other way to clear this blank screen .
One Trackback
[...] 网上查了一下,发现在2.2的版本里有一个bug,详见:http://blog.qinyujie.net/2011/01/15/440/。 [...]