如何使用Kinect从不同的对象获取真实世界的坐标(x,y,z)
我必须使用Kinect获取真实世界的坐标(x,y,z).实际上,我想要距Kinect的x,y,z距离(以米为单位). 我必须从场景中的唯一对象(例如,一个黄色的小盒子)获取这些坐标,并以不同的颜色上色.
I have to get the real world coordinates (x, y, z) using Kinect. Actually, I want the x, y, z distance (in meters) from Kinect. I have to get these coordinates from a unique object (e.g. a little yellow box) in the scenario, colored in a distinct color.
在这里您可以看到该场景的一个示例
Here you can see an example of the scenario
我想要架子上黄色物体的距离(x,y,z以米为单位).
I want the distance (x, y, z in meters) of the yellow object in the shelf.
请注意,在此情况下不需要一个人(骨骼).
Note that is not required a person (skeleton) in the scenario.
首先,我想知道是否有可能且容易做到? 因此,如果您发送一些可以帮助我完成此任务的链接/代码,我将不胜感激.
First of all, I would like to know if it is possible and simple to do? So, I would appreciate if you send some links/code that could help me doing this task.
首先,使用Color Stream
,您需要收集与所需颜色匹配的像素阵列,然后从Depth Stream
查找这些像素的深度数据,以获取与相机的平均距离.那给你Z
.
First, using the Color Stream
you would need to collect an array of pixels that match the color you are looking for and then lookup the depth data from the Depth Stream
for those pixels to get an average distance from the camera. That gives you the Z
.
要获取X
和Y
,您可以使用此答案中的数学方法.
To get the X
and Y
you would use the math from this answer.