GenX320 Calibration

Good Morning,

My GenX320 has a lot of hot/stuck pixels and I want to calibrate them away. It looks like this is a supported function with the IOCTL_GENX320_CALIBRATE command but I can’t seem to get it to work.

The documentation states:

Pass this enum followed by a sigma floating point value to turn off pixel values out of sigma standard deviation from the normal distribution on the GENX320 camera module.

Below is my code to initialize the camera and attempt to calibrate it but this code results in an “invalid argument” error for the calibrate call. How should I use the calibration properly?

self._csi = csi.CSI(cid=csi.GENX320)
self._csi.reset()
self._csi.ioctl(csi.IOCTL_GENX320_CALIBRATE, 1.0)
self._csi.ioctl(
    csi.IOCTL_GENX320_SET_MODE, 
    csi.GENX320_MODE_EVENT,
    self._events.shape[0]
)
self._csi.framebuffers(3)
self._csi.ioctl(csi.IOCTL_GENX320_SET_BIASES, csi.GENX320_BIASES_LOW_NOISE)

Thanks.

Hi, there are calibration examples for it in histogram and event mode. Please see the examples folder in the IDE.

Thanks! I didn’t see that but just ran the examples and they appear to work.

Is the calibration persisted/saved to the sensor or does it have to be done every time the program runs?

Additionally, would you generally recommend running the calibration with something covering the sensor?

It needs to be done on each boot.

Yes, you probably want to cover the sensor when calibrating to get rid of hot pixels rather than things in the scene that are just busy. Or maybe you actually want to remove those busy elements too.

The current calibrate command seems to only return the count of deactivated pixels, rather than a list of coordinates. Is there a way to determine which pixels were deactivated from calibration, save that array, and load it at the next startup? Doing calibration each boot is pretty slow.

Hi, the actual process of writing the calibration array is what takes most of the time. Determining the hot pixels happens very quickly. Writing the calibration settings involves a ton of I2C accesses to open register windows, which allow setting masks per pixel in the camera.