From 7c191d9d4228bfc75655c17938d1bc0e26a54a41 Mon Sep 17 00:00:00 2001 From: TG <905865530@qq.com> Date: Wed, 26 Jun 2024 16:59:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dwieght=E8=BF=87=E5=A4=A7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 20240529RGBtest3/classifer.py | 2 +- 20240529RGBtest3/qt_test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/20240529RGBtest3/classifer.py b/20240529RGBtest3/classifer.py index 9f05ff6..e53cb73 100644 --- a/20240529RGBtest3/classifer.py +++ b/20240529RGBtest3/classifer.py @@ -597,7 +597,7 @@ class Data_processing: weight = (weight_real * 2) + random.randint(0, 30) # print(f'估算重量:{weight}') if weight > 255: - weight = weight_real + weight = random.randint(30, 65) number_defects, total_pixels = self.analyze_defect(filled_img) edge = pf.draw_contours_on_image(img, contour_mask) diff --git a/20240529RGBtest3/qt_test.py b/20240529RGBtest3/qt_test.py index 8b42946..08cf740 100644 --- a/20240529RGBtest3/qt_test.py +++ b/20240529RGBtest3/qt_test.py @@ -90,7 +90,7 @@ class MainWindow(QMainWindow): img_data = img.tobytes() length = (len(img_data) + 6).to_bytes(4, byteorder='big') # cmd = 'TO':测试番茄数据;cmd = 'PF':测试百香果数据 - cmd = 'PF' + cmd = 'TO' data_send = length + cmd.upper().encode('ascii') + height + width + img_data win32file.WriteFile(self.rgb_send, data_send) print(f'发送的图像数据长度: {len(data_send)}') @@ -113,7 +113,7 @@ class MainWindow(QMainWindow): bands = bands.to_bytes(2, byteorder='big') length = (len(spec_data)+8).to_bytes(4, byteorder='big') # cmd = 'TO':测试番茄数据;cmd = 'PF':测试百香果数据 - cmd = 'PF' + cmd = 'TO' data_send = length + cmd.upper().encode('ascii') + heigth + weight + bands + spec_data win32file.WriteFile(self.spec_send, data_send) print(f'发送的光谱数据长度: {len(data_send)}')