tldr: does OpenCV adopt a different Bayer ordering than what's commonly used?
I'm trying to capture an image with a camera with a Bayer sensor, using the drivers provided by the camera company and a Python wrapper. The issue that I'm facing is that I expect a RGB image as output, but I get a BGR one instead.
I'm converting the image using cv2.cvtColor(image, cv2.COLOR_BAYER_BG2RGB), which seems the correct conversion, because both the drivers and the camera company GUI to interact with the camera show the Bayer mosaic as BayerBG.
Since the image comes out as bgr, either I'm using the wrong conversion code, or the camera company's drivers are at fault (which seems highly unlikely).
Here and here are two other questions that kinda touch on the problem, but don't solve my doubts.
My suspicion on the issue is that what chip manufacturers and OpenCV consider as Bayer ordering does not match. For instance, consider the following:
B G B G B G
G R G R G R
B G B G B G
G R G R G R
I would expect the above Bayer format to be referred as BayerBG (which is what I see when using the camera company's software and drivers), however I suspect from here (bottom of page) that OpenCV would consider that as BayerRG format, due to the following quote from that page:
The two letters C1 and C2 in the conversion constants CV_Bayer C1C2 2BGR and CV_Bayer C1C2 2RGB indicate the particular pattern type. These are components from the second row, second and third columns, respectively.
Am I correct in my interpretation that OpenCV adopts a different Bayer ordering than what's commonly used?