@@ -170,6 +170,11 @@ def main():
170170 # 追跡アップデート
171171 start_time = time .time ()
172172 ok , bbox = tracker .update (image )
173+ try :
174+ tracker_score = tracker .getTrackingScore ()
175+ except :
176+ tracker_score = '-'
177+ 173178 elapsed_time_list .append (time .time () - start_time )
174179 if ok :
175180 # 追跡後のバウンディングボックス描画
@@ -185,11 +190,18 @@ def main():
185190
186191 # 各アルゴリズム処理時間描画
187192 for index , tracker_algorithm in enumerate (tracker_algorithm_list ):
188- cv .putText (
189- debug_image , tracker_algorithm + " : " +
190- '{:.1f}' .format (elapsed_time_list [index ] * 1000 ) + "ms" ,
191- (10 , int (25 * (index + 1 ))), cv .FONT_HERSHEY_SIMPLEX , 0.7 ,
192- color_list [index ], 2 , cv .LINE_AA )
193+ if tracker_score != '-' :
194+ cv .putText (
195+ debug_image , tracker_algorithm + " : " +
196+ '{:.1f}' .format (elapsed_time_list [index ] * 1000 ) + "ms" + ' Score:{:.2f}' .format (tracker_score ),
197+ (10 , int (25 * (index + 1 ))), cv .FONT_HERSHEY_SIMPLEX , 0.7 ,
198+ color_list [index ], 2 , cv .LINE_AA )
199+ else :
200+ cv .putText (
201+ debug_image , tracker_algorithm + " : " +
202+ '{:.1f}' .format (elapsed_time_list [index ] * 1000 ) + "ms" ,
203+ (10 , int (25 * (index + 1 ))), cv .FONT_HERSHEY_SIMPLEX , 0.7 ,
204+ color_list [index ], 2 , cv .LINE_AA )
193205
194206 cv .imshow (window_name , debug_image )
195207
0 commit comments