1 #include <visp/vpDisplayGDI.h>
3 #include <visp/vpDisplayOpenCV.h>
4 #include <visp/vpDisplayX.h>
6 #include <visp/vpTime.h>
7 #include <visp/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;
const char * getMessage(void)
unsigned int getWidth() const
Display for windows using GDI (available on any windows 32 platform).
Define the X11 console to display images.
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 double measureTimeMs()
static int wait(double t0, double t)
static void flush(const vpImage< unsigned char > &I)
void open(vpImage< vpRGBa > &I)
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
virtual void setTitle(const char *title)=0
void acquire(vpImage< vpRGBa > &I)
void setFileName(const char *filename)
unsigned int getHeight() const
virtual bool getClick(bool blocking=true)=0