Community
cancel
Showing results for 
Search instead for 
Did you mean: 
harold_y_
Beginner
142 Views

Knowing xyz coordinate of specific region in RGB image

Hi there,

I googled many referece, but couldn't found what I need.

What I want to do is simple.

1. Find target by 2D RGB image, and knowing the target's bounding box in 2D image coordinate.

2. Get the corresponding x-y-z points in camera coordinate inside this bounding box. That is, extract point cloud from 2D RGB information.

I can do step 1 by converting image to cv::mat, and locate the target.

But still don't know how to get the point cloud inside the specific region.

Please help me...

 

0 Kudos
4 Replies
jb455
Valued Contributor II
142 Views

If you already have the bounding points in the colour image (i,j), you can use Projection.MapColorToDepth to map those points to the depth image (u,v); then Projection.QueryVertices to get the array of world/camera (x,y,z) coordinates (AKA vertices).

The camera coordinates for colour point (i,j) which maps to depth point (u,v) is then vertices[u + v * depthImage.width].

samontab
Valued Contributor II
142 Views

What James said is correct.

Also, remember that not all points necessarily will have valid depth values, so you need to consider that in your application, and depth data will usually be noisy, so you will need to do some smoothing as well.

carlos_c_6
Beginner
142 Views

Hi samontab.

I have the same problem. I like to map de bound box of face to depth x,y,z coordinates. Do you have some example about this ?

Best regards.

Carlos Cubas

linhuan_h_
Beginner
142 Views

James B. wrote:

If you already have the bounding points in the colour image (i,j), you can use Projection.MapColorToDepth to map those points to the depth image (u,v); then Projection.QueryVertices to get the array of world/camera (x,y,z) coordinates (AKA vertices).

The camera coordinates for colour point (i,j) which maps to depth point (u,v) is then vertices[u + v * depthImage.width].

Hi,James. Is there any precision difference between Projection.QueryVertices and ProjectColorToCamera.

Reply