Barcode Recognizable System Implementing Based on AM5728
Xicai Li1, Junsheng Shi1, *, Xiaoqiao Huang1, Yonghang Tai1, 2, Chongde Zi1, Huan Yang1, Xingyu Yang3, Zhiwei Deng1, Feiyan Li1
1Color & Image Vision Lab, Yunnan Normal University, Kunming, China
2Institute for Intelligent Systems Research and Innovation, Deakin University, Geelong, Australia
3Institute of Electronic Science and Engineering, Nanjing University, Nanjing, China
To cite this article:
Xicai Li, Junsheng Shi, Xiaoqiao Huang, Yonghang Tai, Chongde Zi, Huan Yang, Xingyu Yang, Zhiwei Deng, Feiyan Li. Barcode Recognizable System Implementing Based on AM5728. Automation, Control and Intelligent Systems. Vol. 4, No. 6, 2016, pp. 89-94. doi: 10.11648/j.acis.20160406.12
Received: November 15, 2016; Accepted: November 28, 2016; Published: December 1, 2016
Abstract: 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.
Keywords: Barcode, Embedded System, AM5728, Barcode Identification, System Design, Convolution Filtering
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 . Moreover, it acquires approximately 835 milliseconds for each single frame image on the iPhone validation framework , 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 ; Liu utilized the commercial barcode image on supermarket commodities as the study object to validate the recognition rate of their system . 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 . At the same time, the rising development cost is unfavorable to the system application and popularization in the industrial assembly line .
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.
2. 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 .
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.
3. Algorithm and Software
3.1. Denoising Method
Firstly, convolution filtering is employed to remove Gaussian white noise , 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.
3.2. 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 . Difference operation process is as follows:
In the equation (4), G represents the gradient difference image, 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:
Erosion operation can eliminate connected with large-area black stripes, its formula is:
Erosion and expansion are each dual operation, presents the image after corrosion or expansion processing; is the original image; means the horizontal and vertical corrosion expansion coefficient respectively.
3.3. 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 .
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, means the scaling, is the original coordinates,is the translation. Image around the origin of the alpha counterclockwise angle, the rotation matrix and its inverse matrix 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:
(, means the original coordinate point (,) is a new coordinate point, y is the value among the interval of position x.
3.4. 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 .
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 . 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:
means the average width of the module means the width of each module.
4. 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 . 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.
|Critical light intensity (Lux)||550|
|Critical deflection Angle (°)||±30|
|Critical distance (m)||0.5|
|Identification number per unit time (frame /s)||20|
|Recognition accuracy (%)||100|
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.
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.
This work is funded by the National Science Foundation of China (grant number 61178054), the Program IRTSTYN and the Program of Yunnan Education Commission (grant number ZD2014004).