added fruit game support

This commit is contained in:
2022-10-31 16:29:41 +01:00
parent 52e3fd001a
commit 90b7177273

View File

@@ -71,11 +71,12 @@ class Fruit(GameBase):
def get_current_board_state(self):
# get an updated image of the game
screenshot = self.capture_window.get_screenshot()
screenshot = screenshot[900:1100, 1100:1450]
# screenshot = cv.imread("field_farm.jpg")
# gray = cv.cvtColor(screenshot, cv.COLOR_BGR2GRAY)
# thresh = cv.threshold(gray, 0, 255, cv.THRESH_BINARY_INV + cv.THRESH_OTSU)[1]
if self.check_for_button_and_execute(screenshot, self.ok_button, 540, 180):
if self.check_for_button_and_execute(screenshot, self.ok_button, 900, 1100):
cv.waitKey(500)
screenshot = self.capture_window.get_screenshot()