Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

RGB vs. BGR

If I capture a frame and then write it to JPG, like this:

VideoCapture capture = VideoCapture(0); capture.read(frame); imwrite("frame.jpg", frame);

ImageMagick identify says frame.jpg is Colorspace: sRGB.

I made this experiment because I read that OpenCV's default is BGR, not RGB.

Can I use CV_RGB2GRAY in cvtColor? Is RGB OpenCV's default?

RGB vs. BGR

If I capture a frame and then write it to JPG, like this:

VideoCapture capture = VideoCapture(0); capture.read(frame); imwrite("frame.jpg", frame);

ImageMagick ImageMagick's identify says frame.jpg is Colorspace: sRGB.

I made this experiment because I read that OpenCV's default is BGR, not RGB.RGB. But it seems to produce RGB JPG files.

Can I use CV_RGB2GRAY in cvtColor? cvtColor always and be safe? Is RGB OpenCV's default?