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.
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.