mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-14 06:11:10 +08:00
Fix: relative_hsv_count was counting pixels in 3 channels
causing lots of predict_current_fleet() mis-detection
This commit is contained in:
@@ -159,8 +159,9 @@ class GridPredictor:
|
|||||||
cv2.cvtColor(image, cv2.COLOR_RGB2HSV, dst=image)
|
cv2.cvtColor(image, cv2.COLOR_RGB2HSV, dst=image)
|
||||||
lower = (h[0] / 2, s[0] * 2.55, v[0] * 2.55)
|
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)
|
upper = (h[1] / 2 + 1, s[1] * 2.55 + 1, v[1] * 2.55 + 1)
|
||||||
cv2.inRange(image, lower, upper, dst=image)
|
# Don't set `dst`, output image is (50, 50) but `image` is (50, 50, 3)
|
||||||
count = image[image > 0].shape[0]
|
image = cv2.inRange(image, lower, upper)
|
||||||
|
count = cv2.countNonZero(image)
|
||||||
return count
|
return count
|
||||||
|
|
||||||
def predict_enemy_scale(self):
|
def predict_enemy_scale(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user