Items with no label
3338 Discussions

align-depth2color

NeuroGalaxy
Beginner
1,494 Views

Could you explain what does the below line of code means or do.

source from:

http://docs.ros.org/kinetic/api/librealsense2/html/align-depth2color_8py_source.html

 

bg_removed = np.where((depth_image_3d > clipping_distance) | (depth_image_3d <= 0), grey_color, color_image)

 

If I want to split the bg_removed into two parameters, for example to x and y. How can I do this? I tried:

x,y = np.where((depth_image_3d > clipping distance)&(depth_image_3d <=0))

but I am getting Value error: "too many values to unpack (expected 2)"

 

0 Kudos
5 Replies
Alexandra_C_Intel
989 Views
Hi NeuroGalaxy, Thank you for your interest in the Intel RealSense cameras. The code line removes background - Sets pixels further than clipping_distance to grey. Regarding your second question, can you please tell me what data do you want in your x, y variables? What specifically are you trying to do? Regards, Alexandra
0 Kudos
NeuroGalaxy
Beginner
989 Views

Thanks for explaining the line of code. I understand it now.

 

I was trying to calculate the distance using the depth information. If I convert it to X,Y and find the mean of this variables (X,Y), will it display the distance in meters?

0 Kudos
Alexandra_C_Intel
989 Views
Hi NeuroGalaxy, You can use this example to get the distance: https://github.com/IntelRealSense/librealsense/tree/master/examples/C/distance Regards, Alexandra
0 Kudos
NeuroGalaxy
Beginner
989 Views

Thank you. Is it possible to get this code in Python?

0 Kudos
Alexandra_C_Intel
989 Views
0 Kudos
Reply