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

Question on Deal with matched detections in main.py? #13

Open tringn opened 5 years ago

tringn commented 5 years ago

Hi @kcg2015, Thanks for your great work. I have a question on function Deal with matched detections in main.py. Assume in the 1st frame, there is no matched detections, then we will jump to if len(unmatched_dets) > 0:. It does the tmp_trk.predict_only() by using current detection (x = np.array([[z[0], 0, z[1], 0, z[2], 0, z[3], 0]]).T; tmp_trk.x_state = x). In the 2nd frame, I assume that all objects in 1st frame are matched to detections in 2nd frame, then we jump to if matched.size > 0, and do predict. However, in tmp_trk.kalman_filter(z), I saw that the code does predict then update with current detection info. I am confused because we already did predict when processing detection in the 1st frame? Can you clarify my confusion? I suppose that we should do update and then predict. Thank you so much.

mzhian commented 5 years ago

Hi @tringn, I agree with what you supposed. In the matched detection and tracker, I also think it should be update first followed by predict. Hi @kcg2015, Thanks for sharing you work and could you please clarify this if we are wrong?