Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can release the old tracker and create a new tracker and initiate it with your new ROI. That is:

tracker.release(); 
tracker = cv::TrackerKCF::create();
tracker->init(frame, newRoi);

You can release the old tracker and create a new tracker and initiate it with your new ROI. That is:

tracker.release(); 
tracker = cv::TrackerKCF::create();
tracker->init(frame, newRoi);

It may not be the right or the prettiest way to do it, but it does the job.