mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 07:28:21 +08:00
Fix: Searching remain times but image smaller than template
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import List, Optional, Tuple
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from module.base.utils import area_offset, color_similarity_2d, rgb2gray, xywh2xyxy, area_pad
|
||||
from module.base.utils import area_offset, color_similarity_2d, rgb2gray, xywh2xyxy, area_pad, image_size
|
||||
from module.event_hospital.assets import *
|
||||
from module.event_hospital.ui import HospitalUI
|
||||
from module.logger import logger
|
||||
@@ -127,6 +127,11 @@ class HospitalClue(HospitalUI):
|
||||
image = self.image_crop(search, copy=False)
|
||||
image = rgb2gray(image)
|
||||
|
||||
# Check image size
|
||||
x, y = image_size(image)
|
||||
if y < 50:
|
||||
return None
|
||||
|
||||
# Check if there's TEMPLATE_REMAIN_CURRENT TEMPLATE_REMAIN_TIMES bellow INVEST
|
||||
if TEMPLATE_REMAIN_CURRENT.match(image):
|
||||
return button
|
||||
|
||||
Reference in New Issue
Block a user