Decoding 1-D Barcode from Degraded Images Using a Neural Network (Computer Vision,Imaging and Computer Graphics) Part 2

Experiments

The performance of ZXing-MOD was evaluated and compared with the original ZXing and with other two open-source libraries: BaToo5 and JJil6. System performances are compared using precision P and recall R [27],

tmp5839-92_thumb[2]

where correct is the number of barcodes correctly recognized by the system, actual is the total number of barcodes recognized by the system, and possible is the total number of barcodes we expected from system. A Precision score of 1.0 means that every code recognized is correct, but says nothing about the number of codes that were not recognized correctly. A high Precision guarantees that there are few false positives. Whereas a Recall of 1.0 means that every barcode was correctly recognized, but says nothing about how many other barcodes were incorrectly recognized. In addition to precision and recall were also evaluated minimum and maximum execution time.

Analyzing the literature we realize that there is no dataset available to evaluate a barcode recognition system. For this reason we create two datasets of images, one with pictures of barcodes taken from devices with the AF function (Dataset1) and a second dataset with photos taken by devices without AF (Dataset2). The Dataset1 contains 215 color images all taken with a Nokia 5800 mobile phone, while Dataset2 contains 215 images all acquired by a Nokia 7610 mobile. The two datasets were acquired varying the rotation angle of the barcode, the distance between camera and object, the lighting conditions and the resolution.


The training set used to train the neural network is built considering 14 pairs of images as shown in Figure 3. All the input images have been cropped from photos belonging to Dataset2.

The two datasets and the training set used for our experiments are available online7 allowing to compare our algorithm with other research works.

The quantitative results are shown in Tables 2 and 3. We must start by saying that the library Jiil, although much-quoted, did not recognize any code in the two datasets used. This could be caused by the fact that the library is currently under development and could therefore be in a state of low functionality. Conversely, libraries ZXing and BaToo showed good performances on Dataset1 but, as introduced earlier, collapsed on images of Dataset2. Analyzing the results obtained on Dataset1, we note that the parameter try.harder of ZXing increases significantly Recall although this advantage also leads to an increase in computation time. ZXing with the parameter tryJiarder=true becomes the best library to use with high resolution and not degraded images. The recall of ZXing-MOD is slightly lower than that of ZXing, this because the rotation of the analyzed image is not carried out and then some codes placed in a position not horizontal are not recognized. BaToo is efficiently fast even if the percentage of recognized images is rather low compared with results obtained with ZXing and ZXing-MOD.

Table 2. Comparison results between the three tested algorithms and our strategy. The table shows the Precision, Recall and execution time computed on Dataset1.

Time (ms)

Library

Parameter

Precision

Recall

Min

Max

Average

ZXing

1.00

0.64

0.26

12.80

1.77

try .harder

1.00

0.82

0.26

244.40

26.59

BaToo

0.95

0.58

1.80

29.64

13.49

JJil

/

0.00

219.26

966.70

470.73

ZXing-MOD

rowStep=1

1.00

0.87

1.74

2777.12

353.78

rowStep=5

1.00

0.83

1.74

559.48

90.22

rowStep=40

1.00

0.70

1.74

68.87

17.71

Three sample images of Dataset1 (a), and three of Dataset2 (b)

Fig. 4. Three sample images of Dataset1 (a), and three of Dataset2 (b)

The results observed in tests carried out on Dataset2 show how our proposed neural restoration strategy makes ZXing-MOD the only viable solution that works on blurred and low resolution images. The rowStep parameter determines the number of lines to be analyzed, the greater the value of rowStep the lower the number of lines analyzed. ZXing-MOD maintains good results even when the value of rowStep increases, passing from a value equal to 1 to 5 the Recall drops of 0.06, and the execution time become four times lower than the initial one (see Table 3).

Tests were performed on a computer with the following configuration: Intel Core 2 Quad Q6600,2GB RAM and the Windows XP Professional OS. Although the processor is multi-cored, all implemented software is single threaded.

A qualitative assessment was done by implementing a simple J2ME application and installing it on different camera phones. Evaluating the application on a Sony Ericsson v800 mobile phone reported the operativeness of the approach with a mean recognition time of 4 seconds.

Table 3. Comparison results between the three tested algorithms and our strategy. The table shows the Precision, Recall and execution time computed on Dataset2.

Time (ms)

Library

Parameter

Precision

Recall

Min

Max

Average

ZXing

1.00

0.04

0.24

12.15

1.87

try_harder

1.00

0.09

0.24

106.16

58.41

BaToo

0.60

0.13

9.29

19.19

10.10

JJil

/

0.00

120.41

253.26

146.89

ZXing-MOD

rowStep=1

0.99

0.70

1.34

439.36

156.59

rowStep=5

0.99

0.64

1.34

101.41

37.52

rowStep=40

1.00

0.47

1.34

27.18

6.62

Two examples of barcode contained in blurred images captured with a device without AF (a)(d). Thresholding results obtained with the library ZXing (b)(e), and corresponding threshold obtained with ZXing-MOD (c)(f)

Fig. 5. Two examples of barcode contained in blurred images captured with a device without AF (a)(d). Thresholding results obtained with the library ZXing (b)(e), and corresponding threshold obtained with ZXing-MOD (c)(f)

Conclusions

In this paper, we proposed a general purpose solution to the problem of recognizing 1D barcodes from blurred images. This solution adopted is applicable to any decoding strategy and is based on supervised neural networks.

The algorithm has shown excellent experimental results and is therefore a valid alternative to standard methods that try to improve the quality of the images before decoding.

We implemented a version of ZXing-MOD in J2ME testing it on different types of phones with very encouraging results.

Next post:

Previous post: