Sample Code for Intel® RealSense™ Depth cameras

function global:prompt {
    Write-Host -Object "$($env:USERNAME)@$([System.Net.Dns]::GetHostName())" -NoNewline -ForegroundColor Green
    Write-Host -Object ":" -NoNewline -ForegroundColor White
    Write-Host -Object "$(Get-Location)" -NoNewline -ForegroundColor DarkRed
    $IsAdmin = (New-Object Security.Principal.WindowsPrincipal ([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
    return $(if ($IsAdmin) { '# ' } else { '$ ' })
}

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 Examples:

NameLanguageDescriptionExperience LevelTechnology
Hello-RealSenseC++Demonstrates the basics of connecting to a RealSense device and using depth data:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
DistanceCEquivalent to hello-realsense but rewritten for C users:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
ColorCDemonstrate how to stream color data and prints some frame information:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
CaptureC++Shows how to synchronize and render multiple streams: left, right, depth and RGB streams:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAMMotion 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, StereoDepth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAMMotion Tracking - T260 and SLAM
PointcloudC++Showcase Projection API while generating and rendering 3D pointcloud:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
ImShowC++ & OpenCVMinimal OpenCV application for visualizing depth data:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
MulticamC++Present multiple cameras depth streams simultaneously, in separate windows:star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAMMotion 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, StereoDepth Sensing - Structured Light, Stereo
Spatial AlignmentC++Introduces the concept of spatial stream alignment, using depth-color mapping:star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
Advanced AlignmentC++Show a simple method for dynamic background removal from video:star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
MeasureC++Lets the user measure the dimensions of 3D objects in a stream:star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
Post ProcessingC++Demonstrating usage of post processing filters for depth images:star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
Record & PlaybackC++Demonstrating usage of the recorder and playback devices:star::star:Depth Sensing - Structured Light, StereoDepth 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 IMUDepth with IMU Motion Tracking - T260 and SLAMMotion Tracking - T260 and SLAM
DNNC++ & OpenCVIntel RealSense camera used for real-time object-detection:star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
Software DeviceC++Shows how to create a custom rs2::device:star::star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAMMotion Tracking - T260 and SLAM
Sensor ControlC++A tutorial for using the rs2::sensor API:star::star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo Motion Tracking - T260 and SLAMMotion Tracking - T260 and SLAM
GrabCutsC++ & OpenCVSimple background removal using the GrabCut algorithm:star::star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo
LatencyC++ & OpenCVBasic latency estimation using computer vision:star::star::star:Depth Sensing - Structured Light, StereoDepth Sensing - Structured Light, Stereo