For measuring distances with a single camera, you need to know some numbers. To measure height of something, say a chair, the only thing you have is the the size of it in the camera (which is in pixels, and can be converted to inches using screen size), that is all. The chance of measuring the height and width is using a reference, say a 6 foot tall person standing next to the chair.
This way you can work out in reverse using say a 10 foot tall object, using its size as appearing in the camera, you can work out the size of things at the same distance, on a surface that is not flat, even ensuring that they are at the same distance is a challenge.
So using the camera and just the camera, it is not possible. You need to know distance somehow, or need a reference.
If you are using the application to measure height of items you know the location of, then using GPS, you can find distance, and rest is math.
I have found some links using Google, they may help.
- http://forestjohnson.blogspot.com/2010/01/how-to-measure-size-of-object-using.html
- http://gigaom.com/mobile/how_to_measure_/
- http://www.iphonelife.com/blog/5/cameasure-use-your-camera-measure-size-or-distance
They may help you to find out what other information is needed other than what the camera can provide, so that you can think about your application as well regarding what can be done and what are the limitations.
One way is using multiple cameras, and that can be compensated using multiple pictures taken a known distance away. So the application can ask the user to take multiple images, track the distance using GPS, and probably it can work.
See these links as well:
- http://iopscience.iop.org/1742-6596/48/1/074/pdf/1742-6596_48_1_074.pdf
- http://www.optical-metrology-centre.com/Downloads/Papers/Photogrammetric%20Record%201994%20Automated%203-D%20measurement.pdf