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
700
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
930
Other Decks in Technology
See All in Technology
CSPMとのつきあい方
nantokanare
0
110
サイト信頼性エンジニアリングとAmazon Web Services / SRE and AWS
ymotongpoo
7
1.9k
Pwned Labsのすゝめ
ken5scal
2
590
書籍『入門 OpenTelemetry』 / Intro of OpenTelemetry book
ymotongpoo
5
460
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
5
6.9k
DeepSeekとは?何がいいの? - Databricksと学ぶDeepSeek! 〜これからのLLMに備えよ!〜
taka_aki
2
200
LangGraph × Bedrock による複数の Agentic Workflow を利用した Supervisor 型のマルチエージェントの実現/langgraph-bedrock-supervisor-agent
ren8k
2
190
どちらかだけじゃもったいないかも? ECSとEKSを適材適所で併用するメリット、運用課題とそれらの対応について
tk3fftk
2
330
エンジニアのキャリアパスと、 その中で自分が大切にしていること
noteinc
3
2.5k
自分のやることに価値を見出だせるようになり、挑戦する勇気をもらったベイトソンの考え / Scrum Fest Fukuoka 2025
bonbon0605
0
160
Qiita Organizationを導入したら、アウトプッターが爆増して会社がちょっと有名になった件
minorun365
PRO
1
370
2025/3/1 公共交通オープンデータデイ2025
morohoshi
0
120
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
12k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
Done Done
chrislema
182
16k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
Practical Orchestrator
shlominoach
186
10k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
660
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の拡張パックのようなも の 開発者が独自定義すると椅子なんかも検知して扱うことができる より多くの物理現実世界の情報を扱うことができて架空の存在に人間 の動作を再現させる(キャラクターを椅子に座らせる等)ことができる
つまり 嫁がコードで進化する!!
最後に ご清聴ありがとうございました