From 39dc58891e9094e866a2ed6bbd8a29efaa3661f5 Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:35:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=B1=BB=E5=9E=8B=E4=B8=BAfloat32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index bac6ac6..ff6304b 100644 --- a/utils.py +++ b/utils.py @@ -200,7 +200,7 @@ def parse_protocol(data: bytes) -> (str, any): except AssertionError: logging.error('图像指令IM转换失败,数据长度错误') 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 elif cmd == 'TR': data = data.decode('ascii')