1 #include <visp3/core/vpConfig.h>
3 #ifdef VISP_HAVE_MODULE_SENSOR
4 #include <visp3/sensor/vpV4l2Grabber.h>
6 #include <visp3/blob/vpDot2.h>
7 #include <visp3/gui/vpDisplayGDI.h>
8 #include <visp3/gui/vpDisplayGTK.h>
9 #include <visp3/gui/vpDisplayOpenCV.h>
10 #include <visp3/gui/vpDisplayX.h>
12 #if defined(HAVE_OPENCV_VIDEOIO)
13 #include <opencv2/videoio.hpp>
16 int main(
int argc,
char **argv)
18 #if ((defined(VISP_HAVE_V4L2) || defined(HAVE_OPENCV_VIDEOIO)) && \
19 (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GTK)))
21 #ifdef ENABLE_VISP_NAMESPACE
27 device = std::atoi(argv[1]);
32 ss <<
"/dev/video" << device;
34 std::cout <<
"Connect to: " << ss.str() << std::endl;
35 #if defined(VISP_HAVE_V4L2)
39 #elif defined(HAVE_OPENCV_VIDEOIO)
40 cv::VideoCapture g(device);
42 std::cout <<
"Failed to open the camera" << std::endl;
50 #if defined(VISP_HAVE_X11)
51 vpDisplayX d(I, 0, 0,
"Camera view");
52 #elif defined(VISP_HAVE_GDI)
54 #elif defined(HAVE_OPENCV_HIGHGUI)
56 #elif defined(VISP_HAVE_GTK)
65 bool init_done =
false;
66 std::cout <<
"Click!!!" << std::endl;
69 #if defined(VISP_HAVE_V4L2)
71 #elif defined(HAVE_OPENCV_VIDEOIO)
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I, bool canMakeTheWindowGrow=true)
void setGraphics(bool activate)
void setGraphicsThickness(unsigned int thickness)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
void open(vpImage< unsigned char > &I)
void setDevice(const std::string &devname)
void acquire(vpImage< unsigned char > &I)