Commit a4fdf7ef authored by Vladimir's avatar Vladimir

Fixed argument dataset index in examples

parent db58fd8b
...@@ -55,15 +55,15 @@ using namespace std; ...@@ -55,15 +55,15 @@ using namespace std;
using namespace cv; using namespace cv;
using namespace cv::datasets; using namespace cv::datasets;
#define DATASET_ID 1
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to folder with dataset }"; "{ path p |true| path to folder with dataset }"
"{ datasetID id |1| Dataset ID}";
CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
int datasetID(parser.get<int>("datasetID"));
if (parser.has("help") || path == "true") if (parser.has("help") || path == "true")
{ {
parser.printMessage(); parser.printMessage();
...@@ -77,9 +77,9 @@ int main(int argc, char *argv[]) ...@@ -77,9 +77,9 @@ int main(int argc, char *argv[])
for (int i = 1; i <= dataset->getDatasetsNum(); i++) for (int i = 1; i <= dataset->getDatasetsNum(); i++)
printf("\tDataset #%d size: %d\n", i, dataset->getDatasetLength(i)); printf("\tDataset #%d size: %d\n", i, dataset->getDatasetLength(i));
dataset->initDataset(DATASET_ID); dataset->initDataset(datasetID);
for (int i = 0; i < dataset->getDatasetLength(DATASET_ID); i++) for (int i = 0; i < dataset->getDatasetLength(datasetID); i++)
{ {
Mat frame; Mat frame;
dataset->getNextFrame(frame); dataset->getNextFrame(frame);
......
...@@ -65,9 +65,9 @@ Rect2d boundingBox; ...@@ -65,9 +65,9 @@ Rect2d boundingBox;
static const char* keys = static const char* keys =
{ "{@tracker_algorithm | | Tracker algorithm }" { "{@tracker_algorithm | | Tracker algorithm }"
"{@dataset_path |true| Dataset path }"
"{@dataset_id |1| Dataset path }"
"{@target_num |1| Number of targets }" "{@target_num |1| Number of targets }"
"{@dataset_path |true| Dataset path }"
"{@dataset_id |1| Dataset ID }"
}; };
static void onMouse(int event, int x, int y, int, void*) static void onMouse(int event, int x, int y, int, void*)
...@@ -119,7 +119,7 @@ static void help() ...@@ -119,7 +119,7 @@ static void help()
"TLD dataset ID: 1~10, VOT2015 dataset ID: 1~60\n" "TLD dataset ID: 1~10, VOT2015 dataset ID: 1~60\n"
"-- pause video [p] and draw a bounding boxes around the targets to start the tracker\n" "-- pause video [p] and draw a bounding boxes around the targets to start the tracker\n"
"Example:\n" "Example:\n"
"./example_tracking_multiTracker_dataset<tracker_algorithm> <dataset_path> <dataset_id> <number_of_targets>\n" "./example_tracking_multiTracker_dataset<tracker_algorithm> <number_of_targets> <dataset_path> <dataset_id>\n"
<< endl; << endl;
cout << "\n\nHot keys: \n" cout << "\n\nHot keys: \n"
...@@ -131,9 +131,9 @@ int main(int argc, char *argv[]) ...@@ -131,9 +131,9 @@ int main(int argc, char *argv[])
{ {
CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string tracker_algorithm = parser.get<string>(0); string tracker_algorithm = parser.get<string>(0);
string datasetRootPath = parser.get<string>(1); targetsNum = parser.get<int>(1);
int datasetID = parser.get<int>(2); string datasetRootPath = parser.get<string>(2);
targetsNum = parser.get<int>(3); int datasetID = parser.get<int>(3);
if (tracker_algorithm.empty() || datasetRootPath.empty() || targetsNum < 1) if (tracker_algorithm.empty() || datasetRootPath.empty() || targetsNum < 1)
{ {
help(); help();
......
...@@ -65,7 +65,7 @@ static bool startSelection = false; ...@@ -65,7 +65,7 @@ static bool startSelection = false;
static const char* keys = static const char* keys =
{ "{@tracker_algorithm | | Tracker algorithm }" { "{@tracker_algorithm | | Tracker algorithm }"
"{@dataset_path |true| Dataset path }" "{@dataset_path |true| Dataset path }"
"{@dataset_id |1| Dataset path }" "{@dataset_id |1| Dataset ID }"
}; };
static void onMouse(int event, int x, int y, int, void*) static void onMouse(int event, int x, int y, int, void*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment