#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/detection/vpDetectorFace.h>
#include <visp3/io/vpVideoReader.h>
int main(int argc, const char *argv[])
{
#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020200)
try {
std::string opt_face_cascade_name = "./haarcascade_frontalface_alt.xml";
std::string opt_video = "video.mpeg";
for (int i = 0; i < argc; i++) {
if (std::string(argv[i]) == "--haar")
opt_face_cascade_name = std::string(argv[i + 1]);
else if (std::string(argv[i]) == "--video")
opt_video = std::string(argv[i + 1]);
else if (std::string(argv[i]) == "--help") {
std::cout << "Usage: " << argv[0]
<< " [--haar <haarcascade xml filename>] [--video <input "
"video file>] [--help]"
<< std::endl;
return 0;
}
}
#if defined(VISP_HAVE_X11)
#elif defined(VISP_HAVE_GDI)
#elif defined(VISP_HAVE_OPENCV)
#endif
bool exit_requested = false;
while (!g.
end() && !exit_requested) {
bool face_found = face_detector.
detect(I);
if (face_found) {
std::ostringstream text;
text <<
"Found " << face_detector.
getNbObjects() <<
" face(s)";
}
}
exit_requested = true;
}
if (!exit_requested)
}
#else
(void)argc;
(void)argv;
#endif
}