# Data Matrix Based Low Cost Autonomous Detection of Medicine Packages
## 3 Experiments and Results  
The developed prototype was installed and tested at the Hospital Pharmacy of the Centro Hospitalar de Vila Nova de Gaia/Espinho, E.P.E., by technicians which perform the medicine packages registration. The proposed prototype is a stand-alone system that can be placed alongside with the conventional scanner, replacing it. A space of 300 mm \(\times\) 300 mm in a table is enough to accommodate the developed reader (with a height of 400 mm). It requires to be supplied by 110 V or 230 V and it owns all the required hardware and  
Figure 8: Scanning process: (**a**) Acquired image with 16 codes; (**b**) \(libdmtx\) scanning output; (**c**) Original image; (**d**) Data Matrix identified by the library; (**e**) The extracted codes according to the defined protocol (libdmtx codes output, as read by a commercial data matrix scanner). software to introduce by USB the decodes matrix codes present on the boxes into the hospital system. The developed prototype was connected, by a USB link, to the same computer to which the original Data Matrix scanner is connected. The computer is used to send the verification codes to the central database. Instead of using the original Data Matrix scanner, the proposed system was assessed by reading the codes, decoding, and introducing them in the database by USB. Figure 9 shows the prototype installed and tested at the hospital pharmaceutical facilities. The right monitor shows the developed application and the Data Matrix identified. The left one shows the hospital computer receiving the codes to validate. The system is launched when the user presses the button and the lighting system is turned on for two seconds to stabilize the camera and capture the image. The LED turns red and the \(libdntx\) is used to extract and decode each Data Matrix. Each code is introduced into the hospital computer (as a keyboard) using the same settings and protocol as the original scanner was programmed. The acquired image and its Data Matrix codes identified and delimited by green squares, allow the user to visually validate the task. Preliminary tests were executed in order to analyze the time and the robustness of the Data Matrix code detection system. According to the commonly performed process, a technician takes between half a second and one second to scan each medicine box. In contrast, the proposed system takes about two seconds to stabilize the image and an average of one second per box. Meanwhile, while the scanning is being performed, the technician can be redirected to do another task. The proposed system has the advantage to scan multiple codes at the same time. To assess the system robustness, the scanning process was performed on boxes covered by reflector plastic as well as rounded bottles, having achieved successful results, as demonstrated by Figure 10.  
Figure 9: Prototype installed and tested at hospital pharmaceutical facilities. The right monitor presents the developed application. At left the hospital computer receiving the Data Matrix codes to validate. The integration with the hospital software was tested and validated. Instead of using the original scanner to shoot Data Matrix codes one by one, the proposed system acquires one image and introduces several Data matrix codes sequentially without the intervention of the technician. The obtained feedback from four technicians (from different shifts) that used the prototype was very positive since they mentioned that the system allows them to do other tasks while introducing the codes increasing the productivity. Moreover, they pointed out some future work possibilities, such as using a conveyor belt to move the boxes in front of the camera in a FIFO (First In, First Out) cue type. Moreover, increasing the detection area was also pointed. As a statistical result, detection robustness was done with real medicine boxes. In total, about two hundred medicine boxes were placed in front of the camera (within 15 images) and 90% of Data Matrix codes were correctly identified, using the proposed system.