Menu

Snapping a tap to a real corner: building a LiDAR tape measure for iPhone
📰

Snapping a tap to a real corner: building a LiDAR tape measure for iPhone

DEV Community: swift·Max·5 days ago
#927xO3sy
#devtoswift#devto#dev#corner#depth
Reading 0:00
15s threshold

When you tap the screen to start a measurement, you are not tapping the corner of the table. You are tapping a pixel, and that pixel sits on a ray that leaves the camera and hits something . Often the something is the floor 40 inches behind the table, because your thumb landed a hair past the edge.

This post is how the tape measure in our iPhone app deals with that: two kinds of evidence (depth and image), a little geometry, and a filter that refuses to let the point jitter.

Depth alone is too blurry

On a Pro iPhone, ARKit hands you a depth map with every frame ( sceneDepth , plus smoothedSceneDepth when the device supports it) and a confidence map next to it. It is wonderful and it is coarse. The reconstructed mesh is a few centimetres per triangle, so it rounds off exactly the thing you want to measure to: the edge.

It is also blind to edges that are flat on a surface. A picture frame on a wall, door trim, the printed edge of a box: depth sees one plane.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.