- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried many different distance calculation using this realsense D435 camera. I program mainly in python and mostly uses RGB input rather than depth. I want to calculate distance between the camera to an nearest object. If possible to calculate the distance in depth or RGB, please advice.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Intel has created a tutorial in Python for measuring distance that is called distance_to_object.
https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried this method before. However it uses trained information of the dog and other classes, a deep learning based detection, then draw distance to the detected box.
Is it possible to get distance, based on objects very close to the camera? (without using deep learning to detect objects, assuming detection is based on an object close to camera or not? )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A possible solution is offered in the link below. In the second comment, a user looked at the C++ code for measuring depth and adapted it for Python.
**************
pipeline = rs.pipeline()
config = rs.config()
profile = pipeline.start(config)
frames = pipeline.wait_for_frames()
while True:
depth_frame = frames.get_depth_frame()
zDepth = depth_frame.get_distance(int(x),int(y))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. I tried using this method and seems to be working. I created a colour detection program and drawn bounding boxes around them and calculated the midpoints. I then added those midpoints to the depth image, which prints distance in cm.
I measured it in real world using a measurement tape, it seems more or less correct but the distance sometimes goes over or below by few cm. I am using resolution 640 x 360 for colour and depth image. Is this happening because the depth error increases if the resolution gets lower?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The 400 Series cameras have something called 'RMS Error'. What this means is that as the distance of an object from the camera increases, the RMS Error (depth noise) increases, causing the accuracy of the depth readings to drift. At close range, this drift is small. After around 3 meters distance and beyond, the error starts to increase noticably. The D435's error-over-distance is significantly more than the D415 model due to the D435's hardware design.
The error over distance can be observed on the chart below. The D435 is the upper of the two curves. Left-click on the image to view it in full size.
You can view the Intel camera tuning guide the chart was taken from at this link:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page