RobotiXX / MuSoHu-data-collection

19 stars 1 forks source link

Depth image quality #4

Open raoshashank opened 1 day ago

raoshashank commented 1 day ago

Hi, Thanks for the awesome dataset. I am trying to extract the point cloud from the depth images from the zed2 data. Here is an example image generated using the parser (uncropped) image I used the intrinsic matrix from the /zed2/zed_node/depth/camera_info topic, specifically:

width = 1280
height = 720
focal_length_x = 523.3953857421875,
focal_length_y = 523.3953857421875,
cx = 648.6547241210938,
cy = 373.26031494140625,
z_min = 0.3
z_max = 20.0
z_scale = 255
z_filter = 5.0

and then calculated the point cloud as follows:

x, y = np.meshgrid(np.arange(width), np.arange(height))
x = (x - cx) / focal_length_x
y = (y - cy) / focal_length_y
z = z_min + depth*(z_max-z_min)/z_scale
pimg = np.stack((np.multiply(x, z), np.multiply(y, z),z), axis=-1)
points = pimg.reshape(-1, 3)
points = points[z.flatten() < z_filter]
colors = image.reshape(-1, 3) / 255.0 
colors = colors[z.flatten() < z_filter]

In open3d, I got the following: Screenshot from 2024-11-06 20-01-51

This doesn't look right to me, please let me know if I'm using the data correctly. Thank you in advance

datar-aniket commented 1 day ago

Can you quickly check the same bag playing using rosbag play and visualize the depth map in RVIZ? in RVIZ you can select depth image directly as depth topic and RGB image as color topic. If the pointcloud is same as per the above image, then can post the bag you are using, and we will try to check with the same bag.