1 #include <visp3/gui/vpDisplayGDI.h> 3 #include <visp3/gui/vpDisplayOpenCV.h> 4 #include <visp3/gui/vpDisplayX.h> 6 #include <visp3/core/vpTime.h> 7 #include <visp3/io/vpVideoReader.h> 16 int main(
int argc,
char **argv)
18 #if (VISP_HAVE_OPENCV_VERSION >= 0x020100) 20 std::string videoname =
"video.mpg";
22 for (
int i = 0; i < argc; i++) {
23 if (std::string(argv[i]) ==
"--name")
24 videoname = std::string(argv[i + 1]);
25 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
26 std::cout <<
"\nUsage: " << argv[0] <<
" [--name <video name> (default: " << videoname <<
")] [--help] [-h]\n" << std::endl;
41 std::cout <<
"Video name : " << videoname << std::endl;
42 std::cout <<
"Video framerate: " << g.
getFramerate() <<
"Hz" << std::endl;
43 std::cout <<
"Video dimension: " << I.
getWidth() <<
" " << I.
getHeight() << std::endl;
47 #elif defined(VISP_HAVE_GDI) 49 #elif defined(VISP_HAVE_OPENCV) 52 std::cout <<
"No image viewer is available..." << std::endl;
69 ss <<
"Frame: " << cpt ++;
78 std::cout <<
"End of video was reached" << std::endl;
85 std::cout <<
"Install OpenCV and rebuild ViSP to use this example." << std::endl;
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
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...
error that can be emited by ViSP classes.
static void flush(const vpImage< unsigned char > &I)
VISP_EXPORT double measureTimeMs()
void open(vpImage< vpRGBa > &I)
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)
const char * getMessage(void) const
unsigned int getHeight() const
void setFileName(const std::string &filename)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
unsigned int getWidth() const