Skip to content

Remove goturn legacy #3729

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

Merged
merged 1 commit into from
May 6, 2024
Merged
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
39 changes: 0 additions & 39 deletions modules/tracking/include/opencv2/tracking/tracking_legacy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,45 +286,6 @@ class CV_EXPORTS_W TrackerKCF : public cv::legacy::Tracker
virtual ~TrackerKCF() CV_OVERRIDE {}
};

#if 0 // legacy variant is not available
/** @brief the GOTURN (Generic Object Tracking Using Regression Networks) tracker

* GOTURN (@cite GOTURN) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers,
* GOTURN is much faster due to offline training without online fine-tuning nature.
* GOTURN tracker addresses the problem of single target tracking: given a bounding box label of an object in the first frame of the video,
* we track that object through the rest of the video. NOTE: Current method of GOTURN does not handle occlusions; however, it is fairly
* robust to viewpoint changes, lighting changes, and deformations.
* Inputs of GOTURN are two RGB patches representing Target and Search patches resized to 227x227.
* Outputs of GOTURN are predicted bounding box coordinates, relative to Search patch coordinate system, in format X1,Y1,X2,Y2.
* Original paper is here: <http://davheld.github.io/GOTURN/GOTURN.pdf>
* As long as original authors implementation: <https://github.com/davheld/GOTURN#train-the-tracker>
* Implementation of training algorithm is placed in separately here due to 3d-party dependencies:
* <https://github.com/Auron-X/GOTURN_Training_Toolkit>
* GOTURN architecture goturn.prototxt and trained model goturn.caffemodel are accessible on opencv_extra GitHub repository.
*/
class CV_EXPORTS_W TrackerGOTURN : public cv::legacy::Tracker
{
public:
struct CV_EXPORTS Params
{
Params();
void read(const FileNode& /*fn*/);
void write(FileStorage& /*fs*/) const;
String modelTxt;
String modelBin;
};

/** @brief Constructor
@param parameters GOTURN parameters TrackerGOTURN::Params
*/
static Ptr<legacy::TrackerGOTURN> create(const TrackerGOTURN::Params &parameters);

CV_WRAP static Ptr<legacy::TrackerGOTURN> create();

virtual ~TrackerGOTURN() CV_OVERRIDE {}
};
#endif

/** @brief the MOSSE (Minimum Output Sum of Squared %Error) tracker

The implementation is based on @cite MOSSE Visual Object Tracking using Adaptive Correlation Filters
Expand Down
11 changes: 0 additions & 11 deletions modules/tracking/misc/java/test/TrackerCreateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.opencv.test.OpenCVTestCase;

import org.opencv.video.Tracker;
import org.opencv.video.TrackerGOTURN;
import org.opencv.tracking.TrackerKCF;
import org.opencv.video.TrackerMIL;

Expand All @@ -16,16 +15,6 @@ protected void setUp() throws Exception {
super.setUp();
}


public void testCreateTrackerGOTURN() {
try {
Tracker tracker = TrackerGOTURN.create();
assert(tracker != null);
} catch (CvException e) {
// expected, model files may be missing
}
}

public void testCreateTrackerKCF() {
Tracker tracker = TrackerKCF.create();
}
Expand Down
5 changes: 0 additions & 5 deletions modules/tracking/misc/python/test/test_tracking_contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ def test_createTracker(self):

t = cv.TrackerMIL_create()
t = cv.TrackerKCF_create()
try:
t = cv.TrackerGOTURN_create()
except cv.error as e:
pass # may fail due to missing DL model files

def test_createLegacyTracker(self):

t = cv.legacy.TrackerBoosting_create()
t = cv.legacy.TrackerMIL_create()
t = cv.legacy.TrackerKCF_create()
t = cv.legacy.TrackerMedianFlow_create()
#t = cv.legacy.TrackerGOTURN_create()
t = cv.legacy.TrackerMOSSE_create()
t = cv.legacy.TrackerCSRT_create()

Expand Down
230 changes: 0 additions & 230 deletions modules/tracking/samples/goturnTracker.cpp

This file was deleted.

4 changes: 0 additions & 4 deletions modules/tracking/samples/samples_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ inline cv::Ptr<cv::Tracker> createTrackerByName(const std::string& name)
tracker = legacy::upgradeTrackingAPI(legacy::TrackerMedianFlow::create());
else if (name == "MIL")
tracker = cv::TrackerMIL::create();
else if (name == "GOTURN")
tracker = cv::TrackerGOTURN::create();
else if (name == "MOSSE")
tracker = legacy::upgradeTrackingAPI(legacy::TrackerMOSSE::create());
else if (name == "CSRT")
Expand All @@ -48,8 +46,6 @@ inline cv::Ptr<cv::legacy::Tracker> createTrackerByName_legacy(const std::string
tracker = legacy::TrackerMedianFlow::create();
else if (name == "MIL")
tracker = legacy::TrackerMIL::create();
else if (name == "GOTURN")
CV_Error(cv::Error::StsNotImplemented, "FIXIT: migration on new API is required");
else if (name == "MOSSE")
tracker = legacy::TrackerMOSSE::create();
else if (name == "CSRT")
Expand Down
2 changes: 1 addition & 1 deletion modules/tracking/samples/tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static void help()
"Example of <video_name> is in opencv_extra/testdata/cv/tracking/\n"
"Call:\n"
"./tracker <tracker_algorithm> <video_name> <start_frame> [<bounding_frame>]\n"
"tracker_algorithm can be: MIL, BOOSTING, MEDIANFLOW, TLD, KCF, GOTURN, MOSSE.\n"
"tracker_algorithm can be: MIL, BOOSTING, MEDIANFLOW, TLD, KCF, MOSSE.\n"
<< endl;

cout << "\n\nHot keys: \n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Explanation
+ MEDIANFLOW
+ TLD
+ KCF
+ GOTURN
+ MOSSE

Each tracker algorithm has their own advantages and disadvantages, please refer the documentation of @ref cv::Tracker for more detailed information.
Expand Down
Loading