1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 01:38:21 +08:00

Merge branch 'LmeSzinc:master' into dev-minigame-for-pr

This commit is contained in:
Tipsy Fisher
2023-07-15 00:58:16 +08:00
committed by GitHub
2 changed files with 25 additions and 3 deletions

View File

@@ -1,4 +1,3 @@
import re
from datetime import timedelta
from scipy import signal
@@ -104,6 +103,14 @@ def _get_research_series(img):
def get_research_series(image, series_button=RESEARCH_SERIES):
"""
Args:
image (np.ndarray):
series_button:
Returns:
list[int]: Such as [1, 1, 1, 2, 3]
"""
result = []
for button in series_button:
img = resize(crop(image, button.area), (46, 25))
@@ -199,7 +206,7 @@ def get_research_series_jp_old(image):
image (np.ndarray): Screenshot
Returns:
series (string):
str: Series like "S4"
"""
# Set 'prominence = 50' to ignore possible noise.
parameters = {'height': 160, 'prominence': 50, 'width': 1}
@@ -228,6 +235,20 @@ def get_research_series_jp_old(image):
return f'S{series}'
def get_research_series_jp(image):
"""
Args:
image:
Returns:
str: Series like "S4"
"""
area = SERIES_DETAIL.area
img = crop(image, area)
series = _get_research_series(img)
return f'S{series}'
def get_research_duration_jp(image):
"""
Args:
@@ -338,7 +359,7 @@ def research_jp_detect(image):
project (ResearchProjectJp):
"""
project = ResearchProjectJp()
project.series = get_research_series(image)
project.series = get_research_series_jp(image)
project.duration = str(get_research_duration_jp(image) / 3600).rstrip('.0')
project.genre = get_research_genre_jp(image)
costs = get_research_cost_jp(image)

View File

@@ -12,6 +12,7 @@ from module.ui.scroll import Scroll
MEDAL_SHOP_SCROLL = Scroll(MEDAL_SHOP_SCROLL_AREA, color=(247, 211, 66))
MEDAL_SHOP_SCROLL.edge_threshold = 0.15
MEDAL_SHOP_SCROLL.drag_threshold = 0.15
class ShopPriceOcr(DigitYuv):