i have to convert a raw image to color. My informations about the Image are:
- the color-depth is 12 bit
- i have to use Bayer-Patern to convert it
- one (color) Pixel has 1 value for red in the raw-image and 3 gray values (i have really no idea, how this should work)
You can see a part of the raw-image here: http://relin.de/0.pgm But if i try to debayer it, i get only a 1-color picture like that: http://relin.de/0.ppm
Note: I have this examples already converted to 8Bit. A 12Bit example can you see here: http://relin.de/0.pgm
I use c++ and opencv. My source-code:
Mat iSource(height, width, CVMatType, (char*)pData);
Mat z, zz;
iSource.convertTo(z, CV_MAKETYPE(CV_8U, 1), 0.0625);
cvtColor(z, zz, CV_BayerGB2RGB);
I have also tried to look at values of that parts of the image, where i know which color there should be (traffic-signs).
Where Blue should be, are this values in the raw image:
00 05
05 05
Red:
08 08
08 08
white:
0D 56
56 56
green(probably):
11 5F
50 5E
That seems not to be a bayer pattern. Has anybody an idea? Thanks! (sorry for my english!)