Fixed argument dataset index in examples

pull/341/head
Vladimir 9 years ago
parent c2ef8213b1
commit aa26cc6231
  1. 10
      modules/datasets/samples/track_vot.cpp
  2. 12
      modules/tracking/samples/multiTracker_dataset.cpp
  3. 2
      modules/tracking/samples/tracker_dataset.cpp

@ -55,15 +55,15 @@ using namespace std;
using namespace cv;
using namespace cv::datasets;
#define DATASET_ID 1
int main(int argc, char *argv[])
{
const char *keys =
"{ 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);
string path(parser.get<string>("path"));
int datasetID(parser.get<int>("datasetID"));
if (parser.has("help") || path == "true")
{
parser.printMessage();
@ -77,9 +77,9 @@ int main(int argc, char *argv[])
for (int i = 1; i <= dataset->getDatasetsNum(); 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;
dataset->getNextFrame(frame);

@ -63,9 +63,9 @@ Rect2d boundingBox;
static const char* keys =
{ "{@tracker_algorithm | | Tracker algorithm }"
"{@dataset_path |true| Dataset path }"
"{@dataset_id |1| Dataset path }"
"{@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*)
@ -117,7 +117,7 @@ static void help()
"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"
"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;
cout << "\n\nHot keys: \n"
@ -129,9 +129,9 @@ int main(int argc, char *argv[])
{
CommandLineParser parser(argc, argv, keys);
string tracker_algorithm = parser.get<string>(0);
string datasetRootPath = parser.get<string>(1);
int datasetID = parser.get<int>(2);
targetsNum = parser.get<int>(3);
targetsNum = parser.get<int>(1);
string datasetRootPath = parser.get<string>(2);
int datasetID = parser.get<int>(3);
if (tracker_algorithm.empty() || datasetRootPath.empty() || targetsNum < 1)
{
help();

@ -65,7 +65,7 @@ static bool startSelection = false;
static const char* keys =
{ "{@tracker_algorithm | | Tracker algorithm }"
"{@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*)

Loading…
Cancel
Save