kcg2015 / Vehicle-Detection-and-Tracking

Computer vision based vehicle detection and tracking using Tensorflow Object Detection API and Kalman-filtering
537 stars 192 forks source link

A question about video tracking #23

Closed younghuvee closed 5 years ago

younghuvee commented 5 years ago

Hi, thanks for your amazing project, i have a question about video tracking, how can i see the different ID for car in the final output video?

kcg2015 commented 5 years ago

Sorry for the late reply, you can modify the following function in the helper.py: draw_box_label(img, bbox_cv2, box_color=(0, 255, 255), show_label=True). Hope this helps.

younghuvee commented 5 years ago

Hello,I mean that can I give the car an ID number to track it in the output video?

kcg2015 commented 5 years ago

Yes. Please see L148: tmp_trk.id = track_id_list.popleft() # assign an ID for the tracker.

younghuvee commented 5 years ago

Thank you, can i put 'ID' text on the detect rectangle just like this

text_x= 'x='+str((left+right)/2)
cv2.putText(img,text_x,(left,top-25), font, font_size, font_color, 1, cv2.LINE_AA)
text_y= 'y='+str((top+bottom)/2)
cv2.putText(img,text_y,(left,top-5), font, font_size, font_color, 1, cv2.LINE_AA)
younghuvee commented 5 years ago

@HWYangege this my twitter address , looking forward your reply^_^

kcg2015 commented 5 years ago

Of course. Feel free to make any changes as you see fit.

kcg2015 commented 5 years ago

@younghuvee, let me close this issue for now.