- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)"
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi NeuroGalaxy,
You can use this example to get the distance:
https://github.com/IntelRealSense/librealsense/tree/master/examples/C/distance
Regards,
Alexandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. Is it possible to get this code in Python?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi NeuroGalaxy,
This python sample will help: https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/python-tutorial-1-depth.py
Regards,
Alexandra

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page