{'fraction_non_alphanumeric': 0.02396035877814715, 'fraction_numerical': 0.008467666060339961, 'mean_word_length': 5.30197628458498, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Barcode Recognizable System Implementing Based on AM5728

To refine the implementation of industrial camera requirements in terms of barcode identification, speeding the barcode image acquisition and processing challenges, as well as the defect of low accuracy. We proposed a barcode recognition framework based on AM5728 embedded system, which employed industrial CCD to scan the barcode image, moreover, integrated with AM5728 visual development platform to manipulate the collected images. After that, decoding information is yielded from series of algorithms refer to convolution filtering, barcode positioning as well as recognition facilitated by AM5728 visual development platform. Experimental outcomes validated that the accuracy of our system recognition rate can reach up to satisfied 100% in the threshold condition, with 20 frames per second barcode images recognition rate.


Introduction
With the recent advances in intelligent hardware technology and the extensive application of barcode in commercial circulation of commodity, high demands in both speed and accuracy during the barcode recognition process are required distinctly.
According to the literature reviews, it takes about 300 milliseconds to identify a barcode image with the 640 × 480 frame resolution on the ARM9 platform, in other words, system could identify four barcode slides in every second [1]. Moreover, it acquires approximately 835 milliseconds for each single frame image on the iPhone validation framework [2], which indicates that it is difficult to meet the requirements of high-speed identification in modern industry obviously. Jiang proposed an algorithm of barcode location and recognition idea based on run-length coding, which can correctly identify the barcode image within ±25 degrees inclination angle [3]; Liu utilized the commercial barcode image on supermarket commodities as the study object to validate the recognition rate of their system [4]. The experimental result demonstrated that the accuracy of the barcode location searching rate is 95%, the recognition accuracy rate is 90%. In addition, the recognition speed of the existing mechanical, laser and infrared photoelectric barcode detection system increases with the increase of the complexity of the system structure [5]. At the same time, the rising development cost is unfavorable to the system application and popularization in the industrial assembly line [6].
Existing barcode recognition platforms mentioned in aforementioned literatures are unable to identify the barcode with high-speed and precision rate through image processing algorithms. The barcode identification system designed in this paper combines the photogate with the industrial camera (CCD) trigger functions, can able to obtain the real time image of barcode with high speed movement target, besides that, as our knowledge, it is the first time to introduced the multi-core heterogeneous AM5728 processor produced by TI in the barcode recognition image processing, which demonstrate a significant performance in the system speed promoting. In order to improve the accuracy of barcode recognition, we abandon the inefficient existing library and proposes our own library of barcode image processing, includes convolution filtering, gradient difference, close operation, corrosion expansion, correction, and decoding. Both system optimizations in hardware and software improve the efficiency of product statistics and classification by utilized barcode on industrial assembly line, which also alleviate the contradiction between recognition speed and production cost. Software and hardware pipelines designed technologies of barcode identification has a higher theoretical significance and practical value.

Design of the Hardware System
Take the process of commodity statistical operation on the industrial assembly line as an example, the whole process of automatic recognition of products by the barcode identification as Figure 1 demonstrates. targeted products on the conveyor belt pass through the photogate with a uniform speed, the photogate receiver generates a rising edge of the signal immediately, CCD camera gather images (contains the product barcode) by the trigger terminal in the rising edge of the signal and the image is transmitted to the embedded AM5728 chip through the gigabit network cable. The barcode image is located, extracted, corrected and decoded in order to obtain the complete digital sequence of the barcode, in which the light source is directly irradiate the surface of the commodity to enhance the acquisition effect for the CCD camera. Hardware needs to be initialized first when the system normal operation, which includes network card initialization and serial port initialization. After that, is the CCD camera configuration parameters initialization operation, includes the camera's working pattern, resolution, exposure time and other parameters. After the accomplishment of initializations, system set out to barcode image acquisition and processing procedures, the specific implementation processes are shown in Figure 2. Amateur cameras produce smear on the images when they recording moving objects which consequently affect the definition of barcode images, meanwhile low pixel images is another effect factor which decrease the recognition rate of barcode images [7].
In order to obtain a high-resolution and non-smearing barcode image, camera with high resolution and short exposure time is required. Therefore, the system facilitated a industrial CCD camera as a barcode image acquisition device to obtain high quality images.
Digital information includes in the barcode image always tremendous, which means suitable digital image processor will facilitate to increase the speed and accuracy during the barcode recognition process. The system employed TI's embedded AM5728 chip as the MCU. This processor performances in machine vision, industrial automation and control performance, can fully meet the requirements of barcode image processing during the recognition procedure.

Denoising Method
Firstly, convolution filtering is employed to remove Gaussian white noise [8], the image is transformed into gray scale image to remove the redundant image information in the same time. Then, the barcode localization algorithm and recognition algorithm are facilitated to image processing step.
The method of image convolution utilzes not only to preprocess the barcode image, but also remove the partial noise of the original image to facilitate the location and extraction of the barcode details. The formula of convolution filtering can be expressed as: the ! , presents the after-filter image; , means convolution kernel; !ℎ' . 、 % !ℎ' . is the anchor point coordinates.

Barcode Location
Images recorded by industrial CCD camera include redundant details occasionally apart from barcode, in order to obtain accurate and integrated barcode images, original images must be manipulated by preprocessing as located and clipped. In this paper, the gradient image extracted from original barcode is generated by gradient difference operation. Barcode image edge information utilize to obtain the location details, after that, the morphological transformation is facilitated to obtain a complete barcode image, and finally through the cropping operation we can acquire the accurate and integrated barcode images.
Digital images can be regarded as a two-dimensional discrete function ( , , and the image of gradient operation is the partial derivative of the two-dimensional discrete function, the horizontal direction and vertical directions of partial derivative can be represented as: )* -,.
In the equation (2) and (3), I present the digital images; x, y means the abscissa and ordinate of image. On account of barcode image in the x direction gradient feature demonstrates a higher performance than y direction gradient feature, we utilized x direction gradient value minus the y direction gradient value to enhance y direction gradient feature. This difference operation is advantageous to obtain obvious barcode image edge details [9]. Difference operation process is as follows: In the equation (4), G represents the gradient difference image, 1 represents the gradient value in the x direction, and j represents the gradient value in the y direction. Morphological operation is a useful tool to extract the image features, corrosion, expansion and various basic operations can be combined to perform an extensive task, specifically for the binary image and gray-scale image. Closed operation is the expansion processing first and then corrosion processing result in mathematics.
The black stripes are located in the region of the barcode image after the gradient difference calculation. It is not conducive to the identification of the complete region of the barcode. As we mentioned before, the black stripes can be removed by the morphological operation, which includes two steps of expansion and corrosion respectively Dilate operation can expand the black stripes in order to make the connection operation, the formula can be expressed as: dst x, y = max , 9 ! + , + Erosion operation can eliminate connected with large-area black stripes, its formula is: dst x, y = min , 9 ! + , + Erosion and expansion are each dual operation, dst x, y presents the image after corrosion or expansion processing; src x + , y + is the original image; ， means the horizontal and vertical corrosion expansion coefficient respectively.

Image Correction
Because of the affection by goods location and camera shooting angle, deflection angle appeared in barcode image frequently. With the purpose of reduce the barcode recognition accuracy, geometric transformation of the image can correct the stripes of the barcode to be vertical, which includes spatial transformation and gray level interpolation [10].
Space transformation is corresponding to the affine transformation matrix, includes translation, scaling and rotation, a pixel coordinate's translation and scaling can be expressed as: > ? means the new coordinates, > @ AA @ AB @ BA @ BB ? means the scaling, C Dis the original coordinates, > E A E B ?is the translation.
Image around the origin of the alpha counterclockwise angle, the rotation matrix M and its inverse matrix G HA are as follows: After the spatial transformation operation, the new pixel position may be interval several pixels, and not necessarily integer coordinates. In this case, the new coordinates should match the new coordinate's value and output it to the pixels by grayscale interpolation. The first-order linear interpolation formula is:

Barcode Identification
Based on the national standard EAN 13 code as a basis for the recognition algorithm, "stripe" and "hollow" modules as the basic width of the barcode unit, 13 characters are represent of the name of products, manufacturers and origin information [11].
According to the EAN-13 encoding rules, it can be known that each "stripe" and "hollow" width can be consist of 1 to 4 modules, there are 95 modules altogether from the start operator to end barcode [12]. If i means the most left blank of the subscript, i+1 is the first subscript " stripe " and i+59 means the last stripe subscript, the average width of modules is as follows: W N means the average width of the module and SQjS means the width of each module.

Results and Discussion
Due to products movement, light and exposure time etc. impact factors, during CCD camera recording barcode images, collected images may produce local blur phenomenon, as shows in Figure 3 (a). In order to eliminate local blur, images to be need processed by convolution filtering algorithm. The result shows in Figure 3 (b). The definition of the image has been significantly improved, and barcode stripes are easily to identify than the original image.  After the convolution filter processing, barcode image contains t barcode and the background, which needs to carry on the localization processing to extract the target image from the background graph [13]. Firstly, the gradient difference operation is performed on the image to obtain the edge characteristic details. At the same time, the binarization operation converts the background image into a black and white image, which shows in Figure 4 (a). The image is then closed. The narrow bar-shaped notches are joined to form elongated bends and fill gaps smaller than the structural elements. Corrosion is a method of contract the boundary to the interior and can be utilized to eliminate small and nonsensical interferences in the barcode. As shown in Figure  4 (b), the barcode region is completely separated from the background image with clearly visualization, and the appearance of the barcode region exhibits a parallelogram characteristic.  The result of the barcode positioning processing is shown in the green wireframe in Figure 5 (a). Barcode stripes are inclined distribution, image correction operation needs to be implemented because of the image is not conducive to determine the width of the module. The barcode image pixel space in the translation, zoom and rotation changes, and finally obtain the vertical stripes, as shown in Figure 5 (b). As the barcode image affected by the bottom of the digital interference, the lower part of the green wireframe cannot completely surround the barcode edge stripes, which leads to barcode decoding information loss. In order to reduce the interference at the bottom of the barcode, the weighted parallelogram correction is carried out. The result of the correction is shown in Figure 5 (c). The green wireframe can obviously improve the encirclement of the barcode image and more barcode edge fringes can be recognized. According to the encoding rules of EAN-13 code, the barcode image is corrected and decoded to obtain the complete decoding information of the product, which shows in Figure 5 (d). base is the average module width, code Digit is the commodity barcode binary information, Decode String is the complete barcode digital information. After a number of verifications during various working conditions, the test parameters in Table 1 were obtained. When the ambient light intensity is higher than 550Lux, the product barcode deflection angle is less than ± 30 degrees and the detection distance is less than 0.5m, the embedded AM5728 barcode recognition system can accurately identify the barcode, and the accuracy rate is higher as 100%. Under the critical condition, the time that the system recognizes a frame of barcode costing about 50ms, which means the number of identification is 20 frames per second. The results show that the system can satisfy the requirement of barcode recognition under critical conditions, and the improvement of barcode image is obviously with high recognition accuracy and large amounts of sampling in each time step.

Conclusion
In this paper, we proposed a barcode recognizable system based on the embedded AM5728, reliable verifications are implemented in both hardware and software performances validation, specifically contributions of our framework can be summarized as follows: (1) Integration of a platform of barcode recognizable system, consisting of the photogate and CCD hardware trigger function. High speed movement targets can be captured in real time, what's more, image processing requirements in the terms of barcode recognition applications are satisfied, which facilitated by the machine vision development of digital image processing model in AM5728 (2) Featuring convolution filtering, location and recognition algorithms, system furnished blur elimination, location, correction as well as decoding functions of barcode image processing. (3) Barcode experimental outcomes validated that the accuracy of our system recognition rate can reach up to satisfied 100% in the threshold condition, with 20 frames per second barcode images recognition rate.