mirror of
https://github.com/NanjingForestryUniversity/supermachine-wood.git
synced 2025-11-08 10:13:53 +00:00
修改了接收图片类型为float32
This commit is contained in:
parent
7e9175c7fd
commit
39dc58891e
2
utils.py
2
utils.py
@ -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')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user