Compare commits

...

2 Commits

Author SHA1 Message Date
6ec1b71d28 update litris with board detection 2023-07-29 20:20:18 +02:00
07d00404d8 update litris with board detection 2023-07-29 20:20:11 +02:00
3 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ from config_file import UserConfigs
# load the original input image and display it to our screen
#filename = "equip/chests/chest_23_32"
path = "equip/wands/"
path = "flappy/"
os.chdir(path)
for entry in os.listdir():

View File

@@ -73,7 +73,7 @@ class Litris(GameBase):
if self.field.get_line_count() >= 6 and self.field.height() <= 2:
if self.field.predict_gaps_in_next_rotation() <= 5:
self.update_move_mode()
self.field = self.stone_id_thread.get_current_board_state()
self.field.state = self.stone_id_thread.get_current_board_state()
self.field.rotate_state()
#self.update_move_mode()
self.field.reset_half_field()

View File

@@ -149,7 +149,7 @@ class NewStoneID(threading.Thread):
for needle_key in self.needles.keys():
#gray_needle = cv.cvtColor(self.needles[needle_key], cv.COLOR_BGR2GRAY)
#thresh_needle = cv.threshold(gray_needle, 0, 255, cv.THRESH_BINARY_INV + cv.THRESH_OTSU)[1]
rectangles = self.vision_stun.find(screenshot, self.needles[needle_key], 0.8, 100)
rectangles = self.vision_stun.find(screenshot, self.needles[needle_key], 0.8, 200)
if len(rectangles) == 0:
continue
points = self.vision_stun.get_click_points(rectangles)