Blind Detection of Severely Blurred 1D Barcode Noura Dridi, Yves Delignon, Wadih Sawaya, François Septier

To cite this version:

Noura Dridi, Yves Delignon, Wadih Sawaya, François Septier. Blind Detection of Severely Blurred 1D Barcode. Global Telecommunications Conference (GLOBECOM 2010), 2010 IEEE, Dec 2010, United States. pp.1-5. ￿hal-00805761￿

HAL Id: hal-00805761 https://hal.archives-ouvertes.fr/hal-00805761 Submitted on 28 Mar 2013

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. 1D Barcode Blind Detection in Severe Environment

Noura Dridi, Yves Delignon, Wadih Sawaya and Franc¸ois Septier Universit´eLille Nord de France, Institut TELECOM, TELECOM Lille1, LAGIS FRE 3303 CNRS TELECOM Lille1, rue Guglielmo Marconi, BP 20145, 59653 Villeneuve d’Ascq, France Email: [email protected]

Abstract—In this paper, we present a joint blind channel a training sequence enables the channel to be estimated but estimation and symbol detection for decoding a blurred and noisy the estimation error leads to performance degradation of the 1D barcode captured image. From an information transmission decoder. point of view, we show that the channel impulse response, the power and the symbols can be efficiently estimated by In this paper, we consider the decoding problem of barcode taking into account the signal structure such as the cyclosta- without training sequence. In particular, we propose a blind tionary property of the hidden Markov process to estimate. decoder that jointly estimates the channel and the symbols. Based on the Expectation-Maximisation method, we show that This joint channel estimation and symbol detection can be the new algorithm offers significative performance gain compared performed, using probabilistic algorithm based on maximum to classical ones pushing back the frontiers of the barcode technology. likelihood criterion [1], [5], [6] and [9]. Here, we show that the channel state of a barcode is a cyclostationary process and I.INTRODUCTION we propose a new joint channel estimator and symbol detector Barcode is an essential element of electronic data inter- based on the Expectation Maximisation algorithm which takes change. Since its birth in 1948, this technology is continuously advantage of this property. By exploiting the cyclostationarity growing up. Its success comes from the simplicity of the binary property, the number of paths of the channel state in the lattice data representation and the efficiency of the reading device diagram is reduced. As a consequence, the detector is more in a controlled acquisition environment. Originally, barcodes robust to noise and the detector performances are significantly represent data through the width and the spacing of parallel improved. lines, and may be referred to as 1D barcodes. Binary data can The paper is organised as follow. In Section 2, both the barcode also be depicted in geometric patterns such as dots or squares and the channel are modeled respectively, by a cyclostationary within images known as 2D barcodes. process and by a finite impulse response filter with an additive When shooted, the original barcode is degraded by blur caused white . Section 3 describes the Expectation - by a bad focalisation and/or a camera movement, in addition Maximisation algorithm used for the channel estimation. Sec- to noise, the whole resulting in a blurred noisy received signal, tion 4 is focused on the symbol detection. Section 5 presents Fig.1. In fact, two main types of blur can affect the received the results of a simulation study that has been conducted to signal; the optical blur owing to bad focus and diffraction assess the new algorithm’s performance. Conclusions are given phenomena and the motion blur coming from the camera in Section 6. mobility with respect to the barcode. Many models have been proposed for these two kinds of blur such as parametric models [10], Gaussian models [4] and models based on the global transfer function [3] and [7]. In the scientific literature few works are related to 1D and 2D barcode coding. Pavlidis et al. [13] have published a study related to information theory fundamentals outlining the process for barcode design using error detection and correction techniques. Tsi et al. [14] have developed a method that allows the calculation of the working range in case of a CCD- Fig. 1: Original and blurred barcode based reader. Houni et al [8] have studied the performance in the framework of the information theory and they have Notation proposed two new measures: the theoretical depth of field x returns the smallest integer value greater than or equal ⌊ ⌋ T and the theoretical resolution. In [11], a method of reading to x. x(i : j)=(xixi+1 xj). x is the classical matrix linear barcodes using the Hough transform is proposed. The transpose. algorithm is designed to a particular type of barcode (Code39). II.SYSTEMMODEL Recently Ould Barikalla et al [12] have proposed a 2D barcode ′ ′ ′ decoder using an iterative structure based on a factor graph Let x0x1 xN−1 be a sequence of N bits to transmit. representation. In all these works, decoders take into account Each bit is represented by a bar of width rx. So the barcode is given by ′ with . the prior knowledge of the channel at the receiver. In practice, xk = x⌊ k ⌋k 0 K 1 K = Nrx rx ∈ { − } When shooted, the barcode is degraded by a blur coming from is the parameter vector of the model. both the optical block and the movement of the camera which From the described model, Xk can be represented in a trellis are modeled by a finite impulse response filter of length L. diagram. Since the Markov process is cyclostationary, the Besides, an additive white Gaussian noise takes into account lattice is cyclic so that the number of paths is reduced. the residual stochastic imperfections. Using matrix notation, As a consequence, the detection of the optimal sequence is T the observed sequence Y =(y0yK−1) is given by: simplified and more robust to noise.

y = HT X + w k 0 K 1 (1) III.PARAMETER ESTIMATION k k k ∀ ∈ { − } T A. EM algorithm where H =(h0hL−1) is the channel coefficients vector, H is symmetric and decreasing from central maximum. Indeed, The maximum likelihood of θ is given by : the blur is the result of the bad focalisation and the camera θˆ = arg max fYθ (y) (6) motion, which belongs to the class of this symmetric blur [3], θ [4], [10] and [7]. where f is the likelihood of the observation. Nevertheless in T Yθ Xk = (xkxk−L+1) is the displayed symbol vector and our application the likelihood maximisation is not tractable. On 2 wk is an additive white Gaussien noise with variance σ . Xk the other hand, when considering the complete data (XY ), verifies the equation : the maximum likelihood estimation can be closely approxi- mated by the Expectation-Maximisation algorithm (EM). This Xk = BXk−1 + Vk (2) recursive algorithm consists of an iterative maximization of 0 0 0 the auxilliary function Q(θ θ(i−1)). .. . 1 . . T eme With B = and Vk =(xk00) . At the i iteration, the two following steps are performed:  . ..  . . 0 E step  0 1 0  From (2), we deduce that Xk is a Markovian process which (i−1)   Q(θ θ )= EX|Yθ(i−1) [log(Pθ(XY ))] (7) belongs to a set ξ0rx ξM−1rx in which the cardinal number M and the states are relied to both the channel length M step (i) (i−1) L and the bar width r . Specifically, the number of states M θ = arg max Q(θ θ ) (8) x θ follows the equation : In order to proceed to the estimation of the three components 2L if L rx of , is first maximised with regards to 2 and the ≤ θ Q H σ M = rx−1 result is maximised relatively to the width rx. (1+⌊(L−1)rx⌋)  2 2(rx 1) otherwise  i=0 − − (i−1) (i−1) (3) max Q θ θ = max max Q θ θ (9) θ rx Hσ2 Let’s point out from equation (3) that M is decreasing with When considering the special case where the width , r which is an interesting property when dealing with the rx = 1 Xk x is a stationary Markov process and the estimation algorithm recovery of the information carried by the barcode. The 2 distance between the various states becomes larger so that of (H σ ) has been proposed by Kaleh et al. [9]. In general detection is less sensitive to the noise. case, i.e. whatever the value of rx, we show that the channel coefficients and the noise variance estimates are respectively By denoting A = (a (k)) , the transition ma- k mn 0≤mn≤M−1 given by these two equations: trix of Xk is given by : K−1 M−1 nrx mrx T amn (k)= P (Xk = ξ Xk−1 = ξ ) (4) mrx mrx mrx (i+1) P (i) (X = ξ Y ) ξ ξ H | θ k | rx k=0 m=0 1 k − 1 nrx mrx ∈ N K−1 M−1 δ (ξ (1 : L 1) ξ (0 : L 2)) if T = rx mrx mrx 2 − − − = P (i) (Xk = ξ Y ) ykξ (10) δ (ξnrx (1 : L 1) ξmrx (0 : L 2)) otherwise θ | m=0 − − − k=0 with δ () the Kronecker symbol. As shown in equation (4), and if Xk is at the border of the bar, two transitions are possible, K−1 M (i+1) otherwise only one transition is allowed. 2 1 mrx σ = P (i) (X = ξ Y ) rx K θ k | × From equation (1) and the Markovian properties of m=0 k=0 X =(X0XK−1), we deduce the distribution of (XY ): (i+1) mrx 2 yk Hrx ξ (11) K−1 K−1 | − | mrx where P (i) (X = ξ Y ) is obtained by the forward back- Pθ(Y X)= P (X0) P (Xk Xk−1) fY |X θ (yk) (5) θ k | k k ward algorithm [2]. | k=1 k=0 We propose to consider the estimation of the width rx as well T 2 1 1 yk H Xk as the estimation of the channel impulse response. Moreover, where fY |X θ (yk) = exp − , k k 2 √2πσ −2 σ the cyclostationarity of Xk is exploited to optimise the accu- T P (X X ) is given by equation (4) and θ = H σ2 r racy of the estimates. k| k−1 x 2 B. Joint estimation of H and σ given rx IV. SYMBOLDETECTION 2 The optimal decision on symbol is obtained using the For a given rx, the estimates of Hrx and σrx are obtained by solving the equations (10) and (11), where the marginal Marginalised Posterior Mode (MPM) criterion, which is based mrx posterior probability Pθ(i) (Xk = ξ Y ) is recursively cal- on the maximisation of the marginal posterior probability. For | ′ culated by the forward backward algorithm adapted to the symbol xk from the transmitted sequence of length N, the cyclostationarity of the hidden process Xk. When rx > 1, decision is taken by: ′ the algorithm chooses the optimal sequence in a reduced set xˆ =1 ′ k ′ of paths in the lattice diagram, since some transitions are not Pθ(xk = 0 Y ) ≶ Pθ(xk = 1 Y ) (20) | ′ | possible. xˆk=0 Let us note Let Ωj be the set of realisations ξ = ξ0 ξrx−1 of mrx ′ γm(k)= Pθ (Xk = ξ Y ) (12) Xkrx:(k+1)rx−1 such as xk = j. Since, there is a one to one | ′ relation between xk and Xkrx:(k+1)rx−1 m 0 M 1 k 0 K 1 , the marginal ∀ ∈ { − } ∀ ∈ { − } ′ j posterior distribution of X . One shows that : Pθ(xk = j Y )= Pθ(Xkrx:(k+1)rx−1 Ω Y ) (21) k | ∈ | α (k) β (k) With, γ (k)= m m (13) m M−1 P (X Ωj Y )= P X = ξ0 Y αn (k) βn (k) θ krx:(k+1)rx−1 ∈ | θ k | × n=0 ξ∈Ωj l=r −1 where αn (k) and βn (k) are respectively the forward and the x l+1 l backward probabilities defined as follow : P (Xk+l = ξ Xk+l−1 = ξ ) (22) | l=1 mrx αm(k)= Pθ(Y1 = y0 Yk = yk Xk = ξ ) (14) 0 Where, Pθ Xk = ξ Y ) is obtained by the forward backward β (k)= P (Y = y Y = y X = ξmrx ) algorithm (III-B) and the transition probabilities are given by m θ k+1 k+1 K−1 K−1| k (15) equation (4). This criterion takes into account the structure These probabilities can be calculated recursively by : of the barcode signal, via the marginal probability and the

M−1 transition probability matrix. αm(k +1)=[ αn(k)anm (k)]fm(yk+1) (16) V. JOINTCHANNELANDRESOLUTIONESTIMATION n=0 ALGORITHM M−1 From, subsections (III-A), (III-B), (III-C) and (IV), we βm(k)= βn(k + 1)amn (k) fn(yk+1) (17) deduce the algorithm to joint channel and barcode resolution n=0 estimation and symbol detection (CRESD): where

• fn(yk) is the density probability function of Y given Algorithm 1 Joint channel and resolution estimation and nrx Xk = ξ . From equation (1), the Gaussian density symbol detection algorithm nrx 2 with mean ξ and variance σ is deduced. 1: for rx =1K − 1 do • amn (k) is the transition probability (4). 2: Calculate the number of state and the transition probability The initialisation step of the forward and the backward algo- matrix using equations (3) and (4). 3: Initialisation, H (0) (σ2)(0). rithm are: We denote by ε a predetermined threshold k k+1 αm(1) = πmfm(y0) and βm(K) = 1, m 0 M 1 4: while |Hrx − Hrx | > ε do ∀ ∈ { − } 5: Calculate the marginal posterior probability using equations C. Estimation of rx (16), (17) and (13). 2 6: Estimation of Hr and σr from (10) and (11). rx is estimated using the maximum likelihood criterion x x 7: end while 2 2 r 8: Given H x and σrx , calculate the pseudo likelihood using rˆx = arg max g(Hrx σrx rx) (18) rx equation (19). 9: end for with g is the pesudo likelihood 2 ˆ ˆr x 10: Select the parameter θ = H x σˆrx rˆ that maximises the 2 (i−1) pseudo likelihood (19). g(Hrx σr rx) = max Q θ θ (19) x Hσ2 11: Detection of symbol using equations (20), (21) and (22). 2 Hrx and σrx are the estimates obtained using equations (10) and (11). Maximisation of g with regard to rx is equivalent to maximisation of the likelihood. Since, explicit expression of the estimator rˆx can not be identified, g is calculated for all possible value of rx 1 K 1 . Next, we choose ˆ 2 ∈ { − } (Hrx σˆrx rˆx) that gives the highest likelihood. P E P b P N VI.SIMULATIONS RESULTS PP 0 2dB 4dB 6dB 8dB 10dB rx PP In this section, the performance of the proposed algorithm rx=2 0.218 0.032 0.008 0.002 0.001 is illustrated through numerical simulations. rx=3 0.169 0.019 0.002 0.001 0 rx=4 0.083 0.005 0 0 0 rx=5 0.057 0.006 0 0 0

3000 TABLE I: rx error rate for channel length L = 3 and block 2500 length N = 100

2000

1500

1000 to rxL, is reduced when rxL > 1. Obviously, for the same 500 value of E N , estimation performance is better for r L > Gray−Scale b 0 x 0 1. −500 −1000 Channel estimation −1500 Initial signal Observed signal −2000 The Root Mean Squared Error (RMSE), assessing the 0 50 100 150 200 250 300 quality of the estimation of the channel, is defined as: Fig. 2: Blurred signal with blur length L=10, r = 3 and x (H Hˆ )T (H Hˆ ) N = 100 RMSE = − − HT H Fig.2 shows the observed signal degraded by blur and noise With H and Hˆ are respectively the true channel coefficients versus the initial transmitted signal. It confirms that vector and the estimated one. the received signal can not be directly decoded. Indeed, a joint 0 −1 blur identification and symbol detection algorithm is required 10 10 to efficiently recover the original signal. In the following, a set of binary symbol 0 1 have been { } considered and the results have been obtained with Ns = 1000

−2 Monte Carlo runs. For each run, a new sequence of length 10 has been generated with a barcode resolution

N = 100 Average RMSE Variance of RMSE barcode rx = 3 and a new simulated channel of length L = 3, −1 10 −5 Kaleh algorithm Kaleh algorithm the treshold ε = 10 . CRESD algorithm r is estimated CRESD algorithm r is estimated x x CRESD algorithm r is known CRESD algorithm r is known To analyse the performances of the proposed algorithm, we x −3 x 10 0 2 4 6 8 10 0 2 4 6 8 10 consider three cases: E /N [dB] E /N [dB] b 0 b 0 • The Kaleh’s algorithm [9], constructed without exploiting the cyclostationarity of the hidden Markov process. Fig. 3: RMSE vs EbN0, for N=100, L=3 and rx = 3 • The CRESD algorithm, described in Algorithm1. • A simple algorithm which does not take into account the channel model (1), but assumes known the resolution. Fig.3 shows the superiority of CRESD algorithm, in term The decision rule is: of RMSE. This clearly illustrates the benefit of exploiting the cyclostationarity of the hidden Markov process in the (k+1)rx ′ 1 xˆk=0 1 trellis diagram. This leads to a more accurate estimation of yi ≶ (23) r  ′ 2 the marginal posterior probability, which directly impacts the x xˆk=1 i=krx channel estimation equation(10). Besides, when the barcode   k 0 N 1 resolution rx is estimated, the RMSE is larger for EbN0 < ∀ ∈ { − } 4dB, but becomes identical to the one when r is known for In the experiments, EbN0 is the energy per bit to noise power x spectral density ratio, with energy per bit defined as: EbN0 4dB. For the≥ estimation of the noise variance, we note the same T T −2 Eb = rxH E XkXk H (24) behavior. The RMSE = 67710 for the CRESD algorithm and it is equal to the double for the Kaleh’s one RMSE = Estimation of the resolution rx −2 130510 , for EbN0 = 5dB. Indeed, as channel coefficients, Table (I) illustrates the performance of estimation of rx. the estimation of the noise variance depends on the marginal We calculate for different value of rx the error rate defined nb posterior probability equation(11) which takes into account the as ρ = , where nb is the number of false detection and true sequence structure of the barcode. Ns Ns the number of trials. As shown in Table (I) the error rate Now, the rapidity of convergence of the estimation is assessed. decreases rapidly, with EbN0. In fact, the error rate is due to Fig.4 shows that the CRESD is both more accurate and faster noise distortion and interference intersymbol. The later, related than the Kaleh’s one. In this exemple,the convergence has been achieved at the 4th iteration, while the Kaleh’s algorithm VII.CONCLUSION requires twice as much iterations. In this paper, we have proposed a blind channel estimation and symbol detection algorithm. Blur identification has been 0 10 performed using the EM algorithm. Besides, given that the received signal is modeled as a hidden Markov chain, a version of the forward-backward algorithm, suitable to the cyclostationarity of the Markov process, has been proposed to estimate the marginal posterior probability. We have shown that, when the barcode structure is taken into account in the

Average RMSE −1 CRESD algorithm(E /N =4dB) 10 b 0 lattice, the estimation of the marginal posterior probability is CRESD algorithm(E /N =8dB) b 0 easier and more accurate. This advantage directly impacts both Kaleh algorithm(E /N =4dB) b 0 Kaleh algorithm(E /N =8dB) b 0 the channel estimation and the symbol detection. Simulation

2 4 6 8 10 12 14 results show a fast convergence, a large gain for the parameter Number of iteration estimation and a smaller symbol error rate compared to existing approaches. As a consequence, the CRESD algorithm Fig. 4: Evolution of the RMSE with iterations, with L = 3, can be efficiently used with larger intersymbol interference, rx = 3 and N = 100 thus enabling to read more compact barcode and to allow higher mobility between the barcode and the camera.

Symbol detection REFERENCES [1] C. Anton-Haro and J. R. Fonollosa, “Blind channel estimation and data 0 detection using hidden markov models,” IEEE Trans. Signal Processing, 10 vol. 45, pp. 241–247, 1997. [2] L. Bahl, J. Cocke, F. Jelinek, and J. Raviv, “Optimal decoding of linear codes for minimizing symbol error rate (corresp),” IEEE Trans.

−1 Information. Theory, vol. 20, no. 2, pp. 284 – 287, Mar 1974. 10 [3] M. Cannon, “Blind deconvolution of spatially invariant image blurs with phase,” IEEE Trans. , Speech and Signal Processing, vol. 24, no. 1, pp. 58–63, Feb 1976.

Average BER [4] M. J. F. Chen, “An empirical identification method of gaussian blur −2 10 parameter for image deblurring,” IEEE Trans, Signal Processing, vol. 57, Kaleh algorithm no. 7, pp. 2467–2478, July 2009. CRESD algorithm r is estimated x [5] M. Feder and J. A. Catipovic, “Algorithms for joint channel estimation CRESD algorithm r is known x and data recovery-application to equalization in underwater communica- −3 Directed decision 10 tions,” IEEE Journal, Oceanic Engineering, vol. 16, no. 1, pp. 42 –55, 0 1 2 3 4 5 6 7 8 9 10 E /N [dB] b 0 Jan 1991. [6] J. A. R. Fonollosa and J. Vidal, “Application of hidden markov models Fig. 5: BER performance for known and estimated rx, L=3, to blind channel characterization and data detection,” IEEE Int Conf r = 3, N = 100 Proceedings of the Acoustics, Speech, and Signal Processing, pp. 185– x 188, 1994. [7] D. B. Grennery, “Determination of optical transfer function by inspection Fig. 5 illustrates Bit Error Rate (BER) performance, curves of frequency-domain plot,” Journal of The optical society of America, vol. 63, no. 12, pp. 1571–1577, Dec 1973. with solid and dashed line correspond respectively to the [8] K. Houni, W. Sawaya, and Y. Delignon, “One-dimensional barcode CRESD algorithm and Kaleh’s method. When rx is known, reading : an information theoretic approach,” Applied Optics, vol. 47, we note that BER performance is significantly improved using pp. 1025–1036, Mar 2008. [9] G. K. Kaleh and R. Vallet, “Joint parameter estimation and symbol CRESD algorithm, and this performance gain increases with detection for linear or nonlinear unknown channels,” IEEE Trans. EbN0. This result is explained by the fact that, with the Communications, vol. 42, no. 7, pp. 2406–2413, Jul 1994. CRESD algorithm, decision is taken in a trellis diagram [10] M. E. Moghaddam, “A mathematical model to estimate out of focus blur,” 5th Int Symp on Image and Signal Processing and Analysis, constructed with respect of the original signal structure. vol. 21, pp. 278–281, Sep 2007. When rx is estimated, the resolution and channel estimation [11] R. Muniz, L. Junco, and A. Otero, “A robust software barcode reader using the hough transform,” Int Conf on Information Intelligence and error lead to an increase of the BER for EbN0 < 4dB for Systems Proceedings, pp. 313–319, 1999. the CRESD algorithm. For the Kaleh’s one, rx is supposed to [12] M. Ouldbarikalla, W. Sawaya, Y. Delignon, and B. Pladeau, “New be known. Nevertheless, the CRESD algorithm still performs algorithm for 2d barcode detection,” 11th Int Conf. Advanced. Com- munication. Technology, vol. 03, pp. 1979 –1981, Feb 2009. better for EbN0 > 4dB, and the estimation of rx does not [13] T. Pavlidis, J. Swartz, and Y. P. Wang, “Fundamentals of barcode really degrades the overall performance. For EbN0 > 4dB, information theory,” Computer, vol. 23, no. 4, pp. 74–86, Apr 1990. the curve obtained with and without estimation of rx are the [14] D. Tsi, E. Marom, J. Katz, and J. Swartz, “System analysis of ccd-based same. bar code readers,” Applied Optics, vol. 32, pp. 3504–3512, 1993. On the other hand, the poor performances of the method based on the decision without channel estimation confirms the need of a more accurate algorithm to ensure correct reconstruction of the original signal.