I’ve double checked the sample has not been modified by building from a fresh copy of the samples. Setup is using an NX with JetPack 4.5 and two imx219 cameras.
@ShaneCCC
Sorry for not being clear, IMX219 is Raspberry Pi Camera v2. I think Waveshare is the manufacturer of this specific one. The camera works fine with nvarguscamerasrc and other apps. Only cudaBayerDemosaic doesn’t work.
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.
// 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!