I have been reading in a few forums that OpenCV has the BGR channel order by default.
It is also possible that a cv::Mat may have RGB channel order.
A gray conversion would specify CV_BGR2GRAY or CV_RGB2GRAY as a parameter.
1) Are there any other options, than RGB and BGR ?
2) Is there any way to find out - through code - what the order of channels is ?
Thank you.
Opencv always (AFAIK) uses BGR channel order, there are a few functions in the GPU module that use BGRA since opengl contexts work better with 32bit pixels.
BGR2Gray and RGB2Gray both call the same function.
The easiest way to check is to create an image in paint etc which has known R,G,B values and then examine the cv::Mat memory in the debugger
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With