42#include <visp3/core/vpConfig.h>
52#include <visp3/ar/vpAROgre.h>
53#include <visp3/core/vpCameraParameters.h>
54#include <visp3/core/vpHomogeneousMatrix.h>
55#include <visp3/core/vpImage.h>
56#include <visp3/sensor/vp1394TwoGrabber.h>
57#include <visp3/sensor/vpV4l2Grabber.h>
59#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)
60#include <opencv2/highgui/highgui.hpp>
61#elif defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)
62#include <opencv2/videoio/videoio.hpp>
67#ifdef ENABLE_VISP_NAMESPACE
72#if defined(VISP_HAVE_OGRE)
73#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_OPENCV) && \
74 (((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
75 ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
83#if defined(VISP_HAVE_V4L2)
88#elif defined(VISP_HAVE_DC1394)
93#elif defined(VISP_HAVE_OPENCV) && \
94 (((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
95 ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
97 cv::VideoCapture grabber(0);
98 if (!grabber.isOpened()) {
99 std::cout <<
"Failed to open the camera" << std::endl;
110 double u0 = I.getWidth() / 2;
111 double v0 = I.getHeight() / 2;
120 vpAROgre ogre(cam, I.getWidth(), I.getHeight());
140 ogre.load(
"Robot",
"robot.mesh");
145 ogre.setScale(
"Robot", 0.001f, 0.001f, 0.001f);
151 std::cout <<
"cMo:\n" <<
cMo << std::endl;
154 while (ogre.continueRendering()) {
156#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394)
158#elif defined(VISP_HAVE_OPENCV) && \
159 (((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI)) || \
160 ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO)))
168 ogre.display(I, cMo);
171 std::cout <<
"You need an available framegrabber to run this example" << std::endl;
174 std::cout <<
"You need Ogre3D to run this example" << std::endl;
179 std::cout <<
"Catch an exception: " <<
e << std::endl;
183 std::cout <<
"Catch an exception " << std::endl;
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void acquire(vpImage< unsigned char > &I)
void open(vpImage< unsigned char > &I)
Implementation of an augmented reality viewer using Ogre3D 3rd party.
Generic class defining intrinsic camera parameters.
error that can be emitted by ViSP classes.
Implementation of an homogeneous matrix and operations on such kind of matrices.
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Definition of the vpImage class member functions.
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
void open(vpImage< unsigned char > &I)
void acquire(vpImage< unsigned char > &I)