物体图像中的实际大小
我想根据距相机固定距离拍摄的图像来计算物体的实际大小。相机的焦距是已知的。现在我如何能够仅使用图像数据来计算对象的实际大小?
我正在使用 Opencv 实现该程序。
提前致谢。
PS:我对像素和厘米的转换有点困惑。
I would like to calculate the actual size of an object from its image taken at a fixed distance from the Camera. The focal length of the camera is known. Now how will I able to calculate the actual size of the object only with the image data??
I am implementing the program using Opencv.
Thanks in advance.
PS: I am little confused with this pixels and centimeter conversions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
物体的大小与距相机的距离的比值与图像的大小与焦距的比值相同。
所以...
其中
s
是物体的大小,is
是图像中物体的大小,fl
是焦距,d
是到相机的距离。The size of the object to the distance from the camera is in the same ratio as the size of the image to the focal length.
So...
where
s
is the size of the object,is
is the size of the object in the image,fl
is the focal length, andd
is distance to the camera.关于摄影交流的这个问题可能会被证明是有用的阅读:
https://photo.stackexchange.com/questions/12434/how-do-i-calculate-the-distance-of-an-object-in-a-photo
最上面的答案提供了轻松创建通用方程为您的目的进行操作,并提供出色、详细的报道。祝你好运:)。
This question on the photography exchange may prove useful reading:
https://photo.stackexchange.com/questions/12434/how-do-i-calculate-the-distance-of-an-object-in-a-photo
The top answer provides a general purpose equation easily manipulated for your purposes, and gives an excellent, detailed coverage. Best of luck :).