 |
Visual Servoing Platform
version 3.3.0
|
1 #include <visp3/core/vpIoTools.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/gui/vpDisplayOpenCV.h>
5 #include <visp3/gui/vpDisplayX.h>
6 #include <visp3/io/vpImageIo.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)
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 <<
".[init,"
34 #ifdef VISP_HAVE_PUGIXML
37 <<
"cao or wrl]" << std::endl;
38 std::cout <<
"Tracker optional config files: " << objectname <<
".[ppm]" << std::endl;
52 #if defined(VISP_HAVE_X11)
54 #elif defined(VISP_HAVE_GDI)
56 #elif defined(VISP_HAVE_OPENCV)
59 std::cout <<
"No image viewer is available..." << std::endl;
63 display.init(I, 100, 100,
"Model-based edge tracker");
70 #ifdef VISP_HAVE_PUGIXML
119 tracker.
initClick(I, objectname +
".init",
true);
143 #if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION >= 2)
148 std::cout <<
"Catch a ViSP exception: " << e << std::endl;
150 #ifdef VISP_HAVE_OGRE
151 catch (Ogre::Exception &e) {
152 std::cout <<
"Catch an Ogre exception: " << e.getDescription() << std::endl;
158 std::cout <<
"Install OpenCV and rebuild ViSP to use this example." << std::endl;
virtual void setClipping(const unsigned int &flags)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
virtual void setAngleDisappear(const double &a)
virtual void track(const vpImage< unsigned char > &I)
virtual void getCameraParameters(vpCameraParameters &cam) const
Make the complete tracking of an object by using its CAD model.
static double rad(double deg)
virtual unsigned int getClipping() const
Generic class defining intrinsic camera parameters.
void setMovingEdge(const vpMe &me)
void setMu2(const double &mu_2)
void loadConfigFile(const std::string &configFile)
void setThreshold(const double &t)
virtual void setNearClippingDistance(const double &dist)
virtual void setOgreVisibilityTest(const bool &v)
Display for windows using GDI (available on any windows 32 platform).
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &col, unsigned int thickness=1, bool displayFullModel=false)
virtual void getPose(vpHomogeneousMatrix &cMo) const
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, bool displayHelp=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix())
virtual void setOgreShowConfigDialog(bool showConfigDialog)
void setRange(const unsigned int &r)
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, const vpImagePoint &offset=vpImagePoint(0, 0))
virtual void setFarClippingDistance(const double &dist)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void open(vpImage< vpRGBa > &I)
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
void setFileName(const std::string &filename)
static void display(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
void setMaskNumber(const unsigned int &a)
virtual void setAngleAppear(const double &a)
static const vpColor none
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
virtual void setCameraParameters(const vpCameraParameters &cam)
void setSampleStep(const double &s)
static void flush(const vpImage< unsigned char > &I)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setMu1(const double &mu_1)
void setMaskSize(const unsigned int &a)
error that can be emited by ViSP classes.
void acquire(vpImage< vpRGBa > &I)
virtual void loadModel(const std::string &modelFile, bool verbose=false, const vpHomogeneousMatrix &T=vpHomogeneousMatrix())
virtual void setDisplayFeatures(bool displayF)