The much anticipated Intel® RealSense™ SDK support for developing Universal Windows Platform (UWP) apps has arrived in SDK R5 (v7), and this article will help get you started. A sneak peek of the UWP interfaces and methods was presented in the R4 release documentation, and R5 now delivers the software components, samples, and documentation you’ll need for developing UWP apps that use the Intel® RealSense™ camera (SR300).

As stated in the What’s News in R5 of the Intel® RealSense™ SDK R5 (v7) article, the SR300 camera should be available for order in Q1 of 2016 and integrated into select Intel-based systems in 2016. Because the SR300 is not yet available for end users, this article will focus on the things you need to know now to prepare for its arrival.

What You’ll Need to Get Started

  • Laptop or PC running Microsoft Window 10 RTM
  • Microsoft Visual Studio* 2015 with Microsoft Windows 10 Developer Tools
  • Intel RealSense camera (SR300) (available for order in Q1 of 2016)
  • Intel RealSense SDK R5 (v7)
  • SR300 DCM 3.0 Gold (only available through Windows Update)

SDK Scope and Limitations

  • The SDK supports UWP app development for Windows 10 using C# and XAML.
  • For UWP apps, the SDK supports only raw color and depth streaming and the blob tracking algorithm. Other UWP-specific algorithms are in development.
  • UWP apps must statically include the SDK runtime files, so the SDK version is fixed at the time of development.
  • The Session interface is not explicitly exposed in C# UWP.
  • The camera coordinate system is slightly different for UWP apps; refer to the SDK manual for details.
  • You cannot change the coordinate system in your UWP application.
  • To map the coordinates between color and depth streams in UWP apps, use the Windows.Devices.Perception.PerceptionDepthCorrelatedCoordinateMapper interface.
  • In the SDK manual, the (UWP) marking indicates UWP-specific interfaces or methods. The (+UWP) markings emphasize that the UWP interface is part of a function along with the other language interfaces.

Windows Desktop App Samples

Once the DCM and SDK are installed, reboot your computer and then ensure the camera is operating correctly by running one of the samples provided in the Intel RealSense SDK Sample Browser.

Click the Windows 10 Start button in the lower-left corner of the screen.

Select All Apps and then scroll to the Intel RealSense SDK folder (Figure 1).

Figure 1. Windows Start menu

Figure 1. Windows Start menu

Locate and run the Intel RealSense SDK Sample Browser. At the top of the SDK Sample Browser window (Figure 2) you’ll find a tab labelled “SR300 Samples” containing all of the Windows Desktop sample apps (i.e., code samples that run in Windows Desktop mode, not as UWP apps). You should familiarize yourself with these samples to understand the full capabilities of the SR300 camera.

Figure 2. SDK Sample Browser

Figure 2. SDK Sample Browser

UWP Components

The UWP software components provided in the Intel RealSense SDK are located in C:\Program Files (x86)\Intel\RSSDK\UWP. (Note: this is the default installation path; your file path may be different depending on how the SDK was installed.) The components are located in the following folders under \UWP:

  • \ExtensionSDKs  – Contains the DLLs that are referenced in a UWP application.
  • \Samples  – Contains the DF_BlobViewer_UWP_CS and DF_StreamViewer_UWP_CS code samples.

Creating a UWP Project from Scratch

If you are new to UWP app development, first familiarize yourself with the basics of creating a UWP project from scratch. An informative C#/XAML “Hello, world” tutorial is available on this Microsoft website.

This tutorial provides a good starting point for learning how to create a simple app that targets the UWP and Windows 10. After completing the “Hello, world” tutorial and running your new UWP app, it will look something like the screen shown in Figure 3.

Figure 3. Hello, world! UWP application

Figure 3. Hello, world! UWP application

When running in Debug mode you may notice a little black frame counter in the upper-left corner of your app. If you don’t want the counter to show, locate the following code in App.xaml.cs:

01 #if DEBUG
03         if (System.Diagnostics.Debugger.IsAttached)
05         {
07             this.DebugSettings.EnableFrameRateCounter = true;
09         }
11 #endif

You can either set the property to false:

this.DebugSettings.EnableFrameRateCounter = false;

Or simply comment-out the line:

// this.DebugSettings.EnableFrameRateCounter = true;

Configure the Development Environment for the Intel®RealSense™ Camera

To enable your app for the Intel RealSense camera, do the following:

  • Enable Webcam under Capabilities in the App Manifest.
  • Add references to the Intel RealSense SDK libraries.

In Solution Explorer, double-click Package.appxmanifest, and then click the Capabilities tab.

Locate and select the checkbox for Webcam, as shown in Figure 4.

Figure 4. Package.appxmanifest

Figure 4. Package.appxmanifest

Next you’ll need to reference the Intel RealSense SDK libraries:

  • Intel.RealSense – The library containing the SDK essential instance implementation, such as algorithm management and streaming data from the cameras.
  • Intel.RealSense.Blob – The library containing the SDK Blob Tracking module implementation.

Right-click on References in Solution Explorer, and then select Add Reference to open the Reference Manager.

Click the Browse button and navigate to the folders containing Intel.RealSense.winmd and Intel.RealSense.Blob.winmd. (These metadata files are located under C:\Program Files (x86)\Intel\RSSDK\UWP\ExtensionSDKs\.)

Click the Add button. The libraries appear under References in Solution Explorer.

Explore the UWP Samples

To learn more about how to integrate the Intel RealSense SDK capabilities in your app, open and build the two sample projects provided in the SDK:

  • DF_BlobViewer_UWP_CS
  • DF_StreamViewer_UWP_CS

Note: These samples are not available in the SDK Sample Browser app discussed earlier. They are located under C:\Program Files (x86)\Intel\RSSDK\UWP\Samples and should be copied to any writable directory in order to build them with Visual Studio 2015.

Previous articlePC Specialist Nvidia GTX Titan Battlebox review
Next articleSamsung updates the internet fridge for 2016
Technewborn is a leading problogging platform that covers the latest in technology, news, social media, mobile industry, apps, games, and more. I have been researching, writing, reading, living in it since 2009. I try adding a unique taste to whatever techy I write. You can follow me on below Social Network