#include <visp3/core/vpImageConvert.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/io/vpVideoReader.h>
#include <visp3/klt/vpKltOpencv.h>
int main(int argc, const char *argv[])
{
#ifdef VISP_HAVE_OPENCV
try {
std::string opt_videoname = "video-postcard.mp4";
bool opt_init_by_click = false;
unsigned int opt_subsample = 1;
for (int i = 0; i < argc; i++) {
if (std::string(argv[i]) == "--videoname")
opt_videoname = std::string(argv[i + 1]);
else if (std::string(argv[i]) == "--init-by-click")
opt_init_by_click = true;
else if (std::string(argv[i]) == "--subsample")
opt_subsample = static_cast<unsigned int>(std::atoi(argv[i + 1]));
else if (std::string(argv[i]) == "--help" || std::string(argv[i]) == "-h") {
std::cout << "Usage: " << argv[0]
<< " [--videoname <video name>] [--subsample <scale factor>] [--init-by-click]"
<< " [--help] [-h]" << std::endl;
return 0;
}
}
Iacq.
subsample(opt_subsample, opt_subsample, I);
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
IplImage *cvI = NULL;
#else
cv::Mat cvI;
#endif
if (opt_init_by_click) {
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
std::vector<CvPoint2D32f> feature;
#else
std::vector<cv::Point2f> feature;
#endif
do {
feature.push_back(cv::Point2f((
float)ip.
get_u(), (float)ip.
get_v()));
}
}
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
#else
#endif
} else {
}
std::cout <<
"Tracker initialized with " << tracker.
getNbFeatures() <<
" features" << std::endl;
Iacq.
subsample(opt_subsample, opt_subsample, I);
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
std::vector<CvPoint2D32f> feature;
#else
std::vector<cv::Point2f> feature;
#endif
do {
feature.push_back(cv::Point2f((
float)ip.
get_u(), (float)ip.
get_v()));
}
}
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
#else
#endif
}
break;
}
}
#if (VISP_HAVE_OPENCV_VERSION < 0x020408)
cvReleaseImage(&cvI);
#endif
return 0;
std::cout << "Catch an exception: " << e << std::endl;
}
#else
(void)argc;
(void)argv;
#endif
}