Software Archive
Read-only legacy content
17061 Discussions

Mapped points from Color to Depth Issue

anjani_j_
Beginner
337 Views

Hello All,

Mapped points from a valid color coordinate to depth is showing as negative e.g. :

lets say i take some color image coordinate (400, 402) and map the coordinate to depth (u,v) pixel locations than it shows as (-1, -1).

Please note here that those coordinate were not far from the camera nor even near, as that issue i already know this problem from one of the posts from sebastian.

Code :         

PXCPointF32 *posij = new PXCPointF32[no_of_points];

PXCPointF32 *posuv = new PXCPointF32[no_of_points];

projection->MapColorToDepth(_depth, no_of_points, posij, posuv);

                                                            where _depth is PXCImage* depth image;

Please help.

Regards,

Anjani J.

0 Kudos
1 Solution
jb455
Valued Contributor II
337 Views

If your mapped point returns (-1,-1), it usually means that there is no point in the depth image corresponding to the point you've asked for. So either it's not in depth range (though you've said it should be), or it's outside of the depth frame: becuase the two cameras point to different locations, some edges of the colour photo can't be seen by the depth lens. If your points aren't too close to the edges you should be safe here.

Though looking at your code, just checking you are filling in your posij array? ie, posij[0] = new PXCPoint(400,402);

View solution in original post

0 Kudos
1 Reply
jb455
Valued Contributor II
338 Views

If your mapped point returns (-1,-1), it usually means that there is no point in the depth image corresponding to the point you've asked for. So either it's not in depth range (though you've said it should be), or it's outside of the depth frame: becuase the two cameras point to different locations, some edges of the colour photo can't be seen by the depth lens. If your points aren't too close to the edges you should be safe here.

Though looking at your code, just checking you are filling in your posij array? ie, posij[0] = new PXCPoint(400,402);

0 Kudos
Reply