使用 Kinect 检测地板上的物体
假设我有一个指向地板的 Kinect。
如果我在地板上放置 3 或 4 个物体,我如何确定这些物体所在的平面?
如何检测该地板上颜色鲜艳的物体?
Lets say that I have a kinect pointing at a floor.
If I place 3 or 4 objects on the floor how can I determine the plane those objects are on?
How can I detect brightly colored objects on that floor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Kinect 返回给您一个矩阵深度图,表示任何表面到传感器的距离,并遵循 针孔相机模型可以将每个深度测量值与相应的 RGB 值对齐。我认为您已经知道如何将深度矩阵的每个像素与其空间上的 X、Y、Z 及其 RGB 值相关联。如果没有,您将需要进行进一步研究并了解深度传感器和 RGB 相机之间的立体关联是如何完成的。
您在这里问了两个完全不同的问题。第一个问题很容易用一些基本的几何概念来解决,但必须首先解决第二个问题才能找到物体在空间上的位置。
有多种方法可以找到颜色鲜艳的物体。如果您的传感器将记录静态场景,则可以使用背景扣除 。这将为您生成一个二进制图像,表示具有与先前训练的背景模型不同的值的像素。由于您的对象将明确具有比背景更亮的颜色,因此您可以简单地应用阈值分割< /a>.只需将 RGB 转换为 HSL 图像并寻找更高的亮度值。还有其他几种方法,如果这些方法不能解决您的问题,请研究它们。遵循这两种方法都会返回一个带有斑点的二进制图像。您可以使用这些斑点的中心作为颜色鲜艳的对象的矩阵坐标。
通过 3 个中心斑点 A'、B' 和 C',您将能够找到您正在寻找的平面,如下图所示:
说明:平面可以表示为点(位置)和法线(方向)。考虑到所有对象都将恰好位于您要查找的平面上,因此您需要的只是 3 个点 A、B、C,它们将代表该平面内的三角形。该三角形法线等于 (A - B) x (C - B) - 这里 x 表示叉积 - 并且与平面相同。因此,您的平面将是这 3 个点和该三角形法线中的任何一个。如果对象的尺寸很大,则需要考虑它们来定义平面位置。
Kinect returns to you a matrix deph-map that represents the distance of any surface to the sensor and following the pinhole camera model it's possible to align each depth measure with a correspondent RGB value. I will consider that you already know how to correlate each pixel of the depth matrix with it's X,Y,Z on the space and it's RGB value. If not, you will need to do further research and understand how the stereo correlation is done between the depth sensor and the RGB camera.
You asked two completely different questions here. The first one is easily solvable with some basic geometry notion, but is necessary to solve the second one first to find the object's position on space.
There is several approaches to find the brightly colored objects. If your sensor will record a static scene, it's possible to use Background Subsctraction. This will produce you a binary image representing the pixels with different values from a previously trained background model. As your objects will explicitly have brighter colors than the background, you can simple apply a Thresholding Segmentation. Just convert the RGB to a HSL image and look to higher Luminance values. There are several other methods, research for them if those don't solve your problem. Following both of those methods will return to you a binary image with blobs. You can use the center of those blobs as the matrix coordinates of your brightly colored objects.
With 3 center blobs A', B' and C' you will be able to find the plane that you are looking for, as represented in the picture below:
Explanation: A plane can be represented as a point(position) and a normal(orientation). Considering that all your objects will be exactly at the plane you are trying to find, all you need is 3 points, A, B, C that will represent a triangle inside that plane. This triangle normal is equal to (A - B) x (C - B) - here x represents the cross product - and is the same as the plane. So, your plane will be anyone of those 3 points and that triangle normal. If the object's dimensions are significant, you will need to take them in consideration to define your plane position.