#include <cstdlib>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/io/vpImageIo.h>
#include <visp3/mbt/vpMbGenericTracker.h>
#include <visp3/io/vpVideoReader.h>
int main(int argc, char **argv)
{
#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020300)
try {
std::string opt_videoname = "teabox.mp4";
for (int i = 0; i < argc; i++) {
if (std::string(argv[i]) == "--name" && i + 1 < argc)
opt_videoname = std::string(argv[i + 1]);
else if (std::string(argv[i]) == "--tracker" && i + 1 < argc)
opt_tracker = atoi(argv[i + 1]);
else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
std::cout << "\nUsage: " << argv[0]
<< " [--name <video name>] [--tracker <1=egde|2=keypoint|3=hybrid>]"
<< " [--help] [-h]\n"
<< std::endl;
return EXIT_SUCCESS;
}
}
if (opt_tracker < 1 || opt_tracker > 3) {
std::cerr << "Wrong tracker type. Correct values are: "
"1=egde|2=keypoint|3=hybrid."
<< std::endl;
return EXIT_SUCCESS;
}
if (!parentname.empty()) {
objectname = parentname + "/" + objectname;
}
std::cout << "Video name: " << opt_videoname << std::endl;
std::cout << "Tracker requested config files: " << objectname << ".[init, cao]" << std::endl;
std::cout << "Tracker optional config files: " << objectname << ".[ppm]" << std::endl;
#if defined(VISP_HAVE_X11)
#elif defined(VISP_HAVE_GDI)
#else
#endif
display.
init(I, 100, 100,
"Model-based tracker");
#if !defined(VISP_HAVE_MODULE_KLT)
if (opt_tracker >= 2) {
std::cout << "KLT and hybrid model-based tracker are not available "
"since visp_klt module is missing"
<< std::endl;
return EXIT_SUCCESS;
}
#endif
#if 0
if (opt_tracker == 1 || opt_tracker == 3) {
}
#ifdef VISP_HAVE_MODULE_KLT
if (opt_tracker == 2 || opt_tracker == 3) {
}
#endif
{
}
#endif
tracker.
initClick(I, objectname +
".init",
true);
break;
}
}
std::cerr <<
"Catch a ViSP exception: " << e.
what() << std::endl;
}
return EXIT_SUCCESS;
#else
(void)argc;
(void)argv;
std::cout << "Install OpenCV and rebuild ViSP to use this example." << std::endl;
return EXIT_SUCCESS;
#endif
}