JP3891072B2 - Bar code reading method and bar code reading apparatus - Google Patents
Bar code reading method and bar code reading apparatus Download PDFInfo
- Publication number
- JP3891072B2 JP3891072B2 JP2002252980A JP2002252980A JP3891072B2 JP 3891072 B2 JP3891072 B2 JP 3891072B2 JP 2002252980 A JP2002252980 A JP 2002252980A JP 2002252980 A JP2002252980 A JP 2002252980A JP 3891072 B2 JP3891072 B2 JP 3891072B2
- Authority
- JP
- Japan
- Prior art keywords
- light
- dark
- boundary
- module
- dark pattern
- 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.)
- Expired - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明はバーコード読取方法およびバーコード読取装置に係り、特にモジュールの中央が白か黒かの判定を優先して白黒パターンを判定するようにしたものに関するものである。
【0002】
【従来の技術】
バーコード読取装置は、CCDセンサなどからなるカメラ部によってバーコードを撮影し、その画像信号を二値化してバーコードの明暗(白黒)判別を行うと共に、その白バー、黒バーの幅を検出して解読する。
【0003】
【発明が解決しようとする課題】
バーコードをカメラ部によって撮影した場合、バーのエッジ部はノイズの影響を受け易く、白バーと黒バーの境界を正確に検出することが難しいため、バー幅を正確に検出できないことがあり、誤読の恐れがある。この問題を解消するものとして、特開昭61−125684号公報に開示されたバーコード読取装置は、バーの中心位置がスタートバー、エンドバーの中心位置に対して相対的に変化しないことに着目し、中心付近の論理1の値の部分の面積計算により白バー、黒バーの判定を行うことによって安定した読み取りを行い得るようにしている。
【0004】
しかしながら、この白バー、黒バーの判定方式(明暗判定方式)のものでは、バーコードに対してカメラ部が傾いたりすると、撮影したバーコードが遠近差のために部分部分でサイズが異なるようになるので、同じ幅のバーでも、その中心部分の面積が変化するようになり、正確性に欠けるものであった。
【0005】
本発明は上記事情に鑑みてなされたものであり、その目的は、画像検出手段により取り込んだバーコードの画像が、バーのエッジ部分で不鮮明であったり、撮影した画像のサイズが部分部分で異なっていたりしたとしても、より正確に解読することができるバーコード読取方法およびバーコード読取装置を提供するところにある。
【0006】
【課題を解決するための手段】
上記目的を達成するために、請求項1,6の発明は、多段階レベルの画像データを明または暗に分けて明暗の境界位置を検出した後、
(1)前記多段階レベルの画像データを明または暗に分けたときの明暗パターンを取り込み時明暗パターンとしたとき、この取り込み時明暗パターンでの1コードワードにおける明暗の境界を中心としたその両側の所定長さ範囲を境界エラー範囲として設定し、
(2)前記取り込み時明暗パターンにおいて、バーコードの種類毎に定められた数のバーによって構成されている1コードワードの長さを算出し、当該1コードワードの長さと1コードワードのモジュール数とから1モジュールの長さを算出し、
(3)前記取り込み時明暗パターンにおいて、1コードワードを1モジュールの長さ毎に区切って各モジュールの中心の位置を初期位置として検出し、
(4)1コードワードを構成する各モジュールの中心を前記初期位置からその両側に各回で移動量が異なるように複数回移動させ、中心が前記境界エラー範囲に位置したモジュールの数を境界モジュール数として移動量が0の前記初期位置を含めて移動量毎にカウントし、
(5)前記境界モジュール数が所定条件を満たしたときの移動量での各モジュールの中心と前記取り込み時明暗パターンとを比較し、各モジュールの明暗を、その中心が位置する取り込み時明暗パターンの明暗と同じに定めて正規化された明暗パターンを作成し、
この正規化された明暗パターンに対して解読処理を行うことを特徴とする。
【0007】
この手段によれば、画像検出手段によって取り込んだバーコードの画像において、明暗の境界を中心にその両側の所定長さ範囲を明暗のはっきりしない境界エラー範囲として設定し、1ワードコードを構成する各モジュールの中心を初期位置からその両側に移動させたとき、境界エラー範囲に入る境界モジュール数が所定条件を満たした時の状態で正規化明暗パターンを作成し、この正規化明暗パターンを解読対象とするので、取り込んだバーコードの画像において、バーのエッジ部が不鮮明であっても、より正確にバーの境界位置を検出することができてバーコードをより正確に解読することができる。しかも、1ワードコードずつ解読するので、取り込んだバーコードの画像が遠近差のために部分部分でサイズが異なったとしても、その影響を極力排除してより正確な解読処理を行うことができる。
【0008】
請求項2,7の発明は、前記(1)ないし(3)の動作は、前記多段階レベルの画像データを明または暗に分けた取り込み時明暗パターンに基づいてバーコードの種類を判別した後に実行することを特徴とする。
【0009】
請求項3,8の発明によれば、前記取り込み時明暗パターンの明暗の境界は、明暗の変化が最大となる位置としたので、画像検出手段の画素間に明暗の境界がある場合でも、それを検出できる。
【0010】
請求項4,9の発明は、前記(3)の動作を、境界モジュール数が所定の中止条件を満たした時点で中止するので、明暗の境界をある程度正しく検出できて正規化明暗パターンを作成できる状態になったにも係らず、更に明暗の境界を検出するための動作を継続するという不具合を解消することができる。
【0011】
請求項5,10の発明は、前記境界モジュール数が所定条件を満たす場合が複数あったとき、移動量の小さい方を採用して明暗パターンを決定するようにしたものである。
【0012】
【発明の実施の形態】
以下、本発明の一実施例を図面に基づいて説明する。図1はハンディタイプのバーコード読取装置の電気的構成を示すもので、読取対象部分を撮像するカメラ部1、増幅回路2、A/D変換器3、クロック発生回路4、アドレス発生回路5、画像メモリ6、液晶表示器7、ホストコンピュータなどとの間でデータの送受を行う入出力回路8、各種のスイッチ9および制御手段としての制御回路10などから構成されている。
【0013】
上記カメラ部1は、受光素子としてのCCDを縦横に配列して構成された二次元の画像検出手段としてのCCDエリアセンサ11、読取対象部を照明する照明手段としてのLED(発光ダイオード)12、読取対象部分からの反射光をCCDエリアセンサ12上に結像するレンズ13から構成されている。
【0014】
CCDエリアセンサ11は、二次元画像を検出すると、その二次元画像を水平方向の走査線信号として増幅回路2を介してA/D変換器3に出力する。A/D変換器3は、CCDエリアセンサ11から出力され、増幅回路2で増幅されたアナログの走査線信号を多段階のレベルからなるデジタル信号に変換する。
【0015】
一方、クロック発生回路4は、CCDエリアセンサ11から出力される同期パルスに応じて、当該CCDエリアセンサ11が出力する走査線信号のパルスよりも充分に細かいクロックパルスを出力する。アドレス発生回路5は、クロック発生回路4から出力されるパルスをカウントして画像メモリ6に対するアドレスを発生させる。そして、制御回路10は、多段階レベルの走査線信号をアドレス発生回路5により定められた画像メモリ6のアドレスに記憶させる。
なお、制御回路10は、CPU、RAM、ROMなどを備えたマイクロコンピュータシステムからなる。
【0016】
ここで、バーコードは、幅の異なる黒バーと白バーとを交互に並べて構成されているが、そのバーの最小幅を1モジュールと称する。また、バーコードの左右両側には、スタートコードとストップコードが設けられ、これらスタートコードとストップコードとの間に、複数のコードワードからなるデータコードが設けられている。スタートコードとストップコードを構成するバーの本数、およびモジュール数などはバーコードの種類によって異なり、1コードワードを構成するバーの本数、および1コードワードを構成するモジュール数などもバーコードの種類によって異なる。
【0017】
次に、上記構成のバーコード読取装置の作用を図2〜図4のフローチャートをも参照しながら説明する。なお、この作用説明では、バーコード読取装置が特定種類のバーコード、例えば図8に示すPDF417の読み取り専用に構成されているとして説明する。
【0018】
PDF417は、左右両側のスタートコードSRとストップコードSTとの間に、白バーと黒バーとが並ぶデータコードパターンDTを複数段重ねて構成されている。そして、データコードを構成する1コードワードは、PDF417の場合、図5に示すように、8本のバーからなり、それら8本のバーの合計モジュールは17モジュールである。
【0019】
さて、制御回路10の制御の下に、CCDエリアセンサ11がPDF417のバーコードを検出すると(ステップS1)、CCDエリアセンサ11から出力される画像信号が多段階のレベル、例えば256階調の画像データとして画像メモリ6に記憶される(ステップS2)。
【0020】
次に制御回路10は、複数段あるPDF417バーコードのデータコードの段数カウンタnを1にセットし(ステップS3)、第1段目(図8で最上段)のデータコードパターンについて明暗の境界位置を検出し(明暗境界位置検出手段)、その明暗のパターンを取り込み時明暗パターンとして(明暗パターン検出手段)図示いないRAMなどの記憶装置に記憶する(ステップS4)。この取り込み時明暗パターンの一部を図5(a)に例示する。
【0021】
この場合の明と暗の二値の境界位置は次のようにして検出する。即ち、記憶された多段階レベルの画像データが図6(a)に示すようなものであったとする。なお、図6(a)において、プロットした点はCCDエリアセンサの画素が検出した明暗度(デジタル)である。明暗の境界位置を求めるには、左側の画素の明暗レベルから右側の明暗レベルを差し引いて明暗レベル差を求めることを、互いに隣どうしとなっている画素のすべてについて行い、図6(b)に示す明暗レベルの一次差分を求める。次に、図6(b)の一次差分データにプロットされた各点について、左側の点の値から右側の点の値を差し引くことを、互いに隣どうしとなっている各点について行い、図6(c)に示す二次差分を求める。そして、二次差分データにプロットされた各点を包絡線で結んだとき、その包絡線がゼロレベルと交差する点の位置を明(白バー)と暗(黒バー)の境界と定める(図6(d))。
【0022】
このようにして明暗の境界を定めると、画素と画素との間に明暗の境界がある場合であっても、画素と画素の間の途中位置を境界として認識し、実際のバーコードに即した境界として定めることができる。例えば、図7に示すように、画素1および2間の一次差分と画素2および3間の一次差分の二次差分a点が+1、画素2および3間の一次差分と画素3および4間の一次差分との二次差分b点が−4であったとき、明暗の境界は画素2と画素3との間に存在する。そこで、二次差分a点とb点との間の包絡線Sが直線と見なせることから、ゼロクロス点は画素2から画素間の距離Rの1/5の位置にあるとする。このように本実施例の境界検出法によれば、明暗の境界が2つの画素の途中にある場合でも、これを検出できる。
【0023】
以上のようにして明暗の境界位置を検出した後、制御回路10は、その検出した境界位置から第1段目のデータコードパターンを構成する多数の白バーと黒バーの幅を算出する(バー幅検出手段、ステップS5)。次に、制御回路10は、1段目のデータコードパターンの1番目のコードワード、例えば最も左側に位置する1コードワード(図5(b))について、そのコードワードを構成する複数本のバーの幅を加算し、その1コードワードの長さを算出する(コードワード長検出手段、ステップS6)。そして、制御回路10は、1コードワードの長さを1コードワードのモジュール(17)で除して、そのコードワードにおける1モジュールの長さを算出し(モジュール長検出手段、ステップS7)、図5(c)に示すように、各モジュールの中心位置を初期位置として算出する(モジュール位置検出手段、ステップS8)。
【0024】
この後、制御回路10は、明暗の境界位置からその左右両側(コードワードの長さ方向両側)に所定範囲、例えばモジュール幅Mの16分の1ずつ取った範囲を境界エラー範囲(図5(d))として設定し(ステップS9)、図5(e)に示すように、前記初期位置において、中心が境界エラー範囲に位置しているモジュールの数をカウントし、これを境界モジュール数として移動量0(初期位置)と関連付けて図示しないROMなどの記憶装置に記憶する(ステップS11)。
【0025】
次に、制御回路10は、移動回数カウンタmを0にセットし(ステップS12)、次にこのカウンタmに1を加算する(ステップS13)。そして、制御回路10は、各モジュールの中心を初期位置から1モジュールの長さMの1/16だけ左側に移動し(ステップS14)、この移動位置で中心が境界エラー範囲に入ったモジュールの数を境界モジュール数としてカウントし(ステップS15)、この境界モジュール数を移動量(方向も含めて)と関連付けて記憶装置に記憶する(ステップS16)。
【0026】
更に、制御回路10は、各モジュールの中心を初期位置から右側に1モジュールの長さMの1/16だけ移動し(ステップS17)、この移動位置で中心が境界エラー範囲に入ったモジュールの数を境界モジュール数としてカウントし(ステップS18)、この境界モジュール数を移動量(方向も含めて)と関連付けて記憶装置に記憶する(ステップS19)
次に、制御回路10は、mが8であるか否かを判断し(ステップS21)、8未満のときには(ステップS21で「NO」)、次にカウントした境界モジュール数が1以下であったか否かを判断し(ステップS21)、1を越えていた場合にはステップS21で「NO」となって前記ステップS13に戻り、カウンタmに1をプラスしてmを2にセットする。
【0027】
そして、制御回路10は、各モジュールを初期位置から左側および右側にモジュール長さMの2/16だけ移動させ、中心が境界エラー範囲に入ったモジュールの数を移動量と関連つけて記憶するという動作を(境界モジュール数検出手段)、mが8となるまで、即ち初期位置からの左右への移動量をM/16ずつ増加させて夫々の移動量がM/2となるまで実行する。
【0028】
mが8になると、制御回路10は、ステップS20で「YES」と判断し、次に境界モジュール数が所定条件を満たす移動量、この実施例では境界モジュール数が最小である移動量を検出し(ステップS22)、その後、最小境界モジュール数である移動量の数を検出してその数が複数か否かを判断する(ステップS23)。そして、制御回路10は、最小境界モジュール数である移動量が1つしかない場合には、ステップS23で「NO」となって次のステップS25に移行し、また最小境界モジュール数である移動量が複数存在する場合には、ステップS23で「YES」となってステップS24に以降し、ここで当初のモジュールの中心位置に最も近く且つ明暗境界位置から最も遠くなる移動量の方を最小境界モジュール数である移動量に設定してステップS25移行する。
【0029】
そして、制御回路10は、ステップS25で、図5(i)に示すように、最小境界モジュール数であるときの移動量に各モジュールの中心を移動させたとき、それら各モジュールの中心が取り込み時明暗パターンにおいて属する明、暗に設定し、これを正規化明暗パターンとする(正規化パターン作成手段)。図5(i)の例では、同図(j)に示すように、左から5モジュール目まで暗(黒)、次の1モジュールは明(白)、次の2モジュールは暗、次の2モジュールは明、次の2モジュールは暗、次の2モジュールは明、次の2モジュールは暗、最後の1モジュールは明である。そして、制御回路10は、1コードワードこの正規化された明暗パターンであるとして、当該コードワードを解読する(解読手段、ステップS26)。
【0030】
ところで、モジュールの中心をモジュール長さMの1/16ずつ増加させながら左右に移動させて境界モジュール数を検出する動作の実行中に、その境界モジュール数が1以下(所定の中止条件)となる場合がある。この場合には、制御回路10は、ステップS21で「YES」となり、ステップS25に移行する。このことは、mが8にならなくとも(モジュールの中心を初期位置から8M/16まで移動させる前に)、境界モジュール数を検出する動作を中止することを意味する。
【0031】
この後、制御回路10は、1段目のコードワードを全て解読したか否かを判断するステップS27で「NO」となってステップS28に移行して次のコードワードを解読対象に設定し、前記ステップS5に戻り、2番目のコードワードの解読動作に入る。そして、前述したと同様にして2番目のコードワードを解読し、次いで3番目以降のコードワードを順次解読してゆく。
【0032】
そして、1段目のデータコードパターンのコードワードを全て解読すると(ステップS27で「YES」)、制御回路10は、次の最終段のデータコードワードまで解読を終了したか否かを判断するステップS29で「NO」となり、続いてnに1を加算して2段目のデータコードパターンの解読に移行する。そして、全ての段のデータコードパターンの解読動作に入り、全ての段のデータコードワードパターンの解読を終了したところで(ステップS29で「YES」)、PDF417バーコードの解読動作を終了する。
【0033】
このように本実施例によれば、バーコードを1コードワード毎に解読するので、バーコードに対してカメラ部1が傾いたりして、バーコードが遠近差のために部分部分で大きさが異なった場合でも、その大きさの違いの影響を極力排除しながら解読することができる。
【0034】
また、明暗の境界が不鮮明となり勝ちな範囲を境界エラー範囲と定め、コードワードを構成する各モジュールの中心を両側に移動させたとき、中心が境界エラー範囲に入るモジュールの数が最も少ないとき、即ち、境界の位置が不確かであっても、明、暗と定めて間違いのないモジュール数が最も多い場合を正規化された明暗パターンに定めて、これを解読するので、バーコードをより正確に解読することができる。
【0035】
また、本実施例では、最小境界モジュール数である移動量が複数存在する場合には、モジュール中心から最も遠く且つ明暗境界位置から最も遠くなる移動量の方を最小境界モジュール数である移動量に設定して正規化された明暗パターンを作成するので、より正確な明暗パターンを作成することができる。
【0036】
なお、本発明は上記し且つ図面に示す実施例に限定されるものではなく、以下のような変形或いは拡張が可能である。
請求項1において、(1)ないし(5)の動作の順序は昇順に限られるものではない。
バーコード読取装置にバーコードの種類を判別する機能を持たせても良い。このようにすれば、読み取ろうとするバーコードの種類が予め分かっていなくても解読が可能となり、読み取り可能なバーコードの種類が拡大する。このときのバーコード種別の判別は制御回路10が行うが、その判別法は、スタートコード、或いはストップコードを構成するバー数およびモジュール数は種類毎に異なるので、種類検出手段としての制御回路10はまずA種のバーコードと仮定してバーコードの一方側からA種のバーコードのスタートコードを構成するバー数の明暗パターンがA種のバーコードのスタートコードパターンと一致するかを判別し、一致するならA種のバーコードと判定する。A種のバーコードと判定できなかったら、次にバーコードの画像を左右逆に取り込んだ可能性もあるので、バーコードの一方側からA種のバーコードのエンドコードを構成するバー数の明暗パターンがA種のバーコードのエンドコードの、明暗パターンと一致するかを判別し、一致するならA種のバーコードと判定する。A種のバーコードのエンドコードと判定できなかったら、次にB種のバーコードと仮定して上記と同様の動作を行い、以下、同様な動作を繰り返してバーコードの種類を判別するというものである。
1コードワードを明暗に分ける分け方は、画像データの多段階レベルの明暗度の分布を求めてこれをしきい値として明、暗に分けるようにしても良い。
明暗の境界位置はバーコード全体に対して一括して検出するようにしても良いし、コードワード毎に行うようにしても良い。
【図面の簡単な説明】
【図1】本発明の一実施例を示すバーコード読取装置の電気的構成図
【図2】バーコードの解読動作の内容を示すフローチャートその1
【図3】同その2
【図4】同その3
【図5】主要ステップの実行内容を示す図
【図6】バーコードの明暗境界位置を求める方法の説明図
【図7】同詳細図
【図8】読み取り対象のバーコードを示す図
【符号の説明】
6は画像メモリ、9は制御回路(明暗検出手段、境界エラー範囲設定手段、モジュール位置検出手段、境界モジュール数検出手段、正規化パターン作成手段)、10はCCDエリアセンサ(画像検出手段)である。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a bar code reading method and a bar code reading apparatus, and more particularly to a black and white pattern which is determined with priority given to whether the center of a module is white or black.
[0002]
[Prior art]
The bar code reader captures a bar code with a camera unit consisting of a CCD sensor, etc., binarizes the image signal, discriminates the brightness of the bar code (monochrome), and detects the width of the white bar and black bar And decipher.
[0003]
[Problems to be solved by the invention]
When the barcode is taken by the camera unit, the edge of the bar is easily affected by noise, and it is difficult to accurately detect the boundary between the white bar and the black bar, so the bar width may not be detected accurately. There is a risk of misreading. In order to solve this problem, the barcode reader disclosed in Japanese Patent Application Laid-Open No. 61-125684 focuses on the fact that the center position of the bar does not change relative to the center positions of the start bar and end bar. Thus, stable reading can be performed by determining the white bar and the black bar by calculating the area of the
[0004]
However, in this white bar / black bar determination method (light / dark determination method), when the camera section is tilted with respect to the barcode, the photographed barcode is different in size due to the perspective difference. As a result, even with a bar having the same width, the area of the central portion of the bar changes, and the accuracy is lacking.
[0005]
The present invention has been made in view of the above circumstances, and the purpose of the present invention is to make the bar code image captured by the image detection means unclear at the edge portion of the bar, or the size of the captured image differs at the partial portion. It is an object of the present invention to provide a barcode reading method and a barcode reading apparatus which can be decoded more accurately even if they are.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the inventions of
(1) When a light / dark pattern obtained by dividing the multi-level image data into light or dark is used as a light / dark pattern at the time of capture, both sides of the light / dark pattern at the time of capture centered on a light / dark boundary in one codeword Set the predetermined length range of as the boundary error range,
(2) In the bright / dark pattern at the time of capture, the length of one code word composed of the number of bars determined for each type of barcode is calculated, and the length of the one code word and the number of modules of one code word are calculated. Calculate the length of one module from
(3) In the bright and dark pattern at the time of capturing, one codeword is divided for each module length, and the center position of each module is detected as an initial position;
(4) The number of modules whose center is located in the boundary error range is determined by moving the center of each module constituting one code word a plurality of times from the initial position to both sides so that the amount of movement differs each time. Counting for each moving amount including the initial position where the moving amount is 0,
(5) The center of each module at the amount of movement when the number of boundary modules satisfies a predetermined condition is compared with the light / dark pattern at the time of capture, and the brightness / darkness of each module is compared with the light / dark pattern at the time of capture at which the center is located. Create a normalized light and dark pattern that is the same as light and dark,
A decoding process is performed on the normalized light / dark pattern.
[0007]
According to this means, in the barcode image captured by the image detecting means, the predetermined length range on both sides of the light / dark boundary is set as the boundary error range where the light / dark is not clear, and each word constituting one word code is set. When the center of the module is moved from the initial position to both sides of the module, a normalized light / dark pattern is created with the number of boundary modules that fall within the boundary error range satisfying a predetermined condition. Therefore, even if the edge portion of the bar is unclear in the captured barcode image, the boundary position of the bar can be detected more accurately and the barcode can be decoded more accurately. Moreover, since the word code is decoded one by one, even if the size of the captured barcode image is different in the partial portion due to the perspective difference, the influence can be eliminated as much as possible and more accurate decoding processing can be performed.
[0008]
According to the second and seventh aspects of the present invention, the operations of (1) to (3) are performed after the type of barcode is determined based on a bright / dark pattern at the time of capture in which the multi-level image data is divided into light and dark. It is characterized by performing.
[0009]
According to the third and eighth aspects of the present invention, since the light / dark boundary of the light / dark pattern at the time of capturing is set to a position where the change in light / dark is maximized, even if there is a light / dark boundary between the pixels of the image detecting means, Can be detected.
[0010]
In the inventions of
[0011]
According to the fifth and tenth aspects of the present invention, when there are a plurality of cases where the number of the boundary modules satisfies a predetermined condition, the light and dark pattern is determined by adopting the smaller moving amount.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 shows an electrical configuration of a handy type bar code reader, and includes a
[0013]
The
[0014]
When detecting a two-dimensional image, the
[0015]
On the other hand, the
The
[0016]
Here, the bar code is configured by alternately arranging black bars and white bars having different widths, and the minimum width of the bar is referred to as one module. In addition, a start code and a stop code are provided on both the left and right sides of the bar code, and a data code including a plurality of code words is provided between the start code and the stop code. The number of bars and modules that make up the start code and stop code vary depending on the type of barcode, and the number of bars that make up one code word and the number of modules that make up one code word also depend on the type of barcode. Different.
[0017]
Next, the operation of the barcode reading apparatus having the above configuration will be described with reference to the flowcharts of FIGS. In this description of the operation, it is assumed that the barcode reader is configured exclusively for reading a specific type of barcode, for example, PDF 417 shown in FIG.
[0018]
The PDF 417 is configured by overlapping a plurality of data code patterns DT in which white bars and black bars are arranged between the start code SR and the stop code ST on both the left and right sides. In the case of PDF417, one code word constituting a data code is composed of 8 bars as shown in FIG. 5, and the total module of these 8 bars is 17 modules.
[0019]
Now, under the control of the
[0020]
Next, the
[0021]
In this case, the binary boundary position between light and dark is detected as follows. That is, it is assumed that the stored multi-level image data is as shown in FIG. In FIG. 6A, the plotted points are the brightness (digital) detected by the pixels of the CCD area sensor. In order to obtain the light / dark boundary position, the light / dark level difference is obtained by subtracting the light / dark level on the right side from the light / dark level of the left pixel. The primary difference of the light and dark levels shown is obtained. Next, for each point plotted in the primary difference data of FIG. 6B, the value of the right point is subtracted from the value of the left point for each point adjacent to each other. The secondary difference shown in (c) is obtained. Then, when each point plotted in the secondary difference data is connected by an envelope, the position of the point where the envelope intersects the zero level is defined as the boundary between light (white bar) and dark (black bar) (Fig. 6 (d)).
[0022]
When the light / dark boundary is defined in this way, even if there is a light / dark boundary between pixels, the intermediate position between the pixels is recognized as the boundary and conforms to the actual barcode. Can be defined as a boundary. For example, as shown in FIG. 7, the primary difference between the primary difference between the
[0023]
After detecting the light / dark boundary position as described above, the
[0024]
Thereafter, the
[0025]
Next, the
[0026]
Further, the
Next, the
[0027]
Then, the
[0028]
When m reaches 8, the
[0029]
Then, in step S25, the
[0030]
By the way, during the execution of the operation of detecting the number of boundary modules by moving the module center left and right while increasing the module length by 1/16, the number of boundary modules becomes 1 or less (predetermined stop condition). There is a case. In this case, the
[0031]
Thereafter, the
[0032]
When all the code words of the data code pattern of the first stage are decoded (“YES” in step S27), the
[0033]
As described above, according to the present embodiment, since the barcode is decoded for each codeword, the
[0034]
In addition, when the range where light and dark boundaries are unclear and wins is defined as a boundary error range, and the center of each module constituting the codeword is moved to both sides, when the number of modules whose center falls within the boundary error range is the smallest, That is, even if the position of the boundary is uncertain, the case where the number of modules without error is the largest is determined as a normalized light / dark pattern and decoded, so that the barcode can be more accurately Can be deciphered.
[0035]
In this embodiment, when there are a plurality of movement amounts that are the minimum boundary module number, the movement amount that is the farthest from the module center and the farthest from the light / dark boundary position is set as the movement amount that is the minimum boundary module number. Since it is set and a normalized light / dark pattern is created, a more accurate light / dark pattern can be created.
[0036]
The present invention is not limited to the embodiments described above and shown in the drawings, and the following modifications or expansions are possible.
In
The bar code reader may be provided with a function for determining the type of bar code. In this way, the barcode can be decoded even if the type of barcode to be read is not known in advance, and the types of barcodes that can be read are expanded. The
As a method of dividing one codeword into light and dark, a distribution of lightness and darkness of multi-level levels of image data may be obtained, and this may be divided into light and dark as a threshold value.
The light / dark boundary position may be detected collectively for the entire barcode, or may be performed for each code word.
[Brief description of the drawings]
FIG. 1 is an electrical configuration diagram of a barcode reader showing an embodiment of the present invention. FIG. 2 is a flowchart showing the contents of a barcode decoding operation.
Fig. 2
Fig. 4
FIG. 5 is a diagram showing the execution contents of main steps. FIG. 6 is an explanatory diagram of a method for obtaining a bar code light / dark boundary position. FIG. 7 is a detailed diagram. FIG. 8 is a diagram showing a barcode to be read. Explanation】
6 is an image memory, 9 is a control circuit (light / darkness detection means, boundary error range setting means, module position detection means, boundary module number detection means, normalization pattern creation means), and 10 is a CCD area sensor (image detection means). .
Claims (10)
前記多段階レベルの画像データを明または暗に分けて明暗の境界位置を検出した後、バーコードを構成する複数のコードワードの各々について、以下の(1)ないし(5)の動作を実行して各コードワードを構成するモジュールの明暗を正規化し、この正規化された明暗パターンに対して解読処理を行うことを特徴とするバーコード読取方法。
(1)前記多段階レベルの画像データを明または暗に分けたときの明暗パターンを取り込み時明暗パターンとしたとき、この取り込み時明暗パターンでの1コードワードにおける明暗の境界を中心としたその両側の所定長さ範囲を境界エラー範囲として設定する。
(2)前記取り込み時明暗パターンにおいて、バーコードの種類毎に定められた数のバーによって構成されている1コードワードの長さを算出し、当該1コードワードの長さと1コードワードのモジュール数とから1モジュールの長さを算出する。
(3)前記取り込み時明暗パターンにおいて、1コードワードを1モジュールの長さ毎に区切って各モジュールの中心の位置を初期位置として検出する。
(4)1コードワードを構成する各モジュールの中心を前記初期位置からその両側に各回で移動量が異なるように複数回移動させ、中心が前記境界エラー範囲に位置したモジュールの数を境界モジュール数として移動量が0の前記初期位置を含めて移動量毎にカウントする。
(5)前記境界モジュール数が所定条件を満たしたときの移動量での各モジュールの中心と前記取り込み時明暗パターンとを比較し、各モジュールの明暗を、その中心が位置する取り込み時明暗パターンの明暗と同じに定めて正規化された明暗パターンを作成する。The image of the barcode to be read is captured by the image detection means, the image signal output as a multi-level signal from the image detection means is stored as image data, and the barcode is based on the stored image data. In the barcode reading method for decoding,
After the multi-level image data is divided into light and dark to detect a light / dark boundary position, the following operations (1) to (5) are performed for each of a plurality of code words constituting the barcode. A bar code reading method comprising: normalizing light and dark of modules constituting each code word and performing decoding processing on the normalized light and dark pattern.
(1) When a light / dark pattern obtained by dividing the multi-level image data into light or dark is used as a light / dark pattern at the time of capture, both sides of the light / dark pattern at the time of capture centered on a light / dark boundary in one codeword Is set as the boundary error range.
(2) In the bright / dark pattern at the time of capture, the length of one code word composed of the number of bars determined for each type of barcode is calculated, and the length of the one code word and the number of modules of one code word are calculated. From this, the length of one module is calculated.
(3) In the bright / dark pattern at the time of capturing, one code word is divided for each module length, and the center position of each module is detected as the initial position.
(4) The number of modules whose center is located in the boundary error range is determined by moving the center of each module constituting one code word a plurality of times from the initial position to both sides so that the amount of movement differs each time. And counting for each moving amount including the initial position where the moving amount is zero.
(5) The center of each module at the amount of movement when the number of boundary modules satisfies a predetermined condition is compared with the light / dark pattern at the time of capture, and the brightness / darkness of each module is compared with the light / dark pattern at the time of capture at which the center is located. Create a normalized light and dark pattern that is the same as light and dark.
前記多段階レベルの画像データを明または暗に分けて明暗の境界位置を検出する明暗検出手段と、
前記多段階レベルの画像データを明または暗に分けたときの明暗パターンを取り込み時明暗パターンとしたとき、この取り込み時明暗パターンでの1コードワードにおける明暗の境界を中心としたその両側の所定長さ範囲を境界エラー範囲として設定する境界エラー範囲設定手段と、
前記取り込み時明暗パターンにおいて、バーコードの種類毎に定められた数の明暗バーによって構成されている1コードワードの長さを算出して当該1コードワードの長さと1コードワードのモジュール数とから1モジュールの長さを算出するモジュール長算出手段と、
前記取り込み時明暗パターンにおいて、1コードワードを1モジュールの長さ毎に区切って各モジュールの中心の位置を初期位置として検出するモジュール位置検出手段と、
1コードワードを構成する各モジュールの中心を前記初期位置からその両側に各回で移動量が異なるように複数回移動させ、中心が前記境界エラー範囲に位置したモジュールの数を境界モジュール数として移動量が0の前記初期位置を含めて移動量毎にカウントする境界モジュール数検出手段と、
前記境界モジュール数が所定条件を満たした移動量での各モジュールの中心と前記取り込み時明暗パターンとを比較し、各モジュールの明暗を、その中心が位置する取り込み時明暗パターンの明暗と同じに定めて正規化された明暗パターンを作成する正規化明暗パターン作成手段とを具備し、
前記正規化された明暗パターンについて解読処理を行うようにしたことを特徴とするバーコード読取装置。The image of the barcode to be read is captured by the image detection means, the image signal output as a multi-level signal from the image detection means is stored as image data, and the barcode is based on the stored image data. In the barcode reader to decode,
Light / dark detection means for detecting the boundary position of light / dark by dividing the image data of the multi-stage level into light or dark,
When a light / dark pattern obtained by dividing the multi-level image data into light or dark is used as a light / dark pattern at the time of capturing, a predetermined length on both sides of the light / dark pattern at the time of capturing at the boundary of light / dark in one codeword Boundary error range setting means for setting the range as a boundary error range;
In the light / dark pattern at the time of capture, the length of one code word composed of the number of light / dark bars determined for each type of barcode is calculated, and the length of the one code word and the number of modules of one code word are calculated. Module length calculating means for calculating the length of one module;
Module position detecting means for detecting one central position of each module as an initial position by dividing one code word for each module length in the bright and dark pattern at the time of capture;
The center of each module constituting one code word is moved a plurality of times from the initial position to both sides of the module so that the amount of movement is different each time, and the number of modules whose center is located in the boundary error range is defined as the number of boundary modules. Boundary module number detection means for counting each movement amount including the initial position of 0,
The center of each module at the amount of movement where the number of boundary modules satisfies a predetermined condition is compared with the light / dark pattern at the time of capture, and the light / dark of each module is determined to be the same as the light / dark of the light / dark pattern at the time of capture. And a normalized light / dark pattern creating means for creating a normalized light / dark pattern,
A bar code reader, wherein the normalized light / dark pattern is decoded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002252980A JP3891072B2 (en) | 2002-08-30 | 2002-08-30 | Bar code reading method and bar code reading apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002252980A JP3891072B2 (en) | 2002-08-30 | 2002-08-30 | Bar code reading method and bar code reading apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004094471A JP2004094471A (en) | 2004-03-25 |
JP3891072B2 true JP3891072B2 (en) | 2007-03-07 |
Family
ID=32059117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002252980A Expired - Fee Related JP3891072B2 (en) | 2002-08-30 | 2002-08-30 | Bar code reading method and bar code reading apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3891072B2 (en) |
-
2002
- 2002-08-30 JP JP2002252980A patent/JP3891072B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004094471A (en) | 2004-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8668149B2 (en) | Bar code reader terminal and methods for operating the same having misread detection apparatus | |
US5389770A (en) | Method and apparatus for decoding unresolved bar code profiles | |
JP3115003B2 (en) | Method and apparatus for decoding barcode symbols using module size ratio analysis | |
JP2007079781A (en) | Two-dimensional code division display method, two-dimensional code reading method and two-dimensional code reader | |
US8333326B2 (en) | Stacked barcode reader and stacked barcode reading method | |
JPH09511603A (en) | Method and apparatus for decoding unresolved profile by variable width bar code symbology | |
US8718370B2 (en) | Optical information-reading apparatus and optical information-reading method | |
JP5187383B2 (en) | Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus | |
JP5187382B2 (en) | Two-dimensional code division display method, two-dimensional code reading method, and two-dimensional code reading apparatus | |
JP3891072B2 (en) | Bar code reading method and bar code reading apparatus | |
US8403221B2 (en) | Method and apparatus for reading barcode information | |
JP5379626B2 (en) | Stack bar code information reading method and stack bar code information reading device | |
JPS63115282A (en) | Bar code reader | |
JP2007102386A (en) | Symbol information reading method and symbol information reading device | |
JP2003022416A (en) | Method and device for reading bar code | |
EP2153419A1 (en) | Apparatus for media recognition and method for media kind distinction with the same | |
JP5232904B2 (en) | Data code reading apparatus and method | |
JP5657987B2 (en) | Stacked bar code reader and stack bar code reading method | |
JP2009123088A (en) | Data code reader and its method | |
JP5683891B2 (en) | Stacked bar code reader and stack bar code reading method | |
JP6393226B2 (en) | Stacked bar code reader and stack bar code reading method | |
JP3636050B2 (en) | Optical information reader | |
JP2903792B2 (en) | Barcode reader | |
JPH06195497A (en) | Bar code decoder | |
US9047527B2 (en) | Method for reading a barcode |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040831 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20061026 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20061114 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061127 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 3891072 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121215 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131215 Year of fee payment: 7 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |