İn this official tutorial I got the error in title. What should be the reason?
Ptr<Tracker> tracker = Tracker::create( "KCF" );
Here the part of tracking.hpp:
@endcode
of course, you can also add any additional methods of your choice. It should be pointed out,
however, that it is not expected to have a constructor declared, as creation should be done via
the corresponding createTracker() method.
In src/tracker.cpp file add BOILERPLATE_CODE(name,classname) line to the body of
Tracker::create() method you will find there, like :
@code
Ptr<Tracker> Tracker::create( const String& trackerType )
{
BOILERPLATE_CODE("BOOSTING",TrackerBoosting);
BOILERPLATE_CODE("MIL",TrackerMIL);
return Ptr<Tracker>();
}
@endcode
- Finally, you should implement the function with signature :
@code
Ptr<classname> classname::createTracker(const classname::Params ¶meters){
...
}
@endcode
I am using 3.2.0 release.
The code you pasted from tracking.hpp
isn't actual code, it's just sample code that's part of the documentation. The only relevant code in the tracking header file is:
#include <opencv2/tracking/tracker.hpp>
#include <opencv2/tracking/tldDataset.hpp>
Thus, to see what you're actually importing you need to look at the tracking/tracker.hpp
file (here).
If you do that, you'll see that there's no static create
method in the Tracker
class declaration. The method was actually removed in this commit. So, basically, you're right: the tutorial wasn't updated after the method was removed. You should report your issue to the opencv team.
That being said, to make the tutorial work you'll probably need to replace the line that's not compiling with:
Ptr<TrackerKCF> tracker = TrackerKCF::create();
That should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With