2 #include <visp3/core/vpPixelMeterConversion.h> 3 #include <visp3/detection/vpDetectorQRCode.h> 4 #include <visp3/gui/vpDisplayGDI.h> 5 #include <visp3/gui/vpDisplayOpenCV.h> 6 #include <visp3/gui/vpDisplayX.h> 7 #include <visp3/io/vpImageIo.h> 8 #include <visp3/vision/vpPose.h> 10 void computePose(std::vector<vpPoint> &point,
const std::vector<vpImagePoint> &ip,
const vpCameraParameters &cam,
15 for (
unsigned int i = 0; i < point.size(); i++) {
29 if (residual_dem < residual_lag)
39 #if defined(VISP_HAVE_ZBAR) 44 #if defined(VISP_HAVE_X11) 46 #elif defined(VISP_HAVE_GDI) 48 #elif defined(VISP_HAVE_OPENCV) 56 std::vector<vpPoint> point;
57 point.push_back(
vpPoint(-0.06, -0.06,
59 point.push_back(
vpPoint(0.06, -0.06,
61 point.push_back(
vpPoint(0.06, 0.06, 0));
62 point.push_back(
vpPoint(-0.06, 0.06,
74 bool status = detector.
detect(I);
76 std::ostringstream legend;
77 legend << detector.
getNbObjects() <<
" bar code detected";
83 std::vector<vpImagePoint> p = detector.
getPolygon(i);
85 for (
size_t j = 0; j < p.size(); j++) {
87 std::ostringstream number;
92 computePose(point, p, cam, init,
108 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
111 std::cout <<
"ViSP is not build with zbar 3rd party." << std::endl;
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Display for windows using GDI (available on any windows 32 platform).
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
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.
bool detect(const vpImage< unsigned char > &I)
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...
size_t getNbObjects() const
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)
Implementation of a rotation vector as quaternion angle minimal representation.
const char * getMessage(void) const
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
vpTranslationVector getTranslationVector() const
unsigned int getHeight() const
static void read(vpImage< unsigned char > &I, const std::string &filename)
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, const vpImagePoint &offset=vpImagePoint(0, 0))
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
double computeResidual(const vpHomogeneousMatrix &cMo) const
Compute and return the residual expressed in meter for the pose matrix 'cMo'.
void addPoint(const vpPoint &P)
unsigned int getWidth() const
vpRotationMatrix getRotationMatrix() const
static const vpColor blue
std::vector< std::vector< vpImagePoint > > & getPolygon()