修改了接收图片类型为float32

This commit is contained in:
FEIJINTI 2022-09-28 12:35:04 +08:00
parent 7e9175c7fd
commit 39dc58891e

View File

@ -200,7 +200,7 @@ def parse_protocol(data: bytes) -> (str, any):
except AssertionError: except AssertionError:
logging.error('图像指令IM转换失败数据长度错误') logging.error('图像指令IM转换失败数据长度错误')
return '', None return '', None
img = np.frombuffer(img, dtype=np.uint8).reshape((n_rows, n_cols, -1)) img = np.frombuffer(img, dtype=np.float32).reshape((n_rows, n_cols, -1))
return cmd, img return cmd, img
elif cmd == 'TR': elif cmd == 'TR':
data = data.decode('ascii') data = data.decode('ascii')