Gain and exposure should be at the defaults. I tried with an IMX477 on Nano and while not perfect, the result isn’t blown out either. Black level is wrong but the rest is fine. Looks like the values returned by IMX219 are wildly not in the same range.
There is a comment in the .cu saying:
// Signed 16-bit Bayer maps 1<<14 to white.
const float whitePoint = 1<<14;
This does not appear to be correct for IMX219. I got decent results in OpenCV reinterpreting the data* as unsigned rather than signed. Otherwise I get this “black sun” effect. Likewise black somehow becomes white. It might be worth it testing with imx219 and putting a note in the code, given the popularity of that sensor. Thanks for your help. The sensor I’m working with is IMX477 anyway, so I can work with this!
