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
Delegating the chores of authenticating users to Keycloak
ahus1
0
130
Tokyo_reInforce_2025_recap_iam_access_analyzer
hiashisan
0
140
5min GuardDuty Extended Threat Detection EKS
takakuni
0
180
Core Audio tapを使ったリアルタイム音声処理のお話
yuta0306
0
150
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
4
3.4k
asken AI勉強会(Android)
tadashi_sato
0
140
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
1
260
KubeCon + CloudNativeCon Japan 2025 Recap
ren510dev
1
300
あなたの声を届けよう! 女性エンジニア登壇の意義とアウトプット実践ガイド #wttjp / Call for Your Voice
kondoyuko
4
500
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
1
450
Yamla: Rustでつくるリアルタイム性を追求した機械学習基盤 / Yamla: A Rust-Based Machine Learning Platform Pursuing Real-Time Capabilities
lycorptech_jp
PRO
4
170
KubeCon + CloudNativeCon Japan 2025 Recap by CA
ponkio_o
PRO
0
240
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
A better future with KSS
kneath
239
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
24k
Making Projects Easy
brettharned
116
6.3k
Site-Speed That Sticks
csswizardry
10
670
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
107
19k
Statistics for Hackers
jakevdp
799
220k
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の拡張パックのようなも の 開発者が独自定義すると椅子なんかも検知して扱うことができる より多くの物理現実世界の情報を扱うことができて架空の存在に人間 の動作を再現させる(キャラクターを椅子に座らせる等)ことができる
つまり 嫁がコードで進化する!!
最後に ご清聴ありがとうございました