From e327c538b04db40d46a57274dfd09f3ff82fd08d Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Thu, 15 Sep 2022 17:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9A=84=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- socket_detector.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/socket_detector.py b/socket_detector.py index ab89ff1..b77b7ac 100644 --- a/socket_detector.py +++ b/socket_detector.py @@ -18,8 +18,7 @@ def main(): # receive data t1 = time.time() size_buff = socket_receive.recv(5) - if size_buff[4] == 0: - + if (size_buff[4] == 0): n_rows, n_cols = size_buff[0] << 8 | size_buff[1], size_buff[2] << 8 | size_buff[3] data_size = n_rows * n_cols * 3 print(data_size) @@ -48,6 +47,15 @@ def main(): socket_send.send(b'Q') print('Q send success') print((time.time()-t1)) + elif (size_buff[4] == 1): + detector = WoodClass(w=4096, h=1200, n=3000, debug_mode=False) + detector.correct() + detector.fit_pictures(data_path=r"C:\Users\FEIJINTI\PycharmProjects\wood_color") + socket_send.send(b'G') + elif (size_buff[4] == 2): + pass + +