Camera Control¶
This example shows how to use DepthAI SDK to control the color camera parameters.
Control: key[dec/inc] min..max
exposure time: I O 1..33000 [us]
sensitivity iso: K L 100..1600
To go back to auto controls:
'E' - autoexposure
Demo¶
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¶
Source Code¶
Also available on GitHub
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | from depthai_sdk import OakCamera with OakCamera() as oak: color = oak.create_camera('color') oak.visualize(color, fps=True, scale=2/3) oak.start() while oak.running(): key = oak.poll() if key == ord('i'): color.control.exposure_time_down() elif key == ord('o'): color.control.exposure_time_up() elif key == ord('k'): color.control.sensitivity_down() elif key == ord('l'): color.control.sensitivity_up() elif key == ord('e'): # Switch to auto exposure color.control.send_controls({'exposure': {'auto': True}}) |