Linux and PointCloud

Hello everybody,

I am currently working on application running on Linux and i build the view with Jmonkey engine.
I stream data from the captor to my app and i have few question about the data format. Sorry if the question is not very relevant…

I used the SimpleRead to get the depth data, here my first question:

I use the sensors to get depth data:


depth.create(device, SENSOR_DEPTH);

DepthPixel* pDepth = (DepthPixel*)frame.getData();

// here the size of the array
int nb = (frame.getHeight())*frame.getWidth();

QByteArray array;
for (int j = 0; j<nb;j++, j=j+2) {
u_int16_t i = pDepth[j];
array.append(i);
array.append(i>>8);
}

and then, i send the data.

I get an array of 51200 values. Why ? 320*240 = 76800

Second question:
How do i know the position of each value in the depth matrix ?

Third question:
I read all the post about 3d coordinates. Is there any algorithm to get easily the 3d coordinate ?

Thx in advance,
Regards,

1 Like

Charles,

I’ll try and help.

Q1) I built SimpleRead on OS X and the frame contains the correct amount of data. Could you provide additional code detailing the transfer of the data?

Q2) What kind of position information are you looking for?

Q3) Have you looked at the GitHub project referenced in this post?

Jim