Is it possible to measure distance to object with camera?

删除回忆录丶 提交于 2019-11-26 07:23:13

问题


Is it possible to measure distance to object with phone camera?

I mean, in my application I start the camera, facing the camera to the object (lets say house) and then press the button and it calculates the distance and shows me in screen.

If it\'s possible where I can find some tutorial or information about it?


回答1:


Well you should read how ithinkdiff.com "measures" the distance:

Uses the angle of the iPhone to estimate the distance to a point on the ground. Hold the iPhone in front of you, align the point in the camera and get a direct reading of the distance. The distance can then be used in the speed tool.

So basically it takes the height of where you hold the phone (eye-level), then you must point the camera to the point where object touches the ground. Then the phone measures the inclination and with simple trigonometry it calculates distance.

This is of course not very accurate. It gets less accurate the further the object is. Also it assumes that the ground is level.




回答2:


I accept the question has been answered adequately (with the obvious caveats of requiring level ground and possible accuracy problems) but for those who don't believe it can be done or that it needs a video camera, let me explain the low-level math needed to do it....

The picture above shows me standing outside my house. The horizontal (d) is the distance I want to measure and the vertical (h) is the height above the ground at which I'm holding the camera. In this case 'h' is a known value when I'm holding the android camera at eye-level (approx 67 inches or 1.7 metres). When I tilt the camera to aim it directly at the point my house meets the ground, all the software needs to do is work out the angle (a) relative to vertical and it can calculate 'd' using...

d = h * tan a



回答3:


Nope. The camera can only give you image data and an image alone doesn't give you enough information to give you depth information. If you had multiple images that you had location information for or even video you could then process it to triangulate the distance, but a single image alone would not be enough to give you a distance.




回答4:


You can use the technique used by our eye to get perspective of depth and distance.

1) Get 2 images of the same object from two different camera positions.

2) The distance or pixels between object in 2 images is inversely proportional to distance between camera and object.

The implementation is available at https://github.com/agnelvishal/Distance-between-camera-and-object Here is the research paper http://dsc.ijs.si/files/papers/S101%20Mrovlje.pdf




回答5:


You have the angle in the phone's accelerometer. If you calculate the tangent of this angle and multiply it by the height of the camera lens, you get the distance.




回答6:


I think this App uses the approach MisterSquonk mentioned (its free). Watch the "Trigonometry" technique.




回答7:


I think by using FastCV you can calculate the distance between Camera and the object. In this You dont need to know the angle or the Position of camera that you are holding above ground Level. take a look at this question here




回答8:


One way to achieve this is using the DPI's in your device. You can take a picture and calculate the height. But you'll need another object as a reference and then you will be able to know the problem with this method could be the perspective between the objects




回答9:


I think it could be possible doing that using the phone camera. I know that the modern phones use lenses to focus on a object. If it is possible to know their focal length and their position(displacement) to focus on the chosen object it's also possible to determinate the distance.




回答10:


No. Only with two cameras in stereo mode, like the xbox 360 kinect. It takes at least 3 points to triangulate distance.



来源:https://stackoverflow.com/questions/4588485/is-it-possible-to-measure-distance-to-object-with-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!