The idea is to project laser lines onto a flat surface, image them, and then put objects in front of the surface and compute the displacement made by the object.
Here is the flat base with a line on it:
Here is the line at the same position with objects intersecting:
Finding depth involves figuring out what the 2d projection of the normal line that is perpendicular to the wall at any point along the laser line. I'm working on this but it's also possible to guess an average line for low precision demonstration. The software looks for all points where it believes the laser is shining, and then computes the intersection of the normal line with the original object free laser line, and gets depth.
I had about 8 different images from laser lines, here are the results from two:
The yellow lines are the projected normals from the base line to the found laser line on the backpack and broom. There are some spurious results, and also on the dark woven backpack material the laser was not always reflected strongly enough to register.
The source code is here:
Post a Comment