# Depthai Examples

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.

### DepthAI nodes

 * [Bootloader](#Depthai%2520Examples-Bootloader)
 * [Calibration](#Depthai%2520Examples-Calibration)
 * [Camera](#Depthai%2520Examples-Camera)
 * [Cast](#Depthai%2520Examples-Cast)
 * [ColorCamera](#Depthai%2520Examples-ColorCamera)
 * [Crash report](#Depthai%2520Examples-Crash%2520report)
 * [EdgeDetector](#Depthai%2520Examples-EdgeDetector)
 * [FeatureTracker](#Depthai%2520Examples-FeatureTracker)
 * [Host side](#Depthai%2520Examples-Host%2520side)
 * [ImageAlign](#Depthai%2520Examples-ImageAlign)
 * [ImageManip](#Depthai%2520Examples-ImageManip)
 * [IMU](#Depthai%2520Examples-IMU)
 * [Mixed](#Depthai%2520Examples-Mixed)
 * [MobileNet](#Depthai%2520Examples-MobileNet)

 * [MonoCamera](#Depthai%2520Examples-MonoCamera)
 * [NeuralNetwork](#Depthai%2520Examples-NeuralNetwork)
 * [ObjectTracker](#Depthai%2520Examples-ObjectTracker)
 * [PointCloud](#Depthai%2520Examples-PointCloud)
 * [Script](#Depthai%2520Examples-Script)
 * [SpatialDetection](#Depthai%2520Examples-SpatialDetection)
 * [StereoDepth](#Depthai%2520Examples-StereoDepth)
 * [Sync Node](#Depthai%2520Examples-Sync%2520Node)
 * [SystemLogger](#Depthai%2520Examples-SystemLogger)
 * [ToF](#Depthai%2520Examples-ToF)
 * [VideoEncoder](#Depthai%2520Examples-VideoEncoder)
 * [Warp](#Depthai%2520Examples-Warp)
 * [UVC](#Depthai%2520Examples-UVC)
 * [Yolo](#Depthai%2520Examples-Yolo)

More examples can be found in the [oak-examples](https://github.com/luxonis/oak-examples) repository.

## Bootloader

 * [Bootloader Config](https://docs.luxonis.com/software/depthai/examples/bootloader_config.md) - Read/Flash/Clear bootloader on
   the device
 * [Bootloader Version](https://docs.luxonis.com/software/depthai/examples/bootloader_version.md) - Retrieves Version of
   Bootloader on the device
 * [Flash Bootloader](https://docs.luxonis.com/software/depthai/examples/flash_bootloader.md) - Flash factory bootloader to the
   device
 * [Flash User Bootloader](https://docs.luxonis.com/software/depthai/examples/flash_user_bootloader.md) - Flash user bootloader to
   the device
 * [Flash USB Recovery Header](https://docs.luxonis.com/software/depthai/examples/flash_usb_recovery_header.md) - Flash USB
   recovery header to the device
 * [POE set IP](https://docs.luxonis.com/software/depthai/examples/poe_set_ip.md) - Sets IP of the POE device

## Calibration

 * [Calibration Flash v5](https://docs.luxonis.com/software/depthai/examples/calibration_flash_v5.md) - Flashes calibration data
   of version 5 (gen1 calibration data) to the device
 * [Calibration Flash](https://docs.luxonis.com/software/depthai/examples/calibration_flash.md) - Flashes calibration data of
   version 6 (gen2 calibration data) to the device
 * [Calibration Reader](https://docs.luxonis.com/software/depthai/examples/calibration_reader.md) - Reads calibration data stored
   on device over XLink
 * [Calibration Load](https://docs.luxonis.com/software/depthai/examples/calibration_load.md) - Loads and uses calibration data of
   version 6 (gen2 calibration data) in a pipeline

## Camera

 * [Undistort camera stream](https://docs.luxonis.com/software/depthai/examples/camera_undistort.md) - Showcases how Camera node
   undistorts camera streams
 * [Thermal Camera](https://docs.luxonis.com/software/depthai/examples/thermal_camera.md) - Thermal camera visualization

## Cast

 * [NN Blur Cast](https://docs.luxonis.com/software/depthai/examples/cast_blur.md)
 * [NN Concat Cast](https://docs.luxonis.com/software/depthai/examples/cast_concat.md)
 * [NN Subtract Cast](https://docs.luxonis.com/software/depthai/examples/cast_diff.md)

## ColorCamera

 * [Auto Exposure on ROI](https://docs.luxonis.com/software/depthai/examples/autoexposure_roi.md) - Demonstrates how to use auto
   exposure based on the selected ROI
 * [RGB Camera Control](https://docs.luxonis.com/software/depthai/examples/rgb_camera_control.md) - Demonstrates how to control
   the RGB camera (crop, focus, exposure, sensitivity) from the host
 * [RGB Preview](https://docs.luxonis.com/software/depthai/examples/rgb_preview.md) - Displays a small preview of the RGB camera
 * [RGB scene](https://docs.luxonis.com/software/depthai/examples/rgb_scene.md) - Shows how to select ColorCamera's scene and
   effect
 * [RGB video](https://docs.luxonis.com/software/depthai/examples/rgb_video.md) - Displays high resolution frames of the RGB
   camera

## Crash report

 * [Crash report](https://docs.luxonis.com/software/depthai/examples/crash_report.md) - In case of a firmware crash, example reads
   it from the device and saves it to a json file

## EdgeDetector

 * [Edge Detector](https://docs.luxonis.com/software/depthai/examples/edge_detector.md) - Performs edge detection on all camera
   streams

## FeatureTracker

 * [Feature Detector](https://docs.luxonis.com/software/depthai/examples/feature_detector.md) - Feature detection on input frame
 * [Feature Tracker](https://docs.luxonis.com/software/depthai/examples/feature_tracker.md) - Feature detection and tracking on
   input frame
 * [Feature Tracker with Motion Estimation](https://docs.luxonis.com/software/depthai/examples/feature_motion_estimation.md) -
   Camera movement estimation based on feature tracking

## Host side

 * [Latency measurement](https://docs.luxonis.com/software/depthai/examples/latency_measurement.md) - Measure frame latency from
   capturing to the host
 * [OpenCV support](https://docs.luxonis.com/software/depthai/examples/opencv_support.md) - Demonstrates how to retrieve an image
   frame as an OpenCV frame
 * [Device Queue Event](https://docs.luxonis.com/software/depthai/examples/device_queue_event.md) - Demonstrates how to use device
   queue events
 * [Queue add callback](https://docs.luxonis.com/software/depthai/examples/queue_add_callback.md) - Demonstrates how to use queue
   callbacks

## ImageAlign

 * [Aligning mono and color cameras](https://docs.luxonis.com/software/depthai/examples/image_align.md) - Aligns mono and color
   camera frames
 * [Thermal-RGB alignment](https://docs.luxonis.com/software/depthai/examples/thermal_align.md) - Aligns thermal and RGB frames
 * [ToF-RGB alignment](https://docs.luxonis.com/software/depthai/examples/tof_align.md) - Aligns ToF and RGB frames

## ImageManip

 * [RGB Rotate Warp](https://docs.luxonis.com/software/depthai/examples/rgb_rotate_warp.md) - Demonstrates how to rotate, mirror,
   flip or perform perspective transform on a frame
 * [ImageManip tiling](https://docs.luxonis.com/software/depthai/examples/image_manip_tiling.md) - Using ImageManip for frame
   tiling
 * [ImageManip rotate](https://docs.luxonis.com/software/depthai/examples/image_manip_rotate.md) - Using ImageManip to rotate
   color/mono frames

## IMU

 * [IMU Accelerometer & Gyroscope](https://docs.luxonis.com/software/depthai/examples/imu_accelerometer_gyroscope.md) -
   Accelerometer and gyroscope at 500hz rate
 * [IMU Rotation Vector](https://docs.luxonis.com/software/depthai/examples/imu_rotation_vector.md) - Rotation vector at 400 hz
   rate

## Mixed

 * [Mono & MobilenetSSD & Depth](https://docs.luxonis.com/software/depthai/examples/mono_depth_mobilenetssd.md) - Runs
   MobileNetSSD on mono frames and displays detections on mono/disparity frames
 * [Multiple Devices](https://docs.luxonis.com/software/depthai/examples/multiple_devices.md) - Run multiple OAK cameras from the
   same host computer
 * [RGB Encoding & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/rgb_encoding_mobilenet.md) - Runs MobileNetSSD
   on RGB frames and encodes FUll-HD RGB into .h265 and saves it on the host
 * [RGB Encoding & Mono & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/rgb_encoding_mono_mobilenet.md) - Runs
   MobileNetSSD on mono frames and displays detections on the frame + encodes RGB to .h265
 * [RGB Encoding & Mono with MobilenetSSD &
   Depth](https://docs.luxonis.com/software/depthai/examples/rgb_encoding_mono_mobilenet_depth.md) - A combination of RGB Encoding
   and Mono & MobilenetSSD & Depth code samples
 * [Spatial detections on rotated OAK](https://docs.luxonis.com/software/depthai/examples/rotated_spatial_detections.md) - Spatial
   detections on upside down OAK camera

## MobileNet

 * [Mono & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/mono_mobilenet.md) - Runs MobileNetSSD on mono frames
   and displays detections on the frame
 * [Video & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/video_mobilenet.md) - Runs MobileNetSSD on the video
   from the host
 * [RGB & MobilenetSSD](https://docs.luxonis.com/software/depthai/examples/rgb_mobilenet.md) - Runs MobileNetSSD on RGB frames and
   displays detections on the frame
 * [RGB & MobileNetSSD @ 4K](https://docs.luxonis.com/software/depthai/examples/rgb_mobilenet_4k.md) - Runs MobileNetSSD on RGB
   frames and displays detections on both preview and 4k frames

## MonoCamera

 * [Mono Preview](https://docs.luxonis.com/software/depthai/examples/mono_preview.md) - Displays right/left mono cameras
 * [Mono Camera Control](https://docs.luxonis.com/software/depthai/examples/mono_camera_control.md) - Demonstrates how to control
   the mono camera (crop, exposure, sensitivity) from the host
 * [Mono preview - Alternate between dot projector and illumination
   LED](https://docs.luxonis.com/software/depthai/examples/mono_preview_alternate_pro.md) on OAK Pro devices
 * [Mono Full Resolution Saver](https://docs.luxonis.com/software/depthai/examples/mono_full_resolution_saver.md) - Saves mono
   (720P) images to the host (.png)

## NeuralNetwork

 * [Multi-Input Frame Concatenation](https://docs.luxonis.com/software/depthai/examples/multiple_devices.md) - Concat mono/rgb
   streams on the device with a custom model
 * [Frame Normalization](https://docs.luxonis.com/software/depthai/examples/normalization_multi_input.md) - Normalize the frame on
   the device with a custom model
 * [Thermal People Detection](https://docs.luxonis.com/software/depthai/examples/thermal_nn.md) - Detect people with NN utilizing
   thermal sensor

## ObjectTracker

 * [Object tracker on video](https://docs.luxonis.com/software/depthai/examples/object_tracker_video.md) - Performs object
   tracking from the video
 * [Object tracker on RGB](https://docs.luxonis.com/software/depthai/examples/object_tracker.md) - Performs object tracking from
   the RGB camera
 * [Spatial object tracker on RGB](https://docs.luxonis.com/software/depthai/examples/spatial_object_tracker.md) - Performs object
   tracking and also provides spatial coordinates

## PointCloud

 * [Point cloud visualization](https://docs.luxonis.com/software/depthai/examples/pointcloud_visualization.md) - Visualizes point
   cloud data from the device
 * [Point cloud control](https://docs.luxonis.com/software/depthai/examples/pointcloud_control.md) - Control point cloud
   visualization from the host

## Script

 * [Script camera control](https://docs.luxonis.com/software/depthai/examples/script_camera_control.md) - Controlling the camera
   with the Script node
 * [Script change pipeline flow](https://docs.luxonis.com/software/depthai/examples/script_change_pipeline_flow.md) - Change the
   flow of data inside your pipeline in runtime with Script node
 * [Script forward frames](https://docs.luxonis.com/software/depthai/examples/script_forward_frames.md) - Forward incoming image
   stream to two different output streams (demuxing)
 * [Script get local IP](https://docs.luxonis.com/software/depthai/examples/script_get_ip.md) - Get local IP of the device (only
   OAK-POE devices)
 * [Script HTTP client](https://docs.luxonis.com/software/depthai/examples/script_http_client.md) - Send HTTP request to a server
   (only OAK-POE devices)
 * [Script JSON communication](https://docs.luxonis.com/software/depthai/examples/script_json_communication.md) - 2-way JSON
   communication between Script <-> Host
 * [Script HTTP server](https://docs.luxonis.com/software/depthai/examples/script_http_server.md) - Serve still image over HTTP
   response (only OAK-POE devices)
 * [Script MJPEG server](https://docs.luxonis.com/software/depthai/examples/script_mjpeg_server.md) - Serve MJPEG video stream
   over HTTP response (only OAK-POE devices)
 * [Script NNData example](https://docs.luxonis.com/software/depthai/examples/script_nndata_example.md) - Constructs NNData in
   Script node and sends it to the host
 * [Script UART communication](https://docs.luxonis.com/software/depthai/examples/script_uart.md) - UART communication with Script
   node
 * [Script EMMC access](https://docs.luxonis.com/software/depthai/examples/script_emmc_access.md) - Access EMMC memory from the
   Script node

## SpatialDetection

 * [Spatial Calculator Multi-ROI](https://docs.luxonis.com/software/depthai/examples/spatial_calculator_multi_roi.md) - Selects
   multiple ROIs and calculates spatial coordinates for each of them
 * [Spatial location calculator](https://docs.luxonis.com/software/depthai/examples/spatial_location_calculator.md) - Demonstrates
   how to use the spatial location calculator
 * [RGB & MobilenetSSD with spatial data](https://docs.luxonis.com/software/depthai/examples/spatial_mobilenet.md) - Displays RGB
   frames with MobileNet detections and spatial coordinates on them
 * [Mono & MobilenetSSD with spatial data](https://docs.luxonis.com/software/depthai/examples/spatial_mobilenet_mono.md) -
   Displays mono frames with MobileNet detections and spatial coordinates on them
 * [RGB & TinyYolo with spatial data](https://docs.luxonis.com/software/depthai/examples/spatial_tiny_yolo.md) - Displays RGB
   frames with Yolo detections and spatial coordinates on them

## StereoDepth

 * [Depth Crop Control](https://docs.luxonis.com/software/depthai/examples/depth_crop_control.md) - Demonstrates how to control
   cropping of depth frames from the host
 * [Depth Post-Processing](https://docs.luxonis.com/software/depthai/examples/depth_post_processing.md) - Depth post-processing
   filters
 * [Depth Preview](https://docs.luxonis.com/software/depthai/examples/depth_preview.md) - Displays colorized stereo disparity
 * [Stereo Depth custom Mesh](https://docs.luxonis.com/software/depthai/examples/stereo_depth_custom_mesh.md) - Calculate and load
   custom mesh for stereo depth calculation
 * [Stereo Depth from host](https://docs.luxonis.com/software/depthai/examples/stereo_depth_from_host.md) - Generates stereo depth
   frame from a set of mono images from the host
 * [Stereo Depth Video](https://docs.luxonis.com/software/depthai/examples/stereo_depth_video.md) - An extended version of Depth
   Preview
 * [RGB Depth alignment](https://docs.luxonis.com/software/depthai/examples/rgb_depth_aligned.md) - Displays RGB depth aligned
   frames

## Sync Node

 * [Depth and Video Sync](https://docs.luxonis.com/software/depthai/examples/depth_video_sync.md) - Synchronizes depth and video
   streams for real-time processing and display.
 * [IMU and Video Sync](https://docs.luxonis.com/software/depthai/examples/imu_video_sync.md) - Aligns IMU data with video frames,
   showcasing real-time rotation vector display alongside video.
 * [Multiple Scripts Sync](https://docs.luxonis.com/software/depthai/examples/scripts_sync.md) - Demonstrates synchronization of
   data from two script nodes emitting data at different intervals.
 * [Demuxing Synchronized Script Outputs](https://docs.luxonis.com/software/depthai/examples/demux_message_group.md) - Features
   synchronization of script outputs followed by demultiplexing for distinct processing streams.

## SystemLogger

 * [System information](https://docs.luxonis.com/software/depthai/examples/system_information.md) - Displays device system
   information (memory/cpu usage, temperature)

## ToF

 * [ToF depth](https://docs.luxonis.com/software/depthai/examples/tof_depth.md) - Displays colorized ToF depth frames
 * [ToF-RGB alignment](https://docs.luxonis.com/software/depthai/examples/tof_align.md) - Aligns ToF and RGB frames

## VideoEncoder

 * [Disparity encoding](https://docs.luxonis.com/software/depthai/examples/disparity_encoding.md) - Encodes stereo disparity into
   .mjpeg
 * [RGB Encoding](https://docs.luxonis.com/software/depthai/examples/rgb_encoding.md) - Encodes RGB (1080P, 30FPS) into .h265 and
   saves it on the host
 * [RGB & Mono Encoding](https://docs.luxonis.com/software/depthai/examples/rgb_mono_encoding.md) - Encodes RGB (1080P, 30FPS) and
   both mono streams (720P, 30FPS) into .h265/.h264 and saves them on the host
 * [Encoding Max Limit](https://docs.luxonis.com/software/depthai/examples/encoding_max_limit.md) - Encodes RGB (4k 25FPS) and
   both mono streams (720P, 25FPS) into .h265/.h264 and saves them on the host
 * [RGB Full Resolution Saver](https://docs.luxonis.com/software/depthai/examples/rgb_full_resolution_saver.md) - Saves full
   resolution RGB images (4k) on the host (.jpeg)

## Warp

 * [Warp Mesh](https://docs.luxonis.com/software/depthai/examples/warp_mesh.md) - Displays an image warped with 2 different meshes
 * [Interactive Warp Mesh](https://docs.luxonis.com/software/depthai/examples/warp_mesh_interactive.md) - Interactively change the
   warp mesh

## UVC

 * [UVC & Color Camera](https://docs.luxonis.com/software/depthai/examples/uvc_rgb.md) - Displays RGB frames from a UVC camera
 * [UVC & Mono Camera](https://docs.luxonis.com/software/depthai/examples/uvc_mono.md) - Displays mono frames from a UVC camera
 * [UVC & Disparity](https://docs.luxonis.com/software/depthai/examples/uvc_disparity.md) - Displays disparity frames from a UVC
   camera

## Yolo

 * [RGB & Tiny YOLO](https://docs.luxonis.com/software/depthai/examples/tiny_yolo.md) - Runs Tiny YOLO on RGB frames and displays
   detections on the frame
 * [RGB & YOLOv8 Nano](https://docs.luxonis.com/software/depthai/examples/yolov8_nano.md) - Runs Yolov8 Nano on RGB frames and
   displays detections on the frame
