Tokyo HoloLens meets up vol.5 LT

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
ZuQ9Nn
September 17, 2017

Tokyo HoloLens meets up vol.5 LT

Tokyo HoloLens meets up vol.5 LT資SpatialUnderstandingで”椅子”の
検知にチャレンジしてみたよ料

ZuQ9Nn

September 17, 2017

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

19 slides
  1. Tokyo HoloLens meets up vol.5 SpatialUnderstanding ” ” で 椅子

    の 検知にチャレンジしてみたよ
  2. ブログにも記事をちょこっと書いるよ  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)
  3. 椅子の定義はこんな感じ 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), });
  4. 解析したら結果を取得し検知した座標 にオブジェクトを配置 // 解析結果を取得 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); }
  5. サンプルコードの注意点  Unity 5.6.2f1(64-bit)を使って作成しました。  HoloToolkit-Unity-v1.5.8.0.unitypackageを利用しました。  椅子の定義はMicrosoftのサンプルコードをそのまま利用、うまく表示されない 場合は各自調整してください。 

    SpatialUnderstandingDllShapes.ShapeResult[512];の部分なぜか、配 列の数字を変更すると配置するポジションがずれる現象がおきた。現在、謎の まま。  キャラクターを椅子に座らせる場合はコライダーに注意
  6. もちろん  ” ” 画像解析等を行って 椅子 を判断しているわけではなく、あくまで開発 ” ” 者の定義を

    椅子 として扱うだけなので誤検知も多いです。  空間内に定義に合致するモノが存在しなければ検知プログラムはうまく 動作しません。  椅子が白一色、黒一色だと検知しにくい。模様があった方がよい

More Decks by ZuQ9Nn

Other Decks in Technology