# Data Matrix Based Low Cost Autonomous Detection of Medicine Packages
## 1 Introduction
Some of the approaches are based on deep learning theory to solve the problem of barcode detection [19]. These algorithms are useful to detect the required patterns in image. The description of the markers generation can be found in [20]. Currently, some commercial solutions can achieve pharmaceutical product traceability through the Data Matrix reading. Funcode technology developed a QR Code/Data Matrix (2D Barcode) reader whose features comprise the scanning, with a Raspberry Pi, of tiny, moving and multiple barcodes using multiple cameras. The algorithm is robust to conditions such as non-uniform lighting or blurred and distorted codes. Its main applications include industrial automation, pharmaceutical products and consumer goods labels, intelligent logistics center, package tracking, automated tracking of product, among others [21]. Scandit presents a mobile barcode scanning application robust to different 1D or 2D symbologies such as Data Matrix. MatrixScan allows to locate, track and decode multiple barcodes, while displaying feedback in the device's screen as an Augmented Reality-overlay, to identify which have already been scanned. The software is able to handle barcodes in challenging conditions such as glare and metal reflections, low light and shadows, damaged, torn, and blurry barcodes, or skewed angles. Some applications in the healthcare sector emcompass shelf management, search-and-find packages, patient verification and medication tracking [22]. In the pharmaceutical/medical industry, Cognex resorts to image-based fixed-mount barcode readers (including Data Matrix symbology) to ensure the simultaneous track-and-trace of multiple medical devices on high-speed production lines, multiples sides, and even extreme angles. The algorithm is able to efficiently scan blurred, damaged or low contrast barcodes. Additional applications include the automation of inspection and distribution of primary (e.g., vials or pre-filled syringes) and secondary (e.g., vaccine boxes) packages. Cognex supplies guidance to other markets such as logistics, life sciences and aerospace [23]. To the best of the authors' knowledge, there is still not a established solution to be applied at the national hospital pharmacies. In this work, a hospital pharmacy scenario is focused, more precisely the pharmacy department of the Centro Hospitalar de Vila Nova de Gaia/Espinho, E.P.E., Portugal, where, on average, more than 27,000 medicine packages are handled per month. Due to the lack of human resources, the action of having each medicine be manually validated at the secondary level by an operator by means of a scanner is burdensome, time-consuming and not the foremost task for the operator. To prioritize some medicine packages, criteria such as their medical significance or cost might be applied. Moreover, the aforementioned action is monotonous, tedious, frequent and highly repetitive, due to the recurrent lifting and transferring of packages, and repeated hand/wrist motions to place the scan in the correct position and press the button to detect  
Figure 2: Packaging levels schematic. Adapted from [16]. the Data Matrix code [24]. The addressed cases are common physical work-related risk factors that can cause upper limb musculoskeletal disorders to the operator [25], and therefore should be avoided. To include all the information of medicine products in a pharmaceutical system, hence enabling their traceability, as well as to contribute to the operator's ergonomy, a low cost solution for automating the simultaneous scanning of multiple medicine packages based on Data Matrix codes is proposed in this work. One important requirement was that the system should be easily integrated in the infrastructure of the Hospital Pharmacy. The remainder of this paper is organized as follows. Section 2 presents the proposed Methodology addressing the hardware, the system architecture and the Software employed. Section 3 stresses the experimental results performed in hospital pharmacy facilities.