Using the example code in the OpenCV docs Using MultiTracker.
// create the tracker
legacy::MultiTracker trackers;
//...
// initialize the tracker
std::vector<Ptr<legacy::Tracker> > algorithms;
The docs have the next key line as algorithms.push_back(createTrackerByName_legacy(trackingAlg));
I don’t know where that createTrackerByName_legacy came from but I figure I could just use a Tracker.create() in its place like this Ptr<legacy::Tracker> TBtracker = TrackerKCF::create();
But when I go to the push_back line algorithms.push_back(TBtracker);
I get the VS2017 compile error
error C2664 > noexcept': cannot convert argument 1 from 'cv::Ptr<cv::tracking::TrackerKCF>' to 'std::nullptr_t'
> algorighms is a vector of Ptr<legacy::Tracker>
> and TBtracker is a Ptr<legacy::Tracker>
> and I am trying to push a Ptr<legacy::Tracker> into a vector of Ptr<legacy::Tracker>
Where would anyone say that I am going wrong that I am getting this compile error?
PS…except when I add the final line trackers.add(algorithms, frame, objects);
The compile error now is
cannot convert argument 1 from 'std::vector<cv::Ptr<cv::Tracker>,std::allocator<_Ty>>' to 'cv::Ptr<cv::legacy::tracking::Tracker>'
In \opencv_contrib-4.x\modules\tracking\samples\multitracker.cpp I found the code that is used in the OCV 4.5.3 docs on the Using MultiTracker page. It also used the createTrackerByName_legacy and I saw at the top that they did an #include "samples_utility.hpp"
Looking at that I see that the tracker was a