mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-18 05:41:29 +08:00
Upd: Update threshold value to match images with random flashes that appear on rainbow books.
This commit is contained in:
@@ -98,16 +98,19 @@ class Book:
|
|||||||
image = crop(image, button.area)
|
image = crop(image, button.area)
|
||||||
self.button = button
|
self.button = button
|
||||||
|
|
||||||
|
# During the test of 40 random screenshots,
|
||||||
|
# when the threshold range is 50-70, the test can all pass,
|
||||||
|
# but it must not exceed 75, otherwise the rainbow will be recognized as purple
|
||||||
self.genre = 0
|
self.genre = 0
|
||||||
color = get_color(image, (65, 35, 72, 42))
|
color = get_color(image, (65, 35, 72, 42))
|
||||||
for key, value in self.color_genre.items():
|
for key, value in self.color_genre.items():
|
||||||
if color_similar(color1=color, color2=value, threshold=30):
|
if color_similar(color1=color, color2=value, threshold=50):
|
||||||
self.genre = key
|
self.genre = key
|
||||||
|
|
||||||
self.tier = 0
|
self.tier = 0
|
||||||
color = get_color(image, (83, 61, 92, 70))
|
color = get_color(image, (83, 61, 92, 70))
|
||||||
for key, value in self.color_tier.items():
|
for key, value in self.color_tier.items():
|
||||||
if color_similar(color1=color, color2=value, threshold=30):
|
if color_similar(color1=color, color2=value, threshold=50):
|
||||||
self.tier = key
|
self.tier = key
|
||||||
|
|
||||||
color = color_similarity_2d(crop(image, (15, 0, 97, 13)), color=(148, 251, 99))
|
color = color_similarity_2d(crop(image, (15, 0, 97, 13)), color=(148, 251, 99))
|
||||||
|
|||||||
Reference in New Issue
Block a user