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)}')