2 #include <visp/vp1394CMUGrabber.h>
3 #include <visp/vp1394TwoGrabber.h>
4 #include <visp/vpDisplayGDI.h>
5 #include <visp/vpDisplayX.h>
6 #include <visp/vpDot2.h>
7 #include <visp/vpPixelMeterConversion.h>
8 #include <visp/vpPose.h>
10 void computePose(std::vector<vpPoint> &point,
const std::vector<vpDot2> &dot,
12 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
16 void computePose(std::vector<vpPoint> &point,
const std::vector<vpDot2> &dot,
19 vpPose pose;
double x=0, y=0;
20 for (
unsigned int i=0; i < point.size(); i ++) {
31 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
36 for(
unsigned int i=0; i<dot.size(); i++) {
37 dot[i].setGraphics(
true);
38 dot[i].setGraphicsThickness(2);
39 dot[i].initTracking(I);
44 for(
unsigned int i=0; i<dot.size(); i++) {
53 #if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394))
56 #if defined(VISP_HAVE_DC1394_2)
58 #elif defined(VISP_HAVE_CMU1394)
69 std::vector<vpDot2> dot(4);
70 std::vector<vpPoint> point(4);
72 point[0].setWorldCoordinates(-L, -L, 0);
73 point[1].setWorldCoordinates( L, -L, 0);
74 point[2].setWorldCoordinates( L, L, 0);
75 point[3].setWorldCoordinates(-L, L, 0);
78 #if defined(VISP_HAVE_X11)
80 #elif defined(VISP_HAVE_GDI)
89 computePose(point, dot, cam, init, cMo);
92 if (init) init =
false;
99 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...
void open(vpImage< unsigned char > &I)
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 void flush(const vpImage< unsigned char > &I)
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void acquire(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
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void computePose(vpPoseMethodType methode, vpHomogeneousMatrix &cMo)
compute the pose for a given method
virtual bool getClick(bool blocking=true)=0
void addPoint(const vpPoint &P)
Add a new point in this array.