How to convert depth point to color coordinate in orbbec unity SDK?

There is world to depth or depth to world but I can’t find any function or variable related to color in unity SDK package.
What can I do for converting depth to color?
Thanks to advice!
Best regards,

do you mean given a depth point coordinate you want to get the coordinate of the corresponding colour pixel?

Im currently doing this by matching the depth image to the colour image pixel for pixel although I don’t know if its accurate yet, it seems to roughly work so far but i’m only in the early stages.

I have also read that there could be a way to receive a registered image, that is, one that matches properly but I don’t know the details of this


1 Like

Thanks to reply.
If color image size is 640 X 480, it is same as depth image.
But I use “Astra Pro” and my project uses 1280 X 720 size.
I want to change depth position to color coordinates of 1280X720.
Can it work?

Best regards,

how about you scale the image?

also use 640 x 480 for your colour image, then do something like this:

Vector2 newXY = new Vector2( (oldPointX / 640) * Screen.width, (oldPointY / 480) * Screen.height );

where oldPointX and oldPointY are your original points at cam resolution of 640x480 and newXY will be your new XY at the current screen resolution (or you can substitute whatever resolution you are aiming for)


actually this will only work at close range, obviously the further away the surface the more the depth and colour images separate, we need depth to color registration to be enabled and then what ive stated above should work