#include <iostream>
#include <visp3/ar/vpAROgre.h>
#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpImage.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#include <visp3/sensor/vpV4l2Grabber.h>
#if defined(HAVE_OPENCV_VIDEOIO)
#include <opencv2/videoio.hpp>
#endif
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
try {
#if defined(VISP_HAVE_OGRE)
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(HAVE_OPENCV_VIDEOIO)
#if defined(VISP_HAVE_V4L2)
#elif defined(VISP_HAVE_DC1394)
#elif defined(HAVE_OPENCV_VIDEOIO)
cv::VideoCapture grabber(0);
if (!grabber.isOpened()) {
std::cout << "Failed to open the camera" << std::endl;
return EXIT_FAILURE;
}
cv::Mat frame;
grabber >> frame;
#endif
double px = 565;
double py = 565;
ogre.
load(
"Robot",
"robot.mesh");
ogre.
setScale(
"Robot", 0.001f, 0.001f, 0.001f);
cMo[2][3] = 0.5;
std::cout << "cMo:\n" << cMo << std::endl;
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394)
#elif defined(HAVE_OPENCV_VIDEOIO)
grabber >> frame;
#endif
}
#else
std::cout << "You need an available framegrabber to run this example" << std::endl;
#endif
#else
std::cout << "You need Ogre3D to run this example" << std::endl;
#endif
return EXIT_SUCCESS;
}
std::cout << "Catch an exception: " << e << std::endl;
return EXIT_FAILURE;
}
catch (...) {
std::cout << "Catch an exception " << std::endl;
return EXIT_FAILURE;
}
}
Class for firewire ieee1394 video devices using libdc1394-2.x api.
Implementation of an augmented reality viewer using Ogre3D 3rd party.
bool continueRendering(void)
void setRotation(const std::string &sceneName, const vpRotationMatrix &wRo)
virtual void init(vpImage< unsigned char > &I, bool bufferedKeys=false, bool hidden=false)
virtual void display(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMw)
void load(const std::string &entityName, const std::string &model)
void setScale(const std::string &sceneName, float factorx, float factory, float factorz)
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)
unsigned int getWidth() const
unsigned int getHeight() const
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)