Bad color when capturing image from WEC7

I’m just trying to grab a frame from a USB camera on a Windows Embedded Compact 7 machine and all seems to work pretty well except that the colors are off. If you look at the attached image you should see on the lower right side there is a reddish tint, then more green towards the left. If I switch to grayscale it looks great. I just need to fix the colors.

Is there a setting that I’m missing or something else I can use to fix this?

I have just a basic implementation:

cv::Mat image;;
VideoCapture >> image;
cv::imwrite(path, image);

I’m pretty new to OpenCV but will greatly appreciate any help.


  • there’s an environment variable to debug it:


  • try to switch backends:

    VideoCapture(0, CAP_DSHOW); // CAP_MSMF is the default, iirc

  • try to get to the global properties page (switch off white-balancing, etc):

  • try to find a better driver for your webcam