Manipulating sensor.snapshot()

I am trying to use an Arduino Nicla Vision for lane detection on a slotcar. At full speed, I want to be able to take a picture and do image processing in a loop at least every 20 ms (50fps).

I have realized, that the snapshot()-method does not allow any other CPU calculations until the picture is taken and it lasts between 2 and 13 ms with my current settings.

It seems like, an Interrupt cannot be triggered, when the snapshot()-method is executed.
Since multithreading is not possible as you have stated here, I wanted to know if it is possible to change the snapshot()-method itself to use the time while taking the picture otherwise. I tried finding it in github but couldn’t find it.


Snapshot() should not block after the first one assuming the image resolution is low enough to enable multiple image buffers.

We have a full DMA system that’s interrupt driven with one interrupt to the CPU per frame. As such, once snapshot is kicked off on the first call the next calls are just grabbing data from the image buffers. Assuming you enable sensor.set_framebuffers(3) (which happens by default if the resolution is low enough) then the call will never block and should return the latest image instantly.

Note that interrupts are processed still while snapshot is running.