From 6bdc464ca9ea5af16387bfc64e07092ead84ab4b Mon Sep 17 00:00:00 2001
From: "li.zhenye"
Date: Thu, 11 Aug 2022 22:29:33 +0800
Subject: [PATCH] =?UTF-8?q?[ext]=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=E8=AF=BB=E5=8F=96=E4=B8=8E=E6=89=93=E5=8D=B0=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.py | 4 ++--
valve_test.py | 9 +++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/config.py b/config.py
index e03fadc..18c4450 100644
--- a/config.py
+++ b/config.py
@@ -28,8 +28,8 @@ class Config:
rgb_tobacco_model_path = r"models/tobacco_dt_2022-08-05_10-38.model"
rgb_background_model_path = r"models/background_dt_2022-08-09_16-08.model"
threshold_low, threshold_high = 10, 230
- threshold_s = 190
- rgb_size_threshold = 4
+ threshold_s = 190 # 饱和度的最高允许值
+ rgb_size_threshold = 4 # rgb的尺寸限制
# mask parameter
target_size = (1024, 1024) # (Width, Height) of mask
diff --git a/valve_test.py b/valve_test.py
index 86d05c1..a308ccb 100755
--- a/valve_test.py
+++ b/valve_test.py
@@ -35,7 +35,16 @@ m. 模式切换:测下一个喷阀还是重发?
print("我在等连接...")
self.c, addr = self.s.accept() # 建立客户端连接
print('和它的链接建立成功了:', addr)
+ self.c.settimeout(0.1)
while True:
+ data = ''
+ try:
+ data = self.c.recv(1024)
+ except Exception as e:
+ print(f"===================================================================")
+ if len(data) > 0:
+ print("receive data!!!")
+ print(data)
value = input(self.reminder)
if value == 'q':
print("好的,我退出啦")