2 #include <visp/vpDisplayGDI.h>
3 #include <visp/vpDisplayOpenCV.h>
4 #include <visp/vpDisplayX.h>
5 #include <visp/vpImageIo.h>
6 #include <visp/vpIoTools.h>
7 #include <visp/vpMbEdgeKltTracker.h>
8 #include <visp/vpVideoReader.h>
10 int main(
int argc,
char** argv)
12 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
15 std::string videoname =
"teabox.mpg";
17 for (
int i=0; i<argc; i++) {
18 if (std::string(argv[i]) ==
"--name")
19 videoname = std::string(argv[i+1]);
20 else if (std::string(argv[i]) ==
"--help") {
21 std::cout <<
"\nUsage: " << argv[0] <<
" [--name <video name>] [--help]\n" << std::endl;
28 if(! parentname.empty())
29 objectname = parentname +
"/" + objectname;
31 std::cout <<
"Video name: " << videoname << std::endl;
32 std::cout <<
"Tracker requested config files: " << objectname
37 <<
"cao or wrl]" << std::endl;
38 std::cout <<
"Tracker optional config files: " << objectname <<
".[ppm]" << std::endl;
48 #if defined(VISP_HAVE_X11)
49 vpDisplayX display(I,100,100,
"Model-based hybrid tracker");;
50 #elif defined(VISP_HAVE_GDI)
51 vpDisplayGDI display(I,100,100,
"Model-based hybrid tracker");;
52 #elif defined(VISP_HAVE_OPENCV)
55 std::cout <<
"No image viewer is available..." << std::endl;
98 tracker.
initClick(I, objectname +
".init",
true);
116 #ifdef VISP_HAVE_XML2
119 #if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3)
124 std::cout <<
"Catch an exception: " << e << std::endl;
129 std::cout <<
"Install OpenCV and rebuild ViSP to use this example." << std::endl;
void setKltOpencv(const vpKltOpencv &t)
void setMovingEdge(const vpMe &me)
void setHarrisFreeParameter(double harris_k)
virtual unsigned int getClipping() const
virtual void setAngleDisappear(const double &a)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setMaskNumber(const unsigned int &a)
Display for windows using GDI (available on any windows 32 platform).
void setMaxFeatures(const int maxCount)
void setSampleStep(const double &s)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
void setNbTotalSample(const int &nb)
Define the X11 console to display images.
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
static const vpColor none
void setMinDistance(double minDistance)
error that can be emited by ViSP classes.
Contains predetermined masks for sites and holds moving edges tracking parameters.
virtual void setClipping(const unsigned int &flags)
static void flush(const vpImage< unsigned char > &I)
virtual void setFarClippingDistance(const double &dist)
void setMu1(const double &mu_1)
void setQuality(double qualityLevel)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void open(vpImage< vpRGBa > &I)
virtual void setOgreVisibilityTest(const bool &v)
void setMaskSize(const unsigned int &a)
void getPose(vpHomogeneousMatrix &cMo_) const
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
virtual void track(const vpImage< unsigned char > &I)
virtual void getCameraParameters(vpCameraParameters &camera) const
virtual 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)
Generic class defining intrinsic camera parameters.
void acquire(vpImage< vpRGBa > &I)
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)
void setFileName(const char *filename)
virtual void setAngleAppear(const double &a)
void loadConfigFile(const char *configFile)
virtual void initClick(const vpImage< unsigned char > &I, const std::string &initFile, const bool displayHelp=false)
void setPyramidLevels(const int pyrMaxLevel)
static double rad(double deg)
virtual void setCameraParameters(const vpCameraParameters &cam)
Hybrid tracker based on moving-edges and keypoints tracked using KLT tracker.
void setMu2(const double &mu_2)
void setWindowSize(const int winSize)
void setMaskBorder(const unsigned int &e)
virtual void loadModel(const char *modelFile, const bool verbose=false)
Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV.
void setBlockSize(const int blockSize)
void setThreshold(const double &t)
virtual bool getClick(bool blocking=true)=0
void setDisplayFeatures(const bool displayF)
void setRange(const unsigned int &r)
virtual void setNearClippingDistance(const double &dist)