Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Single Pixel Colors

Hi Folks,

I am just starting out with openCV and I understand how a 3 channel image uses a combination of RGB values to display a color image. The code below will produce a black and a white window but where do these values come from? Where is it specified that the values from 001 to 255 span the colors black to white with shades of grey in between? Is there a lookup chart like there is for color images with 3 values per pixel?

Also when I draw a circle, openCV let's me specify the color as '0' which is equal to black. When I use '0' or '000' in the code below, openCV produces an error. Why is that?

Mat blackImage(200, 200, CV_8U, 001);

Mat whiteImage(200, 200, CV_8U, 255);

Thanks.