2 Commit-ok 83be77c1b5 ... a39aaa2021

Szerző SHA1 Üzenet Dátum
  Richard Köhl a39aaa2021 rename image 1 éve
  Richard Köhl caee9d452e add screenshot tool 1 éve
3 módosított fájl, 18 hozzáadás és 1 törlés
  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