1 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/io/vpImageIo.h>
6 #include <visp3/core/vpIoTools.h>
8 #include <visp3/mbt/vpMbEdgeTracker.h>
10 #include <visp3/io/vpVideoReader.h>
12 int main(
int argc,
char** argv)
14 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) || defined(VISP_HAVE_FFMPEG)
16 std::string videoname =
"teabox.mpg";
18 for (
int i=0; i<argc; i++) {
19 if (std::string(argv[i]) ==
"--name")
20 videoname = std::string(argv[i+1]);
21 else if (std::string(argv[i]) ==
"--help") {
22 std::cout <<
"\nUsage: " << argv[0] <<
" [--name <video name>] [--help]\n" << std::endl;
29 if(! parentname.empty())
30 objectname = parentname +
"/" + objectname;
32 std::cout <<
"Video name: " << videoname << std::endl;
33 std::cout <<
"Tracker requested config files: " << objectname
38 <<
"cao or wrl]" << std::endl;
39 std::cout <<
"Tracker optional config files: " << objectname <<
".[ppm]" << std::endl;
53 #if defined(VISP_HAVE_X11)
55 #elif defined(VISP_HAVE_GDI)
57 #elif defined(VISP_HAVE_OPENCV)
60 std::cout <<
"No image viewer is available..." << std::endl;
64 display.
init(I, 100, 100,
"Model-based edge tracker");
120 tracker.
initClick(I, objectname +
".init",
true);
144 #ifdef VISP_HAVE_XML2
147 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3)
153 std::cout <<
"Catch a ViSP exception: " << e << std::endl;
155 #ifdef VISP_HAVE_OGRE
156 catch(Ogre::Exception &e) {
157 std::cout <<
"Catch an Ogre exception: " << e.getDescription() << std::endl;
163 std::cout <<
"Install OpenCV or ffmpeg and rebuild ViSP to use this example." << std::endl;
virtual void setDisplayFeatures(const bool displayF)
void setMovingEdge(const vpMe &me)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
virtual unsigned int getClipping() const
virtual void setAngleDisappear(const double &a)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void track(const vpImage< unsigned char > &I)
void setMaskNumber(const unsigned int &a)
Display for windows using GDI (available on any windows 32 platform).
void setSampleStep(const double &s)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
static const vpColor none
error that can be emited by ViSP classes.
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
Make the complete tracking of an object by using its CAD model.
virtual void setCameraParameters(const vpCameraParameters &camera)
void loadConfigFile(const std::string &configFile)
static void flush(const vpImage< unsigned char > &I)
void setMu1(const double &mu_1)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
virtual void setNearClippingDistance(const double &dist)
virtual void setOgreVisibilityTest(const bool &v)
void setOgreShowConfigDialog(const bool showConfigDialog)
void open(vpImage< vpRGBa > &I)
void setMaskSize(const unsigned int &a)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
virtual void getCameraParameters(vpCameraParameters &camera) const
Generic class defining intrinsic camera parameters.
void acquire(vpImage< vpRGBa > &I)
virtual void setFarClippingDistance(const double &dist)
void setFileName(const char *filename)
virtual void setAngleAppear(const double &a)
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
static double rad(double deg)
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0, 0))
void setMu2(const double &mu_2)
virtual void loadModel(const char *modelFile, const bool verbose=false)
virtual void getPose(vpHomogeneousMatrix &cMo_) const
void setThreshold(const double &t)
void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, const unsigned int thickness=1, const bool displayFullModel=false)
void setRange(const unsigned int &r)
virtual void setClipping(const unsigned int &flags)