如何使用Kinect从一个不同的物体获得真实世界坐标(x, y, z) ?

时间:2023-01-05 21:19:29

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.

我需要使用Kinect来获得真实世界坐标(x, y, z)。实际上,我想要的是Kinect的x, y, z距离(米)。我必须从一个独特的物体(例如一个黄色的小盒子)中得到这些坐标,颜色是不同的颜色。

Here you can see an example of the scenario

这里您可以看到一个场景的示例。

如何使用Kinect从一个不同的物体获得真实世界坐标(x, y, z) ?

I want the distance (x, y, z in meters) of the yellow object in the shelf.

我想要的是架子上黄色物体的距离(x, y, z)

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.

首先,我想知道这样做是否可行?因此,如果您发送一些可以帮助我完成这项任务的链接/代码,我将不胜感激。

2 个解决方案

#1


4  

You would need to use both the Color Stream and the Depth Stream.

您需要使用颜色流和深度流。

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.

首先,使用颜色流,您需要收集与您正在查找的颜色匹配的像素数组,然后从深度流中查找这些像素的深度数据,以获得与摄像机平均距离。得到Z。

To get the X and Y you would use the math from this answer.

为了得到X和Y,你可以用这个答案来计算。

#2


0  

The Z distance (from object to kinect) you get from Position.Z of a specific Joint. So there is no problem with getting it. The X and Y. It depends do you want to get distance from joint to joint or from joint to Kinect. You can calculate it. Use the math. You need to take angle of view of kinect and distance from it

你从位置得到的Z距离(从物体到kinect)。一个特定关节的Z。所以得到它是没有问题的。X和y,取决于你想从关节到关节还是从关节到Kinect的距离。你可以计算一下。使用数学。你需要从kinect的角度出发,并与之保持距离。

#1


4  

You would need to use both the Color Stream and the Depth Stream.

您需要使用颜色流和深度流。

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.

首先,使用颜色流,您需要收集与您正在查找的颜色匹配的像素数组,然后从深度流中查找这些像素的深度数据,以获得与摄像机平均距离。得到Z。

To get the X and Y you would use the math from this answer.

为了得到X和Y,你可以用这个答案来计算。

#2


0  

The Z distance (from object to kinect) you get from Position.Z of a specific Joint. So there is no problem with getting it. The X and Y. It depends do you want to get distance from joint to joint or from joint to Kinect. You can calculate it. Use the math. You need to take angle of view of kinect and distance from it

你从位置得到的Z距离(从物体到kinect)。一个特定关节的Z。所以得到它是没有问题的。X和y,取决于你想从关节到关节还是从关节到Kinect的距离。你可以计算一下。使用数学。你需要从kinect的角度出发,并与之保持距离。