1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 08:38:20 +08:00
This commit is contained in:
GH Action - Upstream Sync
2024-09-25 11:17:16 +00:00
20 changed files with 59 additions and 25 deletions

View File

@@ -965,6 +965,9 @@ def color_bar_percentage(image, area, prev_color, reverse=False, starter=0, thre
prev_row = bar[:, prev_index] > 255 - threshold
if not prev_row.size:
return prev_index / length
prev_color = np.mean(image[:, prev_index], axis=0)
# Look back 5px to get average color
left = max(prev_index - 5, 0)
mask = np.where(bar[:, left:prev_index + 1] > 255 - threshold)
prev_color = np.mean(image[:, left:prev_index + 1][mask], axis=0)
return 0.