#include <iostream>
#include <visp3/core/vpConfig.h>
#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
#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/vpMbEdgeKltMultiTracker.h>
#include <visp3/mbt/vpMbEdgeMultiTracker.h>
#include <visp3/io/vpVideoReader.h>
int main(int argc, char **argv)
{
#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
try {
std::string opt_videoname = "teabox.mpg";
int opt_tracker = 0;
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::cout << "\nUsage: " << argv[0]
<< " [--name <video name>] [--tracker "
"<0=egde|1=keypoint|2=hybrid>] [--help]\n"
<< std::endl;
return 0;
}
}
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 (opt_tracker == 0)
#ifdef VISP_HAVE_MODULE_KLT
else if (opt_tracker == 1)
else
#else
else {
std::cout << "klt and hybrid model-based tracker are not available "
"since visp_klt module is missing"
<< std::endl;
return 0;
}
#endif
if (opt_tracker == 0 || opt_tracker == 2) {
}
#ifdef VISP_HAVE_MODULE_KLT
if (opt_tracker == 1 || opt_tracker == 2) {
}
#endif
tracker->
initClick(I, objectname +
".init",
true);
break;
}
}
delete display;
delete tracker;
std::cerr << "Catch a ViSP exception: " << e << std::endl;
}
#else
(void)argc;
(void)argv;
std::cout << "Install OpenCV and rebuild ViSP to use this example." << std::endl;
#endif
}
#else
int main()
{
std::cout << "Nothing to run, deprecated tutorial." << std::endl;
return 0;
}
#endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)