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

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

EdgeDetector

FeatureTracker

Host side

ImageManip

IMU

Mixed

MobileNet

MonoCamera

ObjectTracker

Script

SpatialDetection

StereoDepth

SystemLogger

VideoEncoder

  • Disparity encoding - Encodes stereo disparity into .mjpeg

  • RGB Encoding - Encodes RGB (1080P, 30FPS) into .h265 and saves it on the host

  • RGB & Mono Encoding- Encodes RGB (1080P, 30FPS) and both mono streams (720P, 30FPS) into .h265/.h264 and saves them on the host

  • Encoding Max Limit - Encodes RGB (4k 25FPS) and both mono streams (720P, 25FPS) into .h265/.h264 and saves them on the host

  • RGB Full Resolution Saver - Saves full resolution RGB images (4k) on the host (.jpeg)

Yolo

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