2 次代码提交 83be77c1b5 ... a39aaa2021

作者 SHA1 备注 提交日期
  Richard Köhl a39aaa2021 rename image 1 年之前
  Richard Köhl caee9d452e add screenshot tool 1 年之前
共有 3 个文件被更改,包括 18 次插入1 次删除
  1. 1 1
      dungeon.py
  2. 17 0
      extract.py
  3. 0 0
      templates/dungeon/to_battle.png

+ 1 - 1
dungeon.py

@@ -11,7 +11,7 @@ from helper import (
 
 # templates
 templates = {
-    "to_battle": cv2.imread("templates/dungeon/to_battle2.png"),
+    "to_battle": cv2.imread("templates/dungeon/to_battle.png"),
     "attack": cv2.imread("templates/dungeon/attack.png"),
     "auto_battle": cv2.imread("templates/dungeon/auto_battle.png"),
     "ok": cv2.imread("templates/dungeon/ok.png"),

+ 17 - 0
extract.py

@@ -0,0 +1,17 @@
+import cv2
+
+file_path = "test/20240112_132814.jpg"
+
+topLeftX = 1029
+topLeftY = 480
+bottomRightX = 1252
+bottomRightY = 734
+
+image = cv2.imread(file_path)
+cropped = image  # [topLeftY:bottomRightY, topLeftX:bottomRightX]
+
+# cv2.imwrite("templates/dungeon/angus.png", cropped)
+
+cv2.imshow("preview", cropped)
+cv2.waitKey(0)
+cv2.destroyAllWindows()

+ 0 - 0
templates/dungeon/to_battle2.png → templates/dungeon/to_battle.png