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.

List of Intel RealSense SDK 2.0 Examples:

NameLanguageDescriptionExperience LevelTechnology
Hello-RealSenseC++Demonstrates the basics of connecting to a RealSense device and using depth data:star:Depth Sensing - Structured Light, Stereo
DistanceCEquivalent to hello-realsense but rewritten for C users:star:Depth Sensing - Structured Light, Stereo
ColorCDemonstrate how to stream color data and prints some frame information:star:Depth Sensing - Structured Light, Stereo
CaptureC++Shows how to synchronize and render multiple streams: left, right, depth and RGB streams:star:Depth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAM
Save To DiskC++Demonstrate how to render and save video streams on headless systems without graphical user interface (GUI):star:Depth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAM
PointcloudC++Showcase Projection API while generating and rendering 3D pointcloud:star:Depth Sensing - Structured Light, Stereo
PoseC++Demonstrates how to obtain data from pose frames:star:Motion Tracking - T260 and SLAM
ImShowC++ & OpenCVMinimal OpenCV application for visualizing depth data:star:Depth Sensing - Structured Light, Stereo
MulticamC++Present multiple cameras depth streams simultaneously, in separate windows:star:Depth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAM
DepthCDemonstrates how to stream depth data and prints a simple text-based representation of the depth image:star::star:Depth Sensing - Structured Light, Stereo
Spatial AlignmentC++Introduces the concept of spatial stream alignment, using depth-color mapping:star::star:Depth Sensing - Structured Light, Stereo
Advanced AlignmentC++Show a simple method for dynamic background removal from video:star::star:Depth Sensing - Structured Light, Stereo
MeasureC++Lets the user measure the dimensions of 3D objects in a stream:star::star:Depth Sensing - Structured Light, Stereo
Post ProcessingC++Demonstrating usage of post processing filters for depth images:star::star:Depth Sensing - Structured Light, Stereo
Record & PlaybackC++Demonstrating usage of the recorder and playback devices:star::star:Depth Sensing - Structured Light, Stereo
MotionC++Demonstrates how to use data from gyroscope and accelerometer to compute the rotation of the camera:star::star:Depth with IMU Motion Tracking - T260 and SLAM
Pose PredictionC++Demonstrates how to use tracking camera asynchronously to implement simple pose prediction:star::star:Motion Tracking - T260 and SLAM
Pose and ImageC++Demonstrates how to use tracking camera asynchronously to obtain 200Hz poses and 30Hz images:star::star:Motion Tracking - T260 and SLAM
AR-BasicC++Shows how to use pose and fisheye frames to display a simple virtual object on the fisheye image:star::star:Motion Tracking - T260 and SLAM
DNNC++ & OpenCVIntel RealSense camera used for real-time object-detection:star::star:Depth Sensing - Structured Light, Stereo
TrajectoryC++Shows how to calculate and render 3D trajectory based on pose data from a tracking camera:star::star::star:Motion Tracking - T260 and SLAM
Software DeviceC++Shows how to create a custom rs2::device:star::star::star:Depth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAM
Sensor ControlC++A tutorial for using the rs2::sensor API:star::star::star:Depth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAM
GrabCutsC++ & OpenCVSimple background removal using the GrabCut algorithm:star::star::star:Depth Sensing - Structured Light, Stereo
LatencyC++ & OpenCVBasic latency estimation using computer vision:star::star::star:Depth Sensing - Structured Light, Stereo

Other Samples