JPH02302887A - Method for discriminating sort of bar code for bar code reader - Google Patents
Method for discriminating sort of bar code for bar code readerInfo
- Publication number
- JPH02302887A JPH02302887A JP1125320A JP12532089A JPH02302887A JP H02302887 A JPH02302887 A JP H02302887A JP 1125320 A JP1125320 A JP 1125320A JP 12532089 A JP12532089 A JP 12532089A JP H02302887 A JPH02302887 A JP H02302887A
- Authority
- JP
- Japan
- Prior art keywords
- bars
- bar
- barcode
- black
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野]
゛ 本発明は、バーコード読取装置のバーコード種類
判別方法に関し、特に2種類の幅を有する黒バーと白バ
ーからなる2値レベルバーコードの種類判別方法に関す
る。Detailed Description of the Invention [Industrial Application Field] The present invention relates to a barcode type discrimination method for a barcode reader, and particularly to a binary level barcode consisting of a black bar and a white bar having two widths. Concerning a method for determining the type of.
[従来の技術]
バーコードにはJAN、EANSUPC等と呼ばれる4
種類の幅を有する黒バーと白バーからなるバーコードと
NW 7 (Coda bar) 、COD E39、
I −T F (Infer 1eaved2 of
5 )等と呼ばれる2種類の幅を有する黒バーと白バー
からなる2値レベルバーコードがある。[Prior art] Barcodes have 4 codes called JAN, EANSUPC, etc.
Barcodes consisting of black bars and white bars with different widths, NW 7 (Coda bar), COD E39,
I-T F (Infer 1eaved2 of
There is a binary level barcode consisting of a black bar and a white bar with two types of widths, called 5).
このうち2値レベルバーコードについて見ると、NW7
は、第5図に示すように1つのキャラクタが4本の黒バ
ーと3本の白バーからなり、各キャラクタはキャラクタ
間ギャップと呼ばれる白バーによって区切られており、
バーコードデータの始まりと終りを示す4種類のスター
トキャラクタ、ストップキャラクタを有している。この
スタートキャラクタ、ストップキャラクタはrAJ
rBJrCJ rDJの英字によって表わされている
。Among these, looking at the binary level barcode, NW7
As shown in Figure 5, one character consists of four black bars and three white bars, and each character is separated by a white bar called an intercharacter gap.
It has four types of start and stop characters that indicate the beginning and end of barcode data. This start character and stop character are rAJ
rBJrCJ Represented by the letters rDJ.
そして各キャラクタは7本のバーのうち2本又は3本が
幅広のワイドバーで、特にスタートキャラクタ、ストッ
プキャラクタは自バーのうち2木が、黒バーのうち1本
が幅広のワイドバーとなっている。For each character, 2 or 3 of the 7 bars are wide bars, and especially for the start character and stop character, 2 of the own bars and 1 of the black bars are wide wide bars. ing.
CO,DE39は、第6図に示すように1つのキャラク
タが5本の黒バーと4本の自バーからなり、各キャラク
タはキャラクタ間ギャップと呼ばれる白バーによって区
切られており、バーコードデータの始まりと終りを示す
「*」の記号で表わされるスタートキャラクタ、ストッ
プキャラクタを有している。そして各キャラクタは9本
のバーのうち3本が幅広のワイドバーとなっている。For CO and DE39, as shown in Figure 6, one character consists of five black bars and four self-bars, and each character is separated by a white bar called an intercharacter gap. It has a start character and a stop character represented by the symbol "*" indicating the beginning and end. Each character has nine bars, three of which are wide bars.
ITFは、第7図に示すように1つのキャラクタが5本
の黒バー或いは5本の白バーからなり、これら交互の組
み合わせによる10本のバーで2・っのデータキャラク
タを表わし、キャラクタ間ギャップはなく、5本の黒バ
ー及び自バーのうち各2本が幅広のワイドバーとなって
いる。そしてバーコードデータの始まりを示すスタート
パターンは2本の黒バー及び2本の自バーからなりそれ
ぞれ幅狭のナローバーであり、またバーコードデータの
終りを示すストップパターンは2本の黒バー及び1本の
白バーからなり黒バーのうち1本が幅広のワイドバーと
なっている。In the ITF, as shown in Figure 7, one character consists of five black bars or five white bars, and 10 bars in an alternating combination of these represent 2 data characters, and the gap between characters is Instead, two of the five black bars and the own bar are wide bars. The start pattern indicating the beginning of barcode data is a narrow bar consisting of two black bars and two own bars, and the stop pattern indicating the end of barcode data is two black bars and one narrow bar. It consists of white bars of books, and one of the black bars is a wide bar.
以上を表にしてまとめると第1表に示すようになる。The above is summarized in a table as shown in Table 1.
このような異なる体系の3種類のバーコードを読み取る
バーコード読取装置として従来は特開昭61−1945
78号公報に見られるもの、特開昭63−91792号
公報に見られるもの及び特開昭63−228277号公
報に見られるものがそれぞれ知られている。The conventional barcode reading device for reading these three types of barcodes with different systems was Japanese Patent Application Laid-Open No. 1983-1945.
78, JP-A-63-91792, and JP-A-63-228277 are known.
特開昭61−194578号公報のものは、3種類のバ
ーコードをそれぞれ独立して解読するための3種類の復
調処理手段を設け、あるバーコードの読み取りに対して
各復調処理手段を同時に動作し、どれか1つの復調処理
手段によって解読が行われるというものである。The device disclosed in Japanese Patent Application Laid-open No. 194578/1983 provides three types of demodulation processing means for independently decoding three types of barcodes, and operates each demodulation processing means simultaneously for reading a certain barcode. However, the decoding is performed by one of the demodulation processing means.
特開昭63−91792号公報のものは、バーコードデ
ータを読取ると解読処理フラグをリードし、その解読処
理フラグによって解読処理の優先順位を決めて解読を行
なうが、基本的には3種類の解読を順次行なうものであ
る。In the method disclosed in Japanese Patent Application Laid-open No. 63-91792, when barcode data is read, a decoding processing flag is read, and the decoding processing flag determines the priority of the decoding processing and decoding is performed. The decoding is performed sequentially.
特開昭63−228277号公報のものは、各バーコー
ドデータのスタートシンボルと同数のバーを順に調べて
どれか1つのコード体系と一致するか否かをチェックし
、一致するコードを見付けるとそれに対応した解読処理
を行なうというものである。The method disclosed in Japanese Patent Application Laid-Open No. 63-228277 sequentially examines the same number of bars as the start symbol of each barcode data to check whether they match any one code system, and when a matching code is found, it The corresponding decoding process is performed.
しかし特開昭61−194578号公報のものでは、3
種類の復調処理手段を設けて同時処理するため、CPU
やハードデコーダ等のハードウェアが増大し、装置の小
形化やコスト低下が図れないは問題があった。However, in JP-A No. 61-194578, 3
Since different types of demodulation processing means are provided for simultaneous processing, the CPU
There was a problem in that the amount of hardware such as hard disks and hard decoders increased, making it impossible to downsize the device and reduce costs.
また、特開昭63−91792号公報のもので1 は、
バーコードを復調するためには最大で、(1つのコード
を復調するに要する時間)X(読取り可能なコード種類
の数)だけの時間を要し、比較的復調時間に余裕のある
手動走査形のバーコードリーダには適用できるが、バー
コード読み取りが高速で行われるレーザ走査式のバーコ
ードリーダにおいては復調処理が間に合わなくなる虞が
あり、読取率の低下を招く問題があった。In addition, 1 in Japanese Patent Application Laid-Open No. 63-91792 is
To demodulate a barcode, the maximum time required is (the time required to demodulate one code) x (the number of readable code types), and the manual scanning type has relatively sufficient demodulation time. However, in a laser scanning type barcode reader where barcode reading is performed at high speed, there is a risk that the demodulation process will not be completed in time, resulting in a problem of lowering the reading rate.
また、特開昭63−228277号公報のものでは、各
コードのスタートパターンのみをチェックするため他の
公報のものに比べて処理時間の短縮を図ることはできる
が、しかしスタートパターンを1種類ずつ順に調べるた
め処理時間を十分に短縮する上では不十分であった。ま
たこの公報のものではITF(インタリーブド2or5
)のバーコードについては判別できない問題があった。Furthermore, in the method disclosed in Japanese Patent Application Laid-open No. 63-228277, only the start pattern of each code is checked, so the processing time can be reduced compared to those in other publications. Since the tests were conducted sequentially, it was not sufficient to sufficiently shorten the processing time. Also, in this publication, ITF (interleaved 2 or 5)
) There was a problem that the barcode could not be identified.
[発明が解決しようとする課題]
このように従来のバーコード判別方法においては、装置
の小形化及びコスト低下を図り、しかも判別の処理時間
を十分に短縮するということができなかった。[Problems to be Solved by the Invention] As described above, in the conventional barcode discrimination method, it has not been possible to reduce the size and cost of the device, and to sufficiently shorten the processing time for discrimination.
そこで本発明は、装置の小形化及びコスト低下を図るこ
とができ、しかも判別の処理時間を十分に短縮できるバ
ーコード読取装置のバーコード種類判別方法を提供しよ
うとするものである。SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a barcode type discrimination method for a barcode reading device, which can reduce the size and cost of the device, and can sufficiently shorten the processing time for discrimination.
[課題を解決するための手段と作用]
本発明は、走査して読み取ったバーコードの各バー幅を
カウント値に変換し、そのカウント値からバーコードデ
ータを復調するバーコード読取装置において、マージン
部分に隣接する黒バーから数えて3本又は4本の黒バー
及び3本の白バーから黒バーの最大バー幅MXB及び最
小バー幅MNBと白バーの最大バー幅MXW及び最小バ
ー幅MNWを求め、M X n / M N sが予め
設定された一定値未満のときは全ての黒バーを2進数の
「0」に対応させ、また一定値以上のときは黒バー幅の
判定基準値を(MXB +MNa )/2によって求め
るとともにその判定基準値と各黒バー幅を比較し、判定
基準値よりも広い黒バーに2進数の「1」を対応させる
とともに判定基準値よりも狭い黒バーに2進数の「0」
を対応させ、またM X w / M N Wが予め設
定された一定値未満のときは全ての白バーを2進数の「
0」に対応させ、また一定値以上のときは白バー幅の判
定基準値を(MXw +MNw )/2によって求める
とともにその判定基準値と各自バー幅を比較し、判定基
準値よりも広い自バーに2進数の「1」を対応させると
ともに判定基準値よりも狭い白バーに2進数の「0」を
対応させ、これにより3本又は4本の黒バー及び3本の
白バーからなる6ビット又は7ビットの2進データを求
め、この2進データによってバーコードの種類を判別す
ることにある。[Means and effects for solving the problem] The present invention provides a barcode reading device that converts each bar width of a scanned and read barcode into a count value, and demodulates barcode data from the count value. The maximum bar width MXB and minimum bar width MNB of the black bar and the maximum bar width MXW and minimum bar width MNW of the white bar are calculated from 3 or 4 black bars and 3 white bars counting from the black bars adjacent to the part. When M X n / M N s is less than a preset constant value, all black bars are made to correspond to binary "0", and when it is greater than a certain value, the black bar width is determined by the criterion value. (MXB + MNa)/2 is calculated, and the judgment reference value is compared with each black bar width, and a binary "1" is assigned to a black bar wider than the judgment reference value, and a black bar narrower than the judgment reference value is calculated. Binary “0”
, and when M
0", and when it is above a certain value, find the judgment standard value of the white bar width by (MXw + MNw) / 2, compare the judgment standard value with each bar width, and select the own bar width that is wider than the judgment standard value. A binary number "1" is made to correspond to a binary number "1", and a binary number "0" is made to correspond to a white bar narrower than the judgment reference value, thereby creating a 6-bit result consisting of three or four black bars and three white bars. Alternatively, the method involves obtaining 7-bit binary data and determining the type of barcode based on this binary data.
そして7ビットの2進データが「001010o」のと
き又は6ビットの2進データが「001010」のとき
、左右マージンに挟まれた全バー数をカウントし、この
全バー数が(5n+71(但しnは正の整数)に一致し
たときバーコードの種類をITF(インタリーブド2o
f5)と判別し、また全バー数がilO(n+2)
11 (但しnは正の整数)に一致したときバーコー
ドの種類をC0DE39と判別することにある。Then, when the 7-bit binary data is "001010o" or the 6-bit binary data is "001010", count the total number of bars sandwiched between the left and right margins, and the total number of bars is (5n + 71 (however, n is a positive integer), the barcode type is set to ITF (interleaved 2o
f5), and the total number of bars is ilO(n+2)
11 (where n is a positive integer), the type of barcode is determined to be C0DE39.
また7ビットの2進データがr0011010コのとき
又は6ビットの2進データが
roollolJのとき、左右マージンに挟まれた全バ
ー数をカウントし、この全バー数が(5n+7) (但
しnは正の整数)のみに一致したときバーコードの種類
をITF(インター・リーブド2of5)と判別し、ま
た全バー数が(8(n+2)−11(但しnは正の整数
)のみに一致したときバーコードの種類をNW7 (コ
ーグ・バー)と判別し、また(5n+7)及び(8(n
+2)−1)の両方と一致したときはさらに右スタート
/ストップパターンをチェックしてITFかNW7を判
別することにある。Also, when the 7-bit binary data is r0011010 or the 6-bit binary data is rollolJ, count the total number of bars sandwiched between the left and right margins, and the total number of bars is (5n + 7) (where n is positive). When the total number of bars matches only (8(n+2)-11 (where n is a positive integer)), the barcode type is determined to be ITF (interleaved 2 of 5). The type of code is determined as NW7 (Korg bar), and (5n+7) and (8(n)
When both +2) and -1) match, the right start/stop pattern is further checked to determine whether it is ITF or NW7.
このようにすれば、C0DE39のスタートキャラクタ
を逆方向に読み取った場合とITFのストップパターン
との区別がつかない場合が生じても左右マージンに挟ま
れたすべてのバー数を計数することによってその区別が
可能となる。またNW7のスタートキャラクタAとIT
Fのストップパターンの区別がつかない場合が生じても
同様に左右マージンに挟まれたすべてのバー数を計数す
ることによって区別し、それでも区別できないときには
、さらに右側のスタート/ストップパターンを調べるこ
とによって区別が可能となる。In this way, even if the start character of C0DE39 is read in the opposite direction and the ITF stop pattern cannot be distinguished, the difference can be made by counting all the bars sandwiched between the left and right margins. becomes possible. Also NW7's start characters A and IT
Even if the stop pattern of F cannot be distinguished, it can be distinguished by counting all the bars between the left and right margins, and if it is still not possible to distinguish it, by further examining the start/stop pattern on the right side. It becomes possible to differentiate.
[実施例] 以下、本発明の実施例を図面を参照して説明する。[Example] Embodiments of the present invention will be described below with reference to the drawings.
第1図はバーコード読取装置を示すブロック図で、レー
ザ発光部1から出射されるレーザビームにより走査手段
(図示せず)を介してバーコードを印刷したバーコード
ラベル2上を走査し、その反射光を受光部3で受光して
電気信号に変換している。そして前記受光部3からの電
気信号を増幅回路4で増幅し、さらに2値化回路5でデ
ジタル信号に変換している。FIG. 1 is a block diagram showing a barcode reading device, in which a laser beam emitted from a laser emitting unit 1 scans a barcode label 2 on which a barcode is printed via a scanning means (not shown). The reflected light is received by the light receiving section 3 and converted into an electrical signal. The electric signal from the light receiving section 3 is amplified by an amplifier circuit 4, and further converted into a digital signal by a binarization circuit 5.
そしてバー幅カウンタ6によってデジタル信号の立ち上
がりエツジと立ち下がりエツジとの間及び立ち下がりエ
ツジと立ち上がりエツジとの間の時間幅をクロックジェ
ネレータ7からのクロックをカウントすることによって
計測している。すなわち前記バー幅カウンタ6はバーコ
ードの黒バー及び白バーのバー幅をクロック数からなる
時間幅データに変換している。このバー幅カウンタ6に
よってカウントされた各時間幅データを入力ポート8に
供給している。The bar width counter 6 measures the time width between the rising edge and the falling edge of the digital signal and between the falling edge and the rising edge by counting the clocks from the clock generator 7. That is, the bar width counter 6 converts the bar widths of the black bar and white bar of the barcode into time width data consisting of the number of clocks. Each time width data counted by this bar width counter 6 is supplied to an input port 8.
9は制御部本体を構成するCPU (中央処理装置)で
、このCPU9はROM (リード・オンリー・メモリ
)10のプログラムデータに基づいて各部の制御やバー
コードデータの復調処理を行うようになっている
前記CPU9は前記入力ポート8に入力される各時間幅
データをRAM (ランダム・アクセス・メモリ)11
に順次格納するようにしている。Reference numeral 9 denotes a CPU (central processing unit) that constitutes the main body of the control unit, and this CPU 9 controls each part and demodulates barcode data based on program data in a ROM (read only memory) 10. The CPU 9 stores each time width data input to the input port 8 in a RAM (random access memory) 11.
I am trying to store them sequentially.
また前記CPU9はRAMIIに格納された各時間幅デ
ータを順次読出してバーコードデータの復調を行い、そ
の結果を外部インターフェース12を介してホストコン
ピュータ等の外部機器13に送信するとともに、出力ポ
ート14を介して表示装置15に出力させるようにして
いる。Further, the CPU 9 sequentially reads out each time width data stored in the RAMII, demodulates the barcode data, and sends the result to an external device 13 such as a host computer via the external interface 12, and also outputs the output port 14. The image is outputted to the display device 15 via the display device 15.
前記CPU9は、読み取ったバーコードの種類判別を第
2図乃至第4図に基づいて行うようにプログラム設定さ
れている。The CPU 9 is programmed to determine the type of barcode read based on FIGS. 2 to 4.
すなわちCPU9は第2図に示すように、RAMIIか
ら最初のデータを読み出しマージンチェックを行い、こ
れを左マージンの候補が検索されるまで行う。そして左
マージン候補が検索されると、その次のデータから1つ
おきに4個のデータ、すなわち第1〜第4黒バー幅デー
タを読出し、その最大値MX、と最小値MN、を求める
。That is, as shown in FIG. 2, the CPU 9 reads the first data from RAMII and performs a margin check, and continues this until a left margin candidate is found. When a left margin candidate is retrieved, every other four pieces of data, that is, the first to fourth black bar width data, are read out from the next data, and their maximum value MX and minimum value MN are determined.
そして最大値MXBと最小値MNBを比較し、MXB/
MNBが一定値未満であれば全ての黒バーがナロー幅で
あると判断しこの全黒バーに2進数の「0」を割り当て
る。なお、このときの一定値は読取り条件やアナログ回
路、光学系の特性等によって決まるもので例えば1.5
程度に設定されるものである。Then, compare the maximum value MXB and the minimum value MNB, and MXB/
If MNB is less than a certain value, it is determined that all black bars have a narrow width, and a binary number "0" is assigned to all black bars. Note that the constant value at this time is determined by the reading conditions, analog circuit, optical system characteristics, etc., and is, for example, 1.5.
It is set to a certain degree.
またM X a / M N Bが一定値以上であれば
、判定基準値THBを、
THB −(MXB +MNB )/2によって求め、
各黒バー幅をその判定基準値THBと比較し基準値以上
であればワイドバーであると判断して2進数の「1」を
割り当て、また基準値未満であればナローバーであると
判断して2進数の「0」を割り当てる。Furthermore, if M X a / M N B is above a certain value, the determination reference value THB is determined by THB - (MXB + MNB )/2,
The width of each black bar is compared with its judgment reference value THB, and if it is greater than or equal to the reference value, it is determined that it is a wide bar and a binary number "1" is assigned to it, and if it is less than the reference value, it is determined that it is a narrow bar. Assign the binary number "0".
次に第1〜第4黒バーに挟まれた3本の白バー幅データ
を読出し、その最大値MXwと最小値MNwを求める。Next, the width data of the three white bars sandwiched between the first to fourth black bars is read out, and its maximum value MXw and minimum value MNw are determined.
そして最大値MXWと最小値M N wを比較し、M
X w / M N wが一定値未満であれば全ての白
バーがナロー幅であると判断しこの全白バーに2進数の
rOJを割り当てる。Then, the maximum value MXW and the minimum value M N w are compared, and M
If X w / M N w is less than a certain value, it is determined that all white bars have narrow widths, and a binary number rOJ is assigned to these all white bars.
またM X w / M N wが一定値以上であれば
、判定基準値THWを、
THw −(MXW+MNW )/2によって求め、各
自バー幅をその判定基準値THwと比較し基準値以上で
あればワイドバーであると判断して2進数の「1」を割
り当て、また基準値未満であればナローバーであると判
断して2進数の「0」を割り当てる。Also, if M X w / M N w is above a certain value, determine the judgment reference value THW by THw - (MXW + MNW ) / 2, compare each bar width with the judgment reference value THw, and if it is above the reference value. If it is determined that it is a wide bar, a binary number "1" is assigned to it, and if it is less than the reference value, it is determined that it is a narrow bar and a binary number "0" is assigned to it.
1 こうして黒バー4本、白バー3本からなる7ビット
の2進数を求める。1 In this way, find a 7-bit binary number consisting of 4 black bars and 3 white bars.
そしてこの2進数をROMI O内に設けられた第2表
に示すコードタイプ判別テーブルを参照してNW7、C
0DE39、ITFのどのコードであるかを判別する。Then, by referring to the code type discrimination table shown in Table 2 provided in ROMI O, this binary number is set to NW7, C.
It is determined which code is 0DE39 or ITF.
−18=
なお、この第2表において「上位」は上位3ビットを示
し、「下位」は下位4ビットを示している。またIはI
TF、NはNW7、CはC0DE39、I−CはITF
かC0DE39、I−NはITFかNW7をそれぞれ示
している。さらに添字のFは順方向読取り、Bは逆方向
読取りを示している。-18= In this Table 2, "upper" indicates the upper 3 bits, and "lower" indicates the lower 4 bits. Also, I is I
TF, N is NW7, C is C0DE39, I-C is ITF
or C0DE39 and I-N indicate ITF or NW7, respectively. Furthermore, the subscript F indicates forward reading, and the subscript B indicates backward reading.
この判別において上位が「1」、すなわちroolJで
下位が「4」、すなわちro 100Jのときはrl−
ClでITFとC0DE39の区別ができないときてあ
り、このときにはさらに第3図に示す処理を行う。In this determination, if the upper rank is "1", that is, roolJ, and the lower rank is "4", that is, ro 100J, then rl-
There are times when it is not possible to distinguish between ITF and C0DE39 using Cl, and in this case, the process shown in FIG. 3 is further performed.
この処理は先ず最初のマージン(左マージン)から数え
て18個目のデータが右マージンであるか否かを調べ右
マージンであればITFと判別する。またマージンでな
ければ続いて28個目のデータが右マージンであるか否
かを調べ右マージン1 であればITFと判別する。ま
たマージンでなければさらに29個目のデータがマージ
ンであるか否かを調ベマージンであればC0DE39と
判別する。こうしてt5n+81 目にマージンがあれ
ばITFと判別し、(10(n+2) ) 目にマージ
ンがあ゛ればC0DE39と判別する。但し、n−1,
2,3,・・・である。In this process, first, it is checked whether the 18th data counting from the first margin (left margin) is the right margin or not, and if it is the right margin, it is determined that it is ITF. If it is not a margin, then it is checked whether the 28th data is a right margin or not, and if the right margin is 1, it is determined that it is an ITF. Further, if it is not a margin, it is further determined whether the 29th data is a margin or not, and if it is a margin, it is determined as C0DE39. In this way, if there is a margin at t5n+81, it is determined to be ITF, and if there is a margin at (10(n+2)), it is determined to be C0DE39. However, n-1,
2, 3,...
なお、キャクタ数が予め設定したデータキャラクタの最
大読取り桁数になってもマージン検出ができなかったと
きにはどちらのコードでもないと判断してエラーにする
。Note that if the margin cannot be detected even if the number of characters reaches the preset maximum number of readable digits of data characters, it is determined that neither code exists and an error is generated.
この第3図の処理はITFの全バー数が(5n + 7
)であり、C0DE39の全バー数が(10(n+2)
−1)であることに基づいている。This process in Fig. 3 means that the total number of bars in the ITF is (5n + 7
), and the total number of bars of C0DE39 is (10(n+2)
-1).
また、この判別において上位が「1」、すなわちroo
lJで下位が「A」、すなわちrl 010Jのときは
r、I−NJてITFとNW7の区別ができないときで
あり、このときにはさらに第4図に示す処理を行う。Also, in this discrimination, the higher rank is "1", that is, roo
When the lower rank of lJ is "A", that is, rl 010J, it is when r, I-NJ cannot distinguish between ITF and NW7, and in this case, the process shown in FIG. 4 is further performed.
この処理は先ず最初のマージン(左マージン)から数え
て18個目のデータが右マージンであるか否かを調べ右
マージンであればITFと判別する。またマージンでな
ければ続いて24個目のデータが右マージンであるか否
かを調べ右マージンであればNW7と判別する。またマ
ージンでなければ以降(5n+8)目にマージンがあれ
ばITFと半す別し、(8(n+2)l 目にマージン
があればNW7と判別する。但し、n=1.2゜3、・
・・である。In this process, first, it is checked whether the 18th data counting from the first margin (left margin) is the right margin or not, and if it is the right margin, it is determined that it is ITF. If it is not a margin, then it is checked whether the 24th data is a right margin or not, and if it is a right margin, it is determined to be NW7. Also, if there is no margin, if there is a margin at the (5n+8)th position, it is separated from the ITF, and if there is a margin at the (8(n+2)lth) position, it is determined to be NW7.However, n = 1.2゜3, ・
It is...
また(5n+81 目にマージンがあってもnが8の倍
数のときにはNW7のバー数にも当てはまるのでこのと
きはさらに最後から2つ目の白バーを調べこれがワイド
バーであればNW7と判別し、またナローバーであれば
ITFと判別する。Also, even if there is a margin at 5n+81st, if n is a multiple of 8, this also applies to the number of bars in NW7, so in this case, check the second to last white bar and if it is a wide bar, determine it as NW7, Further, if it is a narrow bar, it is determined that it is an ITF.
なお、この場合もキャクタ数が予め設定したデータキャ
ラクタの最大読取り桁数になってもマージン検出ができ
なかったときにはどちらのコードでもないと判断してエ
ラーにする。In this case as well, if the margin cannot be detected even if the number of characters reaches the preset maximum number of readable digits of data characters, it is determined that neither code exists and an error is generated.
この第4図の処理はITFの全バー数が(5n+7)で
あり、NW7の全バー数が(8(n+2)−11である
ことに基づいている。The process shown in FIG. 4 is based on the fact that the total number of bars in ITF is (5n+7) and the total number of bars in NW7 is (8(n+2)-11).
このような構成の本実施例においては、最初のマージン
候補が検出されると、そのマージンの次の4本の黒バー
幅及び間の3本の白バー幅をチェックし、黒バー幅の最
大値MXBと最小値MNB及び自バー幅の最大値MXW
と最小値MNWを求める。In this embodiment with such a configuration, when the first margin candidate is detected, the widths of the four black bars next to that margin and the widths of the three white bars in between are checked, and the maximum black bar width is determined. Value MXB, minimum value MNB, and maximum value MXW of own bar width
and find the minimum value MNW.
そして黒バーについてはM X n / M N nが
一定値未満であれば全ての黒バーを「0」とし、また一
定値以上であれば判定基準値THBを(MX。Regarding the black bars, if M X n / M N n is less than a certain value, all black bars are set to "0", and if it is above a certain value, the judgment reference value THB is set to (MX).
+MNn)/2で求め、この基準値TH13と各黒バー
幅を比較することによって「1」か「0」を決める。ま
た白バーについても同様にMXW /MNWが一定値未
満であれば全ての白バーを「0」とし、また一定値以上
であれば判定基準値T Hwを(MXW+MNW )/
2で求め、この基準値THwと各自バー、幅を比較する
ことによって「1」か「0」を決める。+MNn)/2, and "1" or "0" is determined by comparing this reference value TH13 with each black bar width. Similarly, regarding the white bars, if MXW/MNW is less than a certain value, all white bars are set to "0", and if it is above a certain value, the judgment reference value T Hw is set to (MXW+MNW)/
2, and determine "1" or "0" by comparing each bar and width with this reference value THw.
こうして求められた7ビットの2進数をROM10に格
納されているバーコードタイプ判別テーブルを参照して
ITFSCODE39、NW7のどのタイプかを判別し
、タイプか判別されると対応する復調プログラムに基づ
いてバーコードデータの復調が行われる。The 7-bit binary number obtained in this way is referred to the barcode type discrimination table stored in the ROM 10 to determine whether it is an ITFSCODE39 or NW7 type, and when the type is determined, it is barcoded based on the corresponding demodulation program. Demodulation of the code data is performed.
このように読み込んだバーコードのマージンに隣接した
黒バー4本、白バー3本の7本のバー幅をそれぞれrD
j rlJの2進数に変換し、その2進数データをテ
ーブルを参照してどのコードタイプかを判別し、対応す
る復調処理を行うようにしているので、3種類のバーコ
ードタイプを順次調べて判別するものに比べてコード判
別時間の短縮ができる。従ってバーフードを読取ってか
ら復調処理するまでの時間短縮ができ、レーザ走査式の
高速走査を行うものに十分対処できる。The width of the 7 bars, 4 black bars and 3 white bars, adjacent to the margin of the barcode read in this way is rD.
j rlJ into binary numbers, the binary data is referred to a table to determine which code type it is, and the corresponding demodulation process is performed, so three types of barcodes are sequentially examined and determined. Code discrimination time can be shortened compared to those that do. Therefore, it is possible to shorten the time from reading the bar hood to demodulating it, and it is sufficient to cope with laser scanning type high-speed scanning.
また、2進数データが「001010oJのときにはテ
ーブルではITFかC0DE39かの区別が出来ない。Further, when the binary data is "001010oJ", it is not possible to distinguish between ITF and C0DE39 in the table.
このときには最初のマージンである左マージンから数え
て(5n−1−gl 目にマージンがあればITFと判
別して復調処理を行い、1また(10’(n+2)1
目にマージンがあればC0DE39と判別して復調処理
を行う。In this case, counting from the left margin, which is the first margin, (5n-1-gl) If there is a margin, it is determined as ITF and demodulation processing is performed.
If there is a margin, it is determined to be C0DE39 and demodulation processing is performed.
また、2進数データがro 011010Jのときには
テーブルではITFかNW7かの区別が出来ない。この
ときには最初のマージンである左マージンから数えて(
5n+8)目にマージンがあればITFと判別して復調
処理を行い、また(8(n+2)l 目にマージンがあ
ればNW7と牢り別して復調処理、を行う。しかしこの
場合においてマージンがあったときのnの値が8の倍数
のときにはITFとNW7との区別ができないのでこの
ときにはさらに最後から2つ目の白バーを調べ、その白
バーがワイドバーであればNW7と判別し、またナロー
バーであればITFと判別する。Further, when the binary data is ro 011010J, it is not possible to distinguish between ITF and NW7 in the table. In this case, count from the first margin, the left margin (
If there is a margin at 5n+8), it is determined to be ITF and demodulation processing is performed, and if there is a margin at 8(n+2)l, demodulation is performed separately from NW7.However, in this case, there was a margin. When the value of n is a multiple of 8, it is impossible to distinguish between ITF and NW7, so in this case, the second-to-last white bar is further checked, and if that white bar is a wide bar, it is determined to be NW7, and if it is a narrow bar, it is determined that it is NW7. If so, it is determined that it is ITF.
こうして特別の2つの2進数データについても最終的に
はITF、C0DE39、NW7の判別が確実に出来る
ことになる。従って各バーコードタイプに対応した復調
処理が確実にできる。In this way, even for the two special binary data, ITF, C0DE39, and NW7 can be determined with certainty. Therefore, demodulation processing corresponding to each barcode type can be reliably performed.
また、このように判別した結果に基づいて対応する復調
プログラムが読み出されて復調処理が行われるので、同
時に3つの復調手段を動作させるものに比べてハードウ
ェア構成が簡単となり、装置の小形化及びコスト低下を
図ることができる。In addition, since the corresponding demodulation program is read out based on the results of this discrimination and the demodulation process is performed, the hardware configuration is simpler compared to a system that operates three demodulation means at the same time, and the device can be made more compact. It is also possible to reduce costs.
なお、3本の黒バーと2本の白バーの計5本のバーでは
全黒バー及び全白バーの幅が等しくなる場合があり、そ
の場合それがワイドバーであるかナローバーであるかの
判別ができなくなるので実現が不可能となる。In addition, for a total of 5 bars (3 black bars and 2 white bars), the widths of the all black bars and all white bars may be equal, and in that case, it is difficult to determine whether it is a wide bar or a narrow bar. It becomes impossible to realize this because discrimination becomes impossible.
また、8本以上のバーではNW7のギヤツブ間キャラク
タを含むことになるので白バー幅の判定基準値を求める
ときに誤差が生じその結果判別が誤る虞があるので好ま
しくない。Further, eight or more bars include the NW7 gear-to-gear character, which is not preferable because an error may occur when determining the white bar width determination reference value, resulting in incorrect determination.
なお、前記実施例ではRAMから4本の黒バーと3本の
白バーの計7本のバーを読出して2進数のデータに変換
しコードの種類を判別するようにしたが必ずしもこれに
限定されるものではなく、3本の黒バーと3本の白バー
の計6本のバーを読出しそれを2進数のデータに変換し
ても同様の処理ができるものである。In the above embodiment, a total of seven bars, four black bars and three white bars, are read out from the RAM and converted into binary data to determine the code type, but the present invention is not necessarily limited to this. Instead, the same processing can be performed by reading a total of six bars, three black bars and three white bars, and converting them into binary data.
また、前記実施例ではバーコードの種別判別をCPUに
よるソフトウェア処理によって行うものについて述べた
が必ずしもこれに限定されるものではなく、ハードウェ
アロジックによって構成してもよい。Further, in the embodiment described above, the barcode type determination is performed by software processing by the CPU, but the invention is not necessarily limited to this, and may be configured by hardware logic.
[発明の効果]
以上詳述したように本発明によれば、装置の小形化及び
コスト低下を図ることができ、しかも判別の処理時間を
十分に短縮できるバーコード読取装置のバーコード種類
判別方法を提供できるものである。[Effects of the Invention] As detailed above, according to the present invention, there is provided a barcode type discrimination method for a barcode reading device that can reduce the size and cost of the device, and can sufficiently shorten the processing time for discrimination. It is possible to provide
第1図乃至第4図は本発明の実施例を示すもので、第1
図はブロック図、第2図乃至第4図はCPUによるバー
コード種類判別処理を示す流れ図、第5図はNW7のバ
ーコードパターンを示す図、第6図はC0DE39のバ
ーコードパターンを示す図、第7図はITFのバーコー
ドパターンを示す図である。
6・・・バー幅カウンタ、
9・・・CPU (中央処理装置)、
10・・・ROM (リード・オンリー・メモリ)、1
1・・・RAM (ランダム・アクセス・メモリ)。1 to 4 show embodiments of the present invention.
The figure is a block diagram, Figures 2 to 4 are flowcharts showing barcode type discrimination processing by the CPU, Figure 5 is a diagram showing the barcode pattern of NW7, Figure 6 is a diagram showing the barcode pattern of C0DE39, FIG. 7 is a diagram showing an ITF barcode pattern. 6... Bar width counter, 9... CPU (Central Processing Unit), 10... ROM (Read Only Memory), 1
1...RAM (Random Access Memory).
Claims (3)
ント値に変換し、そのカウント値からバーコードデータ
を復調するバーコード読取装置において、 マージン部分に隣接する黒バーから数えて3本又は4本
の黒バー及び3本の白バーから黒バーの最大バー幅MX
_B及び最小バー幅MN_Bと白バーの最大バー幅MX
_W及び最小バー幅MN_Wを求め、MX_B/MN_
Bが予め設定された一定値未満のときは全ての黒バーを
2進数の「0」に対応させ、また一定値以上のときは黒
バー幅の判定基準値を(MX_B+MN_B)/2によ
って求めるとともにその判定基準値と各黒バー幅を比較
し、判定基準値よりも広い黒バーに2進数の「1」を対
応させるとともに判定基準値よりも狭い黒バーに2進数
の「0」を対応させ、 またMX_W/MN_Wが予め設定された一定値未満の
ときは全ての白バーを2進数の「0」に対応させ、また
一定値以上のときは白バー幅の判定基準値を(MX_W
+MN_W)/2によって求めるとともにその判定基準
値と各白バー幅を比較し、判定基準値よりも広い白バー
に2進数の「1」を対応させるとともに判定基準値より
も狭い白バーに2進数の「0」を対応させ、 これにより3本又は4本の黒バー及び3本の白バーから
なる6ビット又は7ビットの2進データを求め、この2
進データによってバーコードの種類を判別することを特
徴とするバーコード読取装置のバーコード種類判別方法
。(1) In a barcode reading device that converts each bar width of a scanned barcode into a count value and demodulates barcode data from the count value, three or more black bars are counted from the black bar adjacent to the margin area. Maximum bar width MX of black bar from 4 black bars and 3 white bars
_B and minimum bar width MN_B and maximum bar width MX of white bar
Find _W and minimum bar width MN_W, and calculate MX_B/MN_
When B is less than a preset constant value, all black bars are made to correspond to binary ``0'', and when it is above a constant value, the black bar width judgment standard value is determined by (MX_B + MN_B)/2. The judgment reference value is compared with each black bar width, and a black bar wider than the judgment reference value is associated with a binary ``1'', and a black bar narrower than the judgment reference value is associated with a binary digit ``0''. , Also, when MX_W/MN_W is less than a preset constant value, all white bars correspond to binary "0", and when it is greater than a certain value, the white bar width judgment reference value is (MX_W
+MN_W)/2 and compares the judgment reference value with each white bar width, and assigns a binary number "1" to the white bar wider than the judgment reference value and a binary number to the white bar narrower than the judgment reference value. ``0'' of ``0'' corresponds to the ``0'', thereby obtaining 6-bit or 7-bit binary data consisting of 3 or 4 black bars and 3 white bars, and converting these 2
1. A barcode type determination method for a barcode reading device, characterized in that the barcode type is determined based on digit data.
き又は6ビットの2進データが「001010」のとき
、左右マージンに挟まれた全バー数をカウントし、この
全バー数が{5n+7}(但しnは正の整数)に一致し
たときバーコードの種類をITF(インタリーブド2o
f5)と判別し、また全バー数が{10(n+2)−1
}(但しnは正の整数)に一致したときバーコードの種
類をCODE39と判別することを特徴とする請求項(
1)記載のバーコード読取装置のバーコード種類判別方
法。(2) When the 7-bit binary data is "0010100" or the 6-bit binary data is "001010", count the total number of bars sandwiched between the left and right margins, and calculate this total number of bars as {5n+7} (where n is a positive integer), the barcode type is set to ITF (interleaved 2o).
f5), and the total number of bars is {10(n+2)-1
} (where n is a positive integer), the type of barcode is determined to be CODE39 (
1) Barcode type determination method of the barcode reading device described above.
き又は6ビットの2進データが「001101」のとき
、左右マージンに挟まれた全バー数をカウントし、この
全バー数が{5n+7}(但しnは正の整数)のみに一
致したときバーコードの種類をITF(インター・リー
ブド2of5)と判別し、また全バー数が{8(n+2
)−1}(但しnは正の整数)のみに一致したときバー
コードの種類をNW7(コーダ・バー)と判別し、また
{5n+7}及び{8(n+2)−1}の両方と一致し
たときはさらに右スタート/ストップパターンをチェッ
クしてITFかNW7を判別することを特徴とする請求
項(1)記載のバーコード読取装置のバーコード種類判
別方法。(3) When the 7-bit binary data is "0011010" or the 6-bit binary data is "001101", count the total number of bars sandwiched between the left and right margins, and calculate this total number of bars as {5n+7} (where n is a positive integer), the barcode type is determined to be ITF (interleaved 2 of 5), and the total number of bars is {8(n+2)
)-1} (where n is a positive integer), the barcode type is determined to be NW7 (coda bar), and it also matches both {5n+7} and {8(n+2)-1}. 2. The barcode type determination method for a barcode reading device according to claim 1, further comprising checking a right start/stop pattern to determine whether it is ITF or NW7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1125320A JPH02302887A (en) | 1989-05-18 | 1989-05-18 | Method for discriminating sort of bar code for bar code reader |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1125320A JPH02302887A (en) | 1989-05-18 | 1989-05-18 | Method for discriminating sort of bar code for bar code reader |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH02302887A true JPH02302887A (en) | 1990-12-14 |
Family
ID=14907194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1125320A Pending JPH02302887A (en) | 1989-05-18 | 1989-05-18 | Method for discriminating sort of bar code for bar code reader |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH02302887A (en) |
-
1989
- 1989-05-18 JP JP1125320A patent/JPH02302887A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5821519A (en) | Bar code scan stitching | |
EP0498678B1 (en) | High speed scan bar code reader which can read more than one type of bar code | |
US4667089A (en) | Bar code discriminating apparatus for bar code reading | |
US5457308A (en) | Bar code scan stitching | |
US5438188A (en) | Method and apparatus for decoding bar code images using information from previous scan lines | |
EP0754327B1 (en) | Method and apparatus for decoding bar code images using multi-order feature vectors | |
JP3115003B2 (en) | Method and apparatus for decoding barcode symbols using module size ratio analysis | |
WO1996007155A1 (en) | Method and apparatus for decoding bar code symbols using independent bar and space analysis | |
JPS61115179A (en) | Bar code reader | |
EP0838775B1 (en) | A method of reading a bar code | |
US20020074405A1 (en) | Method of reading barcode and barcode reading system | |
US5686715A (en) | Add-on bar-code reading apparatus in a bar-code reader | |
US5189289A (en) | Distinguishing bar code types by comparing bar block sizes | |
US5979765A (en) | Bar-code reader and bar-code reading method for detecting various possible reproducible bar code combinations and synthesizing information therefrom | |
US5929420A (en) | Method for reading distorted bar codes | |
US6330972B1 (en) | Error correction enhancement for code 93i and other machine-readable symbologies | |
JPH02302887A (en) | Method for discriminating sort of bar code for bar code reader | |
US6164543A (en) | Method of deciphering bar codes | |
EP0896292A2 (en) | Bar code reader, bar code reading method and computer readable medium | |
JP3448404B2 (en) | Barcode reading device and barcode reading method | |
JPH08263585A (en) | Code reader | |
JP2750244B2 (en) | Barcode decoder decoding method | |
JPH0589278A (en) | Bar code symbol reader | |
JPH05324879A (en) | How to identify the bar code type | |
JP3606228B2 (en) | Bar code reader |