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 #include "pose_helper.h" 14 #if defined(VISP_HAVE_ZBAR) 19 #if defined(VISP_HAVE_X11) 21 #elif defined(VISP_HAVE_GDI) 23 #elif defined(VISP_HAVE_OPENCV) 31 std::vector<vpPoint> point;
32 point.push_back(
vpPoint(-0.06, -0.06, 0));
33 point.push_back(
vpPoint( 0.06, -0.06, 0));
34 point.push_back(
vpPoint( 0.06, 0.06, 0));
35 point.push_back(
vpPoint(-0.06, 0.06, 0));
46 bool status = detector.
detect(I);
48 std::ostringstream legend;
49 legend << detector.
getNbObjects() <<
" bar code detected";
55 std::vector<vpImagePoint> p = detector.
getPolygon(i);
57 for (
size_t j = 0; j < p.size(); j++) {
59 std::ostringstream number;
64 computePose(point, p, cam, init, cMo);
79 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
82 std::cout <<
"ViSP is not build with zbar 3rd party." << std::endl;
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
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)
size_t getNbObjects() const
const char * getMessage() const
static void flush(const vpImage< unsigned char > &I)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Generic class defining intrinsic camera parameters.
Implementation of a rotation vector as quaternion angle minimal representation.
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 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 ...
unsigned int getWidth() const
vpRotationMatrix getRotationMatrix() const
static const vpColor blue
std::vector< std::vector< vpImagePoint > > & getPolygon()