소스 검색

add screenshot tool

Richard Köhl 2 년 전
부모
커밋
caee9d452e
1개의 변경된 파일17개의 추가작업 그리고 0개의 파일을 삭제
  1. 17 0
      extract.py

+ 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()