From b723dd2901519a95372863b379fda7d7fa695db1 Mon Sep 17 00:00:00 2001 From: TG <905865530@qq.com> Date: Thu, 4 Jul 2024 16:32:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E9=9D=A2=E7=A7=AF=E8=AF=86=E5=88=AB=E5=AF=B9=E8=B1=A1=E4=B8=BA?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=BB=BF=E8=89=B2=E5=8F=B6=E5=AD=90=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E4=BA=8C=E5=80=BC=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 20240627Actual_deployed/classifer.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d431beb..6bc7e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ fabric.properties /20240627Actual_deployed/封装exe/ /20240627Actual_deployed/qt_test/ /20240627Actual_deployed/qt_test/PF/ +/20240627Actual_deployed/image/ diff --git a/20240627Actual_deployed/classifer.py b/20240627Actual_deployed/classifer.py index e4fa367..e8754d4 100644 --- a/20240627Actual_deployed/classifer.py +++ b/20240627Actual_deployed/classifer.py @@ -519,6 +519,7 @@ class Data_processing: org_defect = tomato.bitwise_and_rgb_with_binary(edge, new_bin_img) fore = tomato.bitwise_and_rgb_with_binary(img, mask) fore_g_r_t = tomato.threshold_segmentation(tomato.extract_g_r(fore), threshold=setting.threshold_fore_g_r_t) + filled_img_nogreen = cv2.bitwise_or(filled_img, fore_g_r_t) res = cv2.bitwise_or(new_bin_img, fore_g_r_t) nogreen = tomato.bitwise_and_rgb_with_binary(edge, res) # 统计白色像素点个数 @@ -533,7 +534,7 @@ class Data_processing: # 获取西红柿的尺寸信息 long_axis, short_axis = self.analyze_ellipse(mask) # 获取缺陷信息 - number_defects, total_pixels = self.analyze_defect(filled_img) + number_defects, total_pixels = self.analyze_defect(filled_img_nogreen) # print(filled_img.shape) # print(f'缺陷数量:{number_defects}; 缺陷总面积:{total_pixels}') # cv2.imwrite('filled_img.jpg',filled_img)