38 #include <visp3/core/vpConfig.h>
44 #include <visp3/detection/vpDetectorDataMatrixCode.h>
62 bool detected =
false;
71 DmtxTime *dmtx_timeout =
nullptr;
73 dmtx_timeout =
new DmtxTime;
74 *dmtx_timeout = dmtxTimeNow();
79 assert(img !=
nullptr);
81 dec = dmtxDecodeCreate(img, 1);
82 assert(dec !=
nullptr);
86 reg = dmtxRegionFindNext(dec, dmtx_timeout);
89 msg = dmtxDecodeMatrixRegion(dec, reg, DmtxUndefined);
92 std::vector<vpImagePoint> polygon;
94 DmtxVector2 p00, p10, p11, p01;
96 p00.X = p00.Y = p10.Y = p01.X = 0.0;
97 p10.X = p01.Y = p11.X = p11.Y = 1.0;
98 dmtxMatrix3VMultiplyBy(&p00, reg->fit2raw);
99 dmtxMatrix3VMultiplyBy(&p10, reg->fit2raw);
100 dmtxMatrix3VMultiplyBy(&p11, reg->fit2raw);
101 dmtxMatrix3VMultiplyBy(&p01, reg->fit2raw);
110 m_message.push_back((
const char *)msg->output);
117 dmtxMessageDestroy(&msg);
122 dmtxRegionDestroy(®);
126 dmtxDecodeDestroy(&dec);
127 dmtxImageDestroy(&img);
134 #elif !defined(VISP_BUILD_SHARED_LIBS)
137 void dummy_vpDetectorDataMatrixCode() { };
std::vector< std::string > m_message
Message attached to each object.
std::vector< std::vector< vpImagePoint > > m_polygon
For each object, defines the polygon that contains the object.
void setTimeout(unsigned long timeout_ms)
size_t m_nb_objects
Number of detected objects.
unsigned long m_timeout_ms
Detection timeout.
vpDetectorDataMatrixCode()
bool detect(const vpImage< unsigned char > &I) VP_OVERRIDE
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int getWidth() const
Type * bitmap
points toward the bitmap
unsigned int getHeight() const