@@ -80,7 +80,6 @@ def getClosestCharacterByCloseup(image, character_closeups, mask, background_bgr
80
80
distances .append (numpy .min (character_distances ))
81
81
return numpy .argmin (distances )
82
82
83
-
84
83
def getClosestPlayerByIcon (image , icons , background_bgr ):
85
84
empty_icon = numpy .full_like (image , background_bgr [0 ])
86
85
empty_icon [:,:,1 ] = numpy .full ((image .shape [0 ], image .shape [1 ]), background_bgr [1 ])
@@ -96,7 +95,7 @@ def getClosestPlayerByIcon(image, icons, background_bgr):
96
95
97
96
def getClosestDigit (image , digit_images ):
98
97
distances = []
99
- for i in range (11 ):
98
+ for i in range (len ( digit_images ) ):
100
99
distances .append (numpy .sum (cv2 .absdiff (digit_images [i ], image )))
101
100
digit = numpy .argmin (distances )
102
101
return digit - 1
@@ -190,15 +189,19 @@ def isValidFirstData(positions, times):
190
189
191
190
192
191
def time2int (arg ):
193
- return 60 * int (arg [0 ]) + int (arg [2 :4 ])
192
+ if (len (arg ) == 4 ):
193
+ return 60 * int (arg [0 ]) + int (arg [2 :4 ])
194
+ else :
195
+ return 60 * int (arg [0 :2 ]) + int (arg [3 :5 ])
194
196
def time2string (arg ):
195
197
if (arg == "" ):
196
198
return ""
197
199
else :
198
200
return str (time2int (arg ))
199
201
200
202
201
- def convertMatchToString (file_name , players , characters , positions , times , falls , given_damages , taken_damages ):
203
+ def convertMatchToString (file_name , characters , positions , times , falls , given_damages , taken_damages ):
204
+ players = len (characters )
202
205
match_string = file_name [6 :8 ] + "/" + file_name [4 :6 ] + "/" + file_name [0 :4 ] + "\t "
203
206
match_string += str (players ) + "\t "
204
207
for i in range (players ):
0 commit comments