Skip to content

Latest commit

 

History

History
 
 

examples

Sample Code for Intel® RealSense™ cameras

Code Examples to start prototyping quickly: These simple examples demonstrate how to easily use the SDK to include code snippets that access the camera into your applications.

For mode advanced usages please review the list of Tools we provide.

For a detailed explanations and API documentation see our Documentation section

List of Examples:

Name Language Description Experience Level Technology
Hello-RealSense C++ Demonstrates the basics of connecting to a RealSense device and using depth data Depth Sensing - Structured Light, Stereo and L500
Distance C Equivalent to hello-realsense but rewritten for C users Depth Sensing - Structured Light, Stereo and L500
Color C Demonstrate how to stream color data and prints some frame information Depth Sensing - Structured Light, Stereo and L500
Capture C++ Shows how to synchronize and render multiple streams: left, right, depth and RGB streams Depth Sensing - Structured Light, Stereo and L500
Save To Disk C++ Demonstrate how to render and save video streams on headless systems without graphical user interface (GUI) Depth Sensing - Structured Light, Stereo and L500
Pointcloud C++ Showcase Projection API while generating and rendering 3D pointcloud Depth Sensing - Structured Light, Stereo and L500
ImShow C++ & OpenCV Minimal OpenCV application for visualizing depth data Depth Sensing - Structured Light, Stereo and L500
Multicam C++ Present multiple cameras depth streams simultaneously, in separate windows Depth Sensing - Structured Light, Stereo and L500
Face C++ & Dlib Facial recognition with simple anti-spoofing Depth Sensing - Structured Light, Stereo and L500
Face C++ & OpenVINO Facial recognition with OpenVINO™ Depth Sensing - Structured Light, Stereo and L500
Depth C Demonstrates how to stream depth data and prints a simple text-based representation of the depth image ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Spatial Alignment C++ Introduces the concept of spatial stream alignment, using depth-color mapping ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Advanced Alignment C++ Show a simple method for dynamic background removal from video ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Measure C++ Lets the user measure the dimensions of 3D objects in a stream ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Post Processing C++ Demonstrating usage of post processing filters for depth images ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Record & Playback C++ Demonstrating usage of the recorder and playback devices ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Motion C++ Demonstrates how to use data from gyroscope and accelerometer to compute the rotation of the camera ⭐⭐ Depth with IMU
DNN C++ & OpenCV Intel RealSense camera used for real-time object-detection ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
DNN C++ & OpenVINO Intel RealSense camera used for real-time object-detection ⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Software Device C++ Shows how to create a custom rs2::device ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500
GL C++ Shows how to perform parts of frame processing using the GPU ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500
GL Spatial Alignment C++ Shows how to perform frame alignment (depth_to_color & color_to_depth) using the GPU ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Sensor Control C++ A tutorial for using the rs2::sensor API ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500
GrabCuts C++ & OpenCV Simple background removal using the GrabCut algorithm ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500
Latency C++ & OpenCV Basic latency estimation using computer vision ⭐⭐⭐ Depth Sensing - Structured Light, Stereo and L500

Community Projects:

  1. OpenCV DNN object detection with RealSense camera
  2. minimal_realsense2 - Streaming and Presets in C
  3. ANDREASJAKL.COM - Capturing a 3D Point Cloud with Intel RealSense and Converting to a Mesh with MeshLab
  4. FluentRealSense - The First Steps to a Simpler RealSense
  5. RealSense ROS-bag parser - code sample for parsing ROS-bag files by @marcovs
  6. OpenCV threaded depth cleaner - RealSense depth-map cleaning and inpainting using OpenCV
  7. Sample of how to use the IMU of D435i as well as doing PCL rotations based on this
  8. realsense-ir-to-vaapi-h264 - hardware encode infrared stream to H.264 with Intel VAAPI
  9. realsense-depth-to-vaapi-hevc10 - hardware encode depth stream to 10 bit HEVC with Intel VAAPI
  10. EtherSense - Ethernet client and server for RealSense using python's Asyncore
  11. Unofficial OpenVino example + D400 - example of using OpenVino with RealSense and ROS for object detection
  12. keijiro/Rsvfx - An example that shows how to connect RealSense depth camera to Unity VFX Graph
  13. kougaku/RealSenseOSC - Client-Server project with Processing example for T265
  14. Vimeo Depth Viewer - A RealSense depth viewer using nanogui
  15. PINTO0309/MobileNet-SSD-RealSense - RaspberryPi3 or Ubuntu + Multi Neural Compute Stick(NCS/NCS2) + RealSense D435 + MobileNet-SSD(MobileNetSSD) + Background Multi-transparent(Simple multi-class segmentation) + FaceDetection + MultiGraph + MultiProcessing + MultiClustering
  16. realsenseOnCyber Realsense module Based on Apollo Cyber RT
  17. Raspberry Pi Handheld 3D Scanner by Frank Zhao
  18. Erwhi Hedgehog by Giovanni Bruno - Open-Source Hardware and Software design featuring Intel RealSense, UP-Squared and Intel Movidius technologies