Abstract
This set of code samples were created to be used during the Brazilian edition of the RealSense Hands-on Labs to make easier to the participants understand the usage of the Intel® RealSense™ SDK. The 12 samples were implemented using the C# SDK wrapper and are basically simple console-based apps printing the information from the RealSense capabilities like face, hands and speech. Also, there are 2 WPF apps showing how to display the cameras stream and background subtraction.
Introduction
As part of the Hands-On Labs Brazil preparation, we created 12 code samples with instructions to show how to leverage RealSense™ voice and camera capabilities in a simple way. As we already made the comments inside it entirely in English, we would like to share them with the worldwide developers’ community.
The samples were implemented using C# and are basically simple console applications that show how to use the RealSense SDK functionalities. It has been tested with the RealSense SDK R2.
We hope to contribute to everyone interested on using the SDK and if you have any doubts or need help, please use the comments section.
Pre-Requisites to Run Samples
- RealSense™ SDK
- Intel® RealSense™ 3D camera
- Visual Studio 2010 or later
- 4th generation Intel® Core™ processor or later.
Important RealSense™ Documentation Links
Available Samples
Camera Calibration
Camera Calibration is a library project that receives a device and a modality and make the proper calibration to improve camera recognition quality when you use a specific feature, for example hand tracking.
Reference Links:
Device
The Device sample makes possible to enumerate devices, select one, get available streams and set configurations in a device. Note: this sample uses the Camera Calibration Library to configure the devices.
Reference Links:
Emotion
The Emotion sample lists emotions using SenseManager with a procedural implementation. This sample finds all the emotion data and prints each one with intensity.
Reference Links:
Emotion with Callback
The Emotion with Callback sample has the same functionality of the Emotion sample, but with a different implementation, showing how to use handlers in RealSense™ SDK to get module data (in this case the Emotion module), but you can use this implementation with other modules.
Reference Links:
Face
Face is a sample that implements different functionalities of the Face module. It uses the PXCMFaceData object and processes information separately in the functionalities below:
Reference Links:
- Detection - Prints X, Y, width, and height from a detected face;
- Expressions - Prints all detected expressions (one-by-one) with intensity from a detected face;
- Landmarks - Prints all (max 78) landmarks from a detected face;
- Pose - Prints X, Y, Z Euler Angles from a detected head.
Face Recognition
This sample implements how to use face recognition functionality. The sample detects a face and checks, in memory, if the user is registered. When the program detects a face that is not registered, the user can press the space bar to register. After registration, the sample prints the unique identifier from recognized face.
Reference Links:
Hands
The Hands sample tracks hands, fingers and gestures. The sample prints how many hands are detected and their positions (image and world), body sides, joints and detected gestures.
Reference Links:
- Gesture Recognition Data
- Gesture Interaction Guide
- Hand Tracking via SenseManager
- Hand Tracking Data
- Joint Type
- Joint Data
Object Tracking
The Object Tracking sample detects a 2D object using RealSense™ SDK. Using a JPEG/PNG markers, it tracks X, Y, Z positions as the object is tracked by the camera. Note: To work, it needs a camera calibration with a specific tag.
Reference Links:
- Object Tracking Documentation
- Object Tracking via SenseManager
- The Metaio Toolbox Calibration(Instructions)
Segmentation
We used the same WPF structure to display the camera stream on a WPF form and used the Segmentation feature to remove the image background.
Reference Links:
Speech Recognition
The Speech Recognition sample shows how to use two Speech Recognition modes: DICTATION or COMMAND. In dictation mode, it recognizes all words that users are saying and prints them on the screen. In Command mode, the program sets a standard grammar and when the user says one of added commands, it prints it on the screen.
- Speech Recognition Documentation
- Command Control and Dictation
- Handling Recognition Events
- RecognitionData Object
Speech Synthesis
This sample is an implementation of the text-to-speech capability of RealSense™ SDK. When a sentence is made available in the profile, it converts the sentence to audio and plays.
Reference Links:
Streams
The Streams samples uses the SDK to display the Creative Camera streams (Color, Depth and Infrared) into a WPF form. The sample selects a stream by its type and shows a window with the selected camera stream, updating the image frame-by-frame in the selected FPS configuration.
Reference Links:
- Enabling Streams
- Capturing Individual Color or Depth Stream
- Accessing Image and Audio Data
- ImageData to Bitmap
Download the Samples
To experiment with this samples and learn more about how use the RealSense SDK, please download it here.
About Intel® RealSense™ Technology
To get started and learn more about the Intel RealSense SDK for Windows, go to https://software.intel.com/en-us/realsense/intel-realsense-sdk-for-windows.
About the Authors
João is a Software Analyst Intern in the Developers Relations Division Brazil. He is studying Information Systems at University of São Paulo and is a Software Developer working mainly with mobile platforms, web applications and RealSense.
Felipe is a RealSense Technical Evangelist in the Developers Relations Division Brazil. He studied Computer Engineering and worked with different technologies, platforms and programming languages during his career. His main interest topics are game development, mobile platforms and HTML5.