Patent ID: 8608074

Claim:
A method for recognizing two-width barcodes having N bars and N spaces, with each two-width barcode having M wide bars or spaces and N−M narrow bars or spaces, comprising using a processor to: sort the N bars or spaces according to width in descending order from widest bar or space to narrowest bar or space; loop n, where n=1 to N−1, wherein a first class A of wide bars or spaces contains n elements Array [ 1 ] to Array [n], and a second class B of narrow bars or spaces contains N−n elements Array [n+1] to Array [N]; calculate a mean value μ A of class A and a mean value μ B of class B, where μ A = ∑ k = 1 n ⁢ ⁢ Array ⁡ [ k ] n , ⁢ μ B = ∑ k = n + 1 N ⁢ ⁢ Array ⁡ [ k ] N - n ; calculate a between-class difference D=μ A −μ B ; record a value of n when D achieves a maximum value; and if n=M when D achieves the maximum value, then recognize the N bars or spaces as a two-width barcode; otherwise, determine the N bars or spaces are not a two-width barcode.