Code Samples

Code samples are used for automated testing. They are also a great starting point for the DepthAI API, as different node functionalities are presented with code.

Bootloader

Calibration

  • Calibration Flash v5 - Flashes calibration data of version 5 (gen1 calibration data) to the device

  • Calibration Flash - Flashes calibration data of version 6 (gen2 calibration data) to the device

  • Calibration Reader - Reads calibration data stored on device over XLink

  • Calibration Load - Loads and uses calibration data of version 6 (gen2 calibration data) in a pipeline

Camera

ColorCamera

  • Auto Exposure on ROI - Demonstrates how to use auto exposure based on the selected ROI

  • RGB Camera Control - Demonstrates how to control the RGB camera (crop, focus, exposure, sensitivity) from the host

  • RGB Preview - Displays a small preview of the RGB camera

  • RGB scene - Shows how to select ColorCamera’s scene and effect

  • RGB video - Displays high resolution frames of the RGB camera

Crash report

  • Crash report - In case of a firmware crash, example reads it from the device and saves it to a json file

EdgeDetector

FeatureTracker

Host side

ImageManip

IMU

Mixed

MobileNet

MonoCamera

NeuralNetwork

ObjectTracker

Script

SpatialDetection

StereoDepth

PointCloud

Sync Node

  • Depth and Video Sync - Synchronizes depth and video streams for real-time processing and display.

  • IMU and Video Sync - Aligns IMU data with video frames, showcasing real-time rotation vector display alongside video.

  • Multiple Scripts Sync - Demonstrates synchronization of data from two script nodes emitting data at different intervals.

  • Demuxing Synchronized Script Outputs - Features synchronization of script outputs followed by demultiplexing for distinct processing streams.

SystemLogger

ToF

  • ToF depth - Displays colorized ToF depth frames

VideoEncoder

Warp

UVC

Yolo

  • RGB & Tiny YOLO - Runs Tiny YOLO on RGB frames and displays detections on the frame