 |
Visual Servoing Platform
version 3.3.0
|
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;
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
VISP_EXPORT int wait(double t0, double t)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
Display for windows using GDI (available on any windows 32 platform).
unsigned int getHeight() const
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
VISP_EXPORT double measureTimeMs()
unsigned int getWidth() const
void open(vpImage< vpRGBa > &I)
Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the...
void setFileName(const std::string &filename)
static void display(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
const char * getMessage(void) const
static void flush(const vpImage< unsigned char > &I)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
error that can be emited by ViSP classes.
void acquire(vpImage< vpRGBa > &I)