Measuring distance with iPhone camera

10,966

Solution 1

Well you do have something for reference, hence the use of the card. Saying that after watching the a video for the app I can't seem it seems too user friendly.

So you either need a reference of an object that has some known size, or you need to deduct the size from the image. One idea I just had that might help you do it is what the iPhone's 4 flash (I'm sure it's very complicated by it might just work for some stuff).

Here's what I think.

When the user wants to measure something, he takes a picture of it, but you're actually taking two separate images, one with flash on, one with flash off. Then you can analyze the lighting differences in the image and the flash reflection to determine the scale of the image. This will only work for close and not too shining objects I guess.

But that's about the only other way I thought about deducting scale from an image without any fixed objects.

Solution 2

I like Ron Srebro's idea and have thought about something similar -- please share if you get it to work!

An alternative approach would be to use the auto-focus feature of the camera. Point-and-shoot camera's often have a laser range finder that they use to auto-focus. iPhone doesn't have this and the f-stop is fixed. However, users can change the focus by tapping the camera screen. The phone can also switch between regular and macro focus.
If the API exposes the current focus settings, maybe there's a way to use this to determine range?

Solution 3

Another solution may be to use two laser pointers.

Basically you would shine two laser pointers at, say, a wall in parallel. Then, the further back you go, the beams will look closer and closer together in the video, 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.

See this thread for more details: Possible to measure distance with an iPhone and laser pointer?.

Share:
10,966

Related videos on Youtube

manuelBetancurt
Author by

manuelBetancurt

Computers, BJJ, Open Source, Psichotronics "Ars longa, vita brevis, occasio praeceps, experimentum periculosum, iudicium difficile", "Life is short, [the] craft long, opportunity fleeting, experiment treacherous, judgment difficult." Hippocrates "Hay cosas tan grandes y complejas que solo el hombre indicado o un loco se atreven a afrontar!!", "There are things so great and complex that only the right man or a nut case dare to face!!" Don Juan

Updated on May 24, 2022

Comments

  • manuelBetancurt
    manuelBetancurt almost 2 years

    How to implement a way to measure distances in real time (video camera?) on the iPhone, like this app that uses a card to compare the size of the card with the actual distance?

    Are there any other ways to measure distances? Or how to go about doing this using the card method? What framework should I use?

    • NWCoder
      NWCoder about 13 years
      The AVCapture framework is where you can access the raw AVCaptureInput. I haven't heard of a public framework to do the distance tests you mention. I'd like to hear if you have success.
    • Amit Battan
      Amit Battan about 12 years
      have found solution ... I have to implement similar thing.
  • Ron Srebro
    Ron Srebro about 13 years
    Let me know if by any chance you got that working, would be awesome.
  • Ladessa
    Ladessa about 11 years
    Ron Srebro Have you any sample of the measure with card reference?