Possible to measure distance with an iPhone and la

2019-05-30 00:49发布

问题:

I want to make this phone app that can measure distance. I want to know how far away something is from the phone. So let's say I want to know how far away a wall is...I'd like my phone to tell me.

So how might this work? Well, I can shine an ordinary red laser pointer against the wall (in the dark) and have the phone's camera "see" the dot.

The further away the phone is from the dot, the smaller the dot will be. The picture below shows the dot from 1 foot, 5 feet, 10 feet, 20 feet, and 25 feet away. I think the app could then measure the size of the dot and figure out how far away the dot actually is from the phone. And then it could use a simple ratio or formula to determine distance for other sizes.

So my question is: Would this likely work for measuring distance?

回答1:

As long as you can clearly identify the laser dot I would say:Yes. I'm seeing the problem in doing the identifying. The distance measuring is just some maths and physics stuff (I'm not sure what to use but I think there is maybe some useful optics stuff... intercept theorem?) or you can create an "algorithm" by testing(but then accuracy could be a problem ;))



回答2:

So, I think the dual laser pointer idea is superior to the single laser pointer idea.

But, because the camera is moving further and further away from the wall, I believe angling the laser pointers is a non-solution.

Instead, I think keeping the laser pointers in parallel is the solution. This way, the further back you go, the beams will look closer and closer together in the photo, but they will still remain the same distance apart. Then you can easily come up with some formula to measure the distance based on how far apart the dots are in the photo.