C/C++ code samples for RealSense SDK 2.0 (original) (raw)
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.
| Name | Language | Description | Experience Level | Technology |
|---|---|---|---|---|
| Hello-RealSense | C++ | Demonstrates the basics of connecting to a RealSense device and using depth data | ⭐ | |
| Distance | C | Equivalent tohello-realsensebut rewritten for C users | ⭐ | |
| Color | C | Demonstrate how to stream color data and prints some frame information | ⭐ | |
| Capture | C++ | Shows how to synchronize and render multiple streams: left, right, depth and RGB streams | ⭐ | |
| Save To Disk | C++ | Demonstrate how to render and save video streams on headless systems without graphical user interface (GUI) | ⭐ | |
| Pointcloud | C++ | Showcase Projection API while generating and rendering 3D pointcloud | ⭐ | |
| Pose | C++ | Demonstrates how to obtain data from pose frames | ⭐ | |
| ImShow | C++ &OpenCV | Minimal OpenCV application for visualizing depth data | ⭐ | |
| Multicam | C++ | Present multiple cameras depth streams simultaneously, in separate windows | ⭐ | |
| Depth | C | Demonstrates how to stream depth data and prints a simple text-based representation of the depth image | ⭐⭐ | |
| Spatial Alignment | C++ | Introduces the concept of spatial stream alignment, using depth-color mapping | ⭐⭐ | |
| Advanced Alignment | C++ | Show a simple method for dynamic background removal from video | ⭐⭐ | |
| Measure | C++ | Lets the user measure the dimensions of 3D objects in a stream | ⭐⭐ | |
| Post Processing | C++ | Demonstrating usage of post processing filters for depth images | ⭐⭐ | |
| Record & Playback | C++ | Demonstrating usage of the recorder and playback devices | ⭐⭐ | |
| Motion | C++ | Demonstrates how to use data from gyroscope and accelerometer to compute the rotation of the camera | ⭐⭐ | |
| Pose Prediction | C++ | Demonstrates how to use tracking camera asynchronously to implement simple pose prediction | ⭐⭐ | |
| Pose and Image | C++ | Demonstrates how to use tracking camera asynchronously to obtain 200Hz poses and 30Hz images | ⭐⭐ | |
| AR-Basic | C++ | Shows how to use pose and fisheye frames to display a simple virtual object on the fisheye image | ⭐⭐ | |
| DNN | C++ &OpenCV | RealSense camera used for real-time object-detection | ⭐⭐ | |
| Trajectory | C++ | Shows how to calculate and render 3D trajectory based on pose data from a tracking camera | ⭐⭐⭐ | |
| Software Device | C++ | Shows how to create a customrs2::device | ⭐⭐⭐ | |
| Sensor Control | C++ | A tutorial for using thers2::sensorAPI | ⭐⭐⭐ | |
| GrabCuts | C++ &OpenCV | Simple background removal using the GrabCut algorithm | ⭐⭐⭐ | |
| Latency | C++ &OpenCV | Basic latency estimation using computer vision | ⭐⭐⭐ |
Updated about 1 month ago