43 #include <visp/vpConfig.h>
49 #include <visp/vpDetectorDataMatrixCode.h>
65 bool detected =
false;
77 dec = dmtxDecodeCreate(img, 1);
82 reg = dmtxRegionFindNext(dec, 0);
85 msg = dmtxDecodeMatrixRegion(dec, reg, DmtxUndefined);
88 std::vector<vpImagePoint> polygon;
90 DmtxVector2 p00, p10, p11, p01;
92 p00.X = p00.Y = p10.Y = p01.X = 0.0;
93 p10.X = p01.Y = p11.X = p11.Y = 1.0;
94 dmtxMatrix3VMultiplyBy(&p00, reg->fit2raw);
95 dmtxMatrix3VMultiplyBy(&p10, reg->fit2raw);
96 dmtxMatrix3VMultiplyBy(&p11, reg->fit2raw);
97 dmtxMatrix3VMultiplyBy(&p01, reg->fit2raw);
106 m_message.push_back( (
const char *)msg->output);
113 dmtxMessageDestroy(&msg);
118 dmtxRegionDestroy(®);
122 dmtxDecodeDestroy(&dec);
123 dmtxImageDestroy(&img);
unsigned int getWidth() const
Type * bitmap
points toward the bitmap
size_t m_nb_objects
Number of detected objects.
std::vector< std::string > m_message
Message attached to each object.
vpDetectorDataMatrixCode()
bool detect(const vpImage< unsigned char > &I)
unsigned int getHeight() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
std::vector< std::vector< vpImagePoint > > m_polygon
For each object, defines the polygon that contains the object.