firativerson
firativerson

Reputation: 435

Hololens Spatial Understanding Calculating Measurements

I have been reading through related holotoolkit spatial understanding codes but could not find anything related to getting the dimentions of found table. I followed this great tutorial to add table as custom shape. But then stuck on the dimentions. I am getting some ideas like, drawing the box right on top of the found area and pulling it out to main scene to get real world measure , however the box is not strictly on top of the table. Are there any ideas or guidelines on how to achieve this? Thank you!

Upvotes: 3

Views: 78

Answers (1)

Bea Boxler
Bea Boxler

Reputation: 302

I wrote that article! Due to the limitations of the v1 toolkit, where we were using this table detection we were unable to accurately get the bounds. The solution we decided upon was to raycast from the camera (the hololens) in the direction of the 'table', in a grid point by point in known intervals, and whereever the height sharply fell off or increased we determined that to be an 'edge'.

We then took the upper left-most, upper right-most, and lower left and right-most points and created a plane with corners in those four coordinates.

The limitations of this are that it is very heuristic and isn't always reliable - it isn't always level either, however that can be taken into consideration and leveled at the average height of the points.

I don't have the code for this on me at the moment, but I can find it at work tomorrow. It's also worth noting that we didn't stick with using this as it turned out it was easier, in our specific use case, just to stick an object where the table is discovered which is then scaled by the first user in the space.

Upvotes: 3

Related Questions