From 15a126a3ea5ec6ad85e40a92472afb0d8060ffce Mon Sep 17 00:00:00 2001
From: "li.zhenye"
Date: Tue, 9 Aug 2022 11:46:16 +0800
Subject: [PATCH] =?UTF-8?q?[ext]=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=A8=AA?=
=?UTF-8?q?=E5=90=91=E8=86=A8=E8=83=80/=E6=A8=AA=E5=90=91padding?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config.py | 1 +
utils.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.py b/config.py
index 20f0d66..e8fcfd9 100644
--- a/config.py
+++ b/config.py
@@ -34,6 +34,7 @@ class Config:
# mask parameter
target_size = (1024, 1024) # (Width, Height) of mask
valve_merge_size = 2 # 每两个喷阀当中有任意一个出现杂质则认为都是杂质
+ valve_horizontal_padding = 3 # 喷阀横向膨胀的尺寸,应该是奇数,3时表示左右各膨胀1
max_open_valve_limit = 25 # 最大同时开启喷阀限制,按照电流计算,当前的喷阀可以开启的喷阀 600W的电源 / 12V电源 = 50A, 一个阀门1A
# save part
diff --git a/utils.py b/utils.py
index 9f39820..6bd1bcb 100755
--- a/utils.py
+++ b/utils.py
@@ -170,7 +170,7 @@ def valve_merge(img: np.ndarray, merge_size: int = 2) -> np.ndarray:
def valve_expend(img: np.ndarray) -> np.ndarray:
- kernel = np.ones((1, 3), np.uint8)
+ kernel = np.ones((1, Config.valve_horizontal_padding), np.uint8)
img = cv2.dilate(img, kernel, iterations=1)
return img