def callback_camera_y(self, data):
# format: rgb8; jpeg compressed bgr8
np_img = np.fromstring(data.data, dtype=np.uint8)
img = cv2.imdecode(np_img, cv2.CV_LOAD_IMAGE_COLOR)
img = cv2.cvtColor(cv2.resize(img, (self.width, self.height)), cv2.COLOR_BGR2GRAY)
self.image_y = np.reshape(img, newshape=(self.width, self.height, 1)) / 256.0
评论列表
文章目录