我正在使用深度学习(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图像和点云之间使用逐像素对齐的信息。
我该怎么办?有什么话题吗?
提前感谢
Intel在https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/distance_to_object.ipynb处发布了有关相同问题的python笔记本>
他们的工作如下:
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))
希望此帮助