Grabbing frames

In this section, we will create a class that will be responsible for grabbing the frames from the HoloLens color camera and making them available for analysis. Start by creating a new class by right-clicking on the Content folder from within the Solution Explorer panel, selecting Add | Class, and then entering the class name FrameGrabber.cs.

Accessing the frame will require classes from the Windows.Media namespace; to get access to these, add the following at the top of the class:

using Windows.Media.Capture;using Windows.Media.Capture.Frames;using Windows.Media.Devices.Core;using Windows.Perception.Spatial;

An instance of the class FrameGrabber will be created using an asynchronous creation method, allowing the creation of ...

Get Microsoft HoloLens By Example now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.