I have a camera which is providing me raw, binary data with 10 bit data. It follows the Bayer pattern RGGB, and each pixel is saved using 16 bit chunks. I am able to demosaic the image almost successfully.
The RGB image looks is almost completely black. If I multiply by 64 the raw data, the RGB image looks better but rather green. The overall intensity is very low. The camera provider has a live view of the camera and it looks much better in both aspects.
Since 10bit are saved into 16bit chunks, the tools I am using assume 16bit depth (at least Matlab and OpenCV do for sure). In order to compensate for this, I multiply by 64 (6bit shift to the left) the raw data. But still is not enough. If I multiply by 128, some pixels saturate and then the image looks weird.
What I have tried
Using Matlab image processing toolbox, Python colour-demosaicing package, and OpenCV functions, I get the same result, but they do not match the live visualization.
Update I analyzed the histogram on the vendor tool, and those from OpenCV. I am not sure, but interestingly there are no values above 255. However, on the raw data I record from their software, there are many values above 255, but nothing compared with values below 255. Thus, if I clip the image with max value of 255, the final result looks very similar!.
- Is there anything else I can verify? I assume is a problem on my end, because the three tools give same results.
- Is there a better way of handling the 10bit pixels to convert to 16bit?
- Is there any sense on what I discovered on the update? It seems that the two extra bits are not used for anything but noise!
Any help is appreciated. I am very sorry for not providing data or images (company privacy).