1

By using open source library, pylibdmtx is able to detect data matrix barcode inside an image. The processing speed slower when the barcode just a small portion in a large image. It take few argument to shrink and detected the barcode

Here is a part of coding in the library

with libdmtx_decoder(img, shrink) as decoder:
        properties = [
            (DmtxProperty.DmtxPropScanGap, gap_size),
            (DmtxProperty.DmtxPropSymbolSize, shape),
            (DmtxProperty.DmtxPropSquareDevn, deviation),
            (DmtxProperty.DmtxPropEdgeThresh, threshold),
            (DmtxProperty.DmtxPropEdgeMin, min_edge),
            (DmtxProperty.DmtxPropEdgeMax, max_edge)
        ]

My question is, is there any other library to use beside pylibdmtx ? Or any suggestion to increase the processing speed without affect the accuracy. By the way pylibdmtx is updated on 18/1/2017, it is a maintained library

Jackdon Chew
  • 117
  • 1
  • 2
  • 10

2 Answers2

1

An option is to pre-locate the code by image filtering.

A Data Matrix has a high contrast (in theory) and a given cell size. If you shring the image so that cells become one or two pixels large, the Data Matrix will stand-out as a highly textured area, and the gradient will strongly respond.

  • shrink argument in decoder functions indeed helps, although I do not fully understand it! So really thanks for your answer. – TwinPenguins Aug 23 '19 at 11:29
  • Alternatively: If you crop all data matrices in an image and run pylibdmtx on each of the cropped subimages it runs significantly faster – jstm Jun 28 '21 at 21:31
0

I am also using this library for decoding data matrix and i found something about these arguments that timeout is int value in milliseconds which is really helping for quickly decoding and gap_size is no of pixels between tow data matrix used when you have more than one data matrix in sequence to decode with equal gap. with threshold you can directly give threshold value between 0-100 to this function without using open-CV functions and max count is no of data matrix to be decode in one image and shape is data_matrix size i. for 1010 it is 0, 1212 it is 1 and so on. by using all these together we can have quick and effective decoding of data matrix.