Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not ready #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions samples/tracker_usup.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <tracker.hpp>

class TrackerUsup : public Tracker
{
public:
virtual ~TrackerUsup() {}

virtual bool init( const cv::Mat& frame, const cv::Rect& initial_position );
virtual bool track( const cv::Mat& frame, cv::Rect& new_position );

private:
cv::Rect position_;
};

bool TrackerUsup::init( const cv::Mat& frame, const cv::Rect& initial_position )
{
position_ = initial_position;
return true;
}

bool TrackerUsup::track( const cv::Mat& frame, cv::Rect& new_position )
{
new_position = position_;
return true;
}

cv::Ptr<Tracker> createTrackerUsup()
{
return cv::Ptr<Tracker>(new TrackerUsup());
}
9 changes: 3 additions & 6 deletions samples/trackers_factory.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#include "tracker.hpp"

cv::Ptr<Tracker> createTrackerDummy();
// TODO: Declare your implementation here
// cv::Ptr<Tracker> createTrackerYourName();
cv::Ptr<Tracker> createTrackerUsup();

cv::Ptr<Tracker> createTracker(const std::string &impl_name)
{
if (impl_name == "dummy")
return createTrackerDummy();
// TODO: Add case for your implementation
// else if (impl_name == "your_name"):
// return createTrackerYourName();

if (impl_name == "usup")
return createTrackerUsup();
return 0;
}