Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Tokyo HoloLens meets up vol.5 LT
Search
ZuQ9Nn
September 17, 2017
Technology
1
4.4k
Tokyo HoloLens meets up vol.5 LT
Tokyo HoloLens meets up vol.5 LT資SpatialUnderstandingで”椅子”の
検知にチャレンジしてみたよ料
ZuQ9Nn
September 17, 2017
Tweet
Share
More Decks by ZuQ9Nn
See All by ZuQ9Nn
今更ながらHoloGiraffeのクローンアプリ作成にチャレンジしてみた
zuq9nn
0
3.1k
2018/04/17 HoloLens RS4 Preview公開記念勉強会! @アカツキ
zuq9nn
1
690
2018/03/09 第五回HoloLens読書会
zuq9nn
0
4.1k
HoloLensでユニティちゃんを椅子に 座らせてみた”その後”の話
zuq9nn
0
5.2k
HoloLensのはじめかた
zuq9nn
1
4.4k
Fabricではじめるfastlane
zuq9nn
0
1.8k
第六回カジュアルSwift勉強会@青葉台
zuq9nn
2
920
Other Decks in Technology
See All in Technology
オブザーバビリティの観点でみるAWS / AWS from observability perspective
ymotongpoo
7
1k
技術的負債解消の取り組みと専門チームのお話 #技術的負債_Findy
bengo4com
1
1.2k
現場の種を事業の芽にする - エンジニア主導のイノベーションを事業戦略に装着する方法 -
kzkmaeda
2
1.5k
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
730
モノレポ開発のエラー、誰が見る?Datadog で実現する適切なトリアージとエスカレーション
biwashi
6
770
データ基盤の成長を加速させる:アイスタイルにおける挑戦と教訓
tsuda7
3
650
管理者しか知らないOutlookの裏側のAIを覗く#AzureTravelers
hirotomotaguchi
2
240
MC906491 を見据えた Microsoft Entra Connect アップグレード対応
tamaiyutaro
1
480
FastConnect の冗長性
ocise
1
9.6k
第13回 Data-Centric AI勉強会, 画像認識におけるData-centric AI
ksaito_osx
0
360
インフラをつくるとはどういうことなのか、 あるいはPlatform Engineeringについて
nwiizo
5
2.1k
エンジニアのためのドキュメント力基礎講座〜構造化思考から始めよう〜(2025/02/15jbug広島#15発表資料)
yasuoyasuo
15
5.5k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
29
4.6k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
8
270
Producing Creativity
orderedlist
PRO
343
39k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.4k
Side Projects
sachag
452
42k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Done Done
chrislema
182
16k
Building Your Own Lightsaber
phodgson
104
6.2k
A better future with KSS
kneath
238
17k
Transcript
Tokyo HoloLens meets up vol.5 SpatialUnderstanding ” ” で 椅子
の 検知にチャレンジしてみたよ
自己紹介 ZuQ9Nn(ずきゅーん) 普段の業務はObjective-CでiOSアプリ開発 Swift は書いてません orz..
HoloLensとUnityは趣味レベル なんちゃってホロデベロッパー
ブログにも記事をちょこっと書いるよ ZuQ9->Nn To 辛周(ズキューンとからまわり) (http://zuq9nn.blogspot.jp/) HoloLens 開発 SpatialUnderstanding
事始め 空間検知と空間内の情報(天 井、床、壁) の判定まで ( http://zuq9nn.blogspot.jp/2017/06/hololens-spatialunderstanding.htm) HoloLens の開発 SpatialUnderstandingDllTopologyで壁にオブジェクト配置 してみる (http://zuq9nn.blogspot.jp/2017/09/hololensspatialunderstandingdlltopol ogy.htm)
SpatialUndstandingの機能 空間検知 空間内の情報(壁、天井、床)の判断 空間内の壁、天井、床にオブジェクトを配置する
ぶっちゃけ 同じことはSpatianMapping でも、できます!
そもそも SpatialUnderstindgは単体で用いるものではな く、SpatioalMappingと共に用いる いわばSpatialUnderstaindingはSpatialMapping ” ” の 拡張パック
のようなもの
それじぁ何がおいしいの? SpatialUnderstandingは壁、天井、床以外にも開発者が独自定義 ” ” すれば 椅子 なんかも検知できる MicrrosoftのサンプルではChair(椅子)、Couch(ソファーのような長椅
子)を定義して検知している
まずは定義が必要 定義はSpatialUnderstandingDllShapes.ShapeComponent と SpatialUnderstandingDllShapes.ShapeComponentConstra intを用いて行う
椅子の定義はこんな感じ SpatialUnderstandingDllShapes.ShapeComponent shapeComponents = new SpatialUnderstandingDllShapes.ShapeComponent( new List<SpatialUnderstandingDllShapes.ShapeComponentConstraint>() { SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_SurfaceHeight_Between(0.25f,
0.6f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_SurfaceCount_Min(1), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_SurfaceArea_Min(0.035f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_IsRectangle(), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleLength_Between(0.1f, 0.5f), SpatialUnderstandingDllShapes.ShapeComponentConstraint.Create_RectangleWidth_Between(0.1f, 0.4f), });
定義を書いたらAddして解析開始の処 理を記述 // 定義の追加 SpatialUnderstandingDllShapes.AddShape( "Chair", 1, HoloToolkit.Unity.SpatialUnderstanding.Instance.UnderstandingDLL.PinObject(shapeComponents), shapeComponents.ConstraintCount, HoloToolkit.Unity.SpatialUnderstanding.Instance.UnderstandingDLL.PinObject(shapeComponents.Constraints)
// 解析の開始 SpatialUnderstandingDllShapes.ActivateShapeAnalysis();
解析したら結果を取得し検知した座標 にオブジェクトを配置 // 解析結果を取得 ShapeResultは配列で512から変更するとresultsShape[i].positionがずれた?謎?? SpatialUnderstandingDllShapes.ShapeResult resultsShape[] = new SpatialUnderstandingDllShapes.ShapeResult[512];
// 検知された椅子の座標にオブジェクト配置 IntPtr resultsShapePtr = SpatialUnderstanding.Instance.UnderstandingDLL.PinObject(resultsShape); if (SpatialUnderstandingDllShapes.QueryShape_FindShapeHalfDims( "Chair", resultsShape.Length, ResultsShapePtr) <= 1) { Instantiate(prefab, resultsShape[0].position, prefab.transform.rotation); }
実機で実行した結果 https://www.youtube.com/wat ch?v=fgS0WH- C1zg&feature=youtu.be
プロジェクトはGithubにも出しました https://github.com/ZuQ9Nn/C hairDetection
プロジェクトはGithubにも出しました https://github.com/ZuQ9Nn/C hairDetection
サンプルコードの注意点 Unity 5.6.2f1(64-bit)を使って作成しました。 HoloToolkit-Unity-v1.5.8.0.unitypackageを利用しました。 椅子の定義はMicrosoftのサンプルコードをそのまま利用、うまく表示されない 場合は各自調整してください。
SpatialUnderstandingDllShapes.ShapeResult[512];の部分なぜか、配 列の数字を変更すると配置するポジションがずれる現象がおきた。現在、謎の まま。 キャラクターを椅子に座らせる場合はコライダーに注意
もちろん ” ” 画像解析等を行って 椅子 を判断しているわけではなく、あくまで開発 ” ” 者の定義を
椅子 として扱うだけなので誤検知も多いです。 空間内に定義に合致するモノが存在しなければ検知プログラムはうまく 動作しません。 椅子が白一色、黒一色だと検知しにくい。模様があった方がよい
まとめ SpatialUnderstandingはSpatialMappingの拡張パックのようなも の 開発者が独自定義すると椅子なんかも検知して扱うことができる より多くの物理現実世界の情報を扱うことができて架空の存在に人間 の動作を再現させる(キャラクターを椅子に座らせる等)ことができる
つまり 嫁がコードで進化する!!
最後に ご清聴ありがとうございました