#include <iostream>
#include <visp/vpOpenCVGrabber.h>
#include <visp/vpV4l2Grabber.h>
#include <visp/vp1394TwoGrabber.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpImage.h>
#include <visp/vpCameraParameters.h>
#include <visp/vpAROgre.h>
int main()
{
try {
#if defined(VISP_HAVE_OGRE)
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)
#if defined(VISP_HAVE_V4L2)
#elif defined(VISP_HAVE_DC1394_2)
#elif defined(VISP_HAVE_OPENCV)
cv::VideoCapture grabber(0);
if(!grabber.isOpened()) {
std::cout << "Failed to open the camera" << std::endl;
return -1;
}
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] = 1.;
std::cout << "cMo:\n" << cMo << std::endl;
while(ogre.continueRendering()){
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2)
grabber.acquire(I);
#elif defined(VISP_HAVE_OPENCV)
grabber >> frame;
#endif
ogre.display(I,cMo);
}
#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 0;
}
std::cout << "Catch an exception: " << e << std::endl;
return 1;
}
catch(...) {
std::cout << "Catch an exception " << std::endl;
return 1;
}
}