How to use python get distance in depth image using realsense D435?
Camera: realsense D435
Operating system: Ubuntu 16.04
I want to get the distance of a point in image. If I use the aligned image that provided in github, there are many holds and the converted depth pixel to metric value will become 0, 0, 0.
What my idea is:
depth image inpainting
get depth value from depth image
using depth value to calculate distance
Following get distance example in GitHub, the code is:
depth = get_depth_at_pixel(depth_frame, pixel_x, pixel_y) x, y, z = convert_depth_pixel_to_metric_coordinate(depth, pixel_x, pixel_y, camera_intrinsics)
I found that the output
depth is float.
Now, I can get value from depth image, which is in numpy.uint16.(e.g.
depth_image is 300)
Can I convert depth image to double/float, so that I can get the distance?
yes, How can I convert depth image to double/float value?