2 #include <visp3/core/vpConfig.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/gui/vpDisplayOpenCV.h>
5 #include <visp3/gui/vpDisplayX.h>
6 #include <visp3/io/vpVideoReader.h>
8 #include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h>
9 #include <visp3/tt/vpTemplateTrackerWarpHomography.h>
12 int main(
int argc,
char **argv)
14 #if defined(VISP_HAVE_OPENCV)
15 #ifdef ENABLE_VISP_NAMESPACE
18 std::string opt_videoname =
"bruegel.mp4";
19 unsigned int opt_subsample = 1;
21 for (
int i = 0; i < argc; i++) {
22 if (std::string(argv[i]) ==
"--videoname")
23 opt_videoname = std::string(argv[i + 1]);
24 else if (std::string(argv[i]) ==
"--subsample")
25 opt_subsample =
static_cast<unsigned int>(std::atoi(argv[i + 1]));
26 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
27 std::cout <<
"\nUsage: " << argv[0] <<
" [--videoname <video name>] [--subsample <scale factor>] [--help] [-h]\n"
33 std::cout <<
"Video name: " << opt_videoname << std::endl;
40 Iacq.
subsample(opt_subsample, opt_subsample, I);
42 #if defined(VISP_HAVE_X11)
44 #elif defined(VISP_HAVE_GDI)
46 #elif defined(HAVE_OPENCV_HIGHGUI)
49 std::cout <<
"No image viewer is available..." << std::endl;
52 display.init(I, 100, 100,
"Template tracker");
61 tracker.setSampling(2, 2);
62 tracker.setLambda(0.001);
63 tracker.setIterationMax(200);
64 tracker.setPyramidal(2, 1);
73 Iacq.
subsample(opt_subsample, opt_subsample, I);
83 std::cout <<
"Homography: \n" << H << std::endl;
Implementation of column vector and the associated operations.
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
unsigned int getDownScalingFactor()
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Implementation of an homography and operations on homographies.
void subsample(unsigned int v_scale, unsigned int h_scale, vpImage< Type > &sampled) const
vpHomography getHomography(const vpColVector &ParamM) const
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
bool isVideoFormat() const
void acquire(vpImage< vpRGBa > &I)
void open(vpImage< vpRGBa > &I)
void setFileName(const std::string &filename)
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()