#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/io/vpVideoReader.h>
#include <visp3/mbt/vpMbEdgeKltTracker.h>
int main(int argc, char **argv)
{
#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
try {
std::string videoname = "teabox.mpg";
for (int i = 0; i < argc; i++) {
if (std::string(argv[i]) == "--name")
videoname = std::string(argv[i + 1]);
else if (std::string(argv[i]) == "--help") {
std::cout << "\nUsage: " << argv[0] << " [--name <video name>] [--help]\n" << std::endl;
return 0;
}
}
if (!parentname.empty())
objectname = parentname + "/" + objectname;
std::cout << "Video name: " << videoname << std::endl;
std::cout << "Tracker requested config files: " << objectname << ".[init,"
#ifdef VISP_HAVE_XML2
<< "xml,"
#endif
<< "cao or wrl]" << std::endl;
std::cout << "Tracker optional config files: " << objectname << ".[ppm]" << std::endl;
#if defined(VISP_HAVE_X11)
vpDisplayX display(I, 100, 100,
"Model-based hybrid tracker");
;
#elif defined(VISP_HAVE_GDI)
vpDisplayGDI display(I, 100, 100,
"Model-based hybrid tracker");
;
#elif defined(VISP_HAVE_OPENCV)
;
#else
std::cout << "No image viewer is available..." << std::endl;
#endif
bool usexml = false;
#ifdef VISP_HAVE_XML2
usexml = true;
}
#endif
if (!usexml) {
}
tracker.
initClick(I, objectname +
".init",
true);
break;
}
#ifdef VISP_HAVE_XML2
#endif
#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION >= 2)
SoDB::finish();
#endif
std::cout << "Catch a ViSP exception: " << e << std::endl;
}
#ifdef VISP_HAVE_OGRE
catch (Ogre::Exception &e) {
std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl;
}
#endif
#else
(void)argc;
(void)argv;
std::cout << "Install OpenCV and rebuild ViSP to use this example." << std::endl;
#endif
}