Ask Your Question

Revision history [back]

It's actually not possible to read in directly grayscale from a webcam. Most webcams will read in by default either YUV or YCrCb. As berak mentioned, 'CV_CAP_PROP_CONVERT_RGB' allows you to set whether or not you want this to be converted to RGB right away. So to get grayscale from a webcam, you'll have to use the 'cvtColor' function like so:


cvtColor(original, gray, CV_BGR2GRAY);


You'll have to do this for every incoming frame. Hope this helps!