Unfortunately I didn't figure out why cvtColor
didn't work, but nonetheless I found a why to convert BayerRGGB to RGB with my SDK.
It turned out that the matrix-vision sdk I was working with provided a built in solution.
The first thing I needed to do was to change PixelFormat
to BayerRG8 in order to get 8 bit Image resolution. After that, I managed to decode Bayer RGGB to RGB by writing idpfRGB888Packed into ImageDestination.pixelFormat
.
Also, I was able to do my conversion in a very primitive way, which also got the job done but required way too much cpu time.
I looped my imageData
array and took out every fourth pixel.
for (int count_small = 0, count_large = 0; count_large < 1000; count_small += 3, count_large +=4)
{
dest[count_small] = source[count_large];
dest[count_small+1] = source[count_large+1];
dest[count_small+2] = source[count_large+2];
}
Not clean but it got the job done.