2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/blob/vpDot2.h>
6 #include <visp3/io/vpImageIo.h>
7 #include <visp3/core/vpPixelMeterConversion.h>
8 #include <visp3/vision/vpPose.h>
10 void computePose(std::vector<vpPoint> &point,
const std::vector<vpDot2> &dot,
13 vpPose pose;
double x=0, y=0;
14 for (
unsigned int i=0; i < point.size(); i ++) {
28 if (residual_dem < residual_lag)
42 #if defined(VISP_HAVE_X11)
44 #elif defined(VISP_HAVE_GDI)
46 #elif defined(VISP_HAVE_OPENCV)
51 std::vector<vpDot2> dot(4);
56 std::vector<vpPoint> point;
57 point.push_back(
vpPoint(-0.06, -0.06, 0) );
58 point.push_back(
vpPoint( 0.06, -0.06, 0) );
59 point.push_back(
vpPoint( 0.06, 0.06, 0) );
60 point.push_back(
vpPoint(-0.06, 0.06, 0) );
67 for (
unsigned int i=0; i < dot.size(); i ++) {
68 dot[i].setGraphics(
true);
71 computePose(point, dot, cam, init, cMo);
75 if (init) init =
false;
83 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
unsigned int getWidth() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
Display for windows using GDI (available on any windows 32 platform).
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
static const vpColor none
error that can be emited by ViSP classes.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
static void flush(const vpImage< unsigned char > &I)
Class that defines what is a point.
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
Generic class defining intrinsic camera parameters.
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(vpHomogeneousMatrix *)=NULL)
const char * getMessage(void) const
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0, 0))
static void read(vpImage< unsigned char > &I, const std::string &filename)
unsigned int getHeight() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void addPoint(const vpPoint &P)
double computeResidual(const vpHomogeneousMatrix &cMo) const
Compute and return the residual expressed in meter for the pose matrix 'cMo'.