JP3580901B2 - Symbol information reader - Google Patents

Symbol information reader Download PDF

Info

Publication number
JP3580901B2
JP3580901B2 JP13525695A JP13525695A JP3580901B2 JP 3580901 B2 JP3580901 B2 JP 3580901B2 JP 13525695 A JP13525695 A JP 13525695A JP 13525695 A JP13525695 A JP 13525695A JP 3580901 B2 JP3580901 B2 JP 3580901B2
Authority
JP
Japan
Prior art keywords
barcode
information
label
variable
image
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
Application number
JP13525695A
Other languages
Japanese (ja)
Other versions
JPH08329185A (en
Inventor
正浩 滝沢
允則 久保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Olympus Corp
Original Assignee
Olympus Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Olympus Corp filed Critical Olympus Corp
Priority to JP13525695A priority Critical patent/JP3580901B2/en
Publication of JPH08329185A publication Critical patent/JPH08329185A/en
Application granted granted Critical
Publication of JP3580901B2 publication Critical patent/JP3580901B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は、バーコード等のシンボル情報を読み取るシンボル情報読取装置に関する。
【0002】
【従来の技術】
従来、物品等に印刷された、若しくは、貼付けられたタグ等に印刷された、その物品に関する情報を示すバーコード記号と呼ばれる記号がある。このバーコード記号は、普及しつつある販売時点情報管理(ポイント・オブ・セールス:POS)システムに使用され、広く一般に知られるようになった。
【0003】
このバーコード記号とは、幅の異なるバーとスペースが平行に組合せられ、1つのパターンからなるバーコードキャラクタを形成する。必要であれば、チェックデジットを含む必要なキャラクタ群を平行に配列し、例えば前後にスタート/ストップキャラクタのような特徴的な所定パターンを配して構成したシンボルもある。
【0004】
一般消費財に使用されているバーコードは、JAN(Japan Article Number)として標準化されている。また、バーコードの他の応用としては、物流シンボルがある。この物流シンボルは、前記JANコードの前に、1桁又は2桁の物流識別コードが追加されたものである。
【0005】
前述した、いずれのバーコードシンボルも、1次元バーコードと呼ばれるものであり、これらのコード体系が持つことができる情報量は、数十バイト程度であり、実際に使用する場合に不十分なものであった。
【0006】
このようなバーコードの情報量に対する要求に従い、構造が異なる2次元バーコードと呼ばれるシンボル体系が提案されている。
それらのシンボル体系によれば、いずれも1次元バーコードに比べ格段に多い情報をコード化できる特徴を持っている。これらの体系は、スタックドバーコードと称され、1次元のバーコードをバーの方向に積み重ねることによって、情報量を増加させる方式である。このスタックドバーコードの代表として、PDF−417と呼ばれるコード体系がある。
【0007】
従来、前記スタックドバーコードを読み取るシンボル情報読取り装置としては、例えば、特開平2−268382号公報に開示されているようなレーザー走査型の読取り装置が知られている。この読取り装置においては、レーザー光を2次元に投射し、スキャンすることで、所定のバーコードを読み取り、シンボル情報を復号している。
【0008】
また、特開平2−268383号公報には、2次元撮像装置でバーコードを撮像し、バーコードの画像をメモリに取り込んで、このデータを元にバーコードシンボル情報を復号する装置が開示されている。
【0009】
さらに、このようなバーコードをFA(Factory Automation)に於けるデータキャリアとして使用したいという要求が高まっている。これは、流通物がベルトコンベアなどの上を移動している最中に、流通物の品名、行き先等を認識するためのものである。
【0010】
従来では、一般にデータキャリアとしてRFタグ等が用いられていたが、タグとしては比較的高価であり、これがバーコードで代用できれば、低コストのデータキャリアが実現される。
【0011】
また従来の移動する物品の情報読取装置としては、特開昭56−118177号公報には、移動する物体の像を走査して得られるビデオ信号に基づいて所定の検査を行なう光学検査装置が記載され、物体が検査視野内を通過したことをビデオ信号から検出する回路が開示されている。
【0012】
【発明が解決しようとする課題】
しかし、前述した特開昭56−118177号公報の問題点として、ビデオ信号の幅データからその物体の存在を認識しているため、前記JAN等の1次元バーコードの認識は可能なものの、前記PDF417等の2次元スタックドバーコードにおいて、バーコードラベルが完全に検査視野内に入っていない場合であっても、不完全なバーコードラベルを認識し、読取り処理に行く恐れがある。このような場合には、バーコード情報を読取ることができず、読取りの信頼性及び読取り速度の低下を招く結果になる。
【0013】
さらに、移動している物品に貼付けられた2次元スタックドバーコードの情報を読取るには、インタレース型撮像素子を用いてフレーム画像により撮像すると、最初に読み取った位置から次に読み取る位置まで移動してしまっているため、2つのフィールド画像を組み合わせた時にフィールド成分のずれが生じるという問題が生じる。
そこで本発明は、移動している2次元バーコードのバーコードシンボル情報を高速に確実に読取るシンボル情報読り取装置を提供することを目的とする。
【0014】
【課題を解決するための手段】
本発明は上記目的を達成するために、バーとスペースとからなり任意の情報をパターンとして表すバーコードを2次元像として撮像する撮像手段と、前記撮像手段により順次得られた2次元像を一時的に記憶する記憶手段と、前記撮像手段から前記記憶手段に2次元像を転送する転送手段と、前記記憶手段に記憶された2次元像を順次読出し、撮像範囲内でのバーコードシンボルの有無を認識する認識手段と、前記認識手段により認識されたバーコードの前記撮像範囲内での存在位置及び傾きを検出し、バーコードのスキャン方向を検出する位置検出手段と、前記位置検出手段により検出されたスキャン方向によりバーコードの2次元像から該バーコードの情報を順次読み取る読取手段と、前記読取手段からのバーコードの情報から、前記任意の情報に復号する復号手段とで構成され、前記転送手段は、前記撮像手段により撮像された2次元像を圧縮し、該撮像手段により撮像された2次元像のフィールド成分の1スキャンラインを転送した後、該記憶手段の1ラインを空けてまたスキャンラインを転送し、1フィールド分の画像情報を転送するまでそれを繰り返し、終了後に空いているラインにそのラインの1ライン上または下のラインの画像情報を複写する処理操作を含み、転送するシンボル情報読取装置を提供する。
【0015】
前記転送手段は、前記撮像手段により撮像された2次元像を圧縮し、撮像した2次元像の1つのフィールド成分のみを記憶手段に転送するシンボル情報読取装置を提供する。または、前記転送手段は、撮像した2次元像の2つのフィールド成分を別々に前記記憶手段に転送する。または、前記転送手段は、前記撮像手段により撮像された2次元像を圧縮し、該撮像手段により撮像された2次元像のフィールド成分の1スキャンラインを転送した後、該記憶手段の1ラインを空けてまたスキャンラインを転送し、1フィールド分の画像情報を転送するまでそれを繰り返し、終了後に空いているラインにそのラインの1ライン上または下のラインの画像情報を複写する処理操作を含み、転送する。
【0016】
【作用】
以上のような構成のシンボル情報読り取装置は、移動している2次元バーコードを2次元像として撮像し、得られた2次元像に所定の圧縮等の処理を適宜施し一時的に記憶させ、撮像画像を記憶手段に転送して、バーコードシンボルの有無を自動認識した後、バーコードシンボルの位置を認識し、バーコードの情報を順次読み取り、バーコードの情報から元の情報に復号する。
【0017】
【実施例】
以下、図面を参照して本発明の実施例を詳細に説明する。
図1には、第1実施例としてのシンボル情報読取り装置の概略的な構成を示し、説明する。このシンボル情報読取り装置は、移動する物品等に貼付されたバーコードシンボルのシンボル情報を読取るための構成例である。ここで、本実施例においては、シンボル情報は物品に関する情報を例とし、例えば、物品名、送付先等であるものとする。勿論、シンボル情報は、使用するものによって異なっている。
【0018】
このシンボル情報読取り装置は、ベルトコンベアー等の搬送系3により移動する物品1等に貼付された、例えばPDF−417フォーマットのスタックドバーコードラベル(以下、バーコードラベルと称する)2と、該バーコードラベル2を光学的に結像する撮像光学系4と、結像されたバーコードラベル2を光電変換面で読み取る2次元撮像部5と、読み取ったラベル画像データ(映像信号)を一時的に記憶するフレームメモリ6と、ラベル画像データを元のシンボル情報に復号するデータ処理装置7とで構成される。また、外部には、シンボル情報を処理するためのマイクロコンピュータ等のホスト装置16が設けられている。また、前記2次元撮像部5で読み取ったラベル画像データ(フレーム画像)に、画像圧縮等の画像処理を施し、フレームメモリ6に処理画像データを記憶させる画像転送部17を設けても良い。
【0019】
前記データ処理装置7は、前記フレームメモリ6に記憶されたラベル画像データが撮像光学系4の撮影範囲にバーコードラベル2が読取り可能に入っているかを検出するラベル検出部8と、バーコードラベル2(ラベル画像データ)をスキャンしてラベル情報として読取る読取り部9と、読取ったラベル情報がデコードできるものかを判定するデコード判定部10と、デコードできると判定されたラベル情報を元のシンボル情報に復元する復号部11と、メモリ(各種定数及び変数を格納するための種々のレジスタを含む)12と、これらの各部位を制御する制御部13とで構成される。
【0020】
前記撮像光学系4と2次元撮像部5は、例えば、CCDカメラからなる。
また前記ラベル検出部8は、前記フレームメモリ6に記憶されたラベル画像データが撮像光学系4の撮影範囲に収まっているか、すなわち撮影範囲内で撮像されるバーコードラベル2に欠けがない位置を検出する位置検出部14と、そのバーコードラベル2の傾き具合を検出する傾き検出部15とで構成される。
【0021】
このデータ処理部7は、例えば、CPUとメモリで構成されるパーソナルコンピュータでも代用することができる。
次に、前述したスタックドバーコードについて説明する。
【0022】
図2には、スタックドバーコードの例として、PDF−417のラベル構造を示している。このバーコードラベル2は、バーとスペースの組合せでなるバーコードキャラクタ群で構成された復号されるべき情報成分の領域であるラベル部21と、その前後に配されたスタート/ストップキャラクタであるスタートコード22及びストップコード23とを有している。そして、1コードは、ストップコード23を除いて4つのバーとスペースとからなっている。また、スタート及びストップコード22,23は、“ビッグバー”と呼ばれる大きなバー22A,23Aから始まっている。
【0023】
このラベル部21は、スタートコード22及びストップコード23の隣に存在するロウインディケータ21Aと呼ばれるコードと、それらの間に挟まれた実際のデータが記述されている複数のデータカラム21Bでなるラベルマトリックス21Cとにより構成される。ロウインディケータ21Aには、ラベルのロウ方向,カラム方向のサイズやセキュリティレベル等が記述されている。従って、このロウインディケータの情報を解読すれば、ラベルの情報サイズや修復可能なコード数等が決定できる。
【0024】
なお、この図2は、4×2のラベルマトリックス有するバーコードラベルを示している。
図4に示すフローチャートを参照して、データ処理装置7におけるラベル検出、ラベル情報読出し及び復号についてを説明する。図3には、仮想的にフレームメモリ6の画素配列に前述したようなPDF−417のラベル画像を投影した模式図を示す。
【0025】
まず、フレームメモリ、しきい値、各種グローバル変数等の種々のパラメータを初期設定する(ステップS1)。次に、後述する画像取り込みルーチンをコールしてラベル画像データ(映像信号)をフレームメモリ6に取り込む(ステップS2)。次に、後述するラベル検出ルーチンをコールし、この取り込まれたラベル画像データを用いてバーコードラベルが存在するかをチェックし、さらにはバーコードラベルが存在するならばラベル画像データを検出する(ステップS3)。
【0026】
そして、前記ステップS3に於けるラベル検出処理の結果を判断し(ステップS4)、ラベルが存在しない場合には(NO)、再度、前記ステップS1に移行して、再度、画像取り込み処理を行う。
【0027】
次に、ラベルが存在したならば(YES)、後述する閾値決定ルーチンをコールし、後述するステップS11の埋め込チェック及びステップS12の最適スキャンルーチン及び、ステップS15のインテリジェントスキャンルーチンに於いて、処理対象となるラインデータからエッジ間の幅情報を抽出するための処理に利用される閾値(変数THRESHOLD)を求める(ステップS5)。
【0028】
次に、インディケータ情報決定ルーチンをコールし、ラベル2のロウインディケータ21Aを読み取り、ラベルサイズ等を決定する(ステップS6)。
そして、前記ステップS6の決定ルーチンに於いてラベルサイズ等が決定されたか否かを判断し(ステップS7)、決定されていない場合は(NO)、再度ステップS1に移行して、再度、画像取り込み処理を行う。一方、ラベルサイズ等が決定された場合には(YES)、後述する傾き再定義ルーチンをコールし、より正確なラベルの傾きを求める(ステップS8)。
【0029】
次に、後述するスキャン方程式決定ルーチンをコールし、ラベル2を全面走査するための各種変数を定義する(ステップS9)。次に、後述する埋め込チェックルーチンをコールし、各コードワードの位置の推定を行い、更に各コードワードの位置が画面内か否かをチェックしている(ステップS10)。
【0030】
そして、前記ステップS10にて、読取り不能と推定されたコードの数が、修復可能な数を上回ったか否かを判断し(ステップS11)、上回った場合にはデコード不能とし(NO)、再度ステップS1に移行して、再度、画像取り込み処理を行う。一方、下回った場合には、デコード可能とし(YES)、後述するような最適スキャンルーチンをコールし、前記ステップS9で定義された各種変数を用いてラベルを最適な間隔で全面走査し、ラベル情報を読み取る(ステップS12)。なおここで、最適スキャンとは、最も計算量が少なくてラベル情報を全て確定できるような最適な間隔でのスキャンのことをいうものとする。
【0031】
そして、前記ステップS12の最適スキャンで読み取った情報でデコード可能か否かを判断し(ステップS13)、デコード可能の場合は(YES)、ステップS16に移行してデコード処理を行う。しかし、デコード不能の場合は(NO)、後述するインテリジェントスキャンルーチンをコールし、前記ステップS10で定義された各種変数とを用いて、前記ステップS12で読取れなかったコード位置を走査し、ラベル情報を読取る(ステップS14)。
【0032】
次に、ステップS14で読取った情報がデコード可能か否かを判断し(ステップS15)、デコード可能の場合(YES)、及びステップS12で読取った情報がデコード可能の場合に、デコード処理を行う(ステップS16)。このデコード処理の終了の後、ステップS1に戻り、新たなバーコードラベルを読取りにいく。
【0033】
しかし、ステップS16の判断でデコード不能の場合は(NO)、再度、前記ステップS1に移行して、画像取り込みを行う。
前記ステップS16のデーコード処理では、前記最適スキャンルーチンと前記インテリジェントスキャンルーチンにより、読取った情報を復号し、復号したシンボル情報をホスト装置14に出力する。
【0034】
次に図4のフローチャートにおける各種処理ルーチンを、以下に詳しく説明する。
まず、図5に示すフィールド画面のみを取り込む図及び、図6に示すフローチャートとを参照して、図4に示した前記ステップS2でコールされる画像取り込みルーチンについて説明する。
【0035】
この画像取り込みルーチンは、2次元撮像部5に撮像されたラベル画像データ(映像信号)を転送し、フレームメモリ6に一時的に記憶させる処理を含んでいる。
【0036】
移動する物品に貼付されるバーコードラベルの読取りに際して、インターレース方式の2次元撮像部5を使用した場合、通常、そのフレーム画面からはバーコード情報を読取ることは出来ない。すなわち、従来技術の課題において説明したように、インターレース方式の2次元撮像装置5では、1行ずつとばしながら画像を走査するフィールド画面を2つ(奇数成分と偶数成分)合成して1つのフレーム画面を構成するが、撮像対象となるバーコードラベルが常に移動しているため、1回目のフィールド画像の走査と、2回目のフィールド画像の走査との間に位置的なずれが生じており、2つのフィールド画像を合成すると、バーコードラベル像にズレが生じてしまうからである。
【0037】
そこで本実施例では、インターレース方式の2次元撮像装置5を用いて、移動するバーコードラベルを読取るときには、フィールド画面のみの画像情報を転送して取り込むようにする。
【0038】
画像取り込みルーチンでは、どちらか(偶数成分または奇数成分)のフィールド画面を転送し取り込む(ステップS21)。この場合、フィールド画像を行を空けずにフレームメモリ6に取り込むので、そのときのフレームメモリ6の内容は、図5に示す様になっている。図5に於いて、フィールド画像は奇数成分と偶数成分のどちらでも構わない。この処理終了の後、メインフローチャート(図4)にリターンする。
【0039】
しかしこの場合、図5に示すように1つのフィールド画像は、縦方向に圧縮された形になるので、バーコードラベルの1行当たりの高さが減ってしまい、読取り条件はフレーム画像よりも厳しくなる。そこで、この方法を用いることが出来るのは、対象画像に対しバーコードラベル像が占める割合が大きくて、バーコードラベルの1行の高さが十分な場合である。
【0040】
また、対象画像に対し、バーコードラベル像が占める割合が小さくバーコードラベルの1行の高さが十分でない場合には、種々の方法が考えられる。
その1つとして、まず、2つのフィールド画面(偶数成分と奇数成分)を両方別々に転送し取り込む。この場合、奇数成分だけを行を空けずにフレームメモリ6に取り込み、次に偶数成分だけを行を空けずに取り込む。そのときのフレームメモリ6の内容は図7の様になっている。但し、図7において、奇数成分と偶数成分はどちらが上になっても構わない。
【0041】
ここで奇数成分と偶数成分の両方を転送する理由は、元は同じ対象を撮像した2つのフィールド画像を別の画像と考え、図7の上の画像が読めなければ、下の画像を読みに行くことで読取の信頼性を上げることが出来るからである。
【0042】
この場合、図4のフローチャートはステップS15の1回目の判断が(NO)であれば、図7の下の画面に対し、再度ステップS12の最適スキャンをトライすることになる。ここで、移動するバーコードラベルの速度が既知であれば、ステップS3で求めた図7の上の画面のバーコードラベルの位置情報A、B、C、Dに、バーコードラベルの移動速度、走査速度を考慮することにより図7の下の画面のバーコードラベルの位置A′、B′、C′、D′を算出することが出来るので、再度バーコードラベル検出ルーチンをコールする必要はない。
【0043】
また、バーコードラベルの移動速度が走査速度に対し十分無視できる速度であれば、図7の上の画面のバーコードラベルの位置情報をそのまま使用することも出来る。
【0044】
また、1つのフィールド画像を1行ずつ間隔を置いてフレームメモリ6に取り込み、空いている行にその1行上の行のフレームメモリの内容を複写して、読取の信頼性を上げる方法もある。この方法において、複写はハードウエアにより簡単に実現できるので、何等バーコードラベル読取の高速性を失うものではない。
【0045】
また、バーコードラベルの1行の高さが十分な場合には図8に示すように、全ての画素情報に対し、任意数の画素を加算し1つの画素にして、フレームメモリ6に格納する方法がある。これもハードウエアで簡単に実現可能であり、しかもノイズを抑制する効果も持っている。図8は、縦2行横2列の計4画素を加算し1つの画素にする例を示している。
【0046】
なお、ノンインターレース方式の2次元撮像装置5を使用した場合には、ステップS21はフレーム画像取り込みとなる。
次に、図9に示すフローチャート及び図10に示すバーコードラベル投影像の図を参照して、前記ステップS3でコールされるバーコードラベル検出ルーチンを説明する。このバーコードラベル検出ルーチンは、バーコードラベルの有無を検出することと、バーコードラベルの位置情報を検出すること即ちバーコードラベルに平行に画像データをフレームメモリ6から抽出するための抽出範囲(変数STARTTOP及びSTOPBOTTOM)とバーコードラベルの傾き(変数SLOPE)を求めることとの2種類のバーコードラベル検出処理を含む。ここで、変数STARTTOPの値は、バーコードラベルのトップ座標を示し、また変数STOPBOTTOMの内容はバーコードラベルのボトム座標を示す。また変数SLOPEの内容はバーコードラベルの傾きを示す。
【0047】
このバーコードラベル検出ルーチンにおいては、まず、後述するバーコードラベル画面内検出ルーチンをコールし、フレームメモリ6に記憶される画面(ラベル画像データ)内からバーコードラベルを検出する(ステップS31)。検出されたバーコードラベルが完全に画面内にあるか否かの判断を行ない(ステップS32)、画面内にない場合には(NO)、バーコードラベル無しの情報を持ってリターンする。しかし画面内にある場合には(YES)、後述するスキャン及び検出ルーチンをコールし、フレームメモリ6のラベル画像データに、スタートコードが存在するか否かを検出する(ステップS33)。つまり、図10に示す座標e、gを検出する。このルーチンにより、スタートコードが検出されて確定されれば、図11に示すフレームメモリ6上の座標変数e、gが定義される。ここで、座標変数eはスタートコード22を検出したいくつかの座標の中で最もY座標が小さいものの座標、gはスタートコード22を検出したいくつかの座標の中で最もY座標が大きいものの座標をそれぞれ示している。
【0048】
次に座標変数e、gの両方が定義されているか否かを判断し(ステップS34)、定義されていない場合は(NO)、バーコードラベル無しとして、メインフローチャートにリターンする。即ち、バーコードラベル無しの情報を持って、リターンする。以上のようにして、バーコードラベルの有無の検出が行われる。
【0049】
次に、バーコードラベルの位置情報の検出、即ちバーコードラベルに平行に画像データをフレームメモリ6から抽出するための抽出範囲(変数STARTTOP及びSTARTBOTTOM)とバーコードラベルの傾き(変数SLOPE)の算出が行われる。
【0050】
即ち、前記ステップS34に於いて、座標変数e、gの両方が定義されていると判断された場合は(YES)、バーコードラベルの位置情報の検出、即ちバーコードラベルに平行に画像データをフレームメモリ6から抽出するための抽出範囲(変数STARTTOP及びSTARTBOTTOM)の算出(ステップS35)とバーコードラベルの傾き(変数SLOPE)の算出(ステップS36)が行われる。そして、バーコードラベルありの情報を持ってリターンする。
【0051】
次に、前述したバーコードラベル検出ルーチン中のステップS31でコールされるバーコードラベル画面内検出ルーチンとステップS32の画面内のバーコードラベルが完全に入っているか否かの判断について、図12に示すフローチャートと図13に示すバーコードラベル画面内検出を説明する。
【0052】
このバーコードラベル画面内検出ルーチンは、前述したように、移動しているバーコードラベルが完全にフレームメモリ6の中に入っているか否かを確認するものである。仮に、バーコードラベルがフレームメモリ6の中に完全に入っていなくても、後述するインテリジェントスキャンを用いれば、画面外のコード数によっては、その位置を推定してバーコードシンボル情報を読取ることは可能であるが、その分読取速度が遅くなってしまうので、このようなルーチンを設け移動するバーコードラベルに対応させる。ここで、バーコードラベルは画像に対し上下方向に移動しているものとする。
【0053】
まず、画像の上端行でスタートコード22若しくはストップコード23を検出する(ステップS41)。この検出法の詳細は後述する。次に検出したか否かを判断する(ステップS42)。ここで、どちらかが検出されたと判断した場合(YES)、図13に示すようにバーコードラベルの上部が画像内に入っていないことを意味している。従って、そのような場合には、バーコードラベルが画面内にないという情報をもってリターンする。また、検出されなかった場合は(NO)、画像の下端行でスタートコード22若しくはストップコード23を検出する(ステップS43)。
【0054】
次に検出したか否かを判断する(ステップS44)。前述したように、ここでもどちらかが検出されたと判断した場合は(YES)、バーコードラベルの下部が画像内に入っていないことを意味しており、バーコードラベルが画面内にないという情報をもってリターンする。
【0055】
また、検出されなかった場合は(NO)、画像の中心行でスタートコード22若しくはストップコード23を検出する(ステップS45)。次に検出したか否かを判断し(ステップS46)、ここでは検出しなかった場合に(NO)、バーコードラベルが画面内にないという情報をもってリターンする。しかし検出した場合は(YES)、バーコードラベルが画面内にあるという情報を持ってリターンする。
【0056】
次に、前述したバーコードラベル検出ルーチン中のステップS33でコールされるスキャン及び検出ルーチンを、図14に示すフローチャートと図15に示すスキャン方法を説明する図を参照して説明する。
【0057】
このスキャン及び検出ルーチンは、前述したように座標変数e及びgの両方を検出するものである。
即ち、まずループ回数のカウントに使用される変数iと検出したスタートコードの数を格納する変数start numを初期化する(ステップS51)。次に、スキャンする行番号nとスキャン間隔nnを決定する(ステップS52)。ここでrow numは対象になる画像の行数である。このサブルーチンでスキャンする行番号は図15に示すように、検索幅を徐々に狭めていく方式をとっている。これは、反復的に方程式の解を求めるNEWTON法に類似している。
【0058】
このような方法を用いることにより、バーコードラベル像がフレームメモリ内のどの位置に存在しても、スタートコード22を高速に検出することが可能になる。次に、1つのループiにつき、2のi乗回のスキャンを行なうため、jを初期化する(ステップS53)。そしてjが“0”か否かを判断する(ステップS54)。ここでjが0でない、即ちステップS54の命題が真だった場合には(NO)、行番号nにステップS52で求めたスキャン間隔nnを2倍したものを加える(ステップS55)。jが“0”である、即ちステップS54の命題が偽だった場合には(YEA)、ステップS55をスキップして、ステップS56に移行し、n行目の画像データを取り込む(ステップS56)。
【0059】
次に、前記取り込んだ画像データに対しスタートコード22の検出を行なう(ステップS57)。次に、スタートコード22を検出したか否かを判断し(ステップS58)、存在しなければ(NO)、ステップS62に移行する。またスタートコード22が存在する場合には(YES)、その検出座標を座標配列start posに格納する(ステップS59)。そして、前記変数start numに1を加える(ステップS60)。
【0060】
次に、前記変数start numが予め定められている規定個数を越えたか否かを判断する(ステップS61)。ここで、越えていた場合は(YES)、ステップS66に移行する。しかし、越えていなかった場合には(NO)、前記変数jをインクリメントし(ステップS62)、jが2のi乗より小さいか否かの判断を行なう(ステップS63)。jの方が小さい場合には(YES)、前記ステップS54に戻る。しかしjが2のi乗より小さくない場合には(NO)、前記変数iをインクリメントし(ステップS64)、iが規定定数Loopより小さいか否かの判断を行なう(ステップS65)。ここで、iが小さかった場合には(YES)、前記ステップS52まで戻る。しかしiが規定定数Loopより小さくない場合には(NO)、バーコードラベル非検出の情報を持って、リターンする。従って、このサブルーチンでは最大(2のLoop乗)−1回のスキャンが行なわれることになる。
【0061】
また前記ステップS61において、start numが規定個数を越えていた場合は、後述するY座標の最大値最小値を求めるルーチンをコールする(ステップS66)。そして、バーコードラベル検出の情報を持って、リターンする。このようにスタートコードが規定個数以上検出できた場合に、ループ処理の途中であっても上位ルーチンに制御を戻すことにより、処理の高速化を図ることができる。
【0062】
次に、図14におけるスキャン及び検出ルーチン中のステップS57でコールされるスタートコード検出ルーチンについて、図16に示すフローチャートを参照して説明する。
【0063】
まず、前記取り込んだ画像データを幅情報に変換する(ステップS71)。次に、変換した幅情報を正規化し(ステップS72)、マッチングを行なう(ステップS73)。そして、前記幅情報がスタートコードにマッチしたか否かを判断し(ステップS74)、スタートコードであると判断した場合には(YES)、スタートコード有りの情報を持って、リターンする。スタートコードでない場合は(NO)、スタートコード無しの情報を持って、リターンする。
【0064】
次に、前記ステップS71でコールされる幅情報に変換ルーチンを、図17、図18に示す一連のフローチャートを参照して説明する。本ルーチンは、バーコードラベルのバーとスペースとの幅を求めるものであり、微分信号によりバーとスペースとの境界を求め、このとき2次曲線に近似することによりデータのピークを求めているものである。そして、順次ピークを求めて、その位置の差を求めることにより、幅が求められている。
【0065】
まず、上位のルーチンで取り込んだ取り込みバッファ配列scan lineをラインデータの配列とし、この取り込まれて変数numにストアされている値をデータ個数と定義する(ステップS81)。次に、この変数numの値をデクリメントした結果を位置標識カウンタiに格納し、また変数jを“0”に初期設定する(ステップS82)。
【0066】
そして、取り込みバッファ配列scan lineのi番目(位置標識カウンタiにより示される)の位置の値から取り込みバッファ配列scan lineのi−1番目の位置の値を引き、その解を取り込みバッファ配列scan lineのi番目の位置に再設定する(ステップS83)。この後、位置標識カウンタiをデクリメントし(ステップS84)、その結果iが“0”よりも大きいか否かを判断する(ステップS85)。iが0より大きくなければ(NO)、前記ステップS83に戻り、即ち、このステップS81からステップS85で、ラインデータを一次微分する。また結果iが“0”よりも大きいければ(YES)、位置標識カウンタiを2に初期化する(ステップS86)。
【0067】
そして、取り込みバッファ配列scan lineのi番目の位置の値が、閾値変数THRESHOLDの値よりも大きく、且つ取り込みバッファ配列scan lineのi−1番目の位置の値よりも大きく、且つ取り込みバッファ配列scan lineのi+1番目の位置の値以上か否かを判断し(ステップS87)、そうであれば(YES)、符号指標flagをUPとする(ステップS88)。しかし、そうでなければ(NO)、次のステップS89に移行する。
【0068】
ここで、取り込みバッファ配列scan lineのi番目の位置の値が、符号を負とした閾値変数THRESHOLDの値(−THRESHOLD)よりも小さく、且つ取り込みバッファ配列scan lineのi−1番目の位置の値よりも小さく、且つ取り込みバッファ配列scan lineのi+1番目の位置の値以下か否かを判断し(ステップS89)、そうであれば(YES)、符号指標flagをDOWNとする(ステップS90)。そうでなければ(NO)、次のステップS91に移行する。
【0069】
ここで、位置標識カウンタiをインクリメントする(ステップS91)。iが変数numの値から1引いた数よりも小さいか判断する(ステップS92)。小さければ(YES)、前記ステップS87へ戻り、小さくなければ(NO)、ステップ72のルーチンへ戻る。
【0070】
即ち、このステップS87からステップS92で、閾値変数THRESHOLDの値を越える最初のピーク、つまり図19の1番目のピークを検出する。そして、検出されたピークの符号が正の場合は、符号指標flagをUPとして、次のステップS93に移行し、検出されたピークの符号が負の場合は、符号指標flagをDOWNとし、ステップS94に移行する。また、ラインデータを走査してもピークが検出されない場合には、上位のルーチンに制御を戻す。
【0071】
このようにして、符号指標flagが設定されたならば、次に、位置標識カウンタiの値をx1とし、また取り込みバッファ配列scan lineのi−1番目の位置の値をy1、取り込みバッファ配列scan lineのi番目の位置の値をy2、取り込みバッファ配列scan lineのi+1番目の位置の値をy3とすることにより、検出されたピーク位置とその両隣データを2次曲線でフィッティングを行う(ステップS93)。そして、−0.5(−y1−2x1y1+4x1y2+y3−2x1y3)/y1−2y2+y3なる計算を行って、前記2次曲線のピーク位置を求め、それを変数lastposに格納する(ステップS94)。
【0072】
その後、位置標識カウンタiの値が変数numの値から2引いた数よりも小さく、且つ前記変数jがWIDTH NUMより小さいか否か判断する(ステップS95)、前記変数jが小さくなければ(NO)、上位のルーチンへ戻る。
【0073】
ここで変数jがWIDTH NUMより小さいという命題について説明する。WIDTH NUMは求めるべき幅数が格納されている定数であり、jは求めたピークの数が格納されている変数である。ここで、スタートコード22の位置を検出するために、スタートコード22が必ず、フレームメモリ6の向かって左側に位置するという条件と、フレームメモリ6の中にバーコードラベル以外の情報がないという条件があれば、前記配列scan lineに格納されている微分情報を全て幅情報に変換する必要はない。
【0074】
即ち、8個の幅情報を検出する為に最低限必要なピークの数は9個であるから、定数WIDTH NUMは、それ以上の数ならばよいということになる。通常、WIDTH NUMは画像のSN比により決定される。即ち、フレームメモリ6内にバーコードラベル以外の情報が全くなければ、WIDTH NUMは“9”に設定できる。そうでなければ、WIDTH NUMは“9以上”の数にしなければならない。
【0075】
以上のような理由により、前記の命題がステップS95の判断に入っている。この命題が判断に入ることにより、全ての幅情報を求めることなくルーチンを終了させられるので、処理の高速化が図れる。後述するが、微分情報から全ての幅情報を求めたいときは、もちろんこの命題を外せばよい。
【0076】
また、前記ステップS95の命題が成り立てば(YES)、位置標識カウンタiをインクリメントする(ステップS96)。そして、符号指標flagがDOWNであり、且つまた取り込みバッファ配列scan lineのi番目の位置の値が、閾値変数THRESHOLDの値よりも大きく且つ取り込みバッファ配列scan lineのi−1番目の位置の値よりも大きく且つ取り込みバッファ配列scan lineのi+1番目の位置の値以上であるか否かを判断する(ステップS97)。全ての項が成り立てば(YES)、符号指標flagをUPとする(ステップS98)。
【0077】
しかし、前記ステップS98で全ての項が成り立たなければ(NO)、次に、符号指標flagがUPであり、且つまた取り込みバッファ配列scan lineのi番目の位置の値が、符号を負とした閾値変数THRESHOLDの値よりも小さく且つ取り込みバッファ配列scan lineのi−1番目の位置の値よりも小さく且つ取り込みバッファ配列scan lineのi+1番目の位置の値以下であるか否かを判断する(ステップS99)。全ての項が成り立たなければ(NO)、前記ステップS95に戻り、全ての項が成り立てば(YES)、符号指標flagをDOWNとする(ステップS100)。
【0078】
こうして、符号指標flagが再設定されたならば、次に、位置標識カウンタiの値をx1とし、また取り込みバッファ配列scan lineのi−1番目の位置の値をy1、取り込みバッファ配列scan lineのi番目の位置の値をy2、取り込みバッファ配列scan lineのi+1番目の位置の値をy3とすることにより、検出されたピーク位置とその両隣データを2次曲線でフィッティングを行う(ステップS101)。
【0079】
そして、−0.5(−y1−2x1y1+4x1y2+y3−2x1y3)/y1−2y2+y3なる計算を行って、前記2次曲線のピーク位置を求め、それを変数nowposに格納する(ステップS102)。
【0080】
これにより、図20に示すように、1回前のピーク位置lastposと今回求めたピーク位置nowposが得られる。そして、こうして得られた両ピーク位置の差を取ることによりピーク間距離を求め、それを幅情報格納配列変数widthの変数jで示される位置に格納する(ステップS103)。
【0081】
その後、ピーク位置変数lastposをピーク位置変数nowposの値に更新し(ステップS104)、また変数jをインクリメントしてから(ステップS105)、前記ステップS95に移行する。
【0082】
このように、ステップS95からステップS105で、順次ピークを検出し、ピーク間距離を幅情報格納配列変数widthに格納していく。ここで、前記ステップS87からステップS92に於ける最初のピーク検出と異なる点は、例えば現在の符号指標flagがDOWNの場合、次に見つけなくては行けないピークは正符号のピークとしている点である。
【0083】
次に、前述したようなスタートコード検出ルーチン中のステップS82でコールされる正規化ルーチンを、図21に示すフローチャートを参照して説明する。まず、ループカウント変数iと変数sumに“0”を代入し、初期化する(ステップS111)。次に、変数sumに前記幅情報に変換ルーチンで求めた幅情報を格納した配列width[i]を加算し、再びsumに格納する(ステップS112)。
【0084】
次に、前記変数iをインクリメントする(ステップS113)。次に、この変数iが“8”より小さいか否かを判断し(ステップS114)、この変数iが“8”より小さければ(YES)、前記ステップS112に戻る。変数iが“8”より大きければ(NO)、次のステップS115に移行する。なお、ここで変数iが“0”から“7”まで変化しているのは、PDF417のコードワードがバー4本、スペース4本の計8個の幅情報から構成されており、8個の幅情報全てを用いてスタートコードの正規化を行なうためである。
【0085】
次に、再度、前記変数iに“0”を代入して初期化する(ステップS115)。次に、“17”を前記変数sumで除算し、前記幅情報配列のi番目width[i]に格納されている値を乗じたものをその値に一番近い整数に丸める(ステップS116)。ここで図21中のroundは、丸めを意味している。そして前記変数iをインクリメントし(ステップS117)、変数iが“8”より小さいか否かを判断する(ステップS118)。この変数iが“8”より小さければ(YES)、前記ステップS116まで戻り、変数iが“8”より大きければ(NO)、上位のルーチンにリターンする。
【0086】
次に、前述したような図16に示したスタートコード検出ルーチン中のステップS73のスタートコードマッチングについて説明する。
これは、どのようなマッチング方法を用いてもよいが、バーコードラベルを印刷する際にバー部分が意図した太さよりも太くなってしまうことがよくある。バー部分が太過ぎると、デコード性能は著しく低下する。しかし、このような場合には、バーが太くなった分スペース部分が細くなるので、バーの太さとスペースの太さを加算した幅情報をマッチングの対象にする方式を採用した方がよい。
【0087】
次に、前述した図14の検出ルーチン中のステップS66でコールされるY座標の最大値最小値検出ルーチンについて、図22に示すフローチャートを参照して説明する。このY座標の最大値最小値検出ルーチンは、規定個数検出したスタートコードの座標の中で、そのY座標が最大のものと最小のものを求めるルーチンである。
【0088】
まず、座標変数MAXとMINのY座標の値(MAXyとMINy)に、前記ステップS57(図14)で検出したスタートコードの検出座標の配列の0番目に格納されているStart pos[0]のY座標の値(start pos[0]y)を代入する(ステップS121)。次に、データの数だけループするのに必要な変数iに1を代入する(ステップS122)。
【0089】
次に、前記配列のi番目に格納されているstart pos[i]のY座標の値(start pos[i]y)がMAXyより大きいか否かを判断する(ステップS123)。ここでMAXyより大きい場合(YES)、即ちステップS123の命題が真の場合には、前記座標配列のi番目のstart pos[i]を前記座標変数MAXに代入し(ステップS124)、ステップS127に移行する。しかし、MAXyより小さい場合(NO)、即ちステップS123の命題が偽の場合には、ステップS125に移行する。
【0090】
次に、前記配列のi番目に格納されているstart pos[i]のY座標の値(start pos[i]y)がMINyより小さいか否かを判断する(ステップS125)。ここでMINyより小さい場合(YES)、即ちステップS125の命題が真の場合には、前記座標配列のi番目のstart pos[i]を前記座標変数MINに代入し(ステップS126)、ステップS127に移行する。しかしMINyより大きい場合(NO)、即ちステップS125の命題が偽の場合には、ステップS127に移行する。
【0091】
次に、前記変数iをインクリメントする(ステップS127)。次に、変数iが前記ステップS57で求めたstart numよりも大きいか否かを判断し(ステップS128)、変数iの方が小さければ(NO)、即ちステップS128の命題が偽の場合には、ステップS123に移行する。しかし変数iの方が大きい場合には(YES)、即ちステップS128の命題が真の場合には、座標変数MAXを図10に於ける座標gに、座標変数MINを座標eに格納した後(ステップS129)、図14の上位のルーチンにリターンする。
【0092】
次に、前述したような図9のラベル検出ルーチン中のステップS35でコールされるラベルの範囲を求めるルーチンについて、図23に示すフローチャートを参照して説明する。
【0093】
まず、線分e−gに平行な直線の方程式を定義、例えば線分e−gの方程式y=ax+bを求める(ステップS131)。次に、この直線がスタートビックバー22Aをクロスするように、切片bを定義する(ステップS132)。スタートコード22の構造は、例えば、8個のバーでなるスタートビックバー22Aと、3対の白バーと黒バーと、3個の白バーの合計17個のバーで構成されており、これを撮像した結果がN画素であったとする。また、方程式y=ax+bで表わされる直線は、切片bを変化させることにより並行移動することが知られている。従って、ビックバー22Aをクロスする直線を得るためには、前記線分e−gを{(17−8/2)/17}×N画素分左に移動させるような切片bとすれば良いことになる。
【0094】
このようにして、スタートビッグバー22Aをクロスする直線が得られたならば、次に、その直線と画面を定義する方程式との交点をそれぞれA,A′(図10参照)とする(ステップS133)。
【0095】
そして、このラインA−A′の中点から点Aに向けてデータを順に見ていき(ステップS134)、エッジが存在するか否かをチェックする(ステップS135)。このチェックは、例えば、輝度変化を見る強度比較、微分法、2次微分法、等により行なうことができる。こうして、エッジが検出されたならば、その検出座標を座標変数iに格納する(ステップS136)。即ち、検出座標を点iとする。
【0096】
次に、前記ラインA−A′の中点から今度はA′に向けてデータを準に見ていき(ステップS137)、エッジが存在するか否かをチェックする(ステップS138)。こうして、エッジが検出されたならば、その検出座標を座標変数mに格納する(ステップS139)。即ち、検出座標を点mとする。
【0097】
そして、座標変数e、gで示される点e、gを通る直線に座標変数iで示される点iから垂線を下ろし、その交点の座標を座標変数aに格納する(ステップS140)。即ち、点iを通るラインA−A′と直交する直線の方程式を求めて、それと点e、gを通る直線の交点を求め、その交点を点aとする。
【0098】
同様に、座標変数e、gで示される点e、gを通る直線に座標変数mで示される点mから垂線を下ろし、その交点の座標を座標変数dに格納する(ステップS141)。即ち、点mを通るラインA−A′と直交する直線の方程式を求めて、それと点e,gを通る直線の交点を求め、その交点を点dとする。
【0099】
このようにして求めた座標変数aの値を座標変数STARTTOPに、また座標変数dの値を座標変数STARTBOTTOMにそれぞれ格納した後(ステップS142)、上位のルーチンへ制御を戻す。
【0100】
次に、前述したようなラベル検出ルーチン中のステップS36でコールされるラベルの傾きを求めるルーチンを、図24に示すフローチャート及び図11に示すラベルの傾きを求めるための説明図を参照して説明する。
【0101】
まず、座標変数STARTBOTTOMのx座標の値を、座標変数STARTBOTTOMのy座標の値から座標変数STARTTOPのy座標の値を差し引いた結果の値で割り、また座標変数STARTTOPのx座標の値を、座標変数STARTBOTTOMのy座標の値から座標変数STARTTOPのy座標の値を差し引いた結果の値で割り、これら2つの商の差を傾き変数Slopeに格納する(ステップS151)。
【0102】
次に、座標変数STARTBOTTOMのy座標と座標変数STARTTOPのx座標とを乗じた結果を、座標変数STARTBOTTOMのy座標の値から座標変数STARTTOPのy座標の値を差し引いた結果の値で割り、また座標変数STARTBOTTOMのx座標と座標変数STARTTOPのy座標とを乗じた結果を、座標変数STARTBOTTOMのy座標の値から座標変数STARTTOPのy座標の値を差し引いた結果の値で割り、これら2つの商の差を切片変数intersectに格納する(ステップS152)。なお、図中のアスタリスク*の上付き文字は、乗算記号×を意味する。
【0103】
次に、図4の前記ステップS5でコールされる閾値決定ルーチンについて、図25に示すフローチャートと図26に示す閾値算出のための説明図を参照して説明する。
【0104】
まず、図10に示す点eに相当する値を点pに代入する(ステップS161)。次に、座標変数pのy座標の値で示されるライン、つまり図26(a)に示すようなデータ取り込みラインのデータをフレームメモリ6から取り込み(ステップS162)、スタートコード22の終わりx座標を点qのx座標とする(ステップS163)。
【0105】
そして、点pから点qまでのデータを微分する(ステップS164)。これにより、例えば、図26(a)に示すデータ取り込みラインの場合には、図26(b)に示すようなスタートコード22の微分波形が求まる。そして、この微分データの3番目のピークの絶対値を変数MAXとする(ステップS165)。
【0106】
ここで、微分データの3番目を見る理由は、概念的に、バーコード領域内で最もコントラストが低くなる(即ち、エッジの微分ピークが最も低い)ところで閾値を決定したいということから、ラベルのバーとスペースの間隔が最も狭いところであるスタート若しくは、ストップコードの第3エッジを選択するようにしているということによる。これにより、ラベルサイズやラベルの照明条件によらず安定的なデコードが可能となる。
【0107】
そして、こうして求めた変数MAXの値をピークに対する比率の定数THRESHOLD RATIOで割り、その結果を閾値変数THRESHOLDに代入する(ステップS166)。即ち、求められたデータから閾値を仮に求める。なお、変数THRESHOLD RATIOとは、ピークの何分の一を閾値に選ぶかを示す値であり、通常は、“2”あるいは“3”に設定される。
【0108】
次に、仮に求めた閾値THRESHOLDの値が、最小閾値定数THRESHOLD SMALLよりも大きく(ステップS167)、且つ、最大閾値定数THRESHOLD BIGよりも小さいか否かを判断する(ステップS168)。つまり、仮に求めた閾値が、閾値の取り得る範囲内に存在するか否かを判断する。定数THERESHOLD SMALLで示される最大値を越える場合には(YES)、定数THRESHOLD SMALLで示される最大値を閾値変数THERESHOLDに代入、つまり閾値を最小値に設定する(ステップS169)。
【0109】
また、変数THRESHOLD BIGで示される最小値未満の場合は(YES)、THERESHOLD BIGで示される最小値を閾値変数THRESHOLDに代入、つまり閾値を最大値に設定する(ステップS170)。
【0110】
次に、図4の前記ステップS6でコールされるインディケータ情報決定ルーチンについて、図27に示すローチャート及び図28に示すフレームメモリへの投影像の図を参照して説明する。
【0111】
まず、ロウインディケータ情報を読取るための基準座標の始点として、ラベルのトップ座標TOPの値を座標変数WORKに格納する(ステップS171)。次に、この座標変数WORKを通り、ラベルの傾き変数Slopeで示される傾きを持つ直線Iを定義し(ステップS172)、この直線Iが画面枠とクロスする点W1,W2を定義する(ステップS173)。
【0112】
そして、線分W1−W2上の画像データを取り込み(ステップS174)、その中に含まれるロウインディケータ情報を読取る(ステップS175)。
ここで、ロウインディケータ情報の読取りは、例えば次のようにして行う。即ち、前記ステップS174で取り込まれた対象ライン上の画像データつまり白黒の画素値からエッジを検出し、幅情報に変換する。そして、この幅情報からスタートコード22を検出し、そのスタートコード22の次のコードがロウインディケータ21Aであることがわかっているので、それを読み込む。
【0113】
同様に、ストップコード23を検出し、そのストップコード23の直前のコードがロウインディケータ21Aであることもわかっているため、それを読み込む。こうして、ロウインディケータ21Aが読取れたならば、それを不図示のバーコード表と比較し、一致する部分をコードに、つまり行数,列数,セキュリティレベル等の情報に変換する。なお、幅情報への変換は、種々の手法があるが、例えば後述するような幅情報への変換ルーチンをコールすることにより行うことができる。
【0114】
次に、ロウインディケータ情報が確立したか否かをチェックし(ステップS176)、確定したならば(YES)、ステップS180に移行する。確定しないならば(NO)、ステップS177に移行する。ここで、確定とは、何回かロウインディケータ21Aを読み込み、情報の信頼度が十分上がった場合のことを意味する。例えば、ロウインディケータ21Aに書かれている情報(行数,列数,セキュリティレベル)が10回読んだならば、その10回とも同じ情報が得られた場合、確定されたとする。
【0115】
前記ステップS176の判断で、ロウインディケータ情報が確定しない場合は(NO)、座標変数WORKのy座標の値に所定の増分L INCを加えて、その結果を新たな座標変数WORKのy座標値として代入する(ステップS177)。また、ラベルの傾き変数Slopeの値に座標変数WORKのy座標の値を乗じ、その結果にラベルの切片変数intersectを加えて、その結果を新たな座標変数WORKのx座標値として代入する(ステップS178)。こうして新たにスキャンするための基準座標を座標変数WORKに再設定する。
【0116】
そして、この再設定された座標変数WORKのy座標値がラベルのボトム座標変数BOTTOMのy座標値を越えているか否か、つまりラベル領域内か否かを判断し(ステップS179)、ラベル領域内であれば前記ステップS172から繰り返し、ラベル領域外の場合はマトリックスの未定義の情報を持って上位のルーチンへリターンする。
【0117】
一方、前記ステップS176で、ロウインディケータ21Aが確定したと判断した場合には(YES)、ロウインディケータ情報から得られたセキュリティレベルから修復可能なデータ数を算出し、REST NUMに格納される(ステップS180)。さらに、ロウインディケータ情報から得られたラベルの行数が、ラベルのロウ数変数ROW NUMBERに格納される(ステップS181)。また、ロウインディケータ情報からラベルの列数が抽出され、ラベルのカラム数変数COLUMN NUMBERに格納される(ステップS182)。その後、マトリックスが定義されたという情報を持って上位のルーチンへ制御を戻す。
【0118】
次に、図4の前記ステップS8でコールされる傾き再定義ルーチンについて、図29に示すフローチャート及び図30に示す傾きを再定義するための説明図を参照して説明する。ここで、傾きを再定義する理由を以下に述べる。
【0119】
図10中のe、gから求めた傾き、即ちスタートコード22の情報のみから求めた傾きは印字品質、CCDの精度等の問題により、正確な値ではない。そこで、前記ステップS8によりインディケータ情報が決定した後で、ストップコード23に近い位置からストップコード23に検出し、スタートコード22とストップコード23の両方の情報から傾きを求めれば、より正確な傾きの値が求まる。前記ステップSCの最適スキャンの前に、より正確な傾きの値を求めることはスキャンの高速化につながる。
【0120】
まず、検出開始点pを決定する(ステップS191)。pは、前記インディケータ情報決定ルーチンで求まった、右行インディケータの列の左端の上端の点uと下端の点vを結ぶ直線Iを4等分し、uからIに沿って4等分した距離を進んだ点である。次に、p、p′間のデータを取り込む(ステップS192)。p′は前記点pからx軸に平行に進みy=列数の直線と交わった点である。
【0121】
次に後述するストップコード検出ルーチンをコールする(ステップS193)。そして、ストップコードを検出したか否かを判断し(ステップS194)、検出しなかった場合には(NO)、傾きの再定義無しの情報を持って、リターンする。検出した場合は(YES)、検出点の座標を図10に示すfに格納し、fを定義する(ステップS195)。
【0122】
次に、検出開始点qを決定する(ステップS196)。この点qは前記インディケータ情報決定ルーチンで求められた右行インディケータの列の左端の上端の点uと下端の点vを結ぶ直線Iを4等分し、vからIに沿って4等分した距離を進んだ点である。次に、点q,q′間のデータを取り込む(ステップS197)。点q′は、前記点qからx軸に平行に進みy=列数の直線と交わった点である。 次に前記ステップS193に於けるストップコード検出ルーチンをコールし、ストップコードの検出を行う(ステップS198)する。そして、ストップコードを検出したか否かを判断し(ステップS199)、検出しなかった場合には(NO)、傾きの再定義無しの情報を持って、リターンする。検出した場合は(YES)、検出点の座標を図10に示すhに格納し、hを定義する(ステップS200)。
【0123】
次に、詳細は後述するラベルの範囲検出のルーチンをコールし(ステップS201)、傾きの計算を行なう(ステップS202)。そして、傾き再定義の情報を持って、リターンする。
【0124】
前記ステップS193,S198でコールされるストップコード検出ルーチンを、図31に示すフローチャートを参照して説明する。
このルーチンは基本的に図16に示したスタートコード検出と同じであるが、図16とは、マッチングの部分が異なっている。これは、PDF417のスタートコード22とステップコード23それぞれの持つ幅情報が異なるためである。マッチング法に関しては、前述したようにバーコードラベルの印刷精度に影響されないマッチング方法が望ましい。
【0125】
次に、図29の前記ステップS201でコールされるラベルの範囲検出ルーチンについて、図32に示すフローチャートを参照して説明する。
まず、線分f−hに平行な直線の方程式を定義、例えば、線分f−hの方程式y=ax+bを求める(ステップS221)。
【0126】
次に、この直線がストップビックバー23Aをクロスするように、切片bを定義する(ステップS222)。ストップコード23の構造は、例えば、8個のバーでなるストップビックバー23Aと、3対の白バーと黒バーと、3個の白バーの合計17個のバーで構成されており、これを撮像した結果がN画素であったとする。また、方程式y=ax+bで表わされる直線は、切片bを変化させることにより並行移動することが知られている。
【0127】
従って、ビックバー23Aをクロスする直線を得るためには、前記線分f−hを{(17−8/2)/17}×N画素分左に移動させるような切片bとすれば良いことになる。
【0128】
こうしてストップビックバー23Aをクロスする直線が得られたならば、次に、その直線と画面を定義する方程式との交点をそれぞれB,B′(図10参照)とする(ステップS223)。
【0129】
そして、このラインB−B′の中点から点Bに向けてデータを順に見ていき(ステップS224)、エッジが存在するか否かをチェックする(ステップS225)。このチェックは、例えば、輝度変化を見る強度比較、微分法、2次微分法、等により行なうことができる。こうして、エッジが検出されたならば、その検出座標を座標変数jに格納する(ステップS226)。即ち、検出座標を点jとする。
【0130】
次に、前記ラインB−B′の中点から今度は点B′に向けてデータを順に見ていき(ステップS227)、エッジが存在するか否かをチェックする(ステップS228)。こうして、エッジが検出されたならば、その検出座標を座標変数kに格納する(ステップS229)。即ち、検出座標を点kとする。
【0131】
そして、座標変数f、hで示される点f、hを通る直線に座標変数jで示される点jから垂線を下ろし、その交点の座標を座標変数bに格納する(ステップS230)。即ち、点jを通るラインB−B′と直交する直線の方程式を求めて、それと点f,hを通る直線の交点を求め、その交点を点bとする。
【0132】
同様に、座標変数f,hで示される点f,hを通る直線に座標変数kで示される点kから垂線を下ろし、その交点の座標を座標変数cに格納する(ステップS231)。即ち、点kを通るラインB−B′と直交する直線の方程式を求めて、それと点f,hを通る直線の交点を求め、その交点を点cとする。
【0133】
そして、こうして求めた座標変数bの値を座標変数STOPTOPに、また座標変数cの値を座標変数STOPBOTTOMにそれぞれ格納した後(ステップS232)、図29の上位のルーチンへ戻る。
【0134】
次に、図29の前記ステップS202でコールされるラベルの傾き再計算ルーチンについて、図33に示すフローチャートを参照して説明する。
まず、座標変数STOPTOPのy座標の値を、座標変数STOPTOPのx座標の値から座標変数STARTTOPのx座標の値を差し引いた結果の値で割り、また座標変数STARTTOPのy座標の値を、座標変数STOPTOPのx座標の値から座標変数STARTTOPのx座標の値を差し引いた結果の値で割り、これら2つの商の差を傾き変数Slope1に格納する(ステップS241)。
【0135】
次に、座標変数STOPBOTTOMのy座標の値を、座標変数STOPBOTTOMのx座標の値から座標変数STARTBOTTOMのx座標の値を差し引いた結果の値で割り、また座標変数STARTBOTTOMのy座標の値を、座標変数STOPBOTTOMのx座標の値から座標変数STARTBOTTOMのx座標の値を差し引いた結果の値で割り、これら2つの商の差を傾き変数Slope2に格納する(ステップS242)。
【0136】
次に、傾き変数Slope1と前記ステップS36で求めた傾き変数Slopeの差の絶対値が閾値定数SLOPETHRESH1より小さく、且つ傾き変数Slope2とSlopeの差の絶対値が閾値定数SLOPETHRESH1より小さいか否かを判断する(ステップS243)。ここで、図中のabsは絶対値を意味する。前記ステップS243の命題が偽だった場合には(NO)、再計算なしの情報をもってリターンする。そうでない場合は(YES)、前記変数Slope1とSlope2の差の絶対値をとり、それが閾値定数SLOPETHRESH2よりも大きいか否かを判断する(ステップS244)。
【0137】
このステップS244で絶対値の方が小さい場合には(NO)、ステップS250に移行し、大きい場合には、次のステップS245に移行する。
次に、前記ステップS36で求めた傾き変数Slopeと前記変数Slope1の差の絶対値を変数aに格納する(ステップS245)。次に、前記ステップS36で求めた傾き変数Slopeと前記変数Slope2の差の絶対値を変数bに格納する(ステップS246)。
【0138】
そして前記変数bが前記変数aより大きいか否かを判断する(ステップS247)。前記変数bが大きい場合には(YES)、前記傾き変数SlopeにSlope1を代入する(ステップS248)。前記変数bが小さい場合は(NO)、前記傾き変数SlopeにSlope2を代入する(ステップS249)。また、前記ステップS244で傾き変数SlopeとSlope2の差の絶対値が閾値定数よりも小さかった場合には(NO)、傾き変数Slopeに傾き変数Slope1とSlope2の和を2で割ったもの、即ちSlope1とSlope2の平均を代入する(ステップS250)。そして、再計算ありの情報を持ってリターンする。
【0139】
以上S244〜S249の一連のステップでは、図34に示すように、PDF417バーコードラベルのスタートコード22もしくはストップコード23のどちらか一方に欠損が存在し、ラベルの範囲が正しく求まっていない場合を考慮している。図34の場合、直線nの傾きSlope1とn′の傾きSlope2の値は大きく違う。それを、このルーチンで検出し、図10中の点e、gから計算したラベルの傾きSlopeに近い値を新しい傾きとして採用している。このような方法を用いることにより、スタートコード22もしくはストップコード23のどちらか一方に欠損が存在した場合でも、より正確なラベルの傾きを求めることができる。
【0140】
なお、前記ステップS243の判断が偽の場合というのは、スタートコード22もしくはストップコード23のどちらか一方の上下に欠損がある場合であり、この場合には傾きの再計算は行なわない。
【0141】
次に、図4の前記ステップS9でコールされるスキャン方程式決定ルーチンについて、図36に示すフローチャート及び図35に示すフレームメモリへの投影像の図を参照して説明する。なお、図35は行スキャンでスタートコード22が基準に選択された場合の例を示している。
【0142】
即ち、まず変数counterを“0”に初期化し(ステップS251)、また基準座標変数WORKをラベルのトップ座標変数TOPの値に初期化する(ステップS252)。
【0143】
次に、ラベルのボトム座標変数BOTTOMのy座標値とラベルのトップ座標変数TOPのy座標値との差を、変数count endに代入する(ステップS253)。即ち、決定しなければならないパターン数(図36の場合ではラベルの列方向の画素数)を求め、変数count endに格納する。つまり、パターン数とは、ラベル全面を走査するための数である。
【0144】
次に、ラベルのトップ座標変数TOPのy座標値に変数counterの値を加算し、その結果を基準座標変数WORKのy座標値として代入する(ステップS254)。また、ラベルの傾き変数Slopeの値に基準座標変数WORKのy座標の値を乗じ、その結果にラベルの切片変数intersectを加えて、その結果を新たな基準座標変数WORKのx座標値として代入する(ステップS255)。このように、変数counter値の増加にともない基準座標変数WORKを再設定している。
【0145】
次に、この再設定された座標変数WORKを通り、ラベルの傾き変数Slopeで示される傾きを持つ直線Iを定義し(ステップS256)、この直線Iが画面枠交差する2点を求め、それぞれを座標変数の配列DIM POINT P及びDIM POINT Qのcounter番目(変数counterの値が示す配列の番号)に格納する(ステップS257)。
【0146】
その後、変数counter値をインクリメントし(ステップS258)、その結果の再設定された変数counter値が必要数、即ち変数counter endに達したか否かをチェックする(ステップS259)。必要数に達しない場合は(YES)、前記ステップS254に戻り、必要数に達した場合は(NO)、ステップS260に移行する。以上の動作によって、ラベルを順次走査する場合の始点と終点の組み合わせが定義される。
【0147】
次に、再度変数counterを“0”に初期化する(ステップS260)、そして、ラベルの傾き変数Slopeの値に変数counter値を乗じることにより、計算されているラベルの傾きSlopeの位置による増加分が計算され、この計算結果を変数の配列LINE INCの所定の位置(変数counterで示される位置)に格納する(ステップS261)。
【0148】
その後、変数counterをインクリメントした後(ステップS262)、この再設定された変数counterが配列の最大サイズ定数MAX NUMに達したか否かをチェックする(ステップS263)。達していない場合は(YES)、前記ステップS261に戻り、達した場合には(NO)、図4のルーチンにリターンする。
【0149】
前述したステップS260からステップS263のループによって、ラベル情報を1ライン取り込む場合の傾きパターンが得られる。なお、前記配列の最大サイズ定数MAX NUMは、プログラム作成時に定める変数のサイズを示すもので、例えば、フレームメモリ6のサイズが“640×480画素”であると仮定すれば、“1000程”とっておけば良い。
【0150】
次に、図4の前記ステップS10でコールされる埋め込チェックルーチンについて、図37に示すフローチャート及び図38に示すフレームメモリへの投影像の図を参照して説明する。なお、図38は、行スキャンでスタートコード22が基準に選択された場合の例を示している。またラベルサイズは、“4×3”であるものとする。
【0151】
まず、後述するROW検出ルーチンをコールし、ラベルをスキャンした場合、最初と最後に見つかるロウの各種情報(検出ライン番号、コードの長さ、ロウ番号、検出位置等)を検出し(ステップS271)、それぞれ変数ROW FIRST,ROW LASTに格納する。
【0152】
次に、変数ROW FIRSTとROW LASTとも確定したか否かを判断し(ステップS272)、確定したならば(YES)、ステップS273に移行する。しかし確定しないならば(NO)、デコード不可能として、図4の上位ルーチンにリターンする。
【0153】
こうして、前記ステップS272で変数ROW FIRSTとROW LASTとも確定しているならば(YES)、コードワードマトリックスの各コードの先頭位置座標を推定し、2次元配列変数CODE POSのそれぞれのコードのロウ番号,カラム番号番目に格納する(ステップS273)。ここで、各コードワード先頭座標位置の推定は、図38に示すように、ラベルの傾きと、最初と最後に見つかるロウの検出ライン番号,コードの長さ,ロウ番号,検出位置、更にマトリックスサイズ(ROW NUMBER×COLUMN NUMBER)などから決めることができる。
【0154】
次に、前記ステップで推定された座標のうち画面外にコードがはみ出してしまう恐れのあるものの個数を集計し、変数error numに格納する(ステップS274)。図38に示す例では、(ロウ番号,カラム番号)=(0,2)、(1,2)、(2,2)、(3,1)、(3,2)の5個のコードが読取不能と判断され、error numに5が格納される。
【0155】
更に、前記error numが図27の前記ステップS180で求めた修復可能コード数の変数REST NUMと比較し(ステップS275)、error numがREST NUM以下であれば(YES)、デコード可能として図4の上位ルーチンにリターンする。一方、error numがREST NUMを越えている場合は(NO)、デコード不可能として図4の上位ルーチンにリターンする。
【0156】
このようなルーチンにより、各コードの位置を推定することができ、また画面外と推定されるコード数をカウントできるため、デコード可能か否かをこの段階で判断することが出来る。これにより、長い時間処理を行ったにも係わらず、デコードされないという最悪のパターンは激減する。
【0157】
次に、図37の前記ステップS271でコールされるROW検出ルーチンについて、図39に示すフローチャート及び図36に示すフレームメモリへの投影像の図を参照して説明する。
【0158】
まず、ラベルのボトム座標変数BOTTOMのy座標値とラベルのトップ座標変数TOPのy座標値との差、つまりラベルのy方向の画素数を計算し、その計算結果を変数pos numに格納する(ステップS281)。
【0159】
次に、変数incの値を“1”に(ステップS282)、変数counterの値を“0”に(ステップS283)、変数endの値を前記ステップS282もしくはS283で求めたpos numとする(ステップS284)。
【0160】
そして、前記ステップS282からS284で求めた各変数(初期値counter,増分inc,終了位置end)を用いて、後述するROW番号検出ルーチンをコールする(ステップS285)。正しくインディケータ情報からロウ番号を検出できた場合は、変数ROW POSに検出ライン番号,コード長さ,ロウ番号,検出位置などの情報が格納される。
【0161】
即ち、前記ルーチンで正しくインディケータ情報からロウ番号を検出できたか否かを判断し(ステップS286)、検出された場合は(YES)、ステップS287へ移行し、検出できなかった場合は(NO)、デコード不可能として上位ルーチンに戻る。
【0162】
次に、前記ステップS285で求められたデータROW POSをROW FIRSTに格納する(ステップS287)。即ち、前記ステップS282からS287でラベルのTOPからBOTTOMに向かってスキャンラインを次々設定し、最初に検出されたインディケータ位置がROW FIRSTに格納される。
【0163】
更に、前記S288からS293までは、ラベルをBOTTOMからTOPに向かって、スキャンラインを次々設定し、最初に検出されたインディケータ位置がROW LASTに格納される。
【0164】
このようなルーチンにより、ロウの一部が処理不能(例えば画面外にとび出しているとか)になっているか否かが分かるわけである。なぜなら、ロウ数4のラベルで、ROW FIRSTでロウ番号0が検出され、ROW LASTでロウ番号2が検出された場合、ロウ番号3は検出不能であるので、処理できないのが分かる。
【0165】
次に、図39の前記ステップS285でコールされるROW番号検出ルーチンについて、図40に示すフローチャートを参照して説明する。
まず、現在の変数counter値に於ける走査始点及び終点を前記座標変数の配列DIM POINT P,DIM POINT Qから求め、x方向増分を“1”且つy方向増分を前記傾き増分配列LINE INCで、フレームメモリ6から画像データを1ライン取出して、取り込みバッファ配列scan lineに格納し、そのデータの個数を変数numに格納する(ステップS301)。
【0166】
そして、後述する幅情報に変換ルーチンをコールして(ステップS302)、この取り出したデータを幅情報に変換する。次に、この幅情報を元に、不図示バーコード表と一致する部分をコードに変換し、その情報の中からインディケータ情報を抽出し保存する(ステップS303)。ここで、インディケータ情報が読めたか否かを判断し(ステップS304)、読めなかった場合は(NO)、その後、変数counterを増分、即ち前記間隔変数incの値で再設定し(ステップS305)、この再設定された変数counter値が、前記変数end、つまり、ラベル範囲を越えるか否かを判断する(ステップS306)。ここで越えない場合は(NO)、前記ステップS301に戻り、越える場合は(YES)、デコード不能と判断し、図39の上位ルーチンにリターンする。
【0167】
一方、前記ステップS304の判断で、読めたと判断した場合は(YES)、その時の検出ライン番号とコード長さとロウ番号と検出位置を変数ROW POSに格納し(ステップS307)、デコード可能として、図39の上位ルーチンにレターンする。従って、このルーチンに入ってから最初に検出されたインディケータの各種情報をROW POSに格納することになる。
【0168】
次に、図4の前記ステップS13でコールされる最適スキャンルーチンについて、図41に示すフローチャート及び図42に示すフレームメモリへの投影像の図を参照して説明する。
【0169】
まず、ラベルのインディケータ情報変数ROW LASTの検出位置y座標値とROW FIRSTの検出位置y座標値との差、つまりラベルのy方向の画素数を計算し、その計算結果を変数endに格納する(ステップS311)。
【0170】
次に、この変数endの値をラベルの行数(変数ROW LASTのロウ番号−変数ROW FIRSTのロウ番号の絶対値)で割ることにより、図42に示すように各行の中心を一度だけ走査するための間隔を計算し、それを変数incに格納する(ステップS312)。そして、変数ROW FIRSTの検出ライン番号を変数counterの初期値とする(ステップS313)。
【0171】
次に、現在の変数counter値に於ける走査始点及び終点を前記座標変数の配列DIM POINT P,DIM POINT Qから求め、x方向増分を“1”且つy方向増分を前記傾き増分配列LINE INCで、フレームメモリ6から画像データを1ライン取出して、それを取り込みバッファ配列scan lineに格納し、またそのデータの個数を変数numに格納する(ステップS314)。
【0172】
そして、後述する前記ステップS302と同じ、幅情報に変換ルーチンをコールして(ステップS315)、この取り出したデータを幅情報に変換する。次に、この幅情報を元に、不図示バーコード表と一致する部分をコードに変換し、その情報を保存する(ステップS316)。
【0173】
その後、変数counterを増分、即ち前記間隔変数incの値で再設定し(ステップS317)、この再設定された変数counter値が、前記変数endつまりラベル範囲を越えるか否かを判断する(ステップS318)。この判断で越えない場合は(YES)、前記ステップS314に戻り、越える場合は(NO)、格納されたコード情報がラベルに記述されている情報が完全に復号可能か否かを判断する(ステップS318)。復号可能の場合は(YES)、デコード可能の情報を持って図4の上位ルーチンへリターンする。しかし復号不可能の場合は(NO)、デコード不可能の情報を持って図4の上位ルーチンへリターンする。
【0174】
次に、図4の前記ステップS14でコールされるインテリジェントスキャンルーチンについて、図43に示すフローチャートを参照して、説明する。このスキップスキャンルーチンは、前記最適スキャンで取りこぼしたコード位置のみをスキャンするルーチンである。
【0175】
まず、最適スキャンで埋め込むことの出来なかったコードワードのうち、画面内と思われるコード数をiと定義する(ステップS321)。さらに、その各コードのロウ番号とカラム番号をそれぞれ配列RとCに格納する(ステップS322)。以上より、最適スキャンで埋め込むことの出来なかったコードワードの個数とその位置が求められる。この位置は、後述するように、カラム番号とロウ番号が分かれば、前記ステップS10で求めたCODE POSよりその座標が分かる。
【0176】
次に、変数counterと傾きパターンカウンターnを“0”に初期化する(ステップS323)。そして、counter番目の未検出場所の座標CODE POS[[R[counter]][C[counter]]を通り、Slope+dt[n]の傾きを持つ直線Iを定義する(ステップS324)。この直線Iが画面枠とクロスする点W3,W4を定義し、線分W3−W4上の画像データを取り込む(ステップS325)。
【0177】
そして、後述する前記ステップS302と同じ、幅情報に変換ルーチンをコールして(ステップS326)、この取り出したデータを幅情報に変換する。次に、この幅情報を元に、当該バーコードの用途に応じて予め決められた不図示バーコード表と一致する部分をコードに変換し、その情報を保存する(ステップS327)。
【0178】
さらに前記ステップS324からステップS326で狙った場所のコードが埋めこめたか否かを判断する(ステップS328)。この判断で埋めこめなかった場合には(NO)、傾きパターンカウンターnをインクリメントし(ステップS329)、それが傾きパターン数N PAT(例えば傾きの種類を10種類予め配列dtに用意しておく場合は“10”に設定)未満か否かをチェックし(ステップS330)、未満の場合は前記ステップS324へ戻り、以上の場合はスップS331へ移行する。
【0179】
前記ステップS328で埋めこめたと判断した場合(YES)、あるいは傾きパターンカウンターnが傾きパターン数N PAT以上の場合は、変数counterをインクリメントし、傾きパターンカウンタnを“0”に再設定する(ステップS331)。この再設定された変数counter値が、前記変数iつまり最適スキャンで埋め込むことの出来なかったコードワードのうち、画面内と思われるコード数を越えるか否かをチェックする(ステップS332)。越えない場合は(YES)、前記ステップS324に戻り、越える場合は(YES)、格納されたコード情報がラベルに記述されている情報を、完全に復号可能か否かを判断する(ステップS333)。
【0180】
この判断で、復号可能の場合は(YES)、デコード可能の情報を持って図4の上位のルーチンへリターンする。しかし復号不可能の場合は(NO)、デコード不可能の情報を持って図4の上位ルーチンへリターンする。
【0181】
従って、ステップS324からステップS332において、最適スキャンで埋め込むことの出来なかったコードワードのうち、画面内と思われるコード毎に、複数種類の傾きで画像データを取り込み、そのコードを確定しようとしている。これにより、必要な部分のみを取り込む操作となるため、最小のトライ数でコードワードマトリクッスが確定される。
【0182】
次に、前記ステップS302若しくはステップS326で、コールされる幅情報に変換ルーチンについて、図44及び図45に一連のフローチャートを参照して説明する。
【0183】
このルーチンは、基本的に図17及び図18で説明したルーチンと同一のものであるが、ステップS95とステップS355の部分だけが異なる。即ち、図17及び図18のルーチンでは、スタートコード22で検出するのみの目的であったため、幅情報は、WIDTH NUM個求めれば良かったが、図44及び図45のルーチンでは、ラベルの全ての情報が必要であるから、幅は全て求めなければいけない。そこで、ステップS355では、前記ステップS95に見られたjに関する判断は取り除くようにする。
【0184】
なお、本発明の前記実施例に限定されるものではなく、種々の変形実施が可能なことは勿論である。
例えば、2次元撮像装置5は、2次元CCDや撮像管に代表されるエリアセンサを用いたものに限定されるものでなく、1次元撮像素子と1次元スキャン機構の組み合せや、光電検出器と2次元スキャン機構の組み合せでも良い。
【0185】
また、前記説明に於いては、バーコードラベルにPDF−417フォーマットのラベルを用いたが、これに限定されるものでなく、Code49等、他のスタックドバーコードや、JAN等の1次元バーコードでも良い。
【0186】
以上の実施例に基づいて説明したが、本明細書には、以下のような発明も含まれる。
(1) バーとスペースとからなるバーコードを2次元像として撮像する撮像手段と、
前記撮像手段により得られた2次元像を一時的に記憶する記憶手段と、
前記撮像手段から該記憶手段に撮像画像を転送する転送手段と、
前記撮像手段により得られたバーコードの2次元像から、バーコードシンボルの有無を自動認識する認識手段と、
前記撮像手段により得られたバーコードの2次元像から、バーコードシンボルの位置を認識する位置認識手段と、
前記撮像手段により得られたバーコードの2次元像から前記バーコードの情報を順次読み取る読取手段と、
前記読取手段からのバーコードの情報から、元の情報に復号する復号手段と、を具備してなることを特徴とするシンボル情報読取装置。
【0187】
従って、バーとスペースとからなるバーコードを2次元像として撮像し、得られた2次元像を一時的に記憶し、撮像画像を記憶手段に転送し、バーコードシンボルの有無を自動認識し、バーコードシンボルの位置を認識し、バーコードの情報を順次読み取り、バーコードの情報から、元の情報に復号する。
【0188】
(2) 前記第1項において、認識手段は、移動しているバーコードの2次元像を、撮像手段により得られる撮像画面のバーコード情報読み取り可能な位置で認識するシンボル情報読取装置。
【0189】
従って、移動しているバーコードの2次元像を、撮像手段により得られる撮像画面のバーコード情報読み取り可能な位置で認識する。
よって効果は、移動しているバーコードラベルを読み取る際に、バーコードラベルが完全に画像内に入っている場合にのみ読取処理に進ようにしたので、画像からはみ出しているバーコードを読みに行くようなことはなく、高速に読取が行なえて、尚且つ信頼性を上げることができることである。
【0190】
(3) 前記第1項において、転送手段は、撮像手段により撮像された2次元像を圧縮して転送するシンボル情報読取装置。
従って、撮像手段により撮像された2次元像を圧縮して転送する。
【0191】
よって、効果は、対象画像を圧縮してフレームメモリ6に転送するので、処理する画素数が少なくなり、バーコードシンボル情報を高速に読み取ることが可能となることである。
【0192】
(4) 前記第3項において、転送手段は、撮像した2次元像の1つのフィールド成分のみを記憶手段に転送するシンボル情報読取装置。
従って、従って撮像した2次元像の1つのフィールド成分のみを記憶手段に転送する。
【0193】
よって、効果は対象画像に対しバーコードラベル像が占める割合が大きくて、バーコードラベルの1行の高さが十分な場合には、フレームメモリにフィールド画像のみを転送し、読取処理を行なうため安価なインタレース型撮像素子でバーコード情報を読み取ることができることである。フィールド画像は偶数成分奇数成分のどちらでもかまわない。
【0194】
(5) 前記第2項において、転送手段は、撮像した2次元像の2つのフィールド成分を別々に記憶手段に転送するシンボル情報読取装置。
従って、撮像した2次元像の2つのフィールド成分を別々に記憶手段に転送する。
【0195】
よって、効果は、対象画像に対しバーコードラベル像が占める割合が小さくて、バーコードラベルの1行の高さが十分でない場合には、2つのフィールド画像(偶数成分と奇数成分)を1つのフレームメモリに別々に取り込み、1つのフィールド画像に対し読取処理を行ない、それが失敗した場合にはもう1つのフィールド画像に対し読取処理を行ない、読取の信頼性を上げることができることである。
【0196】
(6) 前記第2項において、読み取り手段は、記憶手段により記憶された1つのフィールド成分に対し読み取り処理を行ない、処理が失敗したときは記憶手段により記憶された別のフィールド成分に対し再度読み取り処理に行く処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0197】
従って、記憶手段により記憶された1つのフィールド成分に対し読み取り処理を行ない、処理が失敗したときは記憶手段により記憶された別のフィールド成分に対し再度読み取り処理に行く処理操作を含み、バーコード情報を読み取る。
【0198】
よって、(5)項と同様の効果が得られる
(7) 前記第2項において、転送手段は、撮像手段により撮像された2次元像のフィールド成分の1スキャンラインを転送した後、記憶手段の1ラインを空けてまたスキャンラインを転送し、1フィールド分の画像情報を転送するまでそれを繰り返し、終了後に空いているラインにそのラインの1ライン上または下のラインの画像情報を複写をする処理操作を含み、転送するシンボル情報読取装置。
【0199】
従って、撮像手段により撮像された2次元像のフィールド成分の1スキャンラインを転送した後、記憶手段の1ラインを空けてまたスキャンラインを転送し、1フィールド分の画像情報を転送するまでそれを繰り返し、終了後に空いているラインにそのラインの1ライン上または下のラインの画像情報を複写をする処理操作を含み、転送する。
【0200】
よって、効果は、1つのフィールド画像を1行ずつ間隔を置いてフレームメモリ6に取り込み、空いている行にその1行のフレームメモリの内容を複写して、読取処理を行なうことにより、読取の信頼性を上げることができることである。複写はハードウエアにより簡単に実現できる。
【0201】
(8) 前記第3項において、転送手段は、撮像手段により撮像した2次元像の任意数の画素情報を加算し1つの画素にして、転送するシンボル情報読取装置。
【0202】
従って、前記3項において、転送手段は、撮像手段により撮像した2次元像の任意数の画素情報を加算し1つの画素にして、転送する。
よって、効果は、バーコードラベルの1行の高さが十分な場合には、全ての画素情報に対し、任意の画素数を加算し1の画素にしてフレームメモリに格納することにより、バーコードシンボル情報を高速に読み取ることが可能となることである。これもハードウエアで簡単に実現可能であり、しかもノイズを抑制する効果も持っている。
【0203】
(9) 前記第1項において、位置認識手段は、記憶装置の1行の画素情報を任意数だけ幅情報に変換して、当該バーコードの種類によって定められる所定パターンの位置を認識するシンボル情報読取装置。
【0204】
従って、記憶装置の1行の画素情報を任意数だけ幅情報に変換して、当該バーコードの種類によって定められる所定パターンの位置を認識する。
よって、効果は、対象となる画像内にバーコードラベル以外の情報が存在せず、尚且つPDF417バーコードラベルのスタートコードが画像の向かって左側に位置した場合、フレームメモリから行単位で取り込んだ画素情報を全て幅情報に変換せずに、スタートコードを検出するのに十分なだけの幅情報だけ求めるので、高速にスタートコードを検出することができることである。
【0205】
(10) 前記第1項において、位置認識手段は、記憶手段から選択的に行を選ぶ処理操作を含み、当該バーコードの種類によって定められる所定パターンの位置を認識するシンボル情報読取装置。
【0206】
従って、記憶手段から選択的に行を選ぶ処理操作を含み、当該バーコードの種類によって定められる所定パターンの位置を認識する。
よって、効果は、画素を取り込む行の決定法において、方程式の解を反復的に求めるNEWTON法に類似した方法で、行間を徐々に狭めていく方法を採用しているので、スタートコードを大域的にしかも高速に検出することができることである。
【0207】
(11) 前記第1項において、読み取り手段は、当該バーコードの種類によって定められる所定パターンを少なくとも2箇所検出し、バーコードラベルの傾きを求め、既に検出されているパターンとは異なる当該バーコードの種類によって定められる所定パターンを検出し、両方のパターンからバーコードラベルの傾きを再定義する処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0208】
従って、当該バーコードの種類によって定められる所定パターンを少なくとも2箇所検出し、バーコードラベルの傾きを求め、既に検出されているパターンとは異なる当該バーコードの種類によって定められる所定パターンを検出し、両方のパターンからバーコードラベルの傾きを再定義する処理操作を含み、バーコード情報を読み取る。
【0209】
よって、効果は、スタートコードを検出した後にバーコードラベルのインディケータ情報から各コード位置を推定し、ストップコードに近い位置からストップコードを検出して、スタートコードとストップコード両方からバーコードラベルの傾きを再定義しているので、より正確な傾きを求めることができ、読み取りの信頼性を上げることができる。
【0210】
(12) 前記第1項において、読み取り手段は、バーコードラベルの1隅が欠損していた場合に、当該バーコードの種類によって定められる所定パターンの1つのみの情報から求めたバーコードラベルの傾きを参考に傾きを再定義する処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0211】
従って、バーコードラベルの1隅が欠損していた場合に、当該バーコードの種類によって定められる所定パターンの1つのみの情報から求めたバーコードラベルの傾きを参考に傾きを再定義する処理操作を含み、バーコード情報を読み取る。
【0212】
前記(12)項と同様の効果が得られる。
(13) 前記第2項において、認識手段は、記憶手段の2次元像を縦に3等分し、バーコードラベルの大きさにより決まる一番上のエリアの任意の行と一番下のエリアの任意の行で当該バーコードの種類によって定められる所定パターンを検出できず、なおかつ中心のエリアの任意の行で当該バーコードの種類によって定められる所定パターンを検出した場合にバーコードラベルが読み取り可能な位置に存在すると判断する処理操作を含み、バーコードラベルの存在の有無を認識するシンボル情報読取装置。
【0213】
従って、記憶手段の2次元像を縦に3等分し、バーコードラベルの大きさにより決まる一番上のエリアの任意の行と一番下のエリアの任意の行で当該バーコードの種類によって定められる所定パターンを検出できず、なおかつ中心のエリアの任意の行で当該バーコードの種類によって定められる所定パターンを検出した場合にバーコードラベルが読み取り可能な位置に存在すると判断する処理操作を含み、バーコードラベルの存在の有無を認識する。
【0214】
よって効果は、移動しているバーコードラベルを読み取る際に、バーコードラベルが完全に画像内に入っている場合にのみ読取処理に進ようにしたので、画像からはみ出しているバーコードを読みに行くようなことはなく、高速に読取が行なえて、尚且つ信頼性を上げることができることである。
【0215】
(14) 前記第10項において、位置認識手段は、最初に記憶手段の2次元像の中心の行を選択し、その次には2次元像の上半分の中心と下半分の中心の行を選択し、以下同様に分割された画像の中心の行を順次選択する処理操作を含み、当該バーコードの種類によって定められる所定パターンの位置を認識するシンボル情報読取装置。
【0216】
従って、最初に記憶手段の2次元像の中心の行を選択し、その次には2次元像の上半分の中心と下半分の中心の行を選択し、以下同様に分割された画像の中心の行を順次選択する処理操作を含み、当該バーコードの種類によって定められる所定パターンの位置を認識する。
【0217】
前記(10)項と同様の効果が得られる。
(15) 前記第12項において、読み取り手段は、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きからバーコードラベルの傾きを求める処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0218】
従って、前記第12項において、読み取り手段は、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きからバーコードラベルの傾きを求める処理操作を含み、バーコード情報を読み取る。
【0219】
(16) 前記第12項において、読み取り手段は、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きの差が予め定められているしきい値以上であれば、当該バーコードの種類によって定められる所定パターンを少なくとも2箇所検出して求めた傾きに近い値をバーコードラベルの傾きとする処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0220】
従って、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きの差が予め定められているしきい値以上であれば、当該バーコードの種類によって定められる所定パターンを少なくとも2箇所検出して求めた傾きに近い値をバーコードの傾きとする処理操作を含み、バーコード情報を読み取る。
【0221】
前記(10)項と同様の効果が得られる。
(17) 前記第12項において、読み取り手段は、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きの差が予め定められているしきい値未満であれば、2つの傾きの平均値をバーコードラベルの傾きとする処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0222】
従って、記憶手段の2次元バーコードラベル像の4隅の内の上の2隅からバーコードラベルの傾きを求め、次に4隅の内の下の2隅からバーコードラベルの傾きを求め、2つの傾きの差が予め定められているしきい値未満であれば、2つの傾きの平均値をバーコードラベルの傾きとする処理操作を含み、バーコード情報を読み取る。
【0223】
(18) 前記第6項において、読み取り手段は、再度読取処理に行くときに前フィールド画面のバーコードラベルの位置情報を用いる処理操作を含み、バーコード情報を読み取るシンボル情報読取装置。
【0224】
従って、再度読取処理に行くときに前フィールド画面のバーコードラベルの位置情報を用いる処理操作を含み、バーコード情報を読み取る。
よって、効果は、再度読取処理に行くときに前フィールド画面のバーコードラベルの位置情報を用いることが出来るので、再度ラベル検出をする必要はなく、バーコード情報の高速な読み取りが実現できることである。新たなバーコードラベル位置はラベルの速度と撮像装置の走査速度から計算することが出来る。また、バーコードラベルの速度が撮像装置の走査速度に比べ、十分無視できる場合にはそのまま前フィールド画面のバーコードラベルの位置情報を用いることができる。
【0225】
【発明の効果】
以上詳述したように本発明によれば、移動している2次元バーコードのバーコードシンボル情報を高速に確実に読取るシンボル情報読り取装置を提供することができる。
【図面の簡単な説明】
【図1】第1実施例としてのシンボル情報読取り装置の概略的な構成を示す図である。
【図2】スタックドバーコードの一例として、PDF−417のラベル構造を示す図である。
【図3】仮想的にフレームメモリの画素配列にPDF−417のラベル画像を投影した模式図を示す図である。
【図4】データ処理装置におけるラベル検出、ラベル情報読出し及び復号について説明するためのフローチャートである。
【図5】フィールド画面のみを取り込むことを説明するための図である。
【図6】画像取り込みルーチンについて説明するためのフローチャートである。
【図7】2つのフィールド画面(偶数成分と奇数成分)を取り込むことを説明するための図である。
【図8】4画素を加算し1つの画素にすることを説明するための図である。
【図9】バーコードラベル検出を説明するためのフローチャートである。
【図10】バーコードラベル検出を説明するための投影像を示す図である。
【図11】フレームメモリ上に定義されるバーコードラベルの傾きを説明するための図である。
【図12】バーコードラベル画面内検出を説明するためのフローチャートである。
【図13】バーコードラベル画面内検出を説明するためのバーコードラベル投影像を示す図である。
【図14】スキャン方法を説明するためのフローチャートである。
【図15】スキャン方法を説明するためのバーコードラベル投影像を示す図である。
【図16】スタートコード検出を説明するためのフローチャートである。
【図17】幅情報への変換方法を説明するためのフローチャートの前半部である。
【図18】幅情報への変換方法を説明するためのフローチャートの後半部である。
【図19】ピーク値の選択について説明するための図である。
【図20】ピーク間距離の算出方法について説明するための図である。
【図21】正規化について説明するためのフローチャートである。
【図22】Y座標の最大値最小値の検出について説明するためのフローチャートである。
【図23】ラベルの範囲の検出について説明するためのフローチャートである。
【図24】ラベルの傾きの検出について説明するためのフローチャートである。
【図25】閾値決定について説明するためのフローチャートである。
【図26】図26(a)は、閾値算出ラインについて説明するための図、図26(b)はスタートコードの微分波形を示す図である。
【図27】インディケータ情報決定について説明するためのフローチャートである。
【図28】インディケータ情報決定についてフレームメモリへのバーコードラベル投影像を示す図である。
【図29】バーコードラベルの傾きの再定義について説明するためのフローチャートである。
【図30】バーコードラベルの傾きの再定義について説明するためのバーコードラベル投影像を示す図である。
【図31】ストップコード検出について説明するためのフローチャートである。
【図32】バーコードラベルの範囲検出について説明するためのフローチャートである。
【図33】バーコードラベルの傾き再計算について説明するためのフローチャートである。
【図34】バーコードラベルの欠損について説明するための図である。
【図35】バーコードラベルの始点、終点列の算出について説明するためのバーコードラベル投影像を示す図である。
【図36】スキャン方程式決定について説明するためのフローチャートである。
【図37】埋め込チェックについて説明するためのフローチャートである。
【図38】埋め込チェックについて説明するためのバーコードラベル投影像を示す図である。
【図39】ROW検出について説明するためのフローチャートである。
【図40】ROW番号検出について説明するためのフローチャートである。
【図41】最適スキャンについて説明するためのフローチャートである。
【図42】最適スキャンについて説明するためのフレームメモリへのバーコードラベル投影像を示す図である。
【図43】インテリジェントスキャンについて説明するためのフローチャートである。
【図44】幅情報への変換方法を説明するためのフローチャートの前半部である。
【図45】幅情報への変換方法を説明するためのフローチャートの後半部である。
【符号の説明】
1…物品、2…バーコードラベル、3…搬送系、4…撮像光学系、5…2次元撮像部、6…フレームメモリ、7…データ処理装置、8…ラベル検出部、9…読取り部、10…デコード判定部、11…復号部、12…メモリ、13…制御部、14…位置検出部、15…傾き検出部、16…ホスト装置。
[0001]
[Industrial applications]
The present invention relates to a symbol information reading device that reads symbol information such as a barcode.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, there is a symbol called a barcode symbol which is printed on an article or the like, or printed on a tag or the like attached thereto, and indicates information on the article. This bar code symbol is used in the popular point-of-sale (POS) system and has become widely known.
[0003]
The bar code symbol is formed by combining bars and spaces having different widths in parallel to form a bar code character composed of one pattern. If necessary, there is a symbol in which necessary character groups including a check digit are arranged in parallel, and a characteristic predetermined pattern such as a start / stop character is arranged before and after.
[0004]
Barcodes used for general consumer goods are standardized as JAN (Japan Article Number). Another application of the barcode is a physical distribution symbol. This distribution symbol is obtained by adding a one-digit or two-digit distribution identification code before the JAN code.
[0005]
Each of the above-mentioned barcode symbols is called a one-dimensional barcode, and the amount of information that these code systems can have is about several tens of bytes, which is insufficient for actual use. Met.
[0006]
A symbol system called a two-dimensional barcode having a different structure has been proposed in accordance with such a demand for the information amount of the barcode.
According to these symbol systems, each of them has a feature that can encode much more information than a one-dimensional barcode. These systems are called stacked barcodes, and are a method of increasing the amount of information by stacking one-dimensional barcodes in the bar direction. As a representative of the stacked bar code, there is a code system called PDF-417.
[0007]
Conventionally, as a symbol information reader for reading the stacked barcode, for example, a laser scanning reader as disclosed in Japanese Patent Application Laid-Open No. 2-268382 is known. In this reader, a predetermined bar code is read by projecting a laser beam two-dimensionally and scanning, and symbol information is decoded.
[0008]
Also, Japanese Patent Application Laid-Open No. 2-268383 discloses an apparatus for capturing a barcode with a two-dimensional imaging device, loading the barcode image into a memory, and decoding barcode symbol information based on this data. I have.
[0009]
Further, there is an increasing demand for using such a barcode as a data carrier in FA (Factory Automation). This is for recognizing a product name, a destination, and the like of a distributed product while the distributed product is moving on a belt conveyor or the like.
[0010]
Conventionally, an RF tag or the like is generally used as a data carrier, but the tag is relatively expensive. If this tag can be substituted with a barcode, a low-cost data carrier is realized.
[0011]
As a conventional information reading apparatus for a moving article, Japanese Patent Application Laid-Open No. 56-118177 describes an optical inspection apparatus that performs a predetermined inspection based on a video signal obtained by scanning an image of a moving object. A circuit is disclosed for detecting, from a video signal, that an object has passed through the inspection field of view.
[0012]
[Problems to be solved by the invention]
However, as a problem of the above-mentioned Japanese Patent Application Laid-Open No. 56-118177, since the presence of the object is recognized from the width data of the video signal, the one-dimensional barcode such as JAN can be recognized. In a two-dimensional stacked barcode such as PDF417, even when the barcode label is not completely within the inspection field of view, the incomplete barcode label may be recognized and read processing may be performed. In such a case, barcode information cannot be read, resulting in a decrease in reading reliability and reading speed.
[0013]
Further, in order to read the information of the two-dimensional stacked bar code attached to the moving article, when the image is captured using a frame image using an interlaced image sensor, the image moves from the first read position to the next read position. As a result, there is a problem that the field components are shifted when two field images are combined.
Accordingly, it is an object of the present invention to provide a symbol information reading device that reads barcode symbol information of a moving two-dimensional barcode at high speed and with certainty.
[0014]
[Means for Solving the Problems]
In order to achieve the above object, the present invention provides an image pickup means for picking up a barcode consisting of a bar and a space and representing arbitrary information as a pattern as a two-dimensional image, and temporarily storing the two-dimensional images sequentially obtained by the image pickup means. Storage means for temporarily storing, a transfer means for transferring a two-dimensional image from the imaging means to the storage means, and sequentially reading out the two-dimensional images stored in the storage means, for the presence or absence of a barcode symbol within the imaging range. Recognition means for recognizing a bar code, a position detection means for detecting an existing position and a tilt of the bar code recognized by the recognition means within the imaging range, and detecting a scanning direction of the bar code; and a detection means for detecting the bar code scanning direction. Reading means for sequentially reading the barcode information from the two-dimensional barcode image in accordance with the scanning direction obtained, and reading the barcode information from the reading means. It is composed of a decoding means for decoding the informationThe transfer means compresses the two-dimensional image picked up by the image pickup means, transfers one scan line of a field component of the two-dimensional image picked up by the image pickup means, and then empties one line of the storage means Further including transferring a scan line, repeating the process until one field of image information is transferred, and copying the image information of one line above or below that line to a vacant line after completion, ForwardProvided is a symbol information reading device.
[0015]
The transfer unit compresses the two-dimensional image captured by the imaging unit., Storing only one field component of the captured two-dimensional image in the storage meansProvided is a symbol information reading device for transferring.OrThe transfer means,The two field components of the captured two-dimensional image are separately transferred to the storage unit. Alternatively, the transfer unit compresses the two-dimensional image picked up by the image pickup unit, transfers one scan line of the field component of the two-dimensional image picked up by the image pickup unit, and then transfers one line of the storage unit. Includes a processing operation to transfer the scan line after leaving it and repeat it until the image information for one field is transferred, and to copy the image information of one line above or below that line to the vacant line after completion. ,Forward.
[0016]
[Action]
The symbol information reading device configured as described above captures a moving two-dimensional barcode as a two-dimensional image, performs appropriate processing such as predetermined compression on the obtained two-dimensional image, and temporarily stores it. Then, the captured image is transferred to the storage unit, and after automatically recognizing the presence or absence of the barcode symbol, recognizing the position of the barcode symbol, sequentially reading the barcode information, and decoding the barcode information into the original information. I do.
[0017]
【Example】
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 shows a schematic configuration of a symbol information reading apparatus according to a first embodiment, which will be described. This symbol information reading device is a configuration example for reading symbol information of a barcode symbol attached to a moving article or the like. Here, in the present embodiment, the symbol information is information on an article as an example, and is assumed to be, for example, an article name, a destination, and the like. Of course, the symbol information differs depending on what is used.
[0018]
This symbol information reading apparatus includes a stacked barcode label (hereinafter, referred to as a barcode label) 2 in, for example, a PDF-417 format, which is affixed to an article 1 or the like moved by a transport system 3 such as a belt conveyor. An imaging optical system 4 for optically forming the label 2, a two-dimensional imaging unit 5 for reading the formed barcode label 2 on a photoelectric conversion surface, and temporarily storing the read label image data (video signal). And a data processing device 7 for decoding the label image data into the original symbol information. A host device 16 such as a microcomputer for processing symbol information is provided outside. Further, an image transfer unit 17 that performs image processing such as image compression on the label image data (frame image) read by the two-dimensional imaging unit 5 and stores the processed image data in the frame memory 6 may be provided.
[0019]
The data processing device 7 includes a label detection unit 8 that detects whether the label image data stored in the frame memory 6 is readable in the imaging range of the imaging optical system 4 and a bar code label 2. 2 (label image data) for reading as label information, a decoding determining unit 10 for determining whether the read label information can be decoded, and a label information determined to be decodable as original symbol information. , A memory (including various registers for storing various constants and variables) 12, and a control unit 13 for controlling these components.
[0020]
The imaging optical system 4 and the two-dimensional imaging unit 5 are composed of, for example, a CCD camera.
The label detecting unit 8 determines whether the label image data stored in the frame memory 6 falls within the photographing range of the photographing optical system 4, that is, the position where the barcode label 2 photographed in the photographing range has no missing portion. The barcode label 2 is composed of a position detection unit 14 for detecting the barcode label 2 and a tilt detection unit 15 for detecting the degree of tilt of the barcode label 2.
[0021]
The data processing unit 7 can be replaced with, for example, a personal computer including a CPU and a memory.
Next, the above-described stacked barcode will be described.
[0022]
FIG. 2 shows a label structure of PDF-417 as an example of a stacked barcode. The bar code label 2 includes a label portion 21 which is a region of an information component to be decoded, which is composed of a bar code character group formed by a combination of a bar and a space, and a start / stop character which is arranged before and after the label portion 21. It has a code 22 and a stop code 23. One code is made up of four bars and spaces except for the stop code 23. The start and stop codes 22, 23 start from large bars 22A, 23A called "big bars".
[0023]
The label portion 21 is composed of a code called a row indicator 21A adjacent to the start code 22 and the stop code 23, and a label matrix including a plurality of data columns 21B in which actual data sandwiched between the codes is described. 21C. The row indicator 21A describes the size, security level, and the like of the label in the row and column directions. Therefore, by decoding the information of the row indicator, the information size of the label, the number of recoverable codes, and the like can be determined.
[0024]
FIG. 2 shows a barcode label having a 4 × 2 label matrix.
With reference to the flowchart shown in FIG. 4, label detection, label information reading, and decoding in the data processing device 7 will be described. FIG. 3 is a schematic diagram in which a label image of PDF-417 as described above is virtually projected on the pixel array of the frame memory 6.
[0025]
First, various parameters such as a frame memory, a threshold value, and various global variables are initialized (step S1). Next, a label image data (video signal) is fetched into the frame memory 6 by calling an image fetching routine described later (step S2). Next, a label detection routine, which will be described later, is called, and it is checked whether or not a barcode label exists using the fetched label image data. Further, if a barcode label exists, label image data is detected ( Step S3).
[0026]
Then, the result of the label detection processing in step S3 is determined (step S4). If there is no label (NO), the process returns to step S1, and the image capturing processing is performed again.
[0027]
Next, if a label exists (YES), a threshold determination routine described later is called, and processing is performed in an embedding check in step S11 and an optimal scan routine in step S12 and an intelligent scan routine in step S15 described later. A threshold (variable THRESHOLD) used for a process for extracting width information between edges from target line data is obtained (step S5).
[0028]
Next, an indicator information determination routine is called, the row indicator 21A of the label 2 is read, and the label size and the like are determined (step S6).
Then, it is determined whether or not the label size or the like has been determined in the determination routine of step S6 (step S7). If the label size has not been determined (NO), the process returns to step S1, and the image capturing again. Perform processing. On the other hand, if the label size or the like is determined (YES), a tilt redefinition routine described later is called to obtain a more accurate label tilt (step S8).
[0029]
Next, a scan equation determination routine to be described later is called, and various variables for scanning the entire surface of the label 2 are defined (step S9). Next, an embedding check routine to be described later is called to estimate the position of each codeword, and further, it is checked whether or not the position of each codeword is within the screen (step S10).
[0030]
Then, in step S10, it is determined whether the number of codes estimated to be unreadable exceeds a recoverable number (step S11). If it exceeds, it is determined that decoding is impossible (NO), and the step is repeated. The process proceeds to S1, and the image capturing process is performed again. On the other hand, if it is lower, the decoding is enabled (YES), the optimum scan routine described later is called, and the label is scanned over the entire surface at the optimum interval using the various variables defined in step S9, and the label information is read. Is read (step S12). Here, the optimal scan means a scan at an optimal interval so that the amount of calculation is the least and all label information can be determined.
[0031]
Then, it is determined whether or not the information read by the optimal scan in step S12 can be decoded (step S13). If the information can be decoded (YES), the process proceeds to step S16 to perform a decoding process. However, if decoding is not possible (NO), an intelligent scan routine to be described later is called to scan the code position that could not be read in step S12 using the various variables defined in step S10, and label information is read. Is read (step S14).
[0032]
Next, it is determined whether or not the information read in step S14 is decodable (step S15). If the information is decodable (YES) and if the information read in step S12 is decodable, a decoding process is performed ( Step S16). After the completion of the decoding process, the process returns to step S1 to read a new barcode label.
[0033]
However, if the decoding is impossible in step S16 (NO), the process returns to step S1 to capture the image.
In the decoding process in step S16, the read information is decoded by the optimum scan routine and the intelligent scan routine, and the decoded symbol information is output to the host device 14.
[0034]
Next, various processing routines in the flowchart of FIG. 4 will be described in detail below.
First, the image capturing routine called in step S2 shown in FIG. 4 will be described with reference to the diagram that captures only the field screen shown in FIG. 5 and the flowchart shown in FIG.
[0035]
The image capturing routine includes a process of transferring label image data (video signal) captured by the two-dimensional imaging unit 5 and temporarily storing the label image data in the frame memory 6.
[0036]
When an interlaced two-dimensional imaging unit 5 is used to read a barcode label attached to a moving article, barcode information cannot usually be read from the frame screen. That is, as described in the related art, the interlaced two-dimensional imaging device 5 combines two field screens (an odd component and an even component) for scanning an image while skipping one line at a time, thereby forming one frame screen. However, since the barcode label to be imaged is constantly moving, there is a positional shift between the first scan of the field image and the second scan of the field image. This is because if two field images are combined, the barcode label image will be misaligned.
[0037]
Therefore, in this embodiment, when the moving barcode label is read by using the interlaced two-dimensional imaging device 5, image information of only the field screen is transferred and taken in.
[0038]
In the image capturing routine, one (even number component or odd number component) field screen is transferred and captured (step S21). In this case, the field image is taken into the frame memory 6 without leaving a line, and the contents of the frame memory 6 at that time are as shown in FIG. In FIG. 5, the field image may be either an odd component or an even component. After this processing ends, the process returns to the main flowchart (FIG. 4).
[0039]
However, in this case, as shown in FIG. 5, one field image is compressed in the vertical direction, so that the height per line of the barcode label is reduced, and the reading conditions are stricter than the frame image. Become. Therefore, this method can be used when the ratio of the barcode label image to the target image is large and the height of one line of the barcode label is sufficient.
[0040]
Further, when the ratio of the barcode label image to the target image is small and the height of one line of the barcode label is not sufficient, various methods can be considered.
As one of them, first, two field screens (even component and odd component) are both separately transferred and captured. In this case, only the odd-numbered components are fetched into the frame memory 6 without leaving any rows, and then only the even-numbered components are fetched without leaving any rows. The contents of the frame memory 6 at that time are as shown in FIG. However, in FIG. 7, it does not matter which of the odd component and the even component is on the top.
[0041]
Here, the reason for transferring both the odd component and the even component is that two field images that originally imaged the same object are considered as different images, and if the upper image in FIG. 7 cannot be read, the lower image must be read. This is because reading can increase the reliability of reading.
[0042]
In this case, in the flowchart of FIG. 4, if the first determination in step S15 is (NO), the optimum scan in step S12 is tried again on the lower screen in FIG. Here, if the speed of the moving barcode label is known, the moving speed of the barcode label is added to the position information A, B, C, and D of the barcode label on the upper screen in FIG. By considering the scanning speed, the bar code label positions A ', B', C ', and D' on the lower screen of FIG. 7 can be calculated, so that it is not necessary to call the bar code label detection routine again. .
[0043]
If the moving speed of the barcode label is sufficiently negligible with respect to the scanning speed, the position information of the barcode label on the upper screen in FIG. 7 can be used as it is.
[0044]
There is also a method in which one field image is taken into the frame memory 6 at intervals of one line, and the contents of the frame memory of a line above the one line are copied to an empty line to improve the reliability of reading. . In this method, the copying can be easily realized by hardware, so that the bar code label reading speed is not lost at all.
[0045]
When the height of one line of the barcode label is sufficient, as shown in FIG. 8, an arbitrary number of pixels are added to all pieces of pixel information to make one pixel and stored in the frame memory 6. There is a way. This can also be easily realized by hardware, and has the effect of suppressing noise. FIG. 8 shows an example in which a total of four pixels in two rows and two columns are added to form one pixel.
[0046]
When the non-interlaced two-dimensional imaging device 5 is used, step S21 is to capture a frame image.
Next, the barcode label detection routine called in step S3 will be described with reference to the flowchart shown in FIG. 9 and the barcode label projection image shown in FIG. The bar code label detection routine detects the presence or absence of a bar code label, and detects the position information of the bar code label, that is, the extraction range (for extracting image data from the frame memory 6 in parallel with the bar code label). It includes two types of barcode label detection processing, namely, the variables STARTTOP and STOPBOTTOM) and obtaining the inclination of the barcode label (variable SLOPE). Here, the value of the variable STARTTOP indicates the top coordinate of the barcode label, and the content of the variable STOPBOTTOM indicates the bottom coordinate of the barcode label. The content of the variable SLOPE indicates the inclination of the barcode label.
[0047]
In the barcode label detection routine, first, a barcode label in-screen detection routine described later is called to detect a barcode label from the screen (label image data) stored in the frame memory 6 (step S31). It is determined whether or not the detected barcode label is completely on the screen (step S32). If it is not on the screen (NO), the process returns with information indicating that there is no barcode label. However, if it is within the screen (YES), a scan and detection routine to be described later is called to detect whether or not a start code exists in the label image data of the frame memory 6 (step S33). That is, the coordinates e and g shown in FIG. 10 are detected. When the start code is detected and determined by this routine, coordinate variables e and g on the frame memory 6 shown in FIG. 11 are defined. Here, the coordinate variable e is the coordinate of the smallest Y coordinate among several coordinates where the start code 22 is detected, and the coordinate variable e is the coordinate of the largest Y coordinate among some coordinates where the start code 22 is detected. Are respectively shown.
[0048]
Next, it is determined whether or not both coordinate variables e and g are defined (step S34). If not defined (NO), it is determined that there is no barcode label, and the process returns to the main flowchart. That is, the process returns with information indicating that there is no barcode label. As described above, the presence or absence of the barcode label is detected.
[0049]
Next, detection of position information of the barcode label, that is, calculation of an extraction range (variables STARTTOP and STARTBOTTOM) and an inclination of the barcode label (variable SLOPE) for extracting image data from the frame memory 6 in parallel with the barcode label. Is performed.
[0050]
That is, when it is determined in step S34 that both the coordinate variables e and g are defined (YES), the detection of the position information of the barcode label, that is, the image data is parallel to the barcode label is detected. Calculation of an extraction range (variables STARTTOP and STARTBOTTOM) for extraction from the frame memory 6 (step S35) and calculation of a barcode label inclination (variable SLOPE) (step S36) are performed. Then, the process returns with the information having the barcode label.
[0051]
Next, FIG. 12 shows the bar code label in-screen detection routine called in step S31 of the above-described bar code label detection routine and the determination of whether or not the bar code label in the screen is completely included in step S32. The flowchart shown and the detection in the barcode label screen shown in FIG. 13 will be described.
[0052]
This bar code label in-screen detection routine is for confirming whether or not the moving bar code label is completely contained in the frame memory 6, as described above. Even if the bar code label does not completely enter the frame memory 6, it is not possible to estimate the position and read the bar code symbol information depending on the number of codes outside the screen by using the intelligent scan described later. Although it is possible, the reading speed is reduced correspondingly, so such a routine is provided to correspond to the moving barcode label. Here, it is assumed that the barcode label is moving in the vertical direction with respect to the image.
[0053]
First, the start code 22 or the stop code 23 is detected in the upper line of the image (step S41). The details of this detection method will be described later. Next, it is determined whether or not detection has been performed (step S42). Here, when it is determined that either of them is detected (YES), it means that the upper part of the barcode label is not included in the image as shown in FIG. Therefore, in such a case, the process returns with the information that the barcode label is not on the screen. If not detected (NO), the start code 22 or the stop code 23 is detected in the lower line of the image (step S43).
[0054]
Next, it is determined whether or not detection has been performed (step S44). As described above, if it is determined that either of them is detected (YES), this means that the lower part of the bar code label is not included in the image, and information indicating that the bar code label is not on the screen. And return.
[0055]
If not detected (NO), the start code 22 or the stop code 23 is detected in the center line of the image (step S45). Next, it is determined whether or not a bar code label is detected (step S46). If no bar code label is detected (NO), the process returns with information indicating that the bar code label is not in the screen. However, if it is detected (YES), the process returns with the information that the barcode label is on the screen.
[0056]
Next, the scan and detection routine called in step S33 in the above-described barcode label detection routine will be described with reference to a flowchart shown in FIG. 14 and a diagram illustrating a scan method shown in FIG.
[0057]
This scanning and detection routine detects both the coordinate variables e and g as described above.
That is, first, a variable i used for counting the number of loops and a variable start for storing the number of detected start codes. num is initialized (step S51). Next, a row number n to be scanned and a scan interval nn are determined (step S52). Here row num is the number of rows of the target image. As shown in FIG. 15, the line numbers scanned in this subroutine employ a method of gradually narrowing the search width. This is similar to the NEWTON method that iteratively solves an equation.
[0058]
By using such a method, the start code 22 can be detected at high speed regardless of the position of the barcode label image in the frame memory. Next, j is initialized to perform 2 i scans for one loop i (step S53). Then, it is determined whether or not j is "0" (step S54). Here, if j is not 0, that is, if the proposition of step S54 is true (NO), a value obtained by doubling the scan interval nn obtained in step S52 is added to the row number n (step S55). If j is "0", that is, if the proposition of step S54 is false (YEA), step S55 is skipped, the process proceeds to step S56, and the image data of the n-th row is fetched (step S56).
[0059]
Next, the start code 22 is detected from the fetched image data (step S57). Next, it is determined whether or not the start code 22 has been detected (step S58). If the start code 22 does not exist (NO), the process proceeds to step S62. If the start code 22 exists (YES), the detected coordinates are stored in the coordinate array start. pos (step S59). And the variable start One is added to num (step S60).
[0060]
Next, the variable start It is determined whether or not num exceeds a predetermined number (step S61). Here, if it has exceeded (YES), the process proceeds to step S66. However, if not exceeded (NO), the variable j is incremented (step S62), and it is determined whether j is smaller than 2 to the power of i (step S63). If j is smaller (YES), the process returns to step S54. However, if j is not smaller than 2 to the power of i (NO), the variable i is incremented (step S64), and it is determined whether or not i is smaller than a specified constant Loop (step S65). If i is smaller (YES), the process returns to step S52. However, if i is not smaller than the specified constant Loop (NO), the process returns with the bar code label non-detection information. Therefore, in this subroutine, a maximum of (2 to the power of Loop) -1 scans are performed.
[0061]
Also, in step S61, start If num exceeds the specified number, a routine for calculating the maximum and minimum values of the Y coordinate, which will be described later, is called (step S66). Then, the process returns with the barcode label detection information. As described above, when a predetermined number or more of the start codes can be detected, the processing can be speeded up by returning the control to the upper routine even during the loop processing.
[0062]
Next, the start code detection routine called in step S57 in the scan and detection routine in FIG. 14 will be described with reference to the flowchart shown in FIG.
[0063]
First, the fetched image data is converted into width information (step S71). Next, the converted width information is normalized (step S72), and matching is performed (step S73). Then, it is determined whether or not the width information matches the start code (step S74). If it is determined that the width is the start code (YES), the process returns with the information indicating that the start code is present. If it is not a start code (NO), the process returns with information indicating that there is no start code.
[0064]
Next, a routine for converting into width information called in step S71 will be described with reference to a series of flowcharts shown in FIGS. This routine finds the width between the bar and the space of the bar code label, finds the boundary between the bar and the space using the differential signal, and then finds the peak of the data by approximating a quadratic curve. It is. Then, the width is obtained by sequentially obtaining peaks and obtaining the difference between the positions.
[0065]
First, the capture buffer array scan captured by the upper routine The line is an array of line data, and the value taken in and stored in the variable num is defined as the number of data (step S81). Next, the result of decrementing the value of the variable num is stored in the position indicator counter i, and the variable j is initialized to "0" (step S82).
[0066]
Then, the capture buffer array scan The fetch buffer array scan from the value of the i-th position (indicated by the position indicator counter i) of the line Subtract the value at the (i-1) th position of line, take in the solution, and retrieve the buffer array scan The line is reset to the i-th position (step S83). Thereafter, the position indicator counter i is decremented (step S84), and it is determined whether or not the result i is greater than "0" (step S85). If i is not greater than 0 (NO), the process returns to the step S83, that is, in steps S81 to S85, the line data is first differentiated. If the result i is larger than "0" (YES), the position indicator counter i is initialized to 2 (step S86).
[0067]
Then, the capture buffer array scan The value of the i-th position of line is larger than the value of the threshold variable THRESHOLD, and the capture buffer array scan line is larger than the value of the (i-1) th position of the line and the capture buffer array scan It is determined whether or not the value is equal to or more than the value of the (i + 1) th position of the line (step S87). If so (YES), the code index flag is set to UP (step S88). However, if not (NO), the procedure moves to the next step S89.
[0068]
Here, the capture buffer array scan The value of the i-th position of line is smaller than the value of the threshold variable THRESHOLD (-THRESHOLD) with a negative sign, and the capture buffer array scan line is smaller than the value of the (i-1) th position of the line and the capture buffer array scan It is determined whether or not the value is equal to or less than the value of the (i + 1) th position of the line (step S89). If so (YES), the code index flag is set to DOWN (step S90). Otherwise (NO), the procedure moves to the next step S91.
[0069]
Here, the position indicator counter i is incremented (step S91). It is determined whether i is smaller than a value obtained by subtracting 1 from the value of the variable num (step S92). If it is smaller (YES), the process returns to step S87. If it is not smaller (NO), the process returns to the routine of step 72.
[0070]
That is, in steps S87 to S92, the first peak exceeding the value of the threshold variable THRESHOLD, that is, the first peak in FIG. 19 is detected. If the sign of the detected peak is positive, the code index flag is set to UP, and the process proceeds to the next step S93. If the sign of the detected peak is negative, the code index flag is set to DOWN, and step S94 is performed. Move to If no peak is detected even after scanning the line data, the control is returned to a higher-level routine.
[0071]
If the code index flag is set in this way, then the value of the position indicator counter i is set to x1, and the fetch buffer array scan The value of the (i-1) th position of the line is y1, the capture buffer array scan The value of the i-th position of line is y2, the capture buffer array scan By setting the value of the (i + 1) th position of the line as y3, the detected peak position and data on both sides thereof are fitted with a quadratic curve (step S93). Then, a calculation of -0.5 (-y1-2x1y1 + 4x1y2 + y3-2x1y3) / y1-2y2 + y3 is performed to obtain the peak position of the quadratic curve, and this is stored in the variable lastpos (step S94).
[0072]
Thereafter, the value of the position indicator counter i is smaller than the value obtained by subtracting 2 from the value of the variable num, and the variable j is WIDTH. It is determined whether or not the variable j is smaller than NUM (step S95). If the variable j is not smaller (NO), the process returns to the upper routine.
[0073]
Where the variable j is WIDTH The proposition that it is smaller than NUM will be described. WIDTH NUM is a constant storing the number of widths to be obtained, and j is a variable storing the number of obtained peaks. Here, in order to detect the position of the start code 22, a condition that the start code 22 is always located on the left side of the frame memory 6 and a condition that there is no information other than the bar code label in the frame memory 6 If there is, the array scan It is not necessary to convert all the differential information stored in the line into width information.
[0074]
That is, since the minimum number of peaks required to detect eight pieces of width information is nine, the constant WIDTH This means that NUM should be larger than that. Normally, WIDTH NUM is determined by the SN ratio of the image. That is, if there is no information other than the bar code label in the frame memory 6, WIDTH NUM can be set to "9". Otherwise, WIDTH NUM must be a number greater than or equal to nine.
[0075]
For the reasons described above, the above proposition is included in the determination in step S95. When this proposition enters the judgment, the routine can be terminated without obtaining all the width information, so that the processing can be sped up. As will be described later, when it is desired to obtain all the width information from the differential information, it is only necessary to remove this proposition.
[0076]
If the proposition in step S95 is satisfied (YES), the position indicator counter i is incremented (step S96). The code index flag is DOWN, and the capture buffer array scan When the value of the i-th position of the line is larger than the value of the threshold variable THRESHOLD and the capture buffer array scan capture buffer array scan larger than the value of the (i-1) th position of line It is determined whether the value is equal to or greater than the value of the (i + 1) th position of the line (step S97). If all the terms hold (YES), the code index flag is set to UP (step S98).
[0077]
However, if all the terms do not hold in step S98 (NO), then the sign index flag is UP and the fetch buffer array scan The value of the i-th position of line is smaller than the value of the threshold variable THRESHOLD with a negative sign, and the capture buffer array scan capture buffer array scan smaller than the value at the (i-1) th position of line It is determined whether the value is equal to or less than the value of the (i + 1) th position of the line (step S99). If all the terms do not hold (NO), the process returns to step S95, and if all the terms hold (YES), the code index flag is set to DOWN (step S100).
[0078]
When the code index flag is reset in this way, the value of the position indicator counter i is set to x1, and the fetch buffer array scan The value of the (i-1) th position of the line is y1, the capture buffer array scan The value of the i-th position of line is y2, the capture buffer array scan By setting the value of the (i + 1) th position of the line as y3, the detected peak position and data on both sides thereof are fitted with a quadratic curve (step S101).
[0079]
Then, a calculation of -0.5 (-y1-2x1y1 + 4x1y2 + y3-2x1y3) / y1-2y2 + y3 is performed to obtain the peak position of the quadratic curve, and the obtained peak position is stored in a variable nowpos (step S102).
[0080]
As a result, as shown in FIG. 20, the previous peak position lastpos and the currently obtained peak position nowpos are obtained. Then, the peak-to-peak distance is obtained by taking the difference between the two peak positions thus obtained, and is stored in the position indicated by the variable j of the width information storage array variable width (step S103).
[0081]
Thereafter, the peak position variable lastpos is updated to the value of the peak position variable nowpos (step S104), the variable j is incremented (step S105), and the process proceeds to step S95.
[0082]
As described above, in steps S95 to S105, peaks are sequentially detected, and the distance between the peaks is stored in the width information storage array variable width. Here, the difference from the first peak detection in steps S87 to S92 is that, for example, when the current code index flag is DOWN, the next peak that cannot be found is a positive sign peak. is there.
[0083]
Next, the normalization routine called in step S82 in the above-described start code detection routine will be described with reference to the flowchart shown in FIG. First, "0" is substituted for the loop count variable i and the variable sum, and the initialization is performed (step S111). Next, an array width [i] storing the width information obtained by the conversion routine to the width information is added to the variable sum, and the sum is stored again in the sum (step S112).
[0084]
Next, the variable i is incremented (step S113). Next, it is determined whether or not the variable i is smaller than "8" (step S114). If the variable i is smaller than "8" (YES), the process returns to step S112. If the variable i is larger than "8" (NO), the process moves to the next step S115. Here, the reason that the variable i changes from “0” to “7” is that the code word of the PDF 417 is composed of a total of eight pieces of width information of four bars and four spaces. This is for normalizing the start code using all the width information.
[0085]
Next, "0" is substituted for the variable i again to initialize (step S115). Next, "17" is divided by the variable sum, and the value multiplied by the value stored in the i-th width [i] of the width information array is rounded to the nearest integer to the value (step S116). Here, round in FIG. 21 means rounding. Then, the variable i is incremented (step S117), and it is determined whether the variable i is smaller than "8" (step S118). If the variable i is smaller than "8" (YES), the process returns to the step S116, and if the variable i is larger than "8" (NO), the process returns to the upper routine.
[0086]
Next, the start code matching in step S73 in the start code detection routine shown in FIG. 16 as described above will be described.
Although any matching method may be used, a bar portion often becomes thicker than intended when printing a barcode label. If the bar portion is too thick, the decoding performance is significantly reduced. However, in such a case, the space portion becomes thinner as the bar becomes thicker. Therefore, it is better to adopt a method of matching the width information obtained by adding the bar thickness and the space thickness to the matching.
[0087]
Next, the routine for detecting the maximum and minimum values of the Y coordinate called in step S66 in the detection routine of FIG. 14 will be described with reference to the flowchart shown in FIG. The maximum / minimum value detection routine of the Y coordinate is a routine for finding the maximum and minimum Y coordinates among the coordinates of the start code detected by the specified number.
[0088]
First, the Start value stored in the 0th position of the array of the detected coordinates of the start code detected in step S57 (FIG. 14) is stored in the coordinate variable MAX and the value of the Y coordinate of MIN (MAXy and MINy). value of the Y coordinate of pos [0] (start pos [0] y) is substituted (step S121). Next, 1 is substituted for a variable i necessary for looping by the number of data (step S122).
[0089]
Next, the start stored at the i-th position in the array pos [i] Y coordinate value (start It is determined whether or not pos [i] y) is greater than MAXy (step S123). If it is larger than MAXy (YES), that is, if the proposition in step S123 is true, the i-th start of the coordinate array pos [i] is substituted for the coordinate variable MAX (step S124), and the process proceeds to step S127. However, if it is smaller than MAXy (NO), that is, if the proposition in step S123 is false, the process moves to step S125.
[0090]
Next, the start stored at the i-th position in the array pos [i] Y coordinate value (start It is determined whether or not pos [i] y) is smaller than MINy (step S125). If it is smaller than MINy (YES), that is, if the proposition in step S125 is true, the i-th start of the coordinate array pos [i] is substituted for the coordinate variable MIN (step S126), and the process proceeds to step S127. However, if it is larger than MINy (NO), that is, if the proposition in step S125 is false, the process moves to step S127.
[0091]
Next, the variable i is incremented (step S127). Next, the variable i is the start obtained in step S57. It is determined whether or not the variable i is larger than num (step S128). If the variable i is smaller (NO), that is, if the proposition in step S128 is false, the process proceeds to step S123. However, if the variable i is larger (YES), that is, if the proposition in step S128 is true, the coordinate variable MAX is stored in the coordinate g in FIG. 10 and the coordinate variable MIN is stored in the coordinate e in FIG. Step S129), and return to the upper routine of FIG.
[0092]
Next, the routine for determining the range of the label called in step S35 in the label detection routine of FIG. 9 as described above will be described with reference to the flowchart shown in FIG.
[0093]
First, an equation of a straight line parallel to the line segment e-g is defined, for example, an equation y = ax + b of the line segment e-g is obtained (step S131). Next, an intercept b is defined so that this straight line crosses the start big bar 22A (step S132). The structure of the start code 22 includes, for example, a start big bar 22A including eight bars, three pairs of white bars and black bars, and three white bars, for a total of 17 bars. It is assumed that the imaging result is N pixels. It is known that a straight line represented by the equation y = ax + b moves in parallel by changing the intercept b. Therefore, in order to obtain a straight line that crosses the big bar 22A, it is sufficient that the line segment e-g is set to an intercept b that is moved to the left by {(17−8 / 2) / 17} × N pixels. Become.
[0094]
When a straight line crossing the start big bar 22A is obtained in this way, the intersections of the straight line and the equations defining the screen are respectively set to A and A '(see FIG. 10) (step S133). ).
[0095]
Then, the data is sequentially viewed from the midpoint of the line AA ′ to the point A (step S134), and it is checked whether or not an edge exists (step S135). This check can be performed by, for example, an intensity comparison for observing a change in luminance, a differentiation method, a second differentiation method, or the like. If an edge is thus detected, the detected coordinates are stored in a coordinate variable i (step S136). That is, the detected coordinates are set to point i.
[0096]
Next, the data is viewed from the midpoint of the line AA 'to A' next (step S137), and it is checked whether an edge exists (step S138). When an edge is thus detected, the detected coordinates are stored in a coordinate variable m (step S139). That is, the detected coordinates are set to the point m.
[0097]
Then, a perpendicular is drawn from the point i indicated by the coordinate variable i to a straight line passing through the points e and g indicated by the coordinate variables e and g, and the coordinates of the intersection are stored in the coordinate variable a (step S140). That is, an equation of a straight line orthogonal to the line A-A 'passing through the point i is obtained, and an intersection of the equation and a straight line passing through the points e and g is obtained.
[0098]
Similarly, a perpendicular is drawn from the point m indicated by the coordinate variable m to a straight line passing through the points e and g indicated by the coordinate variables e and g, and the coordinates of the intersection are stored in the coordinate variable d (step S141). That is, an equation of a straight line orthogonal to the line A-A 'passing through the point m is obtained, an intersection of the equation and a straight line passing through the points e and g is obtained, and the intersection is defined as a point d.
[0099]
After the value of the coordinate variable a thus obtained is stored in the coordinate variable STARTTOP and the value of the coordinate variable d is stored in the coordinate variable STARTBOTTOM (step S142), the control is returned to the upper routine.
[0100]
Next, a routine for determining the inclination of the label called in step S36 in the above-described label detection routine will be described with reference to a flowchart shown in FIG. 24 and an explanatory diagram for obtaining the inclination of the label shown in FIG. I do.
[0101]
First, the value of the x coordinate of the coordinate variable STARTBOTTOM is divided by the value obtained by subtracting the value of the y coordinate of the coordinate variable STARTTOP from the value of the y coordinate of the coordinate variable STARTBOTTOM, and the value of the x coordinate of the coordinate variable STARTTOP is calculated as the coordinate. The value obtained by subtracting the value of the y coordinate of the coordinate variable STARTTOP from the value of the y coordinate of the variable STARTBOTTOM is divided, and the difference between these two quotients is stored in the slope variable Slope (step S151).
[0102]
Next, the result of multiplying the y coordinate of the coordinate variable STARTBOTTOM by the x coordinate of the coordinate variable STARTTOP is divided by the value obtained by subtracting the y coordinate value of the coordinate variable STARTTOP from the y coordinate value of the coordinate variable STARTBOTTOM, and The result of multiplying the x coordinate of the coordinate variable STARTBOTTOM by the y coordinate of the coordinate variable STARTTOP is divided by the value obtained by subtracting the value of the y coordinate of the coordinate variable STARTTOP from the value of the y coordinate of the coordinate variable STARTBOTTOM, and these two quotients are obtained. Is stored in the intercept variable intersect (step S152). In addition, the superscript of the asterisk * in the figure means the multiplication symbol x.
[0103]
Next, the threshold determination routine called in step S5 in FIG. 4 will be described with reference to the flowchart shown in FIG. 25 and the explanatory diagram for calculating the threshold shown in FIG.
[0104]
First, a value corresponding to the point e shown in FIG. 10 is substituted for the point p (step S161). Next, the line indicated by the y-coordinate value of the coordinate variable p, that is, the data of the data fetch line as shown in FIG. 26A is fetched from the frame memory 6 (step S162), and the end x-coordinate of the start code 22 is obtained. The x coordinate of the point q is set (step S163).
[0105]
Then, the data from the point p to the point q is differentiated (step S164). Thus, for example, in the case of the data capture line shown in FIG. 26A, a differentiated waveform of the start code 22 as shown in FIG. 26B is obtained. Then, the absolute value of the third peak of the differential data is set as a variable MAX (step S165).
[0106]
Here, the reason for looking at the third of the differential data is that, conceptually, it is desired to determine the threshold value where the contrast is lowest in the barcode area (that is, the edge has the lowest differential peak). The reason is that the third edge of the start or stop code where the space between the start code and the space is narrowest is selected. This enables stable decoding regardless of the label size or the lighting conditions of the label.
[0107]
Then, the value of the variable MAX obtained in this manner is converted into a constant THRESHOLD of the ratio to the peak. It divides by RATIO, and substitutes the result into a threshold variable THRESHOLD (step S166). That is, a threshold is temporarily obtained from the obtained data. Note that the variable THRESHOLD RATIO is a value indicating what percentage of the peak is selected as the threshold, and is usually set to “2” or “3”.
[0108]
Next, the value of the temporarily determined threshold value THRESHOLD is the minimum threshold value constant THRESHOLD. It is larger than SMALL (step S167) and the maximum threshold constant THRESHOLD It is determined whether it is smaller than BIG (step S168). That is, it is determined whether or not the temporarily determined threshold value is within a range that the threshold value can take. Constant THERESHOLD If it exceeds the maximum value indicated by SMALL (YES), the constant THRESHOLD The maximum value indicated by SMALL is substituted for the threshold variable THERESHOLD, that is, the threshold is set to the minimum value (step S169).
[0109]
Also, the variable THRESHOLD If less than the minimum value indicated by BIG (YES), THERESHOLD The minimum value represented by BIG is substituted for the threshold variable THRESHOLD, that is, the threshold is set to the maximum value (step S170).
[0110]
Next, the indicator information determination routine called in step S6 of FIG. 4 will be described with reference to the flowchart shown in FIG. 27 and the projection image onto the frame memory shown in FIG.
[0111]
First, the value of the top coordinate TOP of the label is stored in the coordinate variable WORK as a starting point of the reference coordinates for reading the row indicator information (step S171). Next, a straight line I passing through the coordinate variable WORK and having a slope represented by the slope variable Slope of the label is defined (step S172), and points W1 and W2 where the straight line I crosses the screen frame are defined (step S173). ).
[0112]
Then, the image data on the line segment W1-W2 is fetched (step S174), and the row indicator information contained therein is read (step S175).
Here, the reading of the row indicator information is performed, for example, as follows. That is, an edge is detected from the image data on the target line fetched in step S174, that is, a monochrome pixel value, and is converted into width information. Then, the start code 22 is detected from the width information, and since it is known that the code following the start code 22 is the row indicator 21A, it is read.
[0113]
Similarly, the stop code 23 is detected, and since the code immediately before the stop code 23 is also known to be the row indicator 21A, it is read. When the row indicator 21A is read in this way, it is compared with a bar code table (not shown), and the corresponding part is converted into a code, that is, information such as the number of rows, the number of columns, and a security level. Note that there are various methods for conversion to width information. For example, the conversion to width information can be performed by calling a conversion routine for width information as described later.
[0114]
Next, it is checked whether or not the row indicator information has been established (step S176). If it is determined (YES), the process proceeds to step S180. If not fixed (NO), the process moves to step S177. Here, "confirmed" means that the row indicator 21A is read several times and the reliability of the information is sufficiently increased. For example, if the information (the number of rows, the number of columns, and the security level) written in the row indicator 21A is read ten times, if the same information is obtained in all of the ten times, it is assumed that the information is determined.
[0115]
If the row indicator information is not determined in the determination in step S176 (NO), a predetermined increment L is added to the value of the y coordinate of the coordinate variable WORK. INC is added, and the result is substituted as the y coordinate value of a new coordinate variable WORK (step S177). Further, the value of the label slope variable Slope is multiplied by the value of the y coordinate of the coordinate variable WORK, the intercept variable intersect of the label is added to the result, and the result is substituted as the x coordinate value of the new coordinate variable WORK (step S178). Thus, the reference coordinates for the new scan are reset to the coordinate variables WORK.
[0116]
Then, it is determined whether or not the reset y-coordinate value of the coordinate variable WORK exceeds the y-coordinate value of the bottom coordinate variable BOTTOM of the label, that is, whether or not the label is within the label area (step S179). If it is, the process is repeated from the step S172. If it is out of the label area, the process returns to the upper routine with the undefined information of the matrix.
[0117]
On the other hand, if it is determined in step S176 that the row indicator 21A has been determined (YES), the number of recoverable data is calculated from the security level obtained from the row indicator information, and REST It is stored in NUM (step S180). Further, the number of rows of the label obtained from the row indicator information is equal to the row number variable ROW of the label. It is stored in NUMBER (step S181). Also, the number of label columns is extracted from the row indicator information, and the number of label column variables COLUMN It is stored in NUMBER (step S182). Thereafter, control is returned to a higher-level routine with information that the matrix has been defined.
[0118]
Next, the tilt redefinition routine called in step S8 in FIG. 4 will be described with reference to a flowchart shown in FIG. 29 and an explanatory diagram for redefining the tilt shown in FIG. Here, the reason for redefining the inclination will be described below.
[0119]
The inclination obtained from e and g in FIG. 10, that is, the inclination obtained from only the information of the start code 22, is not an accurate value due to problems such as print quality and CCD accuracy. Therefore, after the indicator information is determined in step S8, the stop code 23 is detected from a position close to the stop code 23, and the inclination is obtained from both the information of the start code 22 and the stop code 23. The value is determined. Obtaining a more accurate slope value before the optimum scan in step SC leads to a higher scan speed.
[0120]
First, the detection start point p is determined (step S191). p is the distance obtained by the above-mentioned indicator information determination routine, which divides a straight line I connecting the upper end point u and the lower end point v of the left end of the column of the right-hand indicator into four equal parts, and divides u from u by four equal parts It is a point that has advanced. Next, data between p and p 'is fetched (step S192). p 'is a point that advances from the point p in parallel with the x-axis and intersects a straight line of y = the number of columns.
[0121]
Next, a stop code detection routine to be described later is called (step S193). Then, it is determined whether or not a stop code has been detected (step S194). If the stop code has not been detected (NO), the process returns with information indicating that the slope has not been redefined. If detected (YES), the coordinates of the detected point are stored in f shown in FIG. 10, and f is defined (step S195).
[0122]
Next, the detection start point q is determined (step S196). This point q is obtained by dividing the straight line I connecting the upper end point u and the lower end point v of the left end of the column of the right row indicator obtained by the indicator information determination routine into four equal parts, and dividing the straight line from v into four equal parts. It is a point that has advanced the distance. Next, data between points q and q 'is fetched (step S197). The point q 'is a point which advances from the point q in parallel with the x-axis and intersects a straight line of y = the number of columns. Next, the stop code detection routine in step S193 is called to detect the stop code (step S198). Then, it is determined whether or not a stop code has been detected (step S199). If the stop code has not been detected (NO), the process returns with information indicating that the slope has not been redefined. If detected (YES), the coordinates of the detected point are stored in h shown in FIG. 10, and h is defined (step S200).
[0123]
Next, a label range detection routine, which will be described in detail later, is called (step S201), and the inclination is calculated (step S202). Then, the process returns with the information on redefining the inclination.
[0124]
The stop code detection routine called in steps S193 and S198 will be described with reference to the flowchart shown in FIG.
This routine is basically the same as the start code detection shown in FIG. 16, but differs from FIG. 16 in the matching part. This is because the start code 22 and the step code 23 of the PDF 417 have different width information. As for the matching method, as described above, a matching method that is not affected by the printing accuracy of the barcode label is desirable.
[0125]
Next, the label range detection routine called in step S201 of FIG. 29 will be described with reference to the flowchart shown in FIG.
First, an equation of a straight line parallel to the line segment fh is defined, for example, an equation y = ax + b of the line segment fh is obtained (step S221).
[0126]
Next, an intercept b is defined so that this straight line crosses the stop big bar 23A (step S222). The structure of the stop code 23 includes, for example, a stop big bar 23A including eight bars, three pairs of white bars and black bars, and three white bars, for a total of 17 bars. It is assumed that the imaging result is N pixels. It is known that a straight line represented by the equation y = ax + b moves in parallel by changing the intercept b.
[0127]
Therefore, in order to obtain a straight line that crosses the big bar 23A, it is sufficient that the line segment fh is set to an intercept b that is moved to the left by {(17−8 / 2) / 17} × N pixels. Become.
[0128]
When a straight line crossing the stop big bar 23A is obtained in this way, the intersections of the straight line and the equations defining the screen are respectively set to B and B '(see FIG. 10) (step S223).
[0129]
Then, the data is sequentially viewed from the middle point of the line BB 'to the point B (step S224), and it is checked whether or not an edge exists (step S225). This check can be performed by, for example, an intensity comparison for observing a change in luminance, a differentiation method, a second differentiation method, or the like. When an edge is detected in this way, the detected coordinates are stored in a coordinate variable j (step S226). That is, the detected coordinates are set to a point j.
[0130]
Next, the data is sequentially viewed from the middle point of the line BB 'to the point B' (step S227), and it is checked whether an edge exists (step S228). When an edge is detected in this way, the detected coordinates are stored in a coordinate variable k (step S229). That is, the detected coordinates are set to a point k.
[0131]
Then, a perpendicular is drawn from the point j indicated by the coordinate variable j to a straight line passing through the points f and h indicated by the coordinate variables f and h, and the coordinates of the intersection are stored in the coordinate variable b (step S230). That is, an equation of a straight line orthogonal to the line BB 'passing through the point j is obtained, an intersection of the equation and a straight line passing through the points f and h is obtained, and the intersection is defined as a point b.
[0132]
Similarly, a perpendicular line is drawn from the point k indicated by the coordinate variable k to a straight line passing through the points f and h indicated by the coordinate variables f and h, and the coordinates of the intersection are stored in the coordinate variable c (step S231). That is, an equation of a straight line orthogonal to the line BB 'passing through the point k is obtained, and an intersection of the equation and a straight line passing through the points f and h is obtained.
[0133]
Then, after storing the value of the coordinate variable b thus obtained in the coordinate variable STOPTOP and the value of the coordinate variable c in the coordinate variable STOPBOTTOM (step S232), the process returns to the upper routine of FIG.
[0134]
Next, the label inclination recalculation routine called in step S202 of FIG. 29 will be described with reference to the flowchart shown in FIG.
First, the value of the y-coordinate of the coordinate variable STOPTOP is divided by the value obtained by subtracting the value of the x-coordinate of the coordinate variable STARTTOP from the value of the x-coordinate of the coordinate variable STOPTOP. The x-coordinate value of the coordinate variable STARTTOP is divided by the value obtained by subtracting the x-coordinate value of the coordinate variable STARTTOP, and the difference between these two quotients is stored in the slope variable Slope1 (step S241).
[0135]
Next, the value of the y-coordinate of the coordinate variable STOPBOTTOM is divided by the value obtained by subtracting the value of the x-coordinate of the coordinate variable STARTBOTTOM from the value of the x-coordinate of the coordinate variable STOPBOTTOM, and the value of the y coordinate of the coordinate variable STARTBOTTOM is The value obtained by subtracting the value of the x-coordinate of the coordinate variable STARTBOTTOM from the value of the x-coordinate of the coordinate variable STOPBOTTOM is divided, and the difference between these two quotients is stored in the slope variable Slope2 (step S242).
[0136]
Next, it is determined whether or not the absolute value of the difference between the slope variable Slope1 and the slope variable Slope obtained in step S36 is smaller than the threshold constant SLOPETHRESH1, and whether the absolute value of the difference between the slope variables Slope2 and Slope is smaller than the threshold constant SLOPETHRESH1. (Step S243). Here, abs in the figure means an absolute value. If the proposition in step S243 is false (NO), the process returns with information without recalculation. If not (YES), the absolute value of the difference between the variables Slope1 and Slope2 is taken, and it is determined whether or not it is greater than a threshold constant SLOPETHRESH2 (step S244).
[0137]
If the absolute value is smaller at this step S244 (NO), the process moves to step S250, and if it is larger, the process moves to the next step S245.
Next, the absolute value of the difference between the slope variable Slope obtained in step S36 and the variable Slope1 is stored in a variable a (step S245). Next, the absolute value of the difference between the slope variable Slope obtained in step S36 and the variable Slope2 is stored in a variable b (step S246).
[0138]
Then, it is determined whether or not the variable b is larger than the variable a (step S247). If the variable b is large (YES), Slope1 is substituted for the slope variable Slope (step S248). If the variable b is small (NO), Slope2 is substituted for the slope variable Slope (step S249). If the absolute value of the difference between the slope variables Slope and Slope2 is smaller than the threshold constant (NO) in step S244, the slope variable Slope is obtained by dividing the sum of the slope variables Slope1 and Slope2 by 2, ie, Slope1. And the average of Slope2 is substituted (step S250). Then, the process returns with the information indicating that there is recalculation.
[0139]
In the series of steps S244 to S249, as shown in FIG. 34, a case is considered in which either the start code 22 or the stop code 23 of the PDF417 barcode label has a defect and the label range is not correctly determined. are doing. In the case of FIG. 34, the value of the slope Slope1 of the straight line n and the value of the slope Slope2 of n ′ are significantly different. This is detected by this routine, and a value close to the slope Slope of the label calculated from points e and g in FIG. 10 is adopted as a new slope. By using such a method, it is possible to obtain a more accurate label inclination even when there is a defect in either the start code 22 or the stop code 23.
[0140]
The case where the determination in step S243 is false is a case where there is a defect above or below one of the start code 22 and the stop code 23. In this case, the inclination is not recalculated.
[0141]
Next, the scan equation determination routine called in step S9 in FIG. 4 will be described with reference to the flowchart shown in FIG. 36 and the projection image onto the frame memory shown in FIG. FIG. 35 shows an example in which the start code 22 is selected based on the row scan.
[0142]
That is, first, the variable counter is initialized to "0" (step S251), and the reference coordinate variable WORK is initialized to the value of the top coordinate variable TOP of the label (step S252).
[0143]
Next, the difference between the y-coordinate value of the bottom coordinate variable BOTTOM of the label and the y-coordinate value of the top coordinate variable TOP of the label is calculated by a variable count. is assigned to end (step S253). That is, the number of patterns to be determined (the number of pixels in the column direction of the label in the case of FIG. 36) is obtained, and the variable count Store in end. That is, the number of patterns is a number for scanning the entire label surface.
[0144]
Next, the value of the variable counter is added to the y coordinate value of the top coordinate variable TOP of the label, and the result is substituted as the y coordinate value of the reference coordinate variable WORK (step S254). Further, the value of the label slope variable Slope is multiplied by the value of the y coordinate of the reference coordinate variable WORK, the intercept variable intersect of the label is added to the result, and the result is substituted as the x coordinate value of the new reference coordinate variable WORK. (Step S255). As described above, the reference coordinate variable WORK is reset with the increase in the variable counter.
[0145]
Next, a straight line I passing through the reset coordinate variable WORK and having a slope represented by the slope variable Slope of the label is defined (step S256), and two points at which the straight line I intersects the screen frame are obtained. Array of coordinate variables DIM POINT P and DIM POINT It is stored in the Qth counter (the array number indicated by the value of the variable counter) (step S257).
[0146]
Thereafter, the variable counter value is incremented (step S258), and the resulting reset variable counter value becomes the required number, that is, the variable counter. It is checked whether the end has been reached (step S259). If the required number has not been reached (YES), the process returns to step S254, and if the required number has been reached (NO), the process proceeds to step S260. By the above operation, the combination of the start point and the end point when sequentially scanning the label is defined.
[0147]
Next, the variable counter is initialized to "0" again (step S260), and the value of the slope variable Slope of the label is multiplied by the value of the variable counter, whereby the calculated increment by the position of the slope Slope of the label is calculated. Is calculated, and this calculation result is stored in an array LINE of variables. It is stored in a predetermined position of INC (position indicated by the variable counter) (step S261).
[0148]
After that, the variable counter is incremented (step S262), and the reset variable counter becomes the maximum size constant MAX of the array. It is checked whether or not NUM has been reached (step S263). If not reached (YES), the process returns to step S261, and if reached (NO), the process returns to the routine of FIG.
[0149]
Through the loop from step S260 to step S263 described above, a tilt pattern when one line of label information is captured is obtained. The maximum size constant MAX of the array NUM indicates the size of a variable determined when the program is created. For example, assuming that the size of the frame memory 6 is "640 × 480 pixels", it may be set to "about 1000".
[0150]
Next, the embedding check routine called in step S10 in FIG. 4 will be described with reference to the flowchart shown in FIG. 37 and the diagram of the image projected on the frame memory shown in FIG. FIG. 38 shows an example in which the start code 22 is selected based on the row scan. The label size is “4 × 3”.
[0151]
First, when a ROW detection routine, which will be described later, is called and a label is scanned, various information (detection line number, code length, row number, detection position, etc.) of the first and last rows found are detected (step S271). , Each variable ROW FIRST, ROW Store in LAST.
[0152]
Next, the variable ROW FIRST and ROW It is determined whether or not the LAST is also determined (step S272). If the LAST is determined (YES), the process proceeds to step S273. However, if it is not determined (NO), it is determined that decoding is impossible and the process returns to the upper routine of FIG.
[0153]
Thus, the variable ROW is determined in step S272. FIRST and ROW If LAST is also determined (YES), the start position coordinates of each code in the code word matrix are estimated, and the two-dimensional array variable CODE is estimated. The POS code is stored in the row number and column number order of each code (step S273). Here, as shown in FIG. 38, the estimation of the start coordinate position of each codeword is based on the inclination of the label, the detection line number of the first and last rows, the code length, the row number, the detection position, and the matrix size (ROW NUMBER × COLUMN NUMBER).
[0154]
Next, among the coordinates estimated in the above step, the number of the codes whose code may run off the screen is counted, and the variable error It is stored in num (step S274). In the example shown in FIG. 38, five codes of (row number, column number) = (0, 2), (1, 2), (2, 2), (3, 1), (3, 2) are Unreadable and determined to be error 5 is stored in num.
[0155]
Further, the error num is a variable REST of the number of recoverable codes obtained in step S180 of FIG. NUM (step S275), and error num is REST If it is not more than NUM (YES), it is determined that decoding is possible and the process returns to the upper routine of FIG. On the other hand, error num is REST If it exceeds NUM (NO), decoding is disabled and the process returns to the upper routine of FIG.
[0156]
With such a routine, the position of each code can be estimated, and the number of codes estimated to be out of the screen can be counted. Therefore, it can be determined at this stage whether or not decoding is possible. As a result, the worst pattern in which decoding is not performed despite processing for a long time is drastically reduced.
[0157]
Next, the ROW detection routine called in step S271 of FIG. 37 will be described with reference to the flowchart shown in FIG. 39 and the projection image onto the frame memory shown in FIG.
[0158]
First, the difference between the y coordinate value of the bottom coordinate variable BOTTOM of the label and the y coordinate value of the top coordinate variable TOP of the label, that is, the number of pixels in the y direction of the label is calculated. It is stored in num (step S281).
[0159]
Next, the value of the variable “inc” is set to “1” (step S282), the value of the variable “counter” is set to “0” (step S283), and the value of the variable “end” is determined by the pos obtained in step S282 or S283. num (step S284).
[0160]
Then, a ROW number detection routine to be described later is called using each of the variables (initial value counter, increment inc, end position end) obtained in steps S282 to S284 (step S285). If the row number can be correctly detected from the indicator information, the variable ROW Information such as a detection line number, a code length, a row number, and a detection position is stored in the POS.
[0161]
That is, it is determined whether or not the row number has been correctly detected from the indicator information in the routine (step S286). If the row number has been detected (YES), the process proceeds to step S287. If the row number has not been detected (NO), Return to upper routine as decoding impossible.
[0162]
Next, the data ROW obtained in step S285 POS ROW It is stored in FIRST (step S287). That is, in steps S282 to S287, scan lines are successively set from the TOP of the label to BOTTOM, and the first detected indicator position is ROW. Stored in FIRST.
[0163]
Further, in steps S288 to S293, the scan lines are sequentially set from the BOTTOM to the TOP, and the first detected indicator position is ROW. Stored in LAST.
[0164]
With such a routine, it is possible to determine whether or not a part of the row has become unprocessable (for example, jumping out of the screen). Because the row number is 4 and the ROW Row number 0 is detected by FIRST and ROW When row number 2 is detected in the LAST, row number 3 cannot be detected, so that it cannot be processed.
[0165]
Next, the ROW number detection routine called in step S285 of FIG. 39 will be described with reference to the flowchart shown in FIG.
First, the scan start point and end point at the current variable counter value are set in the coordinate variable array DIM. POINT P, DIM POINT Q, the x-direction increment is “1” and the y-direction increment is the inclination increment array LINE. In the INC, one line of image data is taken out from the frame memory 6 and taken in by the take-in buffer The data is stored in a line, and the number of data is stored in a variable num (step S301).
[0166]
Then, a conversion routine is called for width information described later (step S302), and the extracted data is converted to width information. Next, based on the width information, a portion corresponding to a barcode table (not shown) is converted into a code, and indicator information is extracted from the information and stored (step S303). Here, it is determined whether or not the indicator information has been read (step S304). If the indicator information has not been read (NO), the variable counter is incremented, that is, reset with the value of the interval variable inc (step S305). It is determined whether or not the reset variable counter value exceeds the variable end, that is, the label range (step S306). If not exceeded (NO), the process returns to step S301. If exceeded (YES), it is determined that decoding is impossible, and the process returns to the upper routine of FIG.
[0167]
On the other hand, if it is determined in step S304 that the data can be read (YES), the detected line number, code length, row number, and detected position at that time are stored in the variable ROW. It is stored in the POS (step S307), and the process returns to the upper routine of FIG. Therefore, various information of the indicator detected first after entering this routine is stored in ROW. It will be stored in the POS.
[0168]
Next, the optimal scan routine called in step S13 in FIG. 4 will be described with reference to the flowchart shown in FIG. 41 and the projection image onto the frame memory shown in FIG.
[0169]
First, the indicator information variable ROW of the label LAST detection position y coordinate value and ROW The difference from the FIRST detection position y coordinate value, that is, the number of pixels in the y direction of the label is calculated, and the calculation result is stored in a variable end (step S311).
[0170]
Next, the value of the variable end is set to the number of lines of the label (variable ROW). LAST row number-variable ROW By dividing by the FIRST row number (absolute value), an interval for scanning the center of each row only once is calculated as shown in FIG. 42, and the calculated interval is stored in a variable inc (step S312). And the variable ROW The detection line number of FIRST is set as the initial value of the variable counter (step S313).
[0171]
Next, the scan start point and end point at the current variable counter value are set in the coordinate variable array DIM. POINT P, DIM POINT Q, the x-direction increment is “1” and the y-direction increment is the inclination increment array LINE. The INC fetches one line of image data from the frame memory 6 and fetches it, and fetches it in the buffer array scan. The data is stored in a line, and the number of the data is stored in a variable num (step S314).
[0172]
Then, a conversion routine for width information is called as in step S302 described later (step S315), and the extracted data is converted into width information. Next, based on the width information, a portion corresponding to a barcode table (not shown) is converted into a code, and the information is stored (step S316).
[0173]
Thereafter, the variable counter is incremented, that is, reset with the value of the interval variable inc (step S317), and it is determined whether or not the reset variable counter value exceeds the variable end, that is, the label range (step S318). ). If it does not exceed (YES), the process returns to step S314, and if it does (NO), it is determined whether the information described in the label of the stored code information can be completely decoded (step S314). S318). If decoding is possible (YES), the process returns to the upper routine of FIG. 4 with information indicating that decoding is possible. However, when decoding is impossible (NO), the process returns to the upper routine of FIG.
[0174]
Next, the intelligent scan routine called in step S14 of FIG. 4 will be described with reference to the flowchart shown in FIG. This skip scan routine is a routine that scans only code positions missed in the optimal scan.
[0175]
First, among the code words that cannot be embedded by the optimal scan, the number of codes considered to be in the screen is defined as i (step S321). Further, the row number and column number of each code are stored in arrays R and C, respectively (step S322). As described above, the number and positions of the code words that could not be embedded by the optimal scan are obtained. As will be described later, if the column number and the row number are known, the position is determined by the CODE obtained in step S10. The coordinates are known from the POS.
[0176]
Next, the variable counter and the inclination pattern counter n are initialized to “0” (step S323). Then, the coordinates CODE of the counter-th undetected location A straight line I passing through POS [[R [counter]] [C [counter]] and having a slope of Slope + dt [n] is defined (step S324). Points W3 and W4 at which this straight line I crosses the screen frame are defined, and image data on the line segment W3-W4 is captured (step S325).
[0177]
Then, a conversion routine for width information is called as in step S302 described later (step S326), and the extracted data is converted to width information. Next, based on the width information, a portion corresponding to a barcode table (not shown) predetermined according to the use of the barcode is converted into a code, and the information is stored (step S327).
[0178]
Further, it is determined whether or not the code at the target location in steps S324 to S326 has been embedded (step S328). If it cannot be filled (NO), the inclination pattern counter n is incremented (step S329), and the number of inclination patterns is incremented by N. It is checked whether or not PAT is smaller than PAT (for example, set to “10” when ten kinds of inclinations are prepared in the array dt in advance) (Step S330). Shifts to step S331.
[0179]
If it is determined in step S328 that the data has been embedded (YES), or the inclination pattern counter n indicates the number of inclination patterns N If the value is equal to or larger than the PAT, the variable counter is incremented, and the inclination pattern counter n is reset to “0” (step S331). It is checked whether or not the reset variable counter value exceeds the variable i, that is, the number of codes considered to be in the screen among the code words that could not be embedded by the optimal scan (step S332). If it does not exceed (YES), the process returns to step S324, and if it does (YES), it is determined whether or not the stored code information can completely decode the information described in the label (step S333). .
[0180]
If it is determined that decoding is possible (YES), the process returns to the upper routine of FIG. However, when decoding is impossible (NO), the process returns to the upper routine of FIG.
[0181]
Therefore, in steps S324 to S332, of the codewords that could not be embedded by the optimal scan, image data is fetched with a plurality of types of inclinations for each code considered to be in the screen, and the code is to be determined. As a result, the operation of taking in only a necessary part is performed, so that the codeword matrix is determined with the minimum number of tries.
[0182]
Next, a conversion routine to be called width information in step S302 or step S326 will be described with reference to a series of flowcharts in FIGS.
[0183]
This routine is basically the same as the routine described with reference to FIGS. 17 and 18, except for the steps S95 and S355. That is, in the routines of FIGS. 17 and 18, since the purpose is only to detect the start code 22, the width information is set to WIDTH. It is sufficient to obtain NUM, but in the routines of FIGS. 44 and 45, all the information of the label is required, so that all the widths must be obtained. Therefore, in step S355, the determination regarding j found in step S95 is removed.
[0184]
It is to be noted that the present invention is not limited to the above-described embodiment, and that various modifications can be made.
For example, the two-dimensional imaging device 5 is not limited to a device using an area sensor typified by a two-dimensional CCD or an imaging tube, but may be a combination of a one-dimensional imaging device and a one-dimensional scanning mechanism, or a photoelectric detector. A combination of a two-dimensional scanning mechanism may be used.
[0185]
In the above description, a label in the PDF-417 format is used as the barcode label. However, the present invention is not limited to this, and other stacked barcodes such as Code49 and one-dimensional barcodes such as JAN are used. But it's fine.
[0186]
Although the description has been given based on the above embodiments, the present invention includes the following inventions.
(1) imaging means for imaging a barcode consisting of a bar and a space as a two-dimensional image,
Storage means for temporarily storing a two-dimensional image obtained by the imaging means;
Transfer means for transferring a captured image from the imaging means to the storage means;
Recognition means for automatically recognizing the presence or absence of a barcode symbol from a two-dimensional barcode image obtained by the imaging means;
Position recognition means for recognizing the position of a barcode symbol from a two-dimensional barcode image obtained by the imaging means;
Reading means for sequentially reading the barcode information from a two-dimensional barcode image obtained by the imaging means;
A decoding unit for decoding the barcode information from the reading unit into original information.
[0187]
Therefore, a barcode consisting of a bar and a space is captured as a two-dimensional image, the obtained two-dimensional image is temporarily stored, the captured image is transferred to a storage unit, and the presence or absence of a barcode symbol is automatically recognized. The position of the barcode symbol is recognized, the barcode information is sequentially read, and the barcode information is decoded into the original information.
[0188]
(2) The symbol information reading device according to the first aspect, wherein the recognition unit recognizes a two-dimensional image of the moving barcode at a position where barcode information can be read on an imaged screen obtained by the imaging unit.
[0189]
Therefore, a two-dimensional image of the moving barcode is recognized at a position where the barcode information can be read on the imaging screen obtained by the imaging means.
Therefore, the effect is that when reading a moving barcode label, the process proceeds to the reading process only when the barcode label is completely inside the image, so that barcodes that protrude from the image can be read. This means that reading can be performed at high speed and reliability can be improved.
[0190]
(3) The symbol information reading device according to the first aspect, wherein the transfer unit compresses and transfers the two-dimensional image captured by the imaging unit.
Therefore, the two-dimensional image picked up by the image pickup means is compressed and transferred.
[0191]
Therefore, the effect is that, since the target image is compressed and transferred to the frame memory 6, the number of pixels to be processed is reduced, and barcode symbol information can be read at high speed.
[0192]
(4) The symbol information reading device according to (3), wherein the transfer unit transfers only one field component of the captured two-dimensional image to the storage unit.
Therefore, only one field component of the captured two-dimensional image is transferred to the storage means.
[0193]
Therefore, the effect is that when the barcode label image occupies a large proportion of the target image and the height of one line of the barcode label is sufficient, only the field image is transferred to the frame memory and the reading process is performed. Bar code information can be read by an inexpensive interlaced image sensor. The field image may be either an even component or an odd component.
[0194]
(5) The symbol information reading device according to (2), wherein the transfer unit separately transfers the two field components of the captured two-dimensional image to the storage unit.
Therefore, the two field components of the captured two-dimensional image are separately transferred to the storage unit.
[0195]
Therefore, the effect is that when the ratio of the barcode label image to the target image is small and the height of one line of the barcode label is not enough, two field images (even and odd components) are combined into one. That is, a reading process is performed on one field image separately in the frame memory, and if that fails, the reading process is performed on another field image, thereby improving the reliability of reading.
[0196]
(6) In the above item (2), the reading means performs reading processing on one field component stored by the storage means, and when the processing fails, reads again on another field component stored by the storage means. A symbol information reading device for reading barcode information, including a processing operation for processing.
[0197]
Accordingly, the bar code information includes a reading operation for one field component stored by the storage means and, when the processing fails, another reading for another field component stored by the storage means. Read.
[0198]
Therefore, the same effect as in the item (5) can be obtained.
(7) In the above item (2), the transfer means transfers one scan line of the field component of the two-dimensional image picked up by the image pickup means, and then transfers the scan line again with one line left in the storage means. A symbol information reading apparatus which repeats this process until image information for a field is transferred, and transfers and transfers the image information of one line above or below that line to a vacant line after completion of the transfer.
[0199]
Therefore, after transferring one scan line of the field component of the two-dimensional image picked up by the image pick-up means, one line is left in the storage means and the scan line is transferred again until the image information for one field is transferred. Repeating and transferring the image information including a processing operation of copying the image information of one line above or below the vacant line to the vacant line after the end.
[0200]
Therefore, the effect is that one field image is fetched into the frame memory 6 at intervals of one line, and the contents of the one line of the frame memory are copied to an empty line, and the reading process is performed. That is, reliability can be improved. Copying can be easily realized by hardware.
[0201]
(8) The symbol information reading device according to (3), wherein the transfer unit adds an arbitrary number of pieces of pixel information of the two-dimensional image captured by the imaging unit to form one pixel and transfers the pixel information.
[0202]
Therefore, in the above item 3, the transfer means adds an arbitrary number of pieces of pixel information of the two-dimensional image picked up by the image pick-up means and transfers it as one pixel.
Therefore, the effect is that if the height of one line of the barcode label is sufficient, an arbitrary number of pixels are added to all the pixel information and stored as one pixel in the frame memory. That is, symbol information can be read at high speed. This can also be easily realized by hardware, and has the effect of suppressing noise.
[0203]
(9) In the first aspect, the position recognizing means converts the pixel information of one row of the storage device into an arbitrary number of pieces of width information and recognizes symbol information for recognizing a position of a predetermined pattern determined by the type of the barcode. Reader.
[0204]
Therefore, the pixel information of one row of the storage device is converted into width information by an arbitrary number, and the position of a predetermined pattern determined by the type of the barcode is recognized.
Therefore, the effect is that if there is no information other than the barcode label in the target image and the start code of the PDF417 barcode label is located on the left side of the image, it is fetched line by line from the frame memory. Since only the width information enough to detect the start code is obtained without converting all the pixel information into the width information, the start code can be detected at high speed.
[0205]
(10) The symbol information reading device according to the first aspect, wherein the position recognizing means includes a processing operation for selectively selecting a row from the storage means, and recognizes a position of a predetermined pattern determined by the type of the barcode.
[0206]
Therefore, it includes a processing operation of selectively selecting a row from the storage means, and recognizes a position of a predetermined pattern determined by the type of the barcode.
Therefore, the effect is that, in the method of determining a row for capturing pixels, a method similar to the NEWTON method of repeatedly finding the solution of the equation is employed, and a method of gradually narrowing the space between rows is adopted. In addition, it can be detected at high speed.
[0207]
(11) In the first aspect, the reading unit detects at least two predetermined patterns defined by the type of the barcode, obtains the inclination of the barcode label, and determines the inclination of the barcode different from the already detected pattern. A symbol information reading apparatus for detecting a predetermined pattern determined by the type of the symbol information and redefining the inclination of the bar code label from both patterns, and reading bar code information.
[0208]
Therefore, a predetermined pattern defined by the type of the barcode is detected at least two places, the inclination of the barcode label is obtained, a predetermined pattern defined by the type of the barcode different from the already detected pattern is detected, It includes a processing operation for redefining the inclination of the barcode label from both patterns, and reads barcode information.
[0209]
Therefore, the effect is to estimate each code position from the bar code label indicator information after detecting the start code, detect the stop code from a position near the stop code, and determine the inclination of the bar code label from both the start code and the stop code. Is redefined, a more accurate inclination can be obtained, and the reliability of reading can be improved.
[0210]
(12) In the first aspect, when one corner of the barcode label is missing, the reading unit may read the barcode label obtained from only one piece of information of a predetermined pattern determined by the type of the barcode. A symbol information reading device that includes a processing operation for redefining the inclination with reference to the inclination and reads barcode information.
[0211]
Therefore, when one corner of the barcode label is missing, a processing operation for redefining the inclination with reference to the inclination of the barcode label obtained from only one information of the predetermined pattern determined by the type of the barcode. And reads barcode information.
[0212]
The same effects as in the above item (12) can be obtained.
(13) In the above item (2), the recognizing means vertically divides the two-dimensional image of the storage means into three equal parts, and arbitrarily selects the uppermost area determined by the size of the barcode label and the lowermost area. The bar code label can be read when the predetermined pattern defined by the type of the bar code cannot be detected in any line of the bar code and the predetermined pattern defined by the type of the bar code is detected in any line in the center area A symbol information reading apparatus that includes a processing operation of determining that the bar code label exists at a proper position and recognizes the presence or absence of a bar code label.
[0213]
Therefore, the two-dimensional image of the storage means is vertically divided into three equal parts, and the arbitrary line in the uppermost area and the arbitrary line in the lowermost area determined by the size of the barcode label depend on the type of the barcode. Including a processing operation for determining that a barcode label is present at a readable position when a predetermined pattern determined by the barcode type cannot be detected and a predetermined pattern determined by the type of the barcode is detected in an arbitrary line in the center area. , The presence or absence of the barcode label is recognized.
[0214]
Therefore, the effect is that when reading a moving barcode label, the process proceeds to the reading process only when the barcode label is completely inside the image, so that barcodes that protrude from the image can be read. This means that reading can be performed at high speed and reliability can be improved.
[0215]
(14) In the item (10), the position recognizing means first selects the center row of the two-dimensional image in the storage means, and then selects the center row of the upper half and the lower half of the two-dimensional image. A symbol information reading apparatus that includes a processing operation of selecting and subsequently selecting a center line of a divided image in the same manner, and recognizing a position of a predetermined pattern determined by the type of the barcode.
[0216]
Therefore, first, the center row of the two-dimensional image in the storage means is selected, and then the center row of the upper half and the center of the lower half of the two-dimensional image are selected. And sequentially recognizes the position of a predetermined pattern determined by the type of the barcode.
[0217]
The same effects as in the above item (10) can be obtained.
(15) In the twelfth aspect, the reading means obtains the inclination of the barcode label from two upper corners of the four corners of the two-dimensional barcode label image in the storage means, and then obtains the inclination of the lower part of the four corners. A symbol information reader for reading barcode information, including a processing operation for obtaining the inclination of a barcode label from two corners and obtaining the inclination of a barcode label from two inclinations.
[0218]
Accordingly, in the above paragraph 12, the reading means obtains the inclination of the barcode label from the upper two corners of the four corners of the two-dimensional barcode label image of the storage means, and then determines the lower two corners of the four corners. The barcode information is read out, including a processing operation for obtaining the inclination of the barcode label from the corner and obtaining the inclination of the barcode label from the two inclinations.
[0219]
(16) In the twelfth aspect, the reading means obtains the inclination of the barcode label from the upper two corners of the four corners of the two-dimensional barcode label image in the storage means, and then obtains the lower part of the four corners. The inclination of the barcode label is determined from the two corners, and if the difference between the two inclinations is equal to or greater than a predetermined threshold, the inclination determined by detecting at least two predetermined patterns defined by the type of the barcode. A symbol information reading device for reading bar code information, which includes a processing operation for setting a value close to the inclination of the bar code label.
[0220]
Therefore, the inclination of the barcode label is obtained from the upper two corners of the four corners of the two-dimensional barcode label image in the storage means, and then the inclination of the barcode label is obtained from the lower two corners of the four corners. If the difference between the two inclinations is equal to or greater than a predetermined threshold, a value close to the inclination obtained by detecting at least two locations of a predetermined pattern defined by the type of the barcode is set as the inclination of the barcode. Read barcode information, including operations.
[0221]
The same effects as in the above item (10) can be obtained.
(17) In the twelfth aspect, the reading means obtains the inclination of the barcode label from the upper two corners of the four corners of the two-dimensional barcode label image in the storage means, and then obtains the inclination of the lower part of the four corners. Calculating the inclination of the barcode label from the two corners, if the difference between the two inclinations is less than a predetermined threshold value, including a processing operation of setting the average of the two inclinations as the inclination of the barcode label; Symbol information reading device that reads code information.
[0222]
Therefore, the inclination of the barcode label is obtained from the upper two corners of the four corners of the two-dimensional barcode label image in the storage means, and then the inclination of the barcode label is obtained from the lower two corners of the four corners. If the difference between the two slopes is less than a predetermined threshold, the barcode information is read, including a processing operation of setting the average value of the two slopes as the slope of the barcode label.
[0223]
(18) The symbol information reading apparatus according to (6), wherein the reading unit includes a processing operation using the position information of the barcode label on the previous field screen when the reading process is performed again, and reads the barcode information.
[0224]
Therefore, the barcode information is read by including the processing operation using the position information of the barcode label of the previous field screen when going to the reading process again.
Therefore, the effect is that the barcode label position information of the previous field screen can be used when going to the reading process again, so that it is not necessary to detect the label again, and high-speed reading of the barcode information can be realized. . The new barcode label position can be calculated from the label speed and the scanning speed of the imaging device. If the speed of the barcode label is sufficiently negligible compared to the scanning speed of the imaging device, the position information of the barcode label on the previous field screen can be used as it is.
[0225]
【The invention's effect】
As described in detail above, according to the present invention, it is possible to provide a symbol information reading device that reads barcode symbol information of a moving two-dimensional barcode quickly and reliably.
[Brief description of the drawings]
FIG. 1 is a diagram showing a schematic configuration of a symbol information reading device as a first embodiment.
FIG. 2 is a diagram illustrating a label structure of PDF-417 as an example of a stacked barcode.
FIG. 3 is a diagram showing a schematic diagram in which a label image of PDF-417 is virtually projected on a pixel array of a frame memory.
FIG. 4 is a flowchart for explaining label detection, label information reading, and decoding in the data processing device.
FIG. 5 is a diagram for explaining taking in only a field screen.
FIG. 6 is a flowchart illustrating an image capturing routine.
FIG. 7 is a diagram for describing capture of two field screens (an even component and an odd component).
FIG. 8 is a diagram for explaining that four pixels are added into one pixel.
FIG. 9 is a flowchart for explaining barcode label detection.
FIG. 10 is a diagram showing a projection image for explaining barcode label detection.
FIG. 11 is a diagram for explaining the inclination of a barcode label defined on a frame memory.
FIG. 12 is a flowchart for explaining detection within a barcode label screen.
FIG. 13 is a diagram showing a barcode label projection image for explaining detection within a barcode label screen.
FIG. 14 is a flowchart illustrating a scanning method.
FIG. 15 is a diagram showing a barcode label projection image for explaining a scanning method.
FIG. 16 is a flowchart for explaining start code detection.
FIG. 17 is a first half of a flowchart for describing a method of converting into width information.
FIG. 18 is a latter half of a flowchart for explaining a method of converting into width information.
FIG. 19 is a diagram for describing selection of a peak value.
FIG. 20 is a diagram for describing a method of calculating a distance between peaks.
FIG. 21 is a flowchart illustrating normalization.
FIG. 22 is a flowchart for describing detection of a maximum value and a minimum value of a Y coordinate.
FIG. 23 is a flowchart illustrating detection of a label range.
FIG. 24 is a flowchart illustrating detection of label inclination.
FIG. 25 is a flowchart for explaining threshold value determination.
26A is a diagram for explaining a threshold value calculation line, and FIG. 26B is a diagram illustrating a differential waveform of a start code.
FIG. 27 is a flowchart for explaining indicator information determination.
FIG. 28 is a diagram showing a barcode label projection image on a frame memory for indicator information determination.
FIG. 29 is a flowchart for describing redefinition of the inclination of a barcode label.
FIG. 30 is a diagram showing a barcode label projection image for explaining redefinition of the inclination of the barcode label.
FIG. 31 is a flowchart for describing stop code detection.
FIG. 32 is a flowchart for explaining barcode label range detection.
FIG. 33 is a flowchart for describing recalculation of the inclination of a barcode label.
FIG. 34 is a diagram for explaining the loss of a barcode label.
FIG. 35 is a diagram illustrating a barcode label projection image for describing calculation of a start point and an end point sequence of a barcode label.
FIG. 36 is a flowchart illustrating a scan equation determination.
FIG. 37 is a flowchart illustrating an embedding check.
FIG. 38 is a diagram illustrating a barcode label projection image for describing an embedding check.
FIG. 39 is a flowchart for describing ROW detection.
FIG. 40 is a flowchart for describing ROW number detection.
FIG. 41 is a flowchart illustrating an optimal scan.
FIG. 42 is a diagram illustrating a barcode label projection image onto a frame memory for describing optimal scanning.
FIG. 43 is a flowchart illustrating an intelligent scan.
FIG. 44 is the first half of a flowchart for explaining a method for converting into width information;
FIG. 45 is a second half of a flowchart for describing a method of converting into width information.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Article | item 2 ... Bar code label, 3 ... Conveying system, 4 ... Imaging optical system, 5 ... Two-dimensional imaging part, 6 ... Frame memory, 7 ... Data processing device, 8 ... Label detection part, 9 ... Reading part, Reference numerals 10: decoding determination unit, 11: decoding unit, 12: memory, 13: control unit, 14: position detection unit, 15: inclination detection unit, 16: host device.

Claims (4)

バーとスペースとからなり任意の情報をパターンとして表すバーコードを2次元像として撮像する撮像手段と、
前記撮像手段により順次得られた2次元像を一時的に記憶する記憶手段と、
前記撮像手段から前記記憶手段に2次元像を転送する転送手段と、
前記記憶手段に記憶された2次元像を順次読出し、撮像範囲内でのバーコードシンボルの有無を認識する認識手段と、
前記認識手段により認識されたバーコードの前記撮像範囲内での存在位置及び傾きを検出し、バーコードのスキャン方向を検出する位置検出手段と、
前記位置検出手段により検出されたスキャン方向によりバーコードの2次元像から該バーコードの情報を順次読み取る読取手段と、
前記読取手段からのバーコードの情報から、前記任意の情報に復号する復号手段と、
を具備し、
前記転送手段は、前記撮像手段により撮像された2次元像を圧縮し、該撮像手段により撮像された2次元像のフィールド成分の1スキャンラインを転送した後、該記憶手段の1ラインを空けてまたスキャンラインを転送し、1フィールド分の画像情報を転送するまでそれを繰り返し、終了後に空いているラインにそのラインの1ライン上または下のラインの画像情報を複写する処理操作を含み、転送することを特徴とするシンボル情報読取装置。
Imaging means for imaging a barcode consisting of a bar and a space and representing arbitrary information as a pattern as a two-dimensional image;
Storage means for temporarily storing two-dimensional images sequentially obtained by the imaging means;
Transfer means for transferring a two-dimensional image from the imaging means to the storage means;
A recognition unit for sequentially reading the two-dimensional images stored in the storage unit and recognizing the presence or absence of a barcode symbol within an imaging range;
Position detection means for detecting the position and inclination of the barcode recognized by the recognition means within the imaging range, and detecting the scan direction of the barcode;
Reading means for sequentially reading barcode information from a two-dimensional barcode image according to the scan direction detected by the position detection means;
Decoding means for decoding the barcode information from the reading means to the arbitrary information;
Equipped with,
The transfer unit compresses the two-dimensional image picked up by the image pickup unit, transfers one scan line of a field component of the two-dimensional image picked up by the image pickup unit, and then leaves one line in the storage unit open. In addition, the method includes a process of transferring a scan line, repeating the process until image information for one field is transferred, and copying the image information of one line above or below the line to an empty line after completion of the transfer. A symbol information reading device.
バーとスペースとからなり任意の情報をパターンとして表すバーコードを2次元像として撮像する撮像手段と、
前記撮像手段により順次得られた2次元像を一時的に記憶する記憶手段と、
前記撮像手段から前記記憶手段に2次元像を転送する転送手段と、
前記記憶手段に記憶された2次元像を順次読出し、撮像範囲内でのバーコードシンボルの有無を認識する認識手段と、
前記認識手段により認識されたバーコードの前記撮像範囲内での存在位置及び傾きを検出し、バーコードのスキャン方向を検出する位置検出手段と
前記位置検出手段により検出されたスキャン方向によりバーコードの2次元像から該バーコードの情報を順次読み取る読取手段と、
前記読取手段からのバーコードの情報から、前記任意の情報に復号する復号手段と、
を具備し、
前記転送手段は、前記撮像手段により撮像された2次元像を圧縮し、撮像した2次元像の1つのフィールド成分のみを記憶手段に転送することを特徴とする請求項1記載のシンボル情報読取装置。
Imaging means for imaging a barcode consisting of a bar and a space and representing arbitrary information as a pattern as a two-dimensional image;
Storage means for temporarily storing two-dimensional images sequentially obtained by the imaging means;
Transfer means for transferring a two-dimensional image from the imaging means to the storage means;
A recognition unit for sequentially reading the two-dimensional images stored in the storage unit and recognizing the presence or absence of a barcode symbol within an imaging range;
Position detection means for detecting the position and inclination of the barcode recognized by the recognition means within the imaging range, and detecting the scan direction of the barcode ;
Reading means for sequentially reading barcode information from a two-dimensional barcode image according to the scan direction detected by the position detection means;
Decoding means for decoding the barcode information from the reading means into the arbitrary information;
With
2. The symbol information reading device according to claim 1, wherein the transfer unit compresses the two-dimensional image captured by the imaging unit and transfers only one field component of the captured two-dimensional image to the storage unit. .
前記転送手段は、撮像した2次元像の2つのフィールド成分を別々に前記記憶手段に転送することを特徴とする請求項2記載のシンボル情報読取装置。3. The symbol information reading device according to claim 2 , wherein the transfer unit separately transfers two field components of the captured two-dimensional image to the storage unit . バーとスペースとからなり任意の情報をパターンとして表すバーコードを2次元像として撮像する撮像手段と、
前記撮像手段により順次得られた2次元像を一時的に記憶する記憶手段と、
前記撮像手段から前記記憶手段に2次元像を転送する転送手段と、
前記記憶手段に記憶された2次元像を順次読出し、撮像範囲内でのバーコードシンボルの有無を認識する認識手段と、
前記認識手段により認識されたバーコードの前記撮像範囲内での存在位置及び傾きを検出し、バーコードのスキャン方向を検出する位置検出手段と
前記位置検出手段により検出されたスキャン方向によりバーコードの2次元像から該バーコードの情報を順次読み取る読取手段と、
前記読取手段からのバーコードの情報から、前記任意の情報に復号する復号手段と、
を具備し、
前記転送手段は、撮像手段により撮像した2次元像の任意数の画素情報を加算し、1つの画素にして転送することを特徴とするシンボル情報読取装置。
Imaging means for imaging a barcode consisting of a bar and a space and representing arbitrary information as a pattern as a two-dimensional image;
Storage means for temporarily storing two-dimensional images sequentially obtained by the imaging means;
Transfer means for transferring a two-dimensional image from the imaging means to the storage means;
A recognition unit for sequentially reading the two-dimensional images stored in the storage unit and recognizing the presence or absence of a barcode symbol within an imaging range;
Position detection means for detecting the position and inclination of the barcode recognized by the recognition means within the imaging range, and detecting the scan direction of the barcode ;
Reading means for sequentially reading barcode information from a two-dimensional barcode image according to the scan direction detected by the position detection means;
Decoding means for decoding the barcode information from the reading means into the arbitrary information;
With
The symbol information reading device, wherein the transfer unit adds an arbitrary number of pieces of pixel information of the two-dimensional image captured by the image capturing unit and transfers the pixel information as one pixel.
JP13525695A 1995-06-01 1995-06-01 Symbol information reader Expired - Fee Related JP3580901B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13525695A JP3580901B2 (en) 1995-06-01 1995-06-01 Symbol information reader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13525695A JP3580901B2 (en) 1995-06-01 1995-06-01 Symbol information reader

Publications (2)

Publication Number Publication Date
JPH08329185A JPH08329185A (en) 1996-12-13
JP3580901B2 true JP3580901B2 (en) 2004-10-27

Family

ID=15147463

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13525695A Expired - Fee Related JP3580901B2 (en) 1995-06-01 1995-06-01 Symbol information reader

Country Status (1)

Country Link
JP (1) JP3580901B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116362274A (en) * 2023-05-30 2023-06-30 深圳市华众自动化工程有限公司 High-speed bar code reader

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6899272B2 (en) * 2000-05-17 2005-05-31 Symbol Technologies, Inc Bioptics bar code reader
JP2006172267A (en) * 2004-12-17 2006-06-29 Toyo Kanetsu Solutions Kk System for recognizing symbol on mobile object
JP2009020611A (en) * 2007-07-10 2009-01-29 Toshiba Tec Corp Scanner device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116362274A (en) * 2023-05-30 2023-06-30 深圳市华众自动化工程有限公司 High-speed bar code reader
CN116362274B (en) * 2023-05-30 2023-08-25 深圳市华众自动化工程有限公司 High-speed bar code reader

Also Published As

Publication number Publication date
JPH08329185A (en) 1996-12-13

Similar Documents

Publication Publication Date Title
KR100271245B1 (en) Bar code reading apparatus
US5635697A (en) Method and apparatus for decoding two-dimensional bar code
US5319181A (en) Method and apparatus for decoding two-dimensional bar code using CCD/CMD camera
JP4180497B2 (en) Code type discrimination method and code boundary detection method
JP3233981B2 (en) Symbol information reader
EP0669593B1 (en) Two-dimensional code recognition method
US8254683B2 (en) Code image processing method
CA2282764C (en) System and method for ocr assisted bar code decoding
US8006911B2 (en) System and method for encoding and decoding large capacity 2-dimensional color bar code which can be color-corrected
JP3115610B2 (en) High speed image capture system and method
US5748868A (en) Two-dimensional management pattern, information display tag, and image processing method and device
JP5140820B2 (en) Symbol information reading apparatus and symbol information reading method
US20050167498A1 (en) Method and apparatus for optically picking up an image of an information code
US5550363A (en) Optical information reading apparatus
JP3154809B2 (en) Barcode reader device
US20070140564A1 (en) 2-Dimensional code region extraction method, 2-dimensional code region extraction device, electronic device, 2-dimensional code region extraction program, and recording medium containing the program
US6880758B2 (en) System and method for identifying object information
KR100257128B1 (en) Symbol information reading apparatus
JP3580901B2 (en) Symbol information reader
JPH07120389B2 (en) Optical character reader
EP0651337A1 (en) Object recognizing method, its apparatus, and image processing method and its apparatus
JP4398498B2 (en) Code boundary detection method
US5764798A (en) Prioritized searching methods for finding a coded symbol in a digitized image
JP3302057B2 (en) Symbol information reader
JP2012083836A (en) Stacked barcode reader and stacked barcode reading method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040413

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040614

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: 20040713

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040721

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080730

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090730

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees