def convert_depth_image(self, ros_image):
# Use cv_bridge() to convert the ROS image to OpenCV format
try:
# Convert the depth image using the default passthrough encoding
depth_image = self.cv_bridge.imgmsg_to_cv2(ros_image, "passthrough")
except CvBridgeError, e:
print e
# Convert the depth image to a Numpy array
self.depth_array = np.array(depth_image, dtype=np.float32)
评论列表
文章目录