RealSense ROS上的Pointcloud和RGB图像对齐

问题描述 投票:2回答:1

我正在使用深度学习(Tensorflow对象检测)和Real Sense D425摄像机开发狗检测系统。我正在使用英特尔(R)实感(TM)ROS包装器,以便从相机中获取图像。

我正在执行“ roslaunch rs_rgbd.launch”,并且我的Python代码已订阅“ / camera / color / image_raw”主题,以获得RGB图像。使用此图像和对象检测库,我能够以框级别(xmin,xmax,ymin,ymax)推断(20 fps)狗在图像中的位置]

我想用对象检测信息(xmin,xmax,ymin,ymax)裁剪PointCloud信息。并确定狗是在相机附近还是附近。我想在RGB图像和点云之间使用逐像素对齐的信息。

我该怎么办?有什么话题吗?

提前感谢

tensorflow object-detection ros point-clouds realsense
1个回答
0
投票

Intel在https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb处发布了有关相同问题的python笔记本>

他们的工作如下:

  1. 获取颜色框和深度框(在您的情况下为点云)enter image description hereenter image description here

  2. 将深度调整为彩色enter image description here

  3. 使用ssd检测色框内的狗

  4. enter image description hereenter image description here

  1. 获取检测到的狗的平均深度并转换为米
  2. depth = np.asanyarray(aligned_depth_frame.get_data())
    # Crop depth data:
    depth = depth[xmin_depth:xmax_depth,ymin_depth:ymax_depth].astype(float)
    
    # Get data scale from the device and convert to meters
    depth_scale = profile.get_device().first_depth_sensor().get_depth_scale()
    depth = depth * depth_scale
    dist,_,_,_ = cv2.mean(depth)
    print("Detected a {0} {1:.3} meters away.".format(className, dist))
    

希望此帮助

© www.soinside.com 2019 - 2024. All rights reserved.