def process(state, W, H):
state = cv2.resize(state, (W, H))
state = cv2.cvtColor(state, cv2.COLOR_RGB2GRAY)
#cv2.imwrite('test.png', state)
#state = cv2.normalize(state, state, alpha=0, beta=1, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_32F)
state = np.reshape(state, [W, H, 1])
return state
评论列表
文章目录