예제 #1
0
파일: downie.py 프로젝트: xerosbeat/IkaLog
    def _init_scene(self, debug=False):
        self.mask_gear_window = IkaMatcher(
            430,
            165,
            640,
            90,
            img_file='downie_lottery.png',
            threshold=0.9,
            orig_threshold=0.100,
            bg_method=matcher.MM_NOT_BLACK(),
            fg_method=matcher.MM_BLACK(),
            label='downie/slot_window',
            debug=debug,
        )

        self.mask_cancel = IkaMatcher(
            562,
            569,
            73,
            20,
            img_file='downie_lottery.png',
            threshold=0.9,
            orig_threshold=0.100,
            bg_method=matcher.MM_NOT_WHITE(),
            fg_method=matcher.MM_WHITE(),
            label='downy/cancel',
            debug=debug,
        )

        self.mask_run = IkaMatcher(
            814,
            569,
            123,
            42,
            img_file='downie_lottery.png',
            threshold=0.9,
            orig_threshold=0.100,
            bg_method=matcher.MM_NOT_WHITE(),
            fg_method=matcher.MM_WHITE(),
            label='downy/run',
            debug=debug,
        )

        self.number_recoginizer = NumberRecoginizer()
        self._client_local = APIClient(local_mode=True)
예제 #2
0
    def _init_scene(self, debug=False):
        self.mask_win = IkaMatcher(
            651,
            47,
            99,
            33,
            img_file='result_detail.png',
            threshold=0.950,
            orig_threshold=0.05,
            bg_method=matcher.MM_NOT_WHITE(),
            fg_method=matcher.MM_WHITE(),
            label='result_detail:WIN',
            debug=debug,
        )

        base_dir = IkaUtils.baseDirectory()
        languages = Localization.get_game_languages()
        for lang in languages:
            mask_file = os.path.join(base_dir, 'masks', lang,
                                     'result_detail.png')
            if os.path.exists(mask_file):
                break

        if not os.path.exists(mask_file):
            mask_file = os.path.join(base_dir, 'masks', 'result_detail.png')
        winlose = cv2.imread(mask_file)
        self.winlose_gray = cv2.cvtColor(winlose, cv2.COLOR_BGR2GRAY)

        self._white_filter = matcher.MM_WHITE()
        self.udemae_recoginizer = UdemaeRecoginizer()
        self.number_recoginizer = NumberRecoginizer()

        # for SplatFest (ja)
        self.fest_gender_recoginizer = character_recoginizer.FesGenderRecoginizer(
        )
        self.fest_level_recoginizer = character_recoginizer.FesLevelRecoginizer(
        )

        self.load_akaze_model()
        self._client_local = APIClient(local_mode=True)
        # APIClient(local_mode=False, base_uri='http://localhost:8000')
        self._client_remote = None