OPENCV:固定相机和对象之间的距离

发布于 2025-01-25 13:30:58 字数 492 浏览 4 评论 0 原文

我有一个固定的相机,所以我知道相机与地面之间的距离,以及相机和图像中的底线之间的距离(这是地板)。 我在图像中有一个对象,我需要计算到它的距离。但是,对象的实际尺寸不可用。

在第一个图像中,到对象的距离为75厘米。在第二张图像中,距离为33厘米。

如何使用固定相机计算距离?我找到了一些使用焦距和对象宽度的教程,但是我不能使用它。 我可以检测到对象并在其周围有一个边界框。 谢谢

I have a fixed camera so I know the distance between the camera to the ground, as well as the distance between the camera and the bottom line in the image (which is the floor).
I have an object in the image and I need to calculate the distance to it. However, the actual dimensions of the object are not available.

In the first image, the distance to the object is 75cm. In the second image the distance is 33cm.

How can I calculate the distances using the fixed camera? I found a few tutorials which used the focal length and the width of the object, however I cannot use it.
I can detect the object and have a bounding box around it.
Thanks

Example 1 - distance to the object is 75cm

Example 2 - distance to the object is 33cm

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文