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 defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) || defined(VISP_HAVE_FFMPEG)
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") {
26 std::cout <<
"\nUsage: " << argv[0] <<
" [--name <video name>] [--help]\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;
78 std::cout <<
"Install OpenCV or ffmpeg 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)
unsigned int getWidth() const
Display for windows using GDI (available on any windows 32 platform).
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
void setFileName(const char *filename)
unsigned int getHeight() const
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)