Illumination Compensation for 2-d Barcode Recognition Basing Morphologic

Improvement of image quality has been highly demanded in digital imaging systems. This study presents a novel illumination normalization approach for 2-D barcode recognition under varying lighting conditions. MMs (Morphological transformations) are employed to original images using big scale multiple SEs (structuring elements). Then we make use of entropy to fuse images. The performance of proposed methodology is illustrated through the processing of images with different kinds of 2-D barcodes under different backgrounds. The experimental results show that this approach can process different kinds of 2-D barcodes under varying lighting conditions adaptively. Compared with other conventional methods, our proposed approach does a better job in processing 2-D barcode under non-uniform illumination.


INTRODUCTION
With the popularity of hand held camera-enabled digital devices, among the wide range of automatic identifications such as RFID, magnetic card, barcode is becoming increasingly popular in recent years.
Barcode technique was first introduced by Westinghouse Lab in 1920s.It is a symbol composed by bars and blanks according to a certain encoding rule and it can store numbers and letters in a small space (Hu et al., 2009).The key to 2-D barcode identification lies in the processing of acquired image.Images acquired by image acquisition equipment like PDA (Personal Digital Assistant) will usually degenerate because of the complex and changeable environment.Among many factors causing image degeneration, illumination variation is an important one and brings great challenge to 2-D barcode identification.Thus, in order to get a high barcode recognition rate, we must use light equalization to process acquired images.Nonuniform illumination is still a challenge in 2-D barcode recognition research area.A variety of approaches have been proposed to solve this problem, such as histogram equalization, logarithm transform, gamma correction and mathematical morphology.
Histogram equalization technique can balance gray distribution of the whole image.The basic idea is to combine gray levels with fewer frequencies into neighboring gray levels in order to decrease the number of gray levels and increase global contrast and clarify image details.But this global processing technique is still difficult to solve the uneven illumination because the global properties of the image cannot be properly applied in the local (Sherrier and Johnson, 1987).To solve this problem, region-based histogram equalization, adaptive histogram equalization and block-based histogram equalization have been proposed (Shan et al., 2003;Park et al., 2008).Shan et al. (2003) proposed a normalization method called quotient illumination relighting based on the assumption that lighting modes of the image are known or can be estimated.Chen et al. (2006) proposed a logarithmic DCT method.This method takes the average of the max and minimal values of the whole image as image's background.As a result, local image tends to be degenerated and the contrast might not be correctly enhanced in images with poor lighting when the image background has damaged changes in luminance.Jimenez-Sanchez et al. (2009) proposed a mathematical morphology technique based on Chen et al. (2006), which divides image into several areas, then uses average of the max and minimal gray values of every area to replace the gray value of that area.By this way, Jimenez-Sanchez et al. (2009) can get a relatively good result.But images processed by this method tend to have blocking effect especially when the divided areas are too large.Xu et al. (2008) proposed an algorithm which uses big-scale elements to implement Top-hat transformation on images under varying lighting conditions.This algorithm is simple and being widely used.However, it cannot acquire good processing results under complex lighting conditions due to using single structuring element.
The main purpose of morphological operation is to use SE with certain sizes and shapes to detect images and then obtain the relative structural features.So the sizes and shapes of SEs play crucial roles in such type of processing.However, we can never find a SE which is suitable for all kinds of images, so in recent years, researchers begin to search a new mathematical morphological method which is not sensitive to SE. Multi-scale morphological transformation like geodesic erosion, geodesic dilation, opening reconstruction and closing reconstruction are all good algorithms (Mukhopadhyay andChanda, 2001, 2003).Morphological transformation using multiple SE can not only filter peak and low noise but also maintain the image details.Operators consist of multiple SE like ROBERTS, Canny and Laplancian have their own advantages in image filtering, edge detection and so on Acton and Mukherjee (2000) and Benediktsson et al. (2003).
This study improves Xu et al. (2008) and Park et al. (2008) algorithm.Firstly, we use big scale multiple SEs to implement Top-hat transformation on original images.Then calculate the information entropy of these processed images.Finally, fusing these images that implemented by Top-hat transformation to get illumination normalize image based on the ratio of information entropy.

Basis of algorithm:
A morphological transform: MM which is an extension of Murkowski's set theory were first systematically examined by Gonzalez and Woods (1987).It has been a well-known technique used in image processing and computer vision.Morphological operators consist of erosion, dilation, opening, closing and other derived transformation.
It is well known that the erosion and dilation is a pair of dual operators.In gray scale, erosion of an image ƒ by a SE B is defined as Gonzalez and Woods (1987): (1) Dilation is denoted and defined as: (2) The opening operation performs erosion first, followed by dilation, while the closing operation performs dilation first, followed by erosion (Haralick et al., 1987): (3) (4) Usually, opening and closing operations are used in morphological filters.They smooth the image with different behaviors.Opening an image with a disk SE will smooth the contour and eliminates small islands and sharp peaks or capes.Closing an image with a disk structuring element smooth the contours, eliminates small holes and fills gaps on the contour.
Choosing proper morphological filter depends on target's sharp, size and direction.Using opening and closing operations of a SE which is not uniform with relative structure in image can eliminate these relative structures; these structures can be restored through the difference between original image and its opening or closing results.These morphological transformations are called WTH (white top-hat) and BTH (black tophat).The WTH transformation obtains all bright features smaller than SE: (5) Similarly a BTH sieves out the dark features smaller than SE: (6) Introduction to information entropy: Information entropy is a measure of the disorder degree of system.It is calculated by the weighted average of each gray level probability's logarithm and represents how much information the image contains: (7) In Eq. ( 7), i represents the information type, p i represents the possibility of corresponding information type, k is the weight factor.For a M × N gray image, information type i∈[0,255] k = 1 means entropy of gray image is: Fig. 1: PDF417 and QR code with uneven lighting background which might cause threshold technique unavailable in following process, therefore lead to a false analysis.In order to improve barcode identification rate, we must implement illumination normalization on acquired images.
In a gray image, the variation of image information is more severe than the lighting, which means connected areas of lighting are Bigger than connected areas of image information.Gray image can be treated as a set due to its graphs and sub graphs.We know from Eq. (3) that SE moves around the set from the inside.Smaller set structures which stretch into the background were eliminated and bigger size background structures do not change.Barcode images are usually taken under dark lighting, so we can choose relatively big-scale SEs and use BTH to filter all image information except non-uniform illumination background of an image.
The traditional MM operation employs single SE to do background estimation upon images, the most used SEs include square and disc.As shown in Fig. 1, when uneven lighting degree is large, image background has strong fluctuation.As single SE is only sensitive to edges with the same direction, thus edges with different directions from the SE will be smoothed.Therefore, taking use of single SE to do background estimation cannot keep good image details, causing a big deal of background leakage.When signal noise ratio is low, the gray value of background leakage would possibly be higher than the gray value, making severe degeneration after image processing, while employing multiple SEs can keep details of image undamaged.
From the analysis above, it is evident that multistructure morphological transformation has more advantages than single structure morphological transformation, so we used big scale multi-structure element to do WTH transformation on image ƒ , then took use of entropy to fuse processed images, which is shown as follow: (9) In Eq. ( 9) S i is an image upon which WTH transformation has been done using different SEs.ω i is image's weight factor.From Eq. ( 7), we can get: (10) In Eq. ( 10), p (l, i) represents the probability of gray value i in image category l.
In this study, Fig. 2 illustrates the structuring diagram of the new algorithm based on multiple structures, the complex algorithm can be briefly described as follows: Establish the shape and size of multi-structure SEs: In MM, multi-structure SEs can be used to keep image details in different directions.In this study we choose linear SEs with different directions as is shown in Fig. 3. Through WTH transformation we can get images containing information in different directions.From Eq. ( 5) we can get: In Eq. ( 11), ƒ is the original image, B i are SEs as shown in Fig. 2 whose scales are 1/4 of the smallest scale of image line and column, g i and are the WTH transformation results of corresponding SEs.
• Fuse images: Based on the concepts of index fuzzy entropy and weighted entropy (Xu et al. 2008), we calculate the membership function's corresponding fuzzy weighted entropy and take each pixel's corresponding membership function as the weight of weighted entropy.In fusion processing, the greater value of index fuzzy entropy, the more information it contains.From Eq. ( 9) we can obtain image's information entropy processed by big scale WTH transformation: n∈(1, 2, 3, 4) (12) From Eq. ( 11) we can obtain image's weight factor as follow: (13) From Eq. ( 9) we can obtain the final fused image: (14)

TEST RESULTS AND DISCUSSION
There are various kinds of 2-D barcodes today.According to the shape of image, 2-D barcodes can be classified as stack code and matrix code.The most widely used 2-D barcodes include PDF417 and QR code, Data Matrix, Maxi code, code49 and code 16K.In this study the PDF417, QR code which are the most popular are used to evaluate the proposed approach.Experiments mainly focus on verifying proposed approach's adaptive capacity on different barcode's scales, tile angles and textures.
• Verifying proposed approach's adaptive capacity on different barcodes' scales: In MM, SE plays a key role.The processing result would be degenerated with the decrease of match degree between SE and concerned features.In order to obtain a good processing result, SE is usually chosen according to the priority knowledge of concerned features' scale in image.In autoidentification analysis, one cannot know the scale of concerned features in advance, so finding a scale-adaptive MM is of great significance.
Relative scales include the size of concerned features and the proportion of concerned features accounting the whole image.Figure 4a got a 2-D barcode accounted about 4/5 proportion of the whole image.Figure 4b got a 2-D barcode accounted about 1/10 proportion of the whole image.Figure 4c is the processing result of Fig. 4a using our algorithm.Figure 4d is the processing result of Fig. 4b using our algorithm.
From the experimental results we can see that proposed algorithm can adaptively process images with different resolutions and different proportions of 2-D barcodes as well.It indicates that proposed algorithm has a good adaptive capacity on different barcode's scales.
• Verifying proposed approach's adaptive capacity on different barcodes' tile angles: There are two kinds of 2-D barcode identification devices: fixed and handheld.Fixed 2-D barcode identification device placed in fixed terminal; handheld device include 2-D barcode scanner gun and portable PDA device.When users capture image with a PDA camera, it is difficult In MM, SEs in different directions can get image's information on corresponding directions.As a result, image's information can be kept complete even though image has been inclined.In this study, we used four SEs with different directions to process images.Figure 5a and 5b are non-uniform illumination images with different tile angles.Figure 5c and 5d are images processed by proposed algorithm.
From the experimental results we can see that proposed algorithm can adaptively process non-uniform illumination images under different tile angles.This indicates that proposed algorithm has a good adaptive capacity on different barcodes' tile angles and can resolve inclined image's non-uniform illumination problem as well.Figure 7a is the original matrix QR code. Figure 7b, 7c, 7d and 7e are images processed by algorithms proposed by Mukhopadhyay andChanda (2003), Jimenez-Sanchez et al. (2009) and Soille (1988) and ours respectively.In Fig. 7b, correction might be deleterious to some information of image, image appears to be either too dark or too bright, indicating that algorithm proposed by Mukhopadhyay and Chanda (2003) cannot properly apply global properties to the local; compared with (7-a), algorithm in Fig. 7c improved local properties, but obvious blocking effects and profiles arose because inappropriate values may be obtained, indicating that algorithm proposed by Soille (1988) unable to process good global normalization on non-uniform illumination images.Algorithm in Fig. 7d greatly improved illumination normalization, but uneven illumination still exits.In Fig. 7e, illumination is normalized indicating that our proposed algorithm is more advantageous than others.

CONCLUSION
A novel illumination normalization approach which is used to 2-D barcodes is proposed in this study.Proposed approach is divided into three stages.In the first stage, we proposed a set of linear structuring elements in four different directions, which were 0°, 45°, 90°, 135°, respectively.The scale of SE is the 1/4 of the smaller scale of image line and column.In the second stage, we took use of SEs acquired in the first stage to perform WTH transformation on original image, obtaining images containing different information about different directions.Finally, we perform weighted fusion on images acquired in the second stage to obtain the final image.Weight factor was determined by information entropies.In this study we verified proposed algorithm on several aspects including barcodes' scales, tile angles and types of barcodes.Meanwhile, we compared our proposed algorithm with several commonly used illumination normalization algorithm, results show that our algorithm is more advantageous than others.However, our proposed algorithm requires large amount of computation and storage space.The further studies will be carried out to optimize this algorithm to reduce its computation work and storage space and implement this algorithm through ASIC (application specification integrate circuit).
Approach to normalize non-uniform illumination image with multiple SE:As 2-D barcodes are used under complex environments and images are acquired under varying lighting conditions, images acquired by acquisition equipment usually have bright gradients

FigFig. 3 :
Fig. 2: The structuring diagram of the new algorithm

Figure
Figure 6a is stacked PDF417 2-D barcode, Fig. 6b is matrix QR code; they were taken under the same non-uniform illumination condition.Figure 6c and 6d are the processing results of original images.From the results we can see that proposed algorithm can adaptively process different kinds of 2-D barcodes.This indicates that proposed algorithm has a good adaptive capacity on different kinds of 2-D barcodes.