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
660
2018/03/09 第五回HoloLens読書会
zuq9nn
0
4.1k
HoloLensでユニティちゃんを椅子に 座らせてみた”その後”の話
zuq9nn
0
5k
HoloLensのはじめかた
zuq9nn
1
4.3k
Fabricではじめるfastlane
zuq9nn
0
1.7k
第六回カジュアルSwift勉強会@青葉台
zuq9nn
2
900
Other Decks in Technology
See All in Technology
本当のAWS基礎
toru_kubota
0
370
JSON攻略法.pdf
miyakemito
8
4.4k
LLM とプロンプトエンジニアリング/チューターをビルドする / LLM and Prompt Engineering and Building Tutors
ks91
PRO
0
250
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
160
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
450
HEXA OSINT CTF V3 作戦会議
meow_noisy
0
120
Postman v10リリース後を振り返る / Looking back at Postman v10 after release
yokawasa
1
150
Terraformあれやこれ/terraform-this-and-that
emiki
8
1.3k
SREとその組織類型
tatsuo48
9
1.6k
オーナーシップを持つ領域を明確にする
konifar
13
3k
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
250
継続的な改善 x ⾮連続的な進化
sansantech
PRO
3
130
Featured
See All Featured
Designing with Data
zakiwarfel
95
4.8k
YesSQL, Process and Tooling at Scale
rocio
163
13k
The Language of Interfaces
destraynor
151
23k
How STYLIGHT went responsive
nonsquared
92
4.8k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
Reflections from 52 weeks, 52 projects
jeffersonlam
344
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
The Cost Of JavaScript in 2023
addyosmani
15
3.8k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
119
39k
Web Components: a chance to create the future
zenorocha
305
41k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.9k
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の拡張パックのようなも の 開発者が独自定義すると椅子なんかも検知して扱うことができる より多くの物理現実世界の情報を扱うことができて架空の存在に人間 の動作を再現させる(キャラクターを椅子に座らせる等)ことができる
つまり 嫁がコードで進化する!!
最後に ご清聴ありがとうございました