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
710
2018/03/09 第五回HoloLens読書会
zuq9nn
0
4.2k
HoloLensでユニティちゃんを椅子に 座らせてみた”その後”の話
zuq9nn
0
5.2k
HoloLensのはじめかた
zuq9nn
1
4.5k
Fabricではじめるfastlane
zuq9nn
0
1.9k
第六回カジュアルSwift勉強会@青葉台
zuq9nn
2
940
Other Decks in Technology
See All in Technology
第9回情シス転職ミートアップ_テックタッチ株式会社
forester3003
0
220
Javaで作る RAGを活用した Q&Aアプリケーション
recruitengineers
PRO
1
100
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
1
210
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
26k
Amazon S3標準/ S3 Tables/S3 Express One Zoneを使ったログ分析
shigeruoda
3
460
Postman AI エージェントビルダー最新情報
nagix
0
110
Understanding_Thread_Tuning_for_Inference_Servers_of_Deep_Models.pdf
lycorptech_jp
PRO
0
110
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
290
LinkX_GitHubを基点にした_AI時代のプロジェクトマネジメント.pdf
iotcomjpadmin
0
170
ひとり情シスなCTOがLLMと始めるオペレーション最適化 / CTO's LLM-Powered Ops
yamitzky
0
420
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.1k
解析の定理証明実践@Lean 4
dec9ue
0
170
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
Raft: Consensus for Rubyists
vanstee
140
7k
Unsuck your backbone
ammeep
671
58k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Automating Front-end Workflow
addyosmani
1370
200k
Adopting Sorbet at Scale
ufuk
77
9.4k
Side Projects
sachag
455
42k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
670
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
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の拡張パックのようなも の 開発者が独自定義すると椅子なんかも検知して扱うことができる より多くの物理現実世界の情報を扱うことができて架空の存在に人間 の動作を再現させる(キャラクターを椅子に座らせる等)ことができる
つまり 嫁がコードで進化する!!
最後に ご清聴ありがとうございました