9

Bascially I want to detect an object and than track it in a video (frame-by-frame).

I can detect it on the first frame with for example ORB or SIFT. But for the next frames (or say next XX frames) I would like to avoid to calulcate again all the keypoints (ORB or SIFT) to detect it again.

Considering I want to track it in a video real time, what could I do ?

1
  • I am thinking the same and i have the same question , but i am using SURF+SVM on video but i got the multiple frames of same object , so which technique you finally use ? Can you share
    – AHF
    Commented Feb 16, 2014 at 10:36

4 Answers 4

8

A common option is using a patchtracker. That means that you just search for keypoints in an area of, for example, 8 pixels around the previous frame keypoint. You can perform cv::matchTemplate() of an area surrounding the keypoint, instead of using SIFT.

Performing a pyramidal search helps to improve frame-rate. You first search at a lower scale, if you cannot find the keypoint you double the scale.

If patchtracker fails, because the image moves too fast, you just have to reinitialize the system by applying SIFT again. I would use FAST instead of SIFT. You can use SIFT for the marker, and then FAST for detecting keypoints real-time, generating SIFT descriptors.

3
  • 2
    but as you will have an estimate of the homography, you can project the patches so they will be rotated and scaled
    – Jav_Rock
    Commented Jul 17, 2012 at 11:52
  • You will have an approximate position. Another option is using a kalman filter, so you will have a predicted homography, but it is not necessary. The previous homography will give an approximate position of the searching path.
    – Jav_Rock
    Commented Jul 17, 2012 at 12:09
  • @Jav_Rock +1, I am using SURF with SVM to predict the object from real time video it works fine in prediction but when i predict a moving object it check's and save every frame which contain one particular moving object like vehicle. It takes alot of memory so kalman filter can also use for it ? so that i can only save one frame of one particulat object if it remains for next 70 consective frames.I want that if two different vehicles enter and they remain in the eye of camera for 100 consective frames then my system only save 2 frames of them Thanks
    – AHF
    Commented Feb 16, 2014 at 15:40
5

Detecting and tracking object in a video is a very large topic and the way to go highly depends on your application. There is no magic bullet! If you achieve the detection part, you can try tracking by meanshift on color (maybe HSV color space) likelihood if the object you need to track is colored .. , or try template matching, or .. You need to be more specific on your needs.

0
4

you can use OpticalFlow for simple tracking, here are the steps to do it...

  1. Find the corners of a moving object using harris corner detector or SIFT feature detector.

  2. Give those corners and previous image(in which you found the corners of object to be tracked) and the next image to opticalflow function it will compute the corners of the same object in the next images..

Here are the links:

Link1

Link2

code

NOTE: if you are addressing problems like occlusion handling , multiple people tracking then OpticalFlow alone can't solve problems. For that kalman filter or particle filters are needed to be employed...

0

You can achieve almost perfect and real time tracking using TLD or CLM. Once you detect the object of interest use that bounding box to initiate predator tracking. You can find about CMT here https://www.gnebehay.com/cmt/

and TLD here https://www.gnebehay.com/tld/

Not the answer you're looking for? Browse other questions tagged or ask your own question.