Ask Your Question

Revision history [back]

How to convert from BGR to BayerRG

I am working with a camera with an integrated vision system. I would like to use openCV to generate test images and upload these test images to the camera to evaluate the performance of the system. I have already been able to generate some useful test images but the camera assumes the picture being uploaded is a BayerBG pattern.

I noticed cvtColor can convert a Bayer pattern to BGR but I would like to do the exact opposite. As far as I can tell from the documentation there is no way to convert from BGR to Bayer.

Is there an other easy way to do this?