Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想根据在距相机固定距离处拍摄的图像计算对象的实际大小。相机的焦距是已知的。现在我将如何仅使用图像数据来计算对象的实际大小?
我正在使用 Opencv 实现该程序。
提前致谢。
PS:我对这个像素和厘米转换有点困惑。
物体大小与相机距离的比例与图像大小与焦距的比例相同。
所以...
s = is/fl * d
其中s是物体is的大小,是图像中物体的大小,fl是焦距,d是到相机的距离。
s
is
fl
d
这个关于摄影交流的问题可能会被证明是有用的阅读:
https://photo.stackexchange.com/questions/12434/how-do-i-calculate-the-distance-of-an-object-in-a-photo
最佳答案提供了一个易于为您的目的操作的通用方程,并提供了出色、详细的覆盖范围。祝你好运:)。