# DataMatrix Code Recognition Method Based on Coarse Positioning of Images
## 5 Experiments and Result Analysis
However, through the adaptive sampling grid division method proposed in this paper, as long as there is one module left on the rows and columns used by finder patterns to define data module size, the sampling grid can be accurately divided, as illustrated in Figure 17a,b, and after rebuilding finder patterns, DM code information can be parsed through libdmtx and zxing. Figure 15: Experimental results of sampling grid division: (**a**) standard DM code image; (**b**) standard DM code image; (**c**) indicates high accuracy; (**d**) indicates effectiveness; (**e**) indicates high accuracy; (**f**) indicates good robustness; (**g**) indicates high accuracy; (**h**) indicates good robustness; (**i**) indicates high accuracy; (**j**) indicates good robustness; (**k**) indicates good robustness; (**l**) indicates good robustness. This paper takes two types of datasets, including 20 standard 12 \(\times\) 12 DM code images as Dataset A and 10 DM code labels on butterfly specimens as Dataset B. To facilitate better recognition of the DM codes, the images of butterfly specimens need to be cropped before the image is cropped. Figure 16: DM code reconstruction diagram of Figure 15: (**a**) standard 24 \(\times\) 24 DM code image; (**b**) standard 12 \(\times\) 12 DM code image; (**c**) DM code label on butterfly specimen; (**d**) DM code label on plant specimen; (**e**) DM code etched on caliper; (**f**) DM code etched on machine part; (**g**) DM code etched on chip; (**h**) DM code on bottle; (**i**) DM code labels on medicine box; (**j**) DM code labels on medicine box; (**k**) DM code on microbial mass spectrometer target plate; (**l**) DM code on microbial mass spectrometer target plate. Figure 17: Sampling grid division diagram when finder pattern is damaged: (**a**) standard 24 \(\times\) 24 DM code image; (**b**) DM code etched on caliper. processing. Compared with popular DM code decoding open-source libraries libdmtx and zxing, this algorithm was evaluated in terms of resolution, anti-noise, and anti-distortion, with the experimental results presented in Figures 18 and 19. In addition, this paper also compares the execution time and memory consumption of the proposed algorithm with libdmtx and zxing using DM code images from Datasets A and B without added noise or distortion, with the results shown in Table 3. Among them, the experimental conditions for testing resolution are as follows: converting all of the DM code images in both Datasets A and B into data matrices and constructing all of them into DM code images of different pixel sizes to measure the minimum size that can be recognized. The experimental conditions for testing anti-noise are as follows: cropping the DM code images in Dataset A, and then converting all of the DM code images in both Datasets A and  
Figure 19: Line charts of experimental results of Dataset B. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dataset** & **Algorithm** & \
\begin{tabular}{c} **Average Execution** \\ **Time(s)** \\ \end{tabular} &
\begin{tabular}{c} **Average Memory** \\ **Consumption (KB)** \\ \end{tabular} \\ \hline \multirow{3}{*}{A} & \(\begin{array}{c}\text{libdmtx}\\ \text{zxing}\\ \text{this paper}\end{array}\) & 0.002 & 35.600 \\  & \(\begin{array}{c}\text{2 xing}\\ \text{5.133}\end{array}\) & 5.000 \\ \hline \multirow{3}{*}{B} & \(\begin{array}{c}\text{libdmtx}\\ \text{zxing}\\ \text{this paper}\end{array}\) & 0.004 & 60.364 \\  & \(\begin{array}{c}\text{2 xing}\\ \text{14.971}\end{array}\) & 6.909 \\ \hline \end{tabular}
\end{table} 
Table 3: Comparison with libdmtx and zxing of execution time and memory consumption. Figure 20: Samples of DM code images of Dataset A with varying levels of Gaussian noise added: (**a**) 19%; (**b**) 51%; (**c**) 68%. Figure 23: Samples of DM code images of Dataset A with varying levels of spherical distortion added: (**a**) \(-17\%\); (**b**) \(-25\%\); (**c**) \(-30\%\); (**d**) \(23\%\); (**e**) \(28\%\); (**f**) \(31\%\).