Software Archive
Read-only legacy content
17060 Discussions

Image to color coordinates vector

Alessio_X_
Beginner
1,273 Views

Hi folks,

I am learning how to use the SDK for R200 and I am trying to obtain 3D world coordinates.
I got how to use Quer​yVertices() function from a depth image, but I would like to map color coordinates with depth coordinates to correctly parse pixels in my image. Following the Projection sample, I am going to use ColorToDepth(), but I am missing the vector of color coordinates and I don't know how to construct from the PXCImage sample->color. Based on my knowledge of images as matrices in MatLab, I was thinking of creating a vector by concatenating over columns, isn't it?

Thank you in advance.

0 Kudos
3 Replies
Xusheng_L_Intel
Employee
1,273 Views

ColorToDepth does not need the color image but the color x, y values. It requires the depth image from the camera (which contains the depth data as well as the camera calibration parameters.) Did I answer your question? Thanks!

0 Kudos
samontab
Valued Contributor II
1,273 Views

Hey David, that sounds interesting!

So, the depth image produced by the camera not only contains the depth information, but also the camera calibration parameters? I didn't know that! I assumed those parameters were unavailable at the library level.

Where are these parameters stored? in the image metadata? Do you have any pointer for more information on this?

0 Kudos
jb455
Valued Contributor II
1,273 Views

Hi Alessio,

You need to pass the ColourToDepth projection an array of points you're interested in, so if you only want to know about a single point you can pass it an array containing that one point; or if you want to project the whole colour image you'll have to loop through all pixels in the colour image and construct an array containing each point (ie, for x = 0 to width, for y = 0 to height, array.push(x,y)). Beware though, projecting each pixel in a 640*480 image takes over 60 seconds to process on my PC  - if you're using a higher res image this will take even longer.You may be better off singly projecting each point as you need it.

Hope this helps!
James

0 Kudos
Reply