Finally, I have managed to improve my tracking application so that it can track perfectly on my test video. Here is the result:
There are still some rooms for improvement if we want to apply this technique to an ip-camera. The first one is to seperate the camera streamer thread with the frame processing thread to minimize broken frame:
This is annoying since it can distract the object tracker performance. So, I suggest creating a specific thread for the camera streamer which acquire images from ip-camera and put all of the frames into a queue list. And then, have another thread to read the frames from queue list and process it one-by-one.
Feel free to drop any comments or thoughts regarding this topic.