소스 검색

fix(KekkaiUtilize): Lower the image matching threshold #403

ryland 2 년 전
부모
커밋
f409bdbbbe
3개의 변경된 파일과 5개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      dev_tools/assets_test.py
  2. 1 1
      tasks/KekkaiUtilize/assets.py
  3. 1 1
      tasks/KekkaiUtilize/realm/image.json

+ 3 - 3
dev_tools/assets_test.py

@@ -34,10 +34,10 @@ def detect_ocr(file: str, target: RuleOcr):
 
 
 # 图片文件路径 可以是相对路径
-IMAGE_FILE = r"C:\Users\萌萌哒\Desktop\2024-08-15_23-01-04-220349.png"
+IMAGE_FILE = r"C:\Users\Ryland\Desktop\363385164-41fa341c-3efc-43f8-91b5-0cdd065ed8cf.png"
 if __name__ == '__main__':
-    from tasks.GlobalGame.assets import GlobalGameAssets
-    targe = GlobalGameAssets.I_G_ACCEPT
+    from tasks.KekkaiUtilize.assets import KekkaiUtilizeAssets
+    targe = KekkaiUtilizeAssets.I_SHI_CARD
     print(detect_image(IMAGE_FILE, targe))
 
     # ocr demo

+ 1 - 1
tasks/KekkaiUtilize/assets.py

@@ -31,7 +31,7 @@ class KekkaiUtilizeAssets:
 	# 育成 
 	I_SHI_GROWN = RuleImage(roi_front=(595,291,35,38), roi_back=(530,254,181,198), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_grown.png")
 	# 结界卡 
-	I_SHI_CARD = RuleImage(roi_front=(886,290,38,56), roi_back=(870,276,75,86), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_card.png")
+	I_SHI_CARD = RuleImage(roi_front=(886,290,38,56), roi_back=(870,276,75,86), threshold=0.7, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_card.png")
 	# description 
 	I_SHI_DEFENSE = RuleImage(roi_front=(294,298,49,56), roi_back=(215,207,208,221), threshold=0.8, method="Template matching", file="./tasks/KekkaiUtilize/realm/realm_shi_defense.png")
 	# 收取经验(没有满的图) 

+ 1 - 1
tasks/KekkaiUtilize/realm/image.json

@@ -14,7 +14,7 @@
     "roiFront": "886,290,38,56",
     "roiBack": "870,276,75,86",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "结界卡"
   },
   {