A NOVEL BINARIZATION METHOD FOR QR-CODES UNDER ILL ILLUMINATED LIGHTINGS N.POOMPAVAI 1 Dr. R. BALASUBRAMANIAN 2 1 Research Scholar, JJ College of Arts and Science, Bharathidasan University, Trichy. 2 Research Guide, JJ College of Arts and Science, Bharathidasan University, Trichy. ABSTRACT This paper compares several alternative binarization algorithms for historical recognition, by evaluating their effect on end-to-end performance in a complete QR recognition system. The algorithms evaluated are global thresholding Niblack s and Sauvola s algorithms, adaptive versions of Niblack s and Sauvola s algorithms. We found that, for low illuminated image adaptive Niblack s algorithm can achieve better performance than Sauvola s (which has been claimed as an evolution of Niblack s algorithm). The results are compared with the proposed method employed for performance benchmark and the results are summarized. Keywords :Binarization, Thresholding, QR code, Quick Response code INTRODUCTION TO QR CODE QR Code (Quick Response Code) is developed by Denso Corporation in 1994. There are 40 versions in QR Code, four levels of error correction, and the maximum symbol size (the highest version) can encoding 7089 numeric data or 4296 alphanumeric data. The code consists of black modules arranged in a square pattern with functions such as encoding, image searching, decollating, image allocation and image revision. The advantages of QR code include large capacity for data storage, wide scope for encoding, mini-size printout, hypervelocity reading, strong error correction capability as well as being dirtyresistant, damage-resistant and 360 degrees readable. 13
Finder Pattern This pattern is used for detecting the position of the QR Code. By arranging this pattern at the three corners of a symbol, the position, the size, and the angle of the symbol can be detected. This finderpattern consists of a structure which canbe detected in all directions (360 ). Alignment Pattern This pattern is used for correcting the distortion of the QR Code. It is highly effective for correcting nonlinear distortions. The central coordinate of the alignment pattern will be identified to correct the distortion of the symbol. For this purpose,a black isolated cell is placed in the alignment pattern to make it easier to detect the central coordinate of thealignment pattern. Timing Pattern A pattern for identifying the central coordinate of each cell in the QR Code with black and white patterns arrangedalternately. It is used for correcting the central coordinate of the data cell when the symbol is distorted or when thereis an error for the cell pitch. It is arranged in both vertical and horizontal directions. Quiet Zone This margin space is necessary for reading the QR Code. This quiet zone makes it easier to have the symbol detected fromamong the image read by the CCD sensor. Data Area The QR Code data will be stored (encoded) into the data area. Thedata will be encoded into the binary numbers of 0 and 1 based on the encoding rule. The binary numbers of 0 and 1 will be converted into black and white cells and then will be arranged. Features of QR Code High volume of data can be stored. High-speed reading Readable from any direction from 360 degree Algorithms Compared We have designed a user-configurable QR code processing system to extract information from QR images and then feed them into binarization engine for recognition. The quality of the images however has a significant impact on the recognition performance, since many QR images are of poor quality due to insufficient lighting and poor quality of image. In pursuit of high quality text/background segmentation, we investigated two well known binarization algorithms (Niblack s and OTSU), and also explored two algorithm variants, adaptive Niblack, and adaptive Sauvola. We also investigated an alternative color segmentation algorithm which clusters out the foreground texture from the background. Finally, we compared our 4 algorithm alternatives with the performance achieved using an optimised global threshold. BINARIZATION METHODS Global Thresholding The global thresholding algorithm chooses a fixed intensity threshold value T (from 0 to 255). If the intensity value of any pixel of an input image is more than T, the pixel is set to white otherwise it is black. If the source is a colour image, it first has to be converted to grey level using the standard conversion: Grey = 0.3R + 0.59G + 0.11 B (1) ------------ Eq wherer, G, and B represent the colours red, green and blue respectively, with values from 0 to 255. All algorithms except coloursegmentation are applied to grey level images. 14
Niblack s Algorithm Niblack s algorithm calculates a pixel wise threshold by sliding a rectangular window over the greylevel image. The threshold T is computed by using the mean m and standard deviation s, of all the pixels in the window, and is denoted as: T = m + k*s (2) Step 4: Measure the height h of each block. SW is set as hxh Step 5: Pad B with edge pixels (say 3 pixels wide), to ensure enough surrounding pixels are included for m and s calculation. Then use Niblack s algorithm to binarize each block B i iniusing its local SW and k obtained from step 3 and 4, ignoring other background. wherek is a constant, which determines how much of the total print object edge is retained, and has a value between 0 and 1. The value of k and the size SW of the sliding window define the quality of binarization. Binarization gives thick and unclear strokes with a small k value, and slim and broken strokes with a large k value, while with a small SW value noise is closer to texture. Values for SW and k respectively of 25x25 pixels and 0.6 were heuristically optimal. Adaptive Niblack s Algorithm In archive document processing, it is difficult to identify suitable SW and k values for all images, as the character size of both frame and stroke may vary image by image. Improper choice of SW and k values results in poor binarization. A modified Niblack s algorithm named adaptive algorithm automaticallyallow chosen values for k and SW, which we called adaptive Niblack s algorithm. This comprises five steps: Step 1:Binarize the image I (grey level) by using the global thresholding algorithm to roughly estimate texture area; Step 2: Split the binarized image (texture area) into all blocks Bs by identifying binary connected components which create rectangular areas of continuous connected black pixels. Step 3: Calculate the ratio r of number of black pixels against white for each block, and allocate a relevant k (from 0 to 1) value for the block according to its r. The higher r, the higher the density of black pixels (for example due to thicker strokes), hence a largerk is needed compared with thin strokes. Sauvola s Algorithm Sauvola s algorithm is a modification of Niblack s which is claimed to give improved performance on documents in which the background contains light texture, big variations and uneven illumination. In this algorithm, a threshold is computed with the dynamic range of the standard deviation, R, using the equation: T = m * (1 + k (s/r -1)) (3) wherem and s are again the mean and standard deviation of the whole window and k is a fixed value. Otsu method Otsu [Otsu 1979] calculates a global threshold by accepting the existence of two classes, foreground and background, and choosing the threshold that minimizes the interclass variance of the thresholded black and white pixels. Reddietal. [Reddiet al 1984] technique can be considered as an expansionof Otsu technique for the multithresholding case. But the Otsu method could be failed in complex lighting conditions, including highlight spots, low contradistinction, nonhomogeneous lighting, and various mixed conditions. Proposed method Step 1: Load the QR Image Step 2: Threshold the Image by T1 Step 3: Threshold the Image by T2 Step 4: Dilate the Image Step 5: Fetch the Binarized Image Explanation 1) To perform the binarization, the first step is to calculate the two thresholds 15
values T1 and T2. The threshold procedure aims to split the image in two parts: background and foreground. The main idea is to estimate the gray-level intensities of the background T1 and to estimate the intensity of the foreground T2. 2) After the thresholds estimation, all pixels in the original image greater than T1(background intensity threshold) are set to white. This procedure eliminates most of the image background, generating ImageT1(x, y). 3) To eliminate the remaining background noise, the pixels in ImageT1(x, y) greater than T2(foreground intensity threshold) are set to white, generating ImageT2(x, y). 4) The dilation process is used to delimitate the neighborhood area of the remaining Proposed model implementation Prototype model pixels in ImageT2(x, y).the binary AND is used to recover those pixels of ImageT1(x, y)that are in the neighborhood area of the pixels in ImageT2.This step improves the image quality and preserves the stroke connectivity. Experimental setup A prototype model is developed to test the binarization of different algorithms explored in the paper and these algorithms are compared and summarized. The time taken for the process, accuracy, is taken into consideration. As shown in the figure 2 the input is fed into the prototype model and the proposed algorithm is employed to separate the background from the foreground. The figure 3 shows that the low illuminated image is converted into binarized QR image. Figure 2- Low light QR code fed as input 16
Proposed Process Figure 3 After step1,step2 and final Image after binarized Comparison table for different algorithms based on Recognition rate ALGORITHM RECOGNITION RATE OTSU 90 % NIBLACK 83 % ADAPTIVE NIBLACK 95 % Proposed Method 96.2 % TABLE 1 Comparison based on recognition rate From the table 1 it is clear that the proposed algorithm outperformed other algorithms for illilluminated QR images. The recognition rate is almost cent percent accurate and this method is well suited for QR image of low quality. 17
Comparison based on execution time ALGORITHM OTSU 50 NIBLACK 92 ADAPTIVE NIBLACK 1082 Proposed method 64 EXECUTION TIME(ms) Table 2 Execution time This table 2 clearly shows that the execution time of OTSU is very low when compared to other algorithms. The Adaptive Niblack s recognition rate is comparatively very high but a trade off should be made as we have to compromise it for execution time. Conclusion The experimental study shows that the proposed methodis performing better with the recognition rate and overall binarization time is also low. This paper explored various global and local thresholding algorithms with the aid of a prototype model and the results are summarized. Reference 1. ISO/IEC 18004:2000. Information technology-automatic identification and data capture techniques-bar code Symbology-QR Code, 2000. 2. GB/T 18284-2000. National standard of the People s Republic of China: QuickResponse Code (in Chinese), Issued by China State Bureau of Quality and Technical Supervision, 2000. 3. Z. Chi, K.W. Wong, A two-stage binarization approach for document images, Proceedings of 2001 International Symposium on Intelligent Multimedia, Video and Speech Processing, 2001, May 2-4, pp. 275-278. 4. P.K. Sahoo, S. Soltani, and A.K.C. Wong, A survey of thresholding techniques, Computer Vision, Graphics, and Image Processing, 1988, vol. 41, pp.233-260. 5. I.J. Kim, Multi-Window binarization of camera image for document ecognition, Proceedings of the 9 Int l Workshop on Frontiers in Handwriting Recognition, 2004, Oct. 26-29, pp.323-327. 6. O.D. Trier, Goal-directed evaluation of binarization methods, IEEE PAMI, 1995, Vol. 17.No. 12, pp.11911201. 7. N. Otsu. A threshold selection method from gray-level histograms, IEEE Trans. Systems, Man and Cyernetics, 1979, vol. 9, no. 1, pp. 62-66. 8. E. Ottaviani, et al, A common image processing framework for two-dimensional barcode reading, Seventh International Conference on Image Processing and its Applications, 1999, 2, pp. 2652-655. 9. E. Ohbuchi, et al, Barcode readers using the camera device in mobile phones, Proceedings of the 2004 International Conference on Cyberworlds, 2004, 11, pp. 260-265. 18