当不知道物体和相机之间的距离时,如何从图像获得物体的真实生活大小? [英] How to get the real life size of an object from an image, when not knowing the distance between object and the camera?

查看:174
本文介绍了当不知道物体和相机之间的距离时,如何从图像获得物体的真实生活大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须制作一个移动应用程序来计算图像中对象的真实生活大小。



我已经做了一些研究,发现有帮助[问题]:如何查找对象的高度给定图像?



摄像机的距离和物体的真实生活尺寸之间的关系实际上并不复杂,尺寸比的物体在传感器上的尺寸和物体在现实生活中的尺寸与焦距和到物体的距离之间的比率相同。

 距物体的距离(mm)=焦距(mm)*物体的实际高度)
--------------------------------------------- ------------------------------
物体高度(像素)*传感器高度(mm)

但是如果距离未知,如何获取对象的实际高度值?



从图片创建3d模型的工具是否具有现实生活的尺寸?

解决方案

简单的答案是您不能



顺便一提,这就是为什么人类有两个眼睛。如果你想在没有已知距离的情况下判断大小,你至少需要两个参考点。这允许您对物体的位置进行三角测量,获得距离,并使用已知的焦距来计算尺寸。



更复杂的答案是 有以下方法:


  1. 使用已知参考作弊: em>



    例如,如果你有一个已知大小的对象,你可以推断距离。这类似于 NASA 校准其相机的方法。



    如果你处理常见的对象,例如分析建筑物的图像时,一层的高度,你可以做出安全的假设。

    多个参考点与同一摄像头。



    我想你可以使用加速度计准确测量在时间点T1和点T2捕获的图像之间的位置关系。这将给你两个图像的同一主题之间已知的距离。这样就可以让你进行三角测量,就好像你有两只眼睛。



    无论正常的手持式相机抖动是否足以进行三角测量,或者加速度计是否足够准确以便惯性地定位手机,我不知道。 p>


  2. 假设有一个距离:



    在人的手(或其他位的人体解剖学)的规模,你可以安全地假设一个距离,基于人们会自然做什么。相机本身的焦点限制也将给出对象可以并仍然对焦的距离的上限和下限。这可能在可容忍的误差范围内。


正如您在问题中提到的,有一个完整的子字段,它是一个活跃研究领域


I have to make a mobile app that calculates the real life size of an object in an image.

I have done some research on it and found helpful [question]: How would you find the height of objects given an image?

The relation of the distance of the camera and real life size of the object isn't actually that complex, the ratio of the size of the object on the sensor and the size of the object in real life is the same as the ratio between the focal length and distance to the object.

distance to object (mm) = focal length (mm) * real height of the object (mm) * image height (pixels)
                          ---------------------------------------------------------------------------
                          object height (pixels) * sensor height (mm)

But how to get the value of real height of the object if distance is not known ?

Do the tools that create 3d models from images have real life dimensions?

解决方案

The simple answer is you can't.

Incidentally, this is why humans have two eyes. If you want to judge size without a known distance, you'll need at least two reference points. This allows you to triangulate the position of the object, get a distance to it, and use your known focal distance to calculate the size.

The more complex answer is there are ways around this for example:

  1. Cheat by using a known reference:

    For example, if you have an object of known size, you can infer the distance. This is similar to what NASA does to calibrate its cameras, for example.

    You can make safe assumptions if you're dealing with common objects, such as the height of one storey when analysing the image of a building.

  2. Move your camera around:

    This allows you to get more than one reference point with the same camera.

    I suppose you could use the accelerometer to accurately measure the positional relation between the image captured at point T1 in time and point T2. This would give you two images of the same subject with a known distance between them. This then allows you to triangulate as if you had two eyes.

    Whether normal hand-held camera jitters will be sufficient for triangulation, or whether the accelerometer will be accurate enough to inertially position the phone, I don't know.

  3. Assume a distance:

    If your app is designed to compare something on the scale of a human hand (or other bit of human anatomy), you can probably safely assume a distance based on what people will naturally do. The focus limits of the camera itself will also give an upper and lower range on how far an object can be and still be in focus. This will probably be within a tolerable margin of error.

As you mention in your question, there is an entire subfield dedicated to this question, and it is an active research area.

这篇关于当不知道物体和相机之间的距离时,如何从图像获得物体的真实生活大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆