How to convert Point Cloud Data from AstraS Depth image?

Hi. everyone.

Now I trying to convert point cloud data from ASTRA depth image.
But I don’t know IR sensor focal length.

I actually measured the depth image.
Calculation result became the next focal length .
fx = 625.0
fy = 595.0
But I do not know whether or not the correct answer .

Would you tell me the focal length of IR sensor?

fx = 625.0;
fy = 595.0;
w = 640;
h = 480;

for j=1:h
for i =1:w
world_z = Depth(j,i);
world_x = ((i-240)./fx)*world_z;
world_y = ((j-320)./fy)*world_z;

1 Like

Are you using OpenNI or Astra SDK? Both provide built-in ways to convert depth-to-world points.

Hi Josh. Thank you for reply.

I am using OpenNI now.

Both provide built-in ways to convert depth-to-world points.

Wow. I didn’t know, I can use convert depth-to-world points by Astra SDK.

Is this function ? → “astra_convert_depth_to_world”
I want to use this function!
I’m looking for a document of how to use this function .
But not find .

Would you teach me, how to use function!

In Astra SDK, if you start the PointStream, it will deliver you depth frames where each pixel has already been converted to a Vector3f which is x, y, z in real world millimeters.

In OpenNI2, there is a CoordinateConverter class where you can convert depth to world or vice versa.


I’ll try it.
Thank you very much!!!

Hello, I know it’s been a while but I’m trying to get this data exactly but my problem is that the information i get is exactly identical in x,y,z… the data is like this(Getting the PointMap):

11 11 11 255
100 100 100 255

For every point, Idk how to convert this into the actual coordinates. My first intuition told me that it was the depth in mm repeated in x,y,z. But I understood from the explanation given here that you actually get the 3D coords. Not again the depth info.