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.More examples can be found in the oak-examples (main branch).
AprilTags
- AprilTags - Run AprilTag marker detection on a 1080P camera stream.
- AprilTags 12MP - Run AprilTag marker detection on a 12MP camera stream.
- AprilTags on image replay - Run AprilTag marker detection on an image replay.
Benchmark
- Benchmark Simple - Measure the latency of a pipeline.
- Benchmark Camera - Measure the FPS and the latency of a camera stream.
- Benchmark NN - Measure the FPS and the latency of a neural network model.
Camera
- Display all cameras - Display the highest resolution streams of all available camera sensors.
- Camera output - Request an output stream from the default camera and display it.
- Camera multiple outputs - Request multiple output streams from a single camera using command line arguments.
- Camera raw output - Get raw image data from camera and display it.
- Camera ROI-based exposure and focus - Set auto-exposure and auto-focus based on a user-selected ROI.
- Camera still image at max resolution - Capture a still image at the maximum resolution.
DetectionNetwork
- Detection network - Run a YOLOv6n object detection model and display results (bounding boxes) on a video stream.
- Detection network remap - Run a YOLOv6 object detection model and map the bounding boxes onto a depth frame.
- Detection network replay - Run a YOLOv6 object detection model on a replayed video stream, visualize detections in our custom-built visualizer.
Events
- Events - Handle events and set callbacks in DepthAI.
Feature Tracker
- Feature tracker - Detect features and track them between consecutive frames using optical flow.
Host Nodes
- Display - Create a custom host node that displays frames using OpenCV.
- Host Camera - Create a custom threaded host node to capture frames from the host machine's camera and send them to the pipeline.
- Threaded Host Nodes - Create custom threaded host nodes and link them.
Image Align
- Depth Align - Align and blend RGB and depth frames.
Image Manip
- ImageManip all operations - Demonstrate various image manipulation operations including resizing (stretch/letterbox/crop), cropping, flipping, scaling, rotation, affine and perspective transforms, and frame type conversion.
- ImageManip multiple operations - Define a sequence of operations to be applied to an input frame, all in a single ImageManip node.
- ImageManip resize - Resize frame and display both original and resized images.
- ImageManip remap - Use ImageManip to modify a frame and use the underlying transformation to remap a rectangle to match the modified frame.
IMU
- IMU accelerometer and gyroscope - Get accelerometer and gyroscope data from the IMU node
Neural Network
- Neural network - Create a simple pipeline with a camera and neural network node.
- Neural network multi-input - Run a neural network model that concatenates a camera frame with a static image using two input tensors.
- Neural network multi-input combined - Run a neural network model that combines two input images into a single output image.
Stereo Depth
- Stereo Depth - Visualize disparity depth from stereo camera.
- Stereo Depth Remap - Remap geometry from disparity depth <frame> to color frame.
Video Encoder
- Video Encode - Encode video frames on-device into MJPEG, H264, or H265 video codecs and save them to a file.
Warp
- Warp mesh - Warp the input image frame using a 3x3 mesh transformation to create perspective distortion effects.
ModelZoo
- Model Zoo - Download a model from zoo and unpack it.
RecordReplay
- Holistic Record - Record holistic pipeline data.
- Holistic Replay - Replay recorded holistic pipeline data.
- Video Record - Record video streams.
- Video Replay - Replay recorded video streams.
RGBD
- RGBD Point Cloud Visualization - Visualize colored point cloud data in three different visualizers.
Script
- Script Simple - Arguably the simplest script example ever.
- Script Switch All Cameras - Switch between all available cameras.
SpatialDetectionNetwork
- Spatial Detection - Run object detection with spatial (3D) coordinates
SpatialLocationCalculator
- Spatial Location Calculator - Calculate 3D spatial coordinates for specified points
Sync
- Sync - Synchronize two or more data streams.
SystemLogger
- System Information - Displays device system information (memory/cpu usage, temperature).
Visualizer
- Custom Services - Define custom visualizer services and callbacks.
- Custom Visualizations - Create custom visualizations and add them to the visualizer.
- Visualizer Encoded - Visualize encoded streams.
- Visualizer YOLO - Visualize YOLO detections.
RVC2-specific examples
Camera
- Camera undistort - Demonstate camera undistortion capabilities.
NNArchive
- NN Archive Superblob - Download a superblob model from the zoo and run it.
ObjectTracker
- Object Tracker - Track objects in 3D space using YOLOv6 detection and color histogram tracking.
Thermal
- Thermal - Display thermal camera feed with controls for brightness and shutter.
- Thermal Crosshair - Display thermal camera feed with temperature readout at mouse cursor position using crosshair overlay.
ToF
- ToF - Get depth frames from a ToF camera and visualize them using a colormap
VSLAM
- Basalt VIO - VIO example using stereo cameras and the IMU to estimate the device's motion.
- Basalt VIO RTAB-Map SLAM - VSLAM example
- RTAB-Map VIO - Yet another VIO example.
- RTAB-MAP VIO SLAM - Yet another VSLAM example.