Software Archive
Read-only legacy content
17061 Discussions

Knowing xyz coordinate of specific region in RGB image

harold_y_
Beginner
436 Views

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
436 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].

0 Kudos
samontab
Valued Contributor II
436 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.

0 Kudos
carlos_c_6
Beginner
436 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

0 Kudos
linhuan_h_
Beginner
436 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.

0 Kudos
Reply