mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: False fleet mechanism detection on island and belt
This commit is contained in:
parent
ed7c7a6fb8
commit
00587a3423
@ -294,6 +294,18 @@ class OSGridPredictor(GridPredictor):
|
||||
count = image[image > 221].shape[0]
|
||||
if count < 30:
|
||||
return False
|
||||
# Shouldn't contain any thing green or yellow
|
||||
# Green is island and yellow is belt
|
||||
image = cv2.cvtColor(crop(self.image, area), cv2.COLOR_RGB2HSV)
|
||||
h = (0, 180)
|
||||
s = (30, 90)
|
||||
v = (30, 100)
|
||||
lower = (h[0] / 2, s[0] * 2.55, v[0] * 2.55)
|
||||
upper = (h[1] / 2 + 1, s[1] * 2.55 + 1, v[1] * 2.55 + 1)
|
||||
image_in_range = cv2.inRange(image, lower, upper)
|
||||
if image_in_range[image_in_range > 0].shape[0] > 30:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user