1

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?

enter image description here

Chad Johnson
  • 21,215
  • 34
  • 109
  • 207
  • I'm quite curious how accurate that would be.. – Mike Christensen Aug 30 '12 at 20:47
  • Interesting idea, but it isn't really a question. – Brian Aug 30 '12 at 20:56
  • But it is! I am asking whether this will likely work. – Chad Johnson Aug 30 '12 at 20:59
  • Wouldn't this change depending on the intensity of the laser pointer and ambient light? – Scott Bossak Aug 30 '12 at 21:44
  • 2
    A more robust approach might be to use two pointers, as described here: http://stackoverflow.com/questions/10760552/iphone-ios-is-it-possible-to-create-a-rangefinder-with-2-laser-pointers-and-an-i . Doing this from one source would probably require significant calibration for each laser pointer used, and would seem to be prone to noise. – Brad Larson Aug 30 '12 at 22:12
  • @Scott Probably, yes. This would have to be done in the dark (which is fine, given my target environment). And the app could calibrate for the laser used (i.e. learn the different sizes for different distances and adjust its distance calculation formula). – Chad Johnson Aug 30 '12 at 22:23
  • Ah! Two laser pointers is not a bad idea. – Chad Johnson Aug 30 '12 at 22:25
  • With two lasers, you'd have to hold each of them at the exact right angle or have them mounted on something. I was thinking you wanted a user to just hold up a laser pointer with one hand, shine it at the wall, and measure the distance with an iPhone. – Mike Christensen Aug 30 '12 at 22:46
  • @MikeChristensen Yes, that would be necessary, and using one was my original intent. But I'm open to two. Maybe I could just let the user decide whether to use one or two and then support both ways. – Chad Johnson Aug 30 '12 at 23:00
  • Neat question but hardly a programming one at this point. – ceejayoz Aug 31 '12 at 00:12
  • @ceejayoz I am open to suggestions on places to post where I will actually receive answers. – Chad Johnson Aug 31 '12 at 00:26
  • Guys, if you are going to suggest closing this question because it does not belong on this site, *please suggest another place to post this question!* – Chad Johnson Aug 31 '12 at 04:32

2 Answers2

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 ;))

arnoapp
  • 2,416
  • 4
  • 38
  • 70
  • You would have to ensure the dot always shines against the same type of surface...a piece of white paper, perhaps. But I think the dual-laser pointer approach may be superior, as surface material, lighting, and the laser pointer dot size will then be inconsequential. – Chad Johnson Aug 31 '12 at 03:36
0

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.

Chad Johnson
  • 21,215
  • 34
  • 109
  • 207