#include <visp3/core/vpConfig.h>
#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpPixelMeterConversion.h>
#include <visp3/detection/vpDetectorQRCode.h>
#include <visp3/gui/vpDisplayFactory.h>
#include <visp3/io/vpImageIo.h>
#include <visp3/vision/vpPose.h>
#include "pose_helper.h"
int main(int, char *argv[])
{
#if defined(VISP_HAVE_ZBAR)
#ifdef ENABLE_VISP_NAMESPACE
#endif
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
std::shared_ptr<vpDisplay> display;
#else
#endif
try {
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
#else
#endif
std::vector<vpPoint> point;
point.push_back(
vpPoint(-0.06, -0.06, 0));
point.push_back(
vpPoint(0.06, -0.06, 0));
point.push_back(
vpPoint(0.06, 0.06, 0));
point.push_back(
vpPoint(-0.06, 0.06, 0));
bool init = true;
vpDetectorQRCode detector;
while (1) {
bool status = detector.detect(I);
std::ostringstream legend;
legend << detector.getNbObjects() << " bar code detected";
if (status) {
for (size_t i = 0; i < detector.getNbObjects(); i++) {
std::vector<vpImagePoint> p = detector.getPolygon(i);
for (size_t j = 0; j < p.size(); j++) {
std::ostringstream number;
number << j;
}
computePose(point, p, cam, init, cMo);
}
}
break;
}
}
std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
}
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
if (display != nullptr) {
delete display;
}
#endif
#else
(void)argv;
std::cout << "ViSP is not build with zbar 3rd party." << std::endl;
#endif
}
Generic class defining intrinsic camera parameters.
static const vpColor none
static const vpColor blue
Class that defines generic functionalities for display.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
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), const std::string &frameName="", const vpColor &textColor=vpColor::black, const vpImagePoint &textOffset=vpImagePoint(15, 15))
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
const char * getMessage() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpRotationMatrix getRotationMatrix() const
vpTranslationVector getTranslationVector() const
static void read(vpImage< unsigned char > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int getWidth() const
unsigned int getHeight() const
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
Implementation of a rotation vector as quaternion angle minimal representation.
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
VISP_EXPORT int wait(double t0, double t)