Table of contents
Collapse the table of content
Expand the table of content

Windows Hello infrared camera sample for Windows 10 Build 1511

Last Updated: 1/3/2017

This sample demonstrates a basic implementation of the Windows.Devices.Perception.Provider interfaces to enable Windows Hello for a infrared video camera.

Specifically, this sample shows how to:


System requirements

Download the sample

Download the sample from the Partner application development repo on GitHub.

This sample is an implementation of IPerceptionFrameProvider, intended to work across a wide variety of capture devices, and serves as a starting point for developing device-specific providers. Depending on the specific device or scenario, additional properties or functionality will need to be added.

In order to work with this IPerceptionFrameProvider sample, a sensor must meet the following requirements:

  • The infrared sensor must function as a standard Windows Media Device like a webcam
  • The sensor must support YUY2 video mode
  • Video frames must be fixed size and cannot be interlaced

The sample provider selects the first valid video capture device during enumeration. Therefore, the target sensor must be the only device available on the PC, including any integrated webcams.

Important The sample contains a compiler macro which produces different device enumeration functionality for DEBUG and RELEASE builds. When building for DEBUG, the sample will use a naive enumeration method to find and connect a device; it simply enumerates all UVC capture devices and selects the first compatible device. This method is intended as a quick start for getting your IR camera up and running with Sensor Data Service, it doesn’t require device specific information. Conversely, the RELEASE build uses a different enumeration method, where a query for a device matching a specific PID and VID is made, so that only a single device is ever returned. The PID and VID within the sample are dummy values you’ll need to replace with your own devices’s values in order for this method to work.

Install the registry keys

Registry keys are used to identify the IPerceptionFrameProvider module path and ActivationClass name to the Sensor Data Service. Keys for this sample are included but need to be manually installed. Use the following steps to install the keys.

  1. Using file explorer, locate "FrameProviderSample.reg" file within the sample’s project folder
  2. Right-click on this file and choose "Merge" to install the keys
  3. In the User Account Control dialog box, choose Yes to allow this app to make changes to your PC
  4. In the Registry Editor warning dialog, choose Yes to continue

Keys are installed to "HKLM\Software\Microsoft\Analog\Providers\MediaFoundation"

Installing the SampleMft0 module

The SampleMft0 module project provides a driver Media Foundation Transform (MFT) for use with a camera's Windows Store device app. A driver MFT is used with a specific camera when capturing video. Thus the sample will not fully function until you write driver code for your specific device.

Installation of the SampleMft0 module isn't required for the basic operation of the IPerceptionFrameProvider, i.e. passing frames up to Sensor Data Service. However, in order for Windows Hello to work end-to-end, you must tag the IR frames with ActiveIlluminationEnabled property (as described in the Windows Hello Checklist), requiring you to add device specific functionality. The SampleMft0 project demonstrates one way you may choose to implement this requirement by reading the LED illumination state within the SampleMft0 module and passing an attribute up with the frame to your IPerceptionFrameProvider. Note that you must first modify the SampleMft0 project to read the device state and set the attribute appropriately before it’ll work.

Note Using SampleMft0 is not the only solution for tagging frames with an illumination state nor is it necessarily the recommended way.

To build for ARM, follow these steps:

Open and build the SampleMft0 Solution

  1. Using Configuration Manager, from the drop-down box for Active solution platform, select <New...>. In the New Project Platform dialog box, under New platform, select ARM and click OK.
  2. Open project properties for the SampleMft0 project, and follow these steps:

    • Under Configuration Properties > General, set Use of ATL to Static Link to ATL.
    • Under Configuration Properties > C/C++ > Code Generation, set Runtime Library to Multi-threaded (/MT).
    • Under Linker > Input, edit Ignore Specific Default Libraries to include shlwapi.lib and urlmon.lib.
  3. Copy FrameProviderSampleMft0.dll to C:\Program Files (x86)\FrameProviderSampleMft0 (or C:\Program Files\FrameProviderSampleMft0) on a 32-bit system).

  4. Open an administrator command prompt and navigate to the new location of DLL.
  5. Run regsvr32 on FrameProviderSampleMft0.dll.
  6. On an x64 system, build the x64 version of the DLL and repeat steps 3 to 5, copying the 64-bit DLL to C:\Program Files\FrameProviderSampleMft0).
  7. Run regedit, and open the device registry key for your camera, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\.

    The following example shows a path to a device registry key for a camera. Your camera has a different device ID and may have a different device class:

  8. In Registry Editor, under the GLOBAL#\Device Parameters key, add a CameraPostProcessingPluginCLSID value, and set its value to {DDBE4BC1-541F-4D43-A25B-1F23E7AF4505}. This is the CLSID of the Driver MFT defined in the SampleMFT0 project.

Building and deploying the sample

  1. Open the FrameProviderSample Solution (.sln) in Visual Studio.
  2. Select Build->Build Solution.
  3. In the Solution Explorer window, right-click FrameProviderSample project and select Open Folder in File Explorer.
  4. Open FrameProviderSample's output folder (depending on the build configuration). Use the x64 build if running on a 64-bit OS. As configured, this sample outputs to the Debug foloer.
  5. Create a new directory called "%SystemDrive%\Analog\Providers".
  6. Copy "SampleFrameProvider.dll" to "%SystemDrive%\Analog\Providers"
  7. Launch the Windows Hello setup app under Settings->Accounts->Sign-in Options to start the Sensor Data Service, which loads the provider DLL.
  8. During enrollment, you should see frames from your sensor in the visualizer.

Note If these keys are missing or mismatched, the FrameProviderSample will not function. Make sure to update these keys if any of the following are changed:

  • The file name of the FrameProviderSample’s DLL is "SampleFrameProvider.dll"
  • The file path to the FrameProviderSample DLL is "%SystemDrive%\Analog\Providers"
  • The name of the class, including the namespace, implementing IFrameProviderManager is "MediaFoundationProvider.SampleFrameProviderManager"
© 2017 Microsoft