OpenCV 3 Tracker won't work after reinitialization

前端 未结 3 1774
天涯浪人
天涯浪人 2020-12-20 16:10

I have issue using OpenCV 3 tracking module for tracking. It behaves same, either I use interface class (cv::Tracker) or class with implementation (like cv::TrackerMedianFlo

3条回答
  •  悲哀的现实
    2020-12-20 16:25

    I just ran into the same problem, here's how I got it to work :

    tracker->clear();
    
    Ptr trackerNew = Tracker::create( tracker_algorithm );
    
    tracker = trackerNew;
    tracker->init( image, boundingBox );
    

    Might not be the right way or the prettiest but it does the job :)

提交回复
热议问题