1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 02:48:23 +08:00

Fix: Wrong return in get_research_series_jp() (#2876)

This commit is contained in:
LmeSzinc
2023-07-14 11:20:38 +08:00
parent 2cd7f1df01
commit 1ab1994aa2

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)