Auto IR Brightness

This example shows how to use the automatic IR brightness feature of the DepthAI Stereo Camera. The function set_auto_ir(auto_mode=True) enables/disables auto IR dot projector and flood brightness. If enabled, it selects the best IR brightness level automatically.

Can be set to continious mode, which will continuously adjust the IR brightness. Set to False by default and which will automatically adjust the IR brightness only at device bootup.

Note

Visualization in current example is done with blocking behavor. This means that the program will halt at oak.start() until the window is closed. This is done to keep the example simple. For more advanced usage, see Blocking behavior section.

Setup

Please run the install script to download all required dependencies. Please note that this script must be ran from git context, so you have to download the depthai repository first and then run the script

git clone https://github.com/luxonis/depthai.git
cd depthai/
python3 install_requirements.py

For additional information, please follow our installation guide.

Pipeline

Pipeline graph

Source Code

Also available on GitHub.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from depthai_sdk import OakCamera

with OakCamera() as oak:
    left = oak.create_camera('left')
    right = oak.create_camera('right')
    stereo = oak.create_stereo(left=left, right=right)

    # Automatically estimate IR brightness and adjust it continuously
    stereo.set_auto_ir(auto_mode=True, continuous_mode=True)

    oak.visualize([stereo.out.disparity, left])
    oak.start(blocking=True)

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.