4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C#でHoloLens RS4 PreviewのResearch modeを使う

Last updated at Posted at 2018-04-15

はじめに

CameraFramesというUWPのサンプルプロジェクトを修正して各種センサーのデータを可視化してみた。

近距離赤外線
CameraFrames01_ShortThrowToFReflectivity.jpg
Youtube

近距離深度
CameraFrames02_ShortThrowToFDepth.jpg
Youtube

修正したプロジェクトをGitHubに置いた → https://github.com/sotanmochi/CameraFramesSampleForHoloLensRS4

検証環境

  • Windows 10 Pro Insider Preview (Version: 1803, OS build: 17127.1)
  • Visual Studio 2017 (Version 15.6.6)
  • HoloLens RS4 Preview (OS build: 10.0.17123.1004)

サンプルプロジェクトの取得

Windows-universal-samplesのmasterブランチをcloneする。```
$ git clone https://github.com/Microsoft/Windows-universal-samples.git


# サンプルプロジェクトの実行
[Windows-universal-samples](https://github.com/Microsoft/Windows-universal-samples/tree/master/)には色々なサンプルが含まれているが、今回は[CameraFrames](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraFrames)を使う。
CameraFramesのソリューションファイル(Windows-universal-samples\Samples\CameraFrames\cs\CameraFrames.sln)をVisual Studioで開いてビルド・デプロイする。

実行してSource GroupのSensor Streamingを選択すると「Access is denied.」と表示されてHoloLensのセンサーデータを使えない。各種センサーのデータを使えるようにプロジェクトの設定を変更していく。

![CameraFrames00.jpg](https://qiita-image-store.s3.amazonaws.com/0/162000/dc40c565-9704-5eb7-eec8-4a5f8c32c140.jpeg)

# HoloLensのSensor Streamsを取得できるようにプロジェクト設定を変更

## 開発環境のレジストリの内容確認
開発環境のレジストリエディタ(regedit.exe)でcapabilityClass_Restrictedの内容を事前確認しておく。
capabilityClass_RestrictedのMemberCapabilityに「perceptionSensorsExperimental」が含まれていること。  

![RegEditCapability.jpg](https://qiita-image-store.s3.amazonaws.com/0/162000/fa87c19d-9756-419d-4be5-563a60df0058.jpeg)

## Package.appxmanifestの修正
「CameraFrames\cs\Package.appxmaniest」にPackageとCapabilitiesの設定を追記する。

- Packageにrescapを追加
- CapabilitiesにperceptionSensorsExperimentalを追加

修正後のPackage.appxmanifestは最終的に以下のようになる。

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap mp rescap"

・・・(中略)・・・

```

実行結果

Package.appxmanifestを修正するとHoloLensのセンサーデータを使えるようになった。実行結果は以下のようになる。

近距離赤外線
CameraFrames01_ShortThrowToFReflectivity.jpg

近距離深度
CameraFrames02_ShortThrowToFDepth.jpg

参考情報

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?