def test_watervillage_sift(self): threshold = unit_constants.cherrystone_watervillage_sift_threshold for frame in range(self.frame_count): wargroove_ctrl.vision.load_frame(self.__get_eval_folder() + str(frame) + '.png') match = wargroove_ctrl.find_building_with_sift('cherrystone_watervillage', threshold=threshold) wargroove_ctrl.log_match_for_evaluation(self.id(), match, threshold) assert_that(match).described_as('match in frame ' + str(frame)).is_not_none() assert_that(match.location[0]).described_as('match x value in frame ' + str(frame)).is_between(302, 354) assert_that(match.location[1]).described_as('match y value in frame ' + str(frame)).is_between(516, 574)
def test_watervillage_sift(self): threshold = unit_constants.cherrystone_watervillage_sift_threshold incorrect_location_count = 0 for frame in range(self.frame_count): wargroove_ctrl.vision.load_frame(self.__get_eval_folder() + str(frame) + '.png') match = wargroove_ctrl.find_building_with_sift( 'cherrystone_watervillage', threshold=threshold) wargroove_ctrl.log_match_for_evaluation(self.id(), match, threshold) if match is not None: if match.location[0] < 302 or match.location[ 0] > 354 or match.location[1] < 516 or match.location[ 1] > 574: incorrect_location_count = incorrect_location_count + 1 assert_that(incorrect_location_count).is_equal_to(0)