add:填充干员
This commit is contained in:
parent
c1b23205ee
commit
e7973867ce
5 changed files with 264 additions and 2 deletions
|
@ -57,7 +57,7 @@ def segment_team(img: tp.Image) -> list[tp.Scope]:
|
|||
|
||||
def segment_team_select(img: tp.Image) -> list[tp.Scope]:
|
||||
"作战编队和训练位选干员"
|
||||
line1 = cropimg(img, ((600, 510), (1920, 511)))
|
||||
line1 = cropimg(img, ((600, 476), (1920, 477)))
|
||||
hsv = cv2.cvtColor(line1, cv2.COLOR_RGB2HSV)
|
||||
mask = cv2.inRange(hsv, (98, 140, 200), (102, 255, 255))
|
||||
line1 = cv2.cvtColor(line1, cv2.COLOR_RGB2GRAY)
|
||||
|
@ -69,8 +69,9 @@ def segment_team_select(img: tp.Image) -> list[tp.Scope]:
|
|||
name_x = []
|
||||
for i in range(1, line1.shape[1]):
|
||||
curr = last_line[i]
|
||||
if prev == 0 and curr == 255 and start and i - start > 96:
|
||||
if prev == 0 and curr == 255 and start and i - start > 70:
|
||||
name_x.append((i + 415, i + 590))
|
||||
# name_x.append((i+460, i + 640))
|
||||
elif prev == 255 and curr == 0:
|
||||
start = i
|
||||
prev = curr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue