Revert "drag_success优化"
This reverts commit a9ddbf9b6f9d9bda1a881aab07a34101755183c3.
This commit is contained in:
parent
b5cde9d6c6
commit
e43b90b065
1 changed files with 4 additions and 4 deletions
|
@ -347,13 +347,13 @@ class FightMixin:
|
|||
img, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE
|
||||
)
|
||||
rect = [cv2.boundingRect(c) for c in contours]
|
||||
left = min((x for x, y, w, h in rect if w > 15 and h > 15), default=None)
|
||||
left = min((x for x, y, w, h in rect if w > 10 and h > 10), default=None)
|
||||
right = max(
|
||||
(x + w for x, y, w, h in rect if w > 15 and h > 15), default=None
|
||||
(x + w for x, y, w, h in rect if w > 10 and h > 10), default=None
|
||||
)
|
||||
top = min((y for x, y, w, h in rect if w > 15 and h > 15), default=None)
|
||||
top = min((y for x, y, w, h in rect if w > 10 and h > 10), default=None)
|
||||
bottom = max(
|
||||
(y + h for x, y, w, h in rect if w > 15 and h > 15), default=None
|
||||
(y + h for x, y, w, h in rect if w > 10 and h > 10), default=None
|
||||
)
|
||||
if any(v is None for v in [left, right, top, bottom]):
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue