测量图像上两点之间的物理距离(OPENCV) [英] Measuring the physical distance between two points on an image (OPENCV)

查看:805
本文介绍了测量图像上两点之间的物理距离(OPENCV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为一个项目的要求,我需要找到一个人所采取的步行距离,他们已经获得了行走时的图像。

我已经获得了使用背景的人的二元轮廓减法,现在需要计算步骤的实际物理距离。

有没有办法在OpenCV中将像素距离转换为物理距离?

如果没有,那么是什么方法可以应用于实现相同的?

As a requirement for a project, I need to find the walking step distance taken by a person, whose image while walking has been acquired.
I have acquired a binary silhouette of the person using background subtraction and now need to calculate the actual physical distance of the step.
Is there a method to convert pixel distance to physical distance in OpenCV?
And if not, then what method can be applied to achieve the same?

推荐答案

你不能直接计算实际单位中两个像素之间的距离。

您将需要更多信息,可以通过以下几种方式获得:



- 考虑到此人几乎是水平传递相机(不是远离或远离相机可以使用您知道的图像中某些物体的大小。例如。如果您知道地板的长度(在图像上看到),则该人正在行走,您可以轻松地关联相关的步行距离。您可以从典型的犯罪现场照片中了解这种方法,其中已知大小的标尺放在相关的对象旁边。



- 使用某种深度信息和相机参数:您可以使用图像的深度信息来计算图像中对象的距离和尺寸。给定物体和相机参数(焦距)的距离,您可以计算物体的真实世界尺寸。现在这个深度信息可能来自几个来源:一些深度摄像头可直接为您提供深度信息,或者如果您从不同位置查看同一场景(例如使用立体摄像头设置),您可以计算深度图。如果您从视点上只有一个场景视频,则可以使用连续帧来计算深度信息。后者也被称为动议结构:

http://en.wikipedia.org/wiki/ Structure_from_motion [ ^ ]



您应该了解包含所有必要变量的针孔相机模型:

http://en.wikipedia.org/wiki/Pinhole_camera_model [ ^ ]



如果可以影响录音,当然还有很多其他方法。
You can't just directly calculate the distance between two pixels in real world units.
You will need some more information which may be obtained in several ways:

- Considering the person is passing the camera almost horizontal (not walking away from or up to the camera) you may use the size of some object in the image that you know. E.g. if you know the length of the floor (seen on the image) the person is walking on you can easily correlate the relating walking distance. You may know this method from typical crime scene photographies, where a ruler of known size is placed next to the relevant obejcts.

- Using some kind of depth information and camera parameters: You can use the depth information of an image to calculate distances and dimensions of objects in an images. Given the distance of an object and camera parameters (focal length) you can calculate the real world dimensions of an object a bit of geometry. Now this depth information may come from several sources: some depth camera which will give you the depth information directly or you can calculate the depth map if you're looking at the same scene from different position (e.g. with a stereo-camera setup). If you just have a video of a scene from on point of view you can use consecutive frames to calculate the depth information. The latter is also know as structure from motion:
http://en.wikipedia.org/wiki/Structure_from_motion[^]

You should understand the pinhole-camera model which contains all the neccesary variables needed:
http://en.wikipedia.org/wiki/Pinhole_camera_model[^]

There are of course many other ways if you can influence the recordings.


< a href =http://opencv-users.1802565.n2.nabble.com/How-to-find-distance-between-two-pixels-in-an-image-td6644460.html>此主题 [ ^ ]可能对您有用。

尝试这个 [ ^ ]线程。
This thread[^] might be useful to you.
Try this[^] thread as well.


这篇关于测量图像上两点之间的物理距离(OPENCV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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