2 #include <visp3/gui/vpDisplayGDI.h> 3 #include <visp3/gui/vpDisplayOpenCV.h> 4 #include <visp3/gui/vpDisplayX.h> 5 #include <visp3/io/vpVideoReader.h> 7 #include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> 8 #include <visp3/tt/vpTemplateTrackerWarpHomography.h> 11 int main(
int argc,
char **argv)
13 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) 14 std::string opt_videoname =
"bruegel.mp4";
15 unsigned int opt_subsample = 1;
17 for (
int i = 0; i < argc; i++) {
18 if (std::string(argv[i]) ==
"--videoname")
19 opt_videoname = std::string(argv[i + 1]);
20 else if (std::string(argv[i]) ==
"--subsample")
21 opt_subsample =
static_cast<unsigned int>(std::atoi(argv[i + 1]));
22 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
23 std::cout <<
"\nUsage: " << argv[0] <<
" [--videoname <video name>] [--subsample <scale factor>] [--help] [-h]\n" << std::endl;
28 std::cout <<
"Video name: " << opt_videoname << std::endl;
35 Iacq.
subsample(opt_subsample, opt_subsample, I);
37 #if defined(VISP_HAVE_X11) 39 #elif defined(VISP_HAVE_GDI) 41 #elif defined(VISP_HAVE_OPENCV) 44 std::cout <<
"No image viewer is available..." << std::endl;
47 display.
init(I, 100, 100,
"Template tracker");
56 tracker.setSampling(2, 2);
57 tracker.setLambda(0.001);
58 tracker.setIterationMax(200);
59 tracker.setPyramidal(2, 1);
68 Iacq.
subsample(opt_subsample, opt_subsample, I);
78 std::cout <<
"Homography: \n" << H << std::endl;
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
virtual void setDownScalingFactor(unsigned int scale)
void subsample(unsigned int v_scale, unsigned int h_scale, vpImage< Type > &sampled) const
Display for windows using GDI (available on any windows 32 platform).
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...
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
static void flush(const vpImage< unsigned char > &I)
VISP_EXPORT double measureTimeMs()
void open(vpImage< vpRGBa > &I)
Implementation of an homography and operations on homographies.
bool isVideoFormat() const
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void acquire(vpImage< vpRGBa > &I)
Implementation of column vector and the associated operations.
unsigned int getDownScalingFactor()
void setFileName(const std::string &filename)
vpHomography getHomography(const vpColVector &ParamM) const