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
#if !defined WIN32 && !defined _WIN32 #include "cvconfig.h" #else void FillBitmapInfo( BITMAPINFO* bmi, int width, int height, int bpp, int origin ); #endif
#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.