# DataMatrix Code Recognition Method Based on Coarse Positioning of Images
## 6 Conclusions  
This paper proposes a DM code recognition algorithm based on the coarse positioning of images. The algorithm uses a projection algorithm and an exponential weighted moving average model to convert two-dimensional barcodes into one-dimensional waveforms for analysis and corrects abnormal segmentation lines to achieve adaptive division of sampling grids. After dividing the sampling grid, combined with the LOF algorithm and local weighted linear regression algorithm, according to the grayscale change trend of the sampling grid, the grayscale value of the grid is predicted and binarization is performed to achieve conversion from a DM code image to a data matrix.  
Compared with traditional algorithms, this algorithm can effectively divide the sampling grid of DM codes whose finder patterns are polluted or missing and has been optimized for problems such as DM code image blur, wear, corrosion, geometric distortion, and strong background interference in practical application scenarios. It reduces the quality requirements for DM code images and improves the robustness of DM code recognition in complex environments.  
Although this algorithm has higher robustness in DM code recognition in complex environments, for DM code images with clean backgrounds, less pollution, and high image quality, this algorithm is slightly cumbersome and has low computational efficiency. Therefore, the best application object of this algorithm is DM code images with a high-pollution background or low image quality, as it can be used as an alternative plan after traditional algorithm recognition fails. Future work on this algorithm aims to focus on improving its efficiency, such as by incorporating machine learning-based optimization techniques to reduce processing time and memory consumption. Furthermore, improving its computational efficiency, expanding its application to real-time systems, and exploring its integration with automation processes in industries like logistics, manufacturing, and healthcare could bring significant benefits in environments where image quality is often compromised.  
The next step will involve testing the algorithm with a broader range of real-world data and investigating the possibility of applying the method to other types of two-dimensional barcodes, paving the way for further optimization and real-world deployment.  
Conceptualization, L.H., G.Z. and Z.C. ([PERSON]); methodology, L.H. and G.Z.; software, L.H. and G.Z.; validation, L.H. and G.Z.; formal analysis, L.H., G.Z. and Z.C. ([PERSON]); investigation, L.H. and G.Z.; resources, Z.C. ([PERSON]) and Z.C. ([PERSON]); data curation, G.Z.; writing--original draft preparation, L.H.; writing--review and editing, G.Z. and Z.C. ([PERSON]); visualization, L.H. and G.Z.; supervision, Z.C. ([PERSON]) and Z.C. ([PERSON]) All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
The archived version of the code and the data presented in this article are publicly available in the GitHub repository at [[https://github.com/LingyHu/DataMatrix](https://github.com/LingyHu/DataMatrix)]([https://github.com/LingyHu/DataMatrix](https://github.com/LingyHu/DataMatrix)) (accessed on 21 February 2025).  
The authors declare no conflicts of interest.