算法来确定从视频馈入房间的大小 [英] Algorithm to determine size of a room from video feed

查看:135
本文介绍了算法来确定从视频馈入房间的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道一个图像分析算法我可以决定如何大(约,在现实生活中的测量,假设宽度米或某事)房间超出了这个房间中的一个(或多个)录像?

Does anybody know of a image analysis algorithm with which I can determine how large(approximately, in real-life measurements, let's say width in meters or something) a room is out of one(or multiple) video recordings of this room?

我目前使用的OpenCV作为我的形象选择的库,但我还没有得到很远,在学习的图像分析算法而言,只是一个名字一滴就可以了。

I'm currently using OpenCV as my image library of choice, but I haven't gotten very far in terms of learning image analysis algorithms, just a name drop would be fine.

感谢

编辑:好了,澄清一点我刚刚从参与的人了。我基本上没有控制视频源是如何拍摄,并不能保证有多个数据源。然而,我在房间里的某些点位置,我应该把一些有关这一点。所以,我可能会看试图找出房间的边缘,然后找出给定的位置是在房间里多远procentual然后猜测有大房间。

Okay, a little bit of clarification I just got from the people involved. I basically have no control how the video feed is taken, and can't guarantee that there are multiple data sources. I however have a certain points location in the room and I'm supposed to place something in relation to that point. So I would probably looking at trying to identify the edges of the room, then identifying how far procentual the given location is in the room and then guess how large the room is.

推荐答案

非常困难的(但有趣的!)的问题。

Awfully difficult (yet interesting!) problem.

如果你正在考虑在一个完全自动化的方式这样做,我想你会拥有很多的问题。但我认为这是可行的,如果运营商可以在一组图片标记控制点。

If you are thinking in doing this in a completely automated way I think you'll have a lots of issues. But I think this is doable if an operator can mark control points in a set of pictures.

您的问题,可以更一般地表述为确定两个点之间的距离在3D空间中,当你只有这些点中的两个或更多2D图像从不同的观点考虑的位置。这一过程将工作或多或少是这样的:

Your problem can be stated more generally as finding the distance between two points in 3D space, when you only have the locations of these points in two or more 2D pictures taken from different points of view. The process will work more or less like this:

  • 在这些照片将带着相机的位置和方位信息。例如,假设你得到两张图片,具有相同的摄像头的方向,而且两个照片拍摄用相机3英尺分开水平。你必须定义一个参考原点的三维空间中,摄像机的位置,例如,你可以说左图有相机对准(0,0,0),并在合适的画面(3,0, 0),和两者都将被朝前,这将是(0,0,1的取向)。或者类似的东西。
  • 现在,运营商来了,标志着室在这两张图片的两个角。所以,你有2套二维坐标每个角落。
  • 您必须知道你的相机和镜头(视野,镜头畸变,畸变等)的细节。你越了解相机如何变形的图像更准确,你可以让你的估计。这是相同的东西,全景拼接软件如何实现更好的针迹。请参见 PanoTools 查找有关此信息。
  • 在这里了有趣的部分:现在你会做一个透视投影的逆为每个2D点。透视投影需要在三维空间和摄像机定义的一个点,并计算一个二维点。这是用来重新present三维物体在一个平面上,像一个计算机屏幕。你正在做的是相反的,对于每一个二维点你会尝试得到一个三维坐标。由于没有足够的信息在2D点确定深度,最好可以从一个单一的2D点做的是获得在三维空间中的线穿过透镜并通过所讨论的点,但不知道如何从镜头上点远。但是,你必须在两个图像相同的二维点,这样你就可以计算出从不同的摄像头位置的两个3D线。这些线将不平行,所以他们将相交于一点。三维线的交点将成为三维点在空间中的位置的良好估计,并在参考相机三维空间的坐标。
  • 剩下的就是方便。当你有这两个景点的估计三维位置,你只要计算的 3D距离,这就是你想要的号码。
  • The pictures will come with camera location and orientation information. For example, let's say that you get two pictures, with the same camera orientation and where the two pictures were taken with the camera three feet apart horizontally. You will have to define a reference origin for the 3D space in which the cameras are located, for example, you can say that the left picture has the camera at (0,0,0) and the right picture at (3,0,0), and both will be facing forward, which would be an orientation of (0,0,1). Or something like that.
  • Now the operator comes and marks the two corners of the room in both pictures. So you have 2 sets of 2D coordinates for each corner.
  • You must know the details of your camera and lens (field of view, lens distortion, aberrations, etc.). The more you know about how your camera deforms the image the more accurate you can make your estimate. This is the same stuff panorama stitching software do to achieve a better stitch. See PanoTools for info on this.
  • Here comes the fun part: you will now do the inverse of a perspective projection for each of your 2D points. The perspective projection takes a point in 3D space and a camera definition and computes a 2D point. This is used to represent tridimensional objects in a flat surface, like a computer screen. You are doing the reverse of that, for each 2D point you will try to obtain a 3D coordinate. Since there isn't enough information in a 2D point to determine depth, the best you can do from a single 2D point is obtain a line in 3D space that passes through the lens and through the point in question, but you don't know how far from the lens the point is. But you have the same 2D point in two images, so you can compute two 3D lines from different camera locations. These lines will not be parallel, so they will intersect at a single point. The intersection point of the 3D lines will be a good estimation of the location of the 3D point in space, and in the coordinates of your reference camera 3D space.
  • The rest is easy. When you have the estimated 3D locations of the two points of interest, you just compute the 3D distance between them, and that's the number that you want.

pretty的容易,是吧?

Pretty easy, huh?

这篇关于算法来确定从视频馈入房间的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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