- Edited
The video below demonstrates how users can use STROBE output from M8 connector on OAK camera to drive an external illumination (eg. LED panel) during exposure times:
Strobe lights illuminate the scene in front of the same in order to:
- Decrease the exposure time, and/or
- Decrease sensitivity ISO (gain)
of the camera sensors.
Applications
Strobe lighting with OAK cameras really shines (pun intended) when capturing fast-moving objects (as it eliminates exposure blur):
- Scanning conveyor belt items for:
- Item counting
- QA/QC (defect scanning)
- Barcodes/QR codes scanning on packaging
- License plate recognition (LPR) of a moving vehicle
- Face recognition while people are moving
Hardware setup
Our OAK PoE cameras have an M8 connector, which also exposes STROBE line. Here are schematics of both M8 connector on the OAK-D Pro PoE camera, and the M8 Programming board (R0 revision) which was used to expose these lines. We used 12V, 50W LED panel for illumination.
From M8 pins:
- 1 - GPIO52 is used as 3v3 source, we need to drive it to HIGH with API
- 6 - STROBE(ISO) is the strobe output. In needs to be pulled up, as it can only sink current. It's also negated by default, that's why we have a negator before the MOSFET.
- 7 - GND_ISO needs to be connected to the ground
- 8-12 - GND
As seen on the video, we created a strobe driver (on a perf board) based on these schematics:
Code
For the video I used set standard mono_preview sample code as the base, and added 2 things;
First I manually set exposure time and ISO, as we're in a controlled environment in terms of lighting conditions:
monoLeft = pipeline.create(dai.node.MonoCamera)
monoLeft.setFps(FPS)
monoLeft.setCamera("left")
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_800_P)
monoLeft.initialControl.setManualExposure(200, 200)
And to provide the 3V3 source from GPIO52, we need to set these two GPIO pins to HIGH:
config = dai.Device.Config()
config.board.gpio[6] = dai.BoardConfig.GPIO(
dai.BoardConfig.GPIO.OUTPUT, dai.BoardConfig.GPIO.Level.HIGH,
)
config.board.gpio[52] = dai.BoardConfig.GPIO(
dai.BoardConfig.GPIO.OUTPUT, dai.BoardConfig.GPIO.Level.HIGH,
)
Full code can be found here.
Rolling shutter
STROBE output is driven from the stereo (global shutter) cameras - see shutter type documentation here for more info.
We synchronize the main color camera (12MP, rolling shutter) to stereo cameras, but exposure times aren't the same - both because of how the rolling shutter works, and because monochrome cameras have, in general, better quantum efficiency (QE), and thus lower exposure times.
The result is that only some rows on color (rolling shutter) sensor are being exposed during strobe illumination (so during mono camera exposure), which can be seen here:
Note that longer exposure on mono camera will result in more rows being illuminated. The time chart below nicely explains the reason for this interesting phenomenon.
The workaround here would be to either:
- Make a strobe signal longer - either longer exposure time of mono cameras, or use a digital circuit/MCU to extend the signal,
- Use a different type of sensors that are more suitable for such an application - the OAK-D-Pro-PoE also has "OV9782" variant, which is a global shutter color sensor (1MP).
Let us know your thoughts in the comments!