SpectacularAI / sdk-examples

Spectacular AI SDK examples
Apache License 2.0
203 stars 35 forks source link

Modify the frame rate of the OAK-D-PRO-W camera #74

Closed liang-zijian closed 1 year ago

liang-zijian commented 1 year ago

I tested VIO with indoor lighting and found significant drift. However, results are stable in outdoor natural light. I noticed that the Oak camera flickered under the indoor strobe light.

Does this SDK support modifying the frame rate or exposure time of the OAK camera to solve the strobe problem?

Can you give an example of how to change it? Thank you so much!

oseiskar commented 1 year ago

Hi. You can modify the FPS of the cameras using the Depth AI methods by modifying the example codes as follows

vio_pipeline = spectacularAI.depthai.Pipeline(pipeline)
changed_fps = 25 # new
vio_pipeline.monoLeft.setFps(changed_fps) # new
vio_pipeline.monoRight.setFps(changed_fps) # new

There is also a new configuration flag called useVioAutoExposure that can reduce motion blur in low-light and indoor conditions. It can be enabled as

vio_pipeline = spectacularAI.depthai.Pipeline(pipeline, useVioAutoExposure=True)

Alternatively, you can also set the exposure fully manually using the relevant Depth AI API (see, e.g., here)