def deal_image(self , image):
# index = len(self.obs_origin)
# image_end = []
# if index < pms.history_number:
# image_end = self.obs_origin[0:index]
# for i in range(pms.history_number - index):
# image_end.append(image)
# else:
# image_end = self.obs_origin[index - pms.history_number:index]
#
# image_end = np.concatenate(image_end)
# # image_end = image_end.reshape((pms.obs_height, pms.obs_width, pms.history_number))
# obs = cv2.resize(cv2.cvtColor(image_end , cv2.COLOR_RGB2GRAY) / 255. , (pms.obs_height , pms.obs_width))
obs = cv2.resize(image, (pms.obs_height, pms.obs_width))
# obs = np.transpose(np.array(obs), (2, 0, 1))
return obs
评论列表
文章目录