# DataMatrix Code Recognition Method Based on Coarse Positioning of Images
## 5 Experiments and Result Analysis  
To verify the performance of the above algorithm, we conducted experiments on the problems of DM code image blur, wear, corrosion, geometric distortion, and strong background interference in practical application scenarios and present 12 representative \begin{table}
\begin{tabular}{c c} \hline \hline
**Time Complexity** & **Space Complexity** \\ \hline \(O(m\times(n\text{log}n+n^{2}))\) & \(O(m\times n)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The computational complexity of Algorithm 2. Figure 13: Converting DM code image into data matrix. experimental results in this paper. After that, we prepared two types of datasets, including 20 standard 12 \(\times\) 12 DM code images, and 10 DM code labels on butterfly specimens, to compare with other DM code decoding algorithms with respect to resolution, anti-noise, anti-distortion, execution time, and memory consumption. Figure 14a-l are twelve original test images. Figure 14a,b are standard 24 \(\times\) 24 and 12 \(\times\) 12 DM code images; Figure 14c is a close-up image of a butterfly specimen label with a DM code, where the size of the DM code is small. Figure 14d is an image of a DM code label with printing issues, leading to image distortion, which affects its readability; Figure 14e,f are images of a mechanical tool and a component with DM codes etched onto the metallic surface. Due to the small size of Figure 14e and the shooting inclination of Figure 14f, the resolution is low, affecting its legibility. Figure 14g is a DM code image etched on a chip. The chip is tiny and the DM code image is even smaller, resulting in low resolution and blur of the DM code image. Figure 14h is a DM code label on a bottle, where the distortion of the DM code and the poor lighting add to the difficulty of decoding. Figure 14i,j are the DM code labels on medicine boxes, where stains and glue marks on the surface of the boxes affect decoding. Figure 14k,l are barcode labels on microbial mass spectrometer target plates; due to the poor lighting and tilted shooting angle, there is strong background interference and image distortion. Figure 15a-l are the experimental results of DM code image sampling grid division. The results show that the proposed adaptive sampling grid division method is effective and  
Figure 14: Test images: (**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. accurate. Figure 15c,e,g,i show that the adaptive sampling grid division method has high accuracy for small-size and low-resolution DM code images; Figure 15f,h,j-l show that even under distortion conditions or harsh lighting, the proposed method can accurately divide the sampling grid and has good robustness against interference from complex backgrounds. Figure 15d highlights this method's effectiveness in handling image deformation caused by printing issues. Based on Figure 15a-l, experiments were conducted on binarization based on the grid grayscale change trend. To facilitate observation of the experimental results, the data matrix generated by DM code images was visualized, and the experimental results were obtained successively, as shown in Figure 16a-l. Among them, dark modules and light modules represent binary \"1\" and \"0\". When using popular DM code decoding open-source libraries libdmtx [58] and zxing [59], taking Figure 14a,e as examples, where Figure 14e requires cropping before processing, since libdmtx and zxing both define the size of data modules based on finder patterns, if they are damaged, this will lead to failure of DM code decoding.