def depth_callback(self,data):
try:
self.depth_image= self.br.imgmsg_to_cv2(data, desired_encoding="passthrough")
except CvBridgeError as e:
print(e)
# print "depth"
depth_min = np.nanmin(self.depth_image)
depth_max = np.nanmax(self.depth_image)
depth_img = self.depth_image.copy()
depth_img[np.isnan(self.depth_image)] = depth_min
depth_img = ((depth_img - depth_min) / (depth_max - depth_min) * 255).astype(np.uint8)
cv2.imshow("Depth Image", depth_img)
cv2.waitKey(5)
# stream = open("/home/chentao/depth_test.yaml", "w")
# data = {'img':depth_img.tolist()}
# yaml.dump(data, stream)
image_to_world.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录