Search code examples
opencvimage-processingopencv3.1tracker

How can I know tracking is lost using KCF tracker


I am using KCF tracker to track a region selected by hand (mouse). Once it is selected, the tracker is able to do it but the tracker fails to stop tracking after the target has moved outside the image.

Is there any way to know that the target region is lost or out of the image region.


Solution

  • You can now use Tracker::update to detect whether the object is lost. This feature was just recently added (see https://github.com/opencv/opencv_contrib/pull/1123) and should land in the next release after 3.2.0.