2 #include <visp/vpDisplayGDI.h>
3 #include <visp/vpDisplayX.h>
4 #include <visp/vpDot2.h>
5 #include <visp/vpImageIo.h>
6 #include <visp/vpPixelMeterConversion.h>
7 #include <visp/vpPose.h>
9 void computePose(std::vector<vpPoint> &point,
const std::vector<vpDot2> &dot,
12 void computePose(std::vector<vpPoint> &point,
const std::vector<vpDot2> &dot,
15 vpPose pose;
double x=0, y=0;
16 for (
unsigned int i=0; i < point.size(); i ++) {
33 #if defined(VISP_HAVE_X11)
35 #elif defined(VISP_HAVE_GDI)
40 std::vector<vpDot2> dot(4);
45 std::vector<vpPoint> point(4);
46 point[0].setWorldCoordinates(-0.06, -0.06, 0);
47 point[1].setWorldCoordinates( 0.06, -0.06, 0);
48 point[2].setWorldCoordinates( 0.06, 0.06, 0);
49 point[3].setWorldCoordinates(-0.06, 0.06, 0);
56 for (
unsigned int i=0; i < dot.size(); i ++) {
57 dot[i].setGraphics(
true);
60 computePose(point, dot, cam, init, cMo);
64 if (init) init =
false;
72 std::cout <<
"Catch an exception: " << e << std::endl;
unsigned int getWidth() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Display for windows using GDI (available on any windows 32 platform).
Define the X11 console to display images.
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 int wait(double t0, double t)
static void flush(const vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
Class used for pose computation from N points (pose from point only).
Generic class defining intrinsic camera parameters.
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness=1)
unsigned int getHeight() const
void computePose(vpPoseMethodType methode, vpHomogeneousMatrix &cMo)
compute the pose for a given method
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static void read(vpImage< unsigned char > &I, const char *filename)
void addPoint(const vpPoint &P)
Add a new point in this array.