JP4100273B2 - Two-dimensional code reading method and two-dimensional code reading apparatus - Google Patents

Two-dimensional code reading method and two-dimensional code reading apparatus Download PDF

Info

Publication number
JP4100273B2
JP4100273B2 JP2003185775A JP2003185775A JP4100273B2 JP 4100273 B2 JP4100273 B2 JP 4100273B2 JP 2003185775 A JP2003185775 A JP 2003185775A JP 2003185775 A JP2003185775 A JP 2003185775A JP 4100273 B2 JP4100273 B2 JP 4100273B2
Authority
JP
Japan
Prior art keywords
dimensional code
reading
image
specific pattern
cause
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 - Lifetime
Application number
JP2003185775A
Other languages
Japanese (ja)
Other versions
JP2005018649A (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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2003185775A priority Critical patent/JP4100273B2/en
Publication of JP2005018649A publication Critical patent/JP2005018649A/en
Application granted granted Critical
Publication of JP4100273B2 publication Critical patent/JP4100273B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
この発明は、所定の情報がエンコードされた2次元コードを撮像し、生成された画像中の2次元コードに対する画像処理を行って、その2次元コードが表示する情報の内容を読み取る技術に関連する。なお、この明細書では、2次元コードが表す視覚認識可能な情報(一般に、白および黒のセルの配列パターンとして現れる。)を「光学情報」という。
【0002】
【従来の技術】
2次元コードは、「セル」と呼ばれる白または黒の小領域を2次元配列したコードである。各セルは光学情報の最小単位を表すもので、具体的な情報を構成するセルのほか、2次元コードの位置や向きを識別するためのファインダパターンを構成するセルや、コード内の各セルを切り分けて識別するためのタイミングパターンを構成するセルを含む。
【0003】
図8(1)(2)は、それぞれ代表的な2次元コードであるデータマトリクスとQRコードとを示す。データマトリクスは、直交する2辺にコードの方向を示すL字状のファインダパターン40が形成され、他の直交する2辺に同じくL字状のタイミングパターン41が形成される。ファインダパターン40は、黒いセルを配列することで構成され、タイミングパターン41は、白いセルと黒いセルとが交互に配列された構成をとる(以下、白いセルを「白セル」、黒いセルを「黒セル」という。)。
【0004】
一方、QRコードには、矩形状の3個の位置決めシンボル42a,42b,42cによるファインダパターン42が設けられる。各位置決めシンボル42a,42b,42cは、複数の黒セルによる矩形パターンの周囲に白セルの枠を配置し、さらにその外側に黒セルの枠を配置して成る。これら位置決めシンボル42a,42b,42cは、それぞれコードの頂点に対応する位置に配備され、それぞれのシンボル42a,42b,42cの内側の角部を結ぶように、白セルと黒セルとが交互に配列されたL字型のタイミングパターン43が形成される。
なお、データマトリクス、QRコードのいずれにおいても、図示の白セルと黒セルとの関係は、背景の状態によって逆転することがある。
【0005】
上記のような2次元コードを読み取る際には、まずエッジ抽出処理やパターンマッチング処理などによる画像処理により、画像上のファインダパターン40,42を抽出してコードの位置および向きを認識する。つぎに、抽出されたファインダパターン40,42に基づき、タイミングパターン41,43を抽出する。
【0006】
前記タイミングパターン41,43により囲まれた領域は、光学情報の具体的な内容がエンコードされた領域である(以下、この領域のことを「情報表示領域」という。)。前記タイミングパターン41,43が抽出されると、つぎはそのパターン内の白セルと黒セルとの配列に基づき、情報表示領域内の各セルの位置を特定する。そして、2値化処理などによって各セルが白黒いずれのセルであるかを判別し、その判別結果に応じて各セルが表す光学情報を符号化する。さらに、文字など1単位分の情報を表すセルのグループ(シンボルキャラクタ)毎に、各セルのコードを配列することにより、前記光学情報をデコードする。また、このデコードにおいては、セルの白黒状態を判別する際に生じた誤りを訂正する処理(誤り訂正処理)も実行される。以下では、前記タイミングパターンの抽出から光学情報のデコードを完了するまでの処理を「デコード処理」と呼ぶ。
【0007】
なお、上記の読取処理では、本来、ファインダパターンは1個しか抽出されないはずであるが、2次元コードの背景にファインダパターンの形状に似たノイズ(模様や影などによる。)があると、これらのノイズがファインダパターンの候補として抽出される場合がある。このようなノイズに対応するために、従来の2次元コード読取装置では、抽出されたファインダパターンの候補毎にデコード処理を実行し、いずれかのファインダパターンについてデコードに成功したとき、そのデコードされた情報の内容を示す読取データを出力するようにしている。
【0008】
【発明が解決しようとする課題】
従来の2次元コード読取装置を用いた読取処理では、導入時に、装置の設置位置、照明状態、カメラの視野に対するワークの送り込み位置などを調整してから読取処理を開始するようにしている。しかしながら、これらの調整が悪いと、光学情報の読取に失敗することがある(以下、この失敗を「読取失敗」という。)。また、調整が適正であっても、ワーク上の2次元コードのマーキング状態が悪かったり、2次元コードの背景に前記したノイズがあるために、光学情報の読取に失敗する場合がある。
【0009】
しかしながら、従来の読取処理においては、読取失敗が起こっても、その失敗がどのような原因によるものかを示す情報がないため、ユーザーは試行錯誤で原因を究明しなければならなかった。このため、導入時の設定に手間がかかり、本格的な読取処理の開始が遅れてしまう、という不具合がある。
【0010】
下記の特許文献1には、光学情報の読取処理において、デコード処理に失敗したときにその原因を解析し、その解析結果に基づいて読取エラーの原因やその対処方法を報知することが記載されている。
【0011】
【特許文献1】
特開2002−236870号 公報
(段落[0008][0009]参照。)
【0012】
上記特許文献1では、読取処理の具体例としてバーコードに対する読取処理をあげ、画像の全体的な電圧レベル(波形)、バーの幅、コードの左右のマージンなどに基づき、読取エラーの原因を解析するようにしている(段落[0025]〜[0031]参照。)。しかしながら、2次元コードについては、段落[0039]に、バーコードと同様の方法を適用できる旨が記載されているだけであり、2次元コードの読取失敗に対する具体的な処理方法については、何も示されていない。
【0013】
この発明は、2次元コードに対する読取処理に失敗したとき、その読取失敗の原因を詳細に判別し、その判別結果をユーザーに報知できるようにすることを目的とする。
【0014】
【課題を解決するための手段】
この発明にかかる2次元コードの読取方法は、表示態様が異なる2種類のセルの2次元配列より成る2次元コードを撮像対象とした画像から、前記2次元コード中の情報表示領域の外側にそれぞれ位置する複数のセルが構成する特定のパターンを抽出し、抽出された特定のパターンに基づき前記情報表示領域を特定して当該領域にデコード処理を施すことによって、前記画像中の2次元コードが表す光学情報を読み取るものである。
【0015】
上記方法においては、既存の2次元コードにおいてファインダパターンと呼ばれているパターンを、特定のパターンとすることができる。ただし、特定のパターンはファインダパターンに限定されるものではなく、たとえば、ファインダパターンとタイミングパターンとの組み合わせを特定のパターンとしてもよい。
【0016】
特定のパターンを抽出するための画像処理の一例として、その特定のパターンのモデルを用いたパターンマッチング処理をあげることができる。また、特定のパターンが線形のパターン、または黒セルまたは白セルが直線状に並ぶ部分を含むパターンであれば、前記画像に含まれるエッジ点を抽出した後、抽出された各エッジ点につき、濃度勾配に直交する方向に所定長さの線分を設定し、線分の重なり度合が所定の値以上となる画像領域を抽出する方法を採用することもできる。
【0017】
前記デコード処理では、タイミングパターンを抽出する処理、情報表示領域内の各セルを識別して2値化する処理、2値化により符号化された情報をシンボルキャラクタ毎にまとめながらデコードする処理などを実行することができる。さらに、デコード処理では、シンボルキャラクタ毎に、個々のセルに対する識別において生じた誤りを訂正する処理を行うこともできる。
【0018】
背景に模様や影などのノイズがあるために特定のパターンの抽出数が増えた場合には、その抽出にかかる処理時間が長くなるため、デコード処理に要する時間が不足し、デコードが不可能になる可能性がある。
【0019】
また、たとえば、黒セルと白セルとの濃度差が小さかったり、セルの大きさが適正でないなど、2次元コードの状態に不備が生じると、タイミングパターンを抽出できなかったり、セルの白黒状態の判別時に生じた誤りが訂正可能な数を超え、デコードができない状態となる。このような場合には、特定のパターンの抽出数がゼロより大きく、前記ノイズによりデコードが不可能になるときの抽出数よりも少なくなると、考えることができる。
【0020】
上記の点に鑑み、この発明にかかる2次元コードの読取方法では、1つの2次元コードの読取に所定長さの処理時間を割り当てるとともに、この処理時間が経過するまで前記デコード処理を繰り返すことを許容し、前記特定のパターンの抽出に応じてデコード処理が実行された結果、光学情報を読み取ることができない読取失敗が生じたとき、前記特定のパターンの抽出数を前記1つの2次元コードの読取に割り当てられた処理時間に基づき定めたしきい値と比較し、前記抽出数がしきい値を上回るときは、前記特定のパターンとして誤抽出されたノイズの多さが前記読取失敗の原因であると判別し、前記特定のパターンの抽出数が前記しきい値を下回るときは、画像中の2次元コードがデコードできない状態にあることが前記読取失敗の原因であると判別するようにしている。
【0021】
なお、前記した特許文献1には、画像の明るさレベル、コードの幅、左右のマージンに基づき読取失敗の原因を判別することが記載されているが、読取失敗の原因を判別する処理にコード内の特定のパターンの抽出数を使用する点については、何も示されていない。
【0022】
上記の方法によれば、デコード処理の失敗が特定のパターンとして誤抽出されたノイズの多さによるのか、2次元コードがデコードできない状態にあることによるのかを判別し、ユーザーに明瞭に提示することができる。
【0023】
上記方法にかかる一態様では、前記特定パターンが抽出されずに読取失敗となったとき、前記画像の明るさを所定の数値範囲と比較する。そして、前記明るさが前記数値範囲内にあれば撮像時の2次元コードの位置が前記読取失敗の原因であると判別し、前記明るさが前記数値範囲外にあれば2次元コードに対する照明の状態が前記読取失敗の原因であると判別する。
【0024】
上記の態様において、画像の明るさは、画像を構成する各画素毎の階調を平均することにより得ることができる。前記数値範囲は、画像がハレーションをおこすときの明るさや、照明されていないときの最低の明るさ(ノイズの影響のみの明るさ)に基づき設定するのが望ましい。前記明るさが数値範囲内であれば、画像の濃淡を識別することが可能であるから、画像内に特定パターンがあれば、これを抽出することができると考えられる。にもかかわらず、特定パターンの抽出数がゼロということは、撮像装置の視野内に特定パターンが含まれていない状態にあると考えることができる。
【0025】
一方、前記明るさが数値範囲を超える場合には、照明が明るすぎると考えることができる。また、前記明るさが数値範囲を下回る場合には、照明が暗すぎると考えることができる。
よって、上記の態様によれば、特定のパターンが抽出されずに読取失敗となった場合に、その失敗が撮像時の2次元コードの位置の不備によるものなのか、または照明の不備によるものなのかを的確に判別し、その原因を提示することができる。
【0026】
前記2次元コード読取方法の第2の態様では、読取失敗の原因の判別に応じてその判別した原因を示す情報を表示する。この表示情報は、前記原因をユーザーが簡単に理解できるようなコメント情報とするのが望ましい。
【0027】
つぎに、この発明にかかる2次元コード読取装置は、表示態様が異なる2種類のセルの2次元配列より成る2次元コードを撮像対象とした画像を取得する画像取得手段と、前記取得した画像から、前記2次元コード中の情報表示領域の外側にそれぞれ位置する複数のセルが構成する特定のパターンを抽出する特定パターン抽出手段と、前記特定パターン抽出手段により抽出された特定のパターンに基づき前記情報表示領域を特定し、その特定された領域内の画像を用いてデコード処理を実行するデコード処理手段と、前記デコード処理手段によりデコードされた情報の内容を示す読取データを出力する読取データ出力手段と、前記読取データ出力手段が読取データを出力できない読取失敗が生じたとき、前記特定パターンの抽出数に基づき前記読取失敗の原因を判別する判別手段と、前記判別手段による判別結果を出力する出力手段とを具備する。
【0028】
前記デコード処理手段は、1つの2次元コードの読取のために割り当てられた処理時間が経過するまで前記デコード処理を繰り返すことが可能に設定される。また判別手段には、前記1つの2次元コードの読取に割り当てられた処理時間に基づいて定められたしきい値が設定されており、前記特定のパターンの抽出に応じてデコード処理が実行された結果、前記読取失敗が生じたとき、前記特定のパターンの抽出数を前記しきい値と比較し、前記抽出数がしきい値を上回るときは、前記特定のパターンとして誤抽出されたノイズの多さが前記読取失敗の原因であると判別し、前記特定のパターンの抽出数が前記しきい値を下回るときは、画像中の2次元コードがデコードできない状態にあることが前記読取失敗の原因であると判別する。
【0029】
画像取得手段は、少なくともカメラなどの撮像部により生成された画像を入力する入力インターフェースを具備する。また、アナログ画像信号が入力される場合には、画像取得手段には、A/D変換回路を含ませるのが望ましい。
【0030】
特定パターン抽出手段、デコード処理手段、判別手段は、それぞれ前記2次元コードの読取方法において述べた特定パターンの抽出処理、デコード処理、読取失敗の原因を判別する処理を実行する。これらの手段は、プログラムを組み込んだコンピュータにより構成することができ、また各手段を1つのコンピュータにより構成することができる。ただし、各手段とも、2次元コードの画像に対する画像処理を行う機能については、別体のコンピュータまたは画像処理専用のハードウェア回路により構成することもできる。
【0031】
前記読取データ出力手段および判別結果出力手段は、それぞれ外部機器に対するインターフェース回路として構成することができる。また、これらの出力手段は、前記判別結果を表示する表示装置もしくは判別結果を音声出力する音声回路として構成することもできる。また、上記いずれの形態を用いる場合でも、各出力手段を一体に構成することができる。
【0032】
上記2次元コード読取装置の1番目の態様では、前記判別手段は、前記特定のパターンが抽出されずに読取失敗となったとき、前記画像の明るさを所定の数値範囲と比較し、前記明るさが前記数値範囲内にあれば撮像時の2次元コードの位置が前記読取失敗の原因であると判別し、前記明るさが前記数値範囲外にあれば2次元コードに対する照明の状態が前記読取失敗の原因であると判別する。
【0033】
さらに、上記2次元コード読取装置にかかる第2の態様では、前記出力手段は、前記判別手段が判別した読取失敗の原因を示す情報を表示する表示手段を含むものとして構成される。このようにすれば、読取失敗が生じたとき、2次元コード読取装置自身に失敗の原因を示す情報を表示させることができるので、読取処理の現場にいるユーザーに、失敗の原因を、迅速かつ、わかりやすく知らせることができる。
【0034】
上記した各構成にかかる2次元コード読取装置は、2次元コードを撮像する撮像部(カメラ、スキャナなど)や、2次元コードの読取結果などを表示するためのモニタを接続することができる。あるいは、これら撮像部やモニタを上記した各種手段にかかる構成とともに、単一の筐体の内外に一体化することもできる。
【0035】
上記した2次元コード読取方法および装置によれば、読取失敗が生じた場合には、その失敗の原因をユーザーに提示することができる。よって、たとえば、本格的な読取処理を開始する前の調整時に、読取失敗の原因を速やかに取り除いて適切な調整を行うことができ、設定作業の効率化をはかることができる。
【0036】
【発明の実施の形態】
図1は、この発明にかかる2次元コード読取装置の構成を示す。図中、レンズ101および撮像素子(CCD)102は、2次元コード7を撮像するためのもの、照明ランプ6は、処理対象の2次元コード7を照明するためのものである。
【0037】
さらに、この2次元コード読取装置1には、撮像制御部104、照明制御部105、トリガ入力部106、A/D変換部107、画像記憶部108、画像処理部109、デコード処理部110、判定処理部111、出力処理部112などを具備する。また、図中の11は、この2次元コード読取装置1の動作を制御する上位システムであり、パーソナルコンピュータやプログラマブルコントローラ(PLC)などにより構成される。また、モニタ4は、後記するように、2次元コード読取装置1の構成要素として設定することもできる。
【0038】
トリガ入力部106は、上位システム11から撮像開始を指示するトリガ信号を受け付ける。このトリガ信号は、撮像制御部104および照明制御部105に与えられる。これにより、照明ランプ6による照明の下でCCD102が作動し、2次元コード7が撮像される。
【0039】
CCD102からの画像信号は、A/D変換部107においてディジタル変換された後、画像記憶部108に格納される。画像処理部109は、画像記憶部108に格納された画像データ(以下、「処理対象画像」という。)から2次元コード7のファインダパターンを抽出した後、その抽出結果に基づき、処理対象画像中の2次元コードの位置や傾きを判別する。また画像処理部109は、タイミングパターンを抽出し、その配列に基づき、コード内の各セルの位置、大きさを認識する。さらに2値化処理などにより、各セルが黒セル、白セルのいずれであるかの判別や、セルの大きさを判別する処理などを実行する。
【0040】
デコード処理部110は、画像処理部109の処理結果に基づき、各セル毎の光学情報を符号化する。さらに、デコード処理部110は、これらの符号をシンボルキャラクタ毎にまとめながら、そのシンボルキャラクタの示す値(コードワード)に誤りが生じていないかどうかを判別し、誤りがある場合にはこれを訂正する。これにより、光学情報がデコードされると、そのデコード結果は出力処理部113に出力される。
【0041】
判定処理部111は、前記画像処理部109やデコード処理部110による一連の処理において光学情報の読取に失敗したとき、その失敗の原因を判別する処理を実行する。この判別結果も出力処理部112に与えられる。出力処理部112は、デコード処理部110や判定処理部111からの処理結果を前記上位システム11やモニタ4に出力する。
【0042】
つぎに、図2および図3は、前記2次元コード読取装置1の具体的な構成例を示す。まず、図2は、2次元コード読取装置1の外観とその使用状態を示すものである。この実施例の2次元コード読取装置1は、プリント配線基板の組立製造ラインにおける情報管理システムに組み込まれるもので、コンピュータが内蔵されたコントローラ2と、このコントローラ2にケーブル接続されるCCDカメラ3(以下、単に「カメラ3」という。)とを基本構成とする。なお、コントローラ2の前面には、カメラ接続用のコネクタ8aが2つ設けられるほか、モニタ4,コンソール5(いずれも図3に示す。)を接続するためのコネクタ8b,8cなどが設けられる。また、カメラ3の内部には、前記した照明ランプ6が収容されている。
【0043】
この実施例にかかる2次元コード読取装置1は、前記プリント配線基板に実装される部品9の表面に付された2次元コード7を読み取る目的で設置される。なお、この2次元コード7のマーキングは、コンベア10の上流において、図示しないマーキング装置により行われる。また、このマーキングは、黒セルに相当する部分にピンで孔を形成する方法や、レーザー光により黒セルを印刷する方法など、部品9に2次元コード7を直接マークする方法(ダイレクトマーキング)により行われる。
【0044】
前記カメラ3は、部品の搬送用コンベア10(以下、単に「コンベア10」という。)の上方に設置される。コントローラ2は、このコンベア10の近傍位置に設置されており、前記した上位システム11に接続される。コントローラ2は、この上位システム11からのコマンドを受けてカメラ3を作動させて前記2次元コード7を撮像させた後、その画像中の2次元コードが有する光学情報をデコードする。
【0045】
前記コントローラ2で最終的に得られたデコード結果は、上位システム11に送信される。なお前記2次元コード7には、部品の種類,部品番号,部品の搬送先,部品が組み付けられる基板の番号など、組立処理に必要な種々の情報が格納される。上位システム11は、これらの情報を用いて、前記コンベア10の経路を切り替えたり、図示しない組立ロボットにコマンドを送るなどの制御を実行する。
【0046】
図3は、前記コントローラ2を中心とした2次元コード読取装置1のハードウェアブロック図を示す。この実施例のコントローラ2は、CPU21、メインメモリ22、入出力制御部23、画像処理部24、モデルメモリ25、画像メモリ26などを主要構成として含む。前記したカメラ3、モニタ4、コンソール5、およびカメラ3内の照明ランプ6は、それぞれインターフェース回路203,204,205,206を介して入出力制御部23に接続される。なお、カメラインターフェース回路203には、前記したA/D変換部107が含まれる。
【0047】
またCPU21は、通信インターフェース回路201を介して、前記上位システム11とデータやコマンドのやりとりを実行する。前記図1のトリガ入力部106は、通信インターフェース回路201およびCPU21におけるトリガ信号を受け付ける機能により構成されるものである。
【0048】
前記入出力制御部23および画像処理部24は、CPUバス27を介してCPU21に接続されるとともに、画像バス28を介して相互に画像データをやりとりできるように構成されている。カメラ3から出力された画像は、入出力制御部23から画像処理部24に提供されて、画像メモリ26に格納される。この画像メモリ26は、図1の画像記憶部108に対応する。画像処理部24は、この画像メモリ26に格納された画像をCPU21からの指示に応じて読み出して、入出力制御部23に提供する。
【0049】
入出力制御部23は、モニタ4に対し、前記画像処理部24から提供された画像およびカメラ3から入力したリアルタイムの画像を切り替えて表示させることができる。また、画像の表示とともに、その画像に対する読取処理の結果を表示させることもできる。さらに、2次元コードの読取に失敗したときには、入出力制御部23は、CPU21から後記するコメント情報の提供を受け、これを前記モニタ4に表示させる。また、CPU21は、上位システム11に対し、コメント情報と同じ内容を示すエラーコードを出力する。
【0050】
メインメモリ22は、CPU21の動作に必要なプログラムを格納するほか、処理の過程で生じたデータを一時保存したり、コメント情報の設定テーブル(図4に示す。)や後記するしきい値NM,Lmax,Lminを記憶するなどの目的で使用される。
【0051】
モデルメモリ25は、2次元コードのファインダパターンの抽出に使用するモデルを登録するためのもので、画像メモリ26とともに画像処理部24に接続される。画像処理部24は、画像処理専用のプロセッサやディジタル演算回路を具備するもので、前記図1の画像処理部109に対応する。
【0052】
前記メインメモリ22には、前記図1の撮像制御部104、照明制御部105、デコード処理部110、判定処理部111、出力処理部112の各処理部に対応するプログラムが格納される。CPU21は、これらのプログラムに基づく処理を実行することにより、各処理部として機能することができる。
【0053】
この実施例のコントローラ2は、前記コンベア10上に搬送される各部品9に対し、カメラ3を作動させて2次元コード7の画像を取り込む処理と、その画像の2次元コードを読み取る処理とを、高速で繰り返し実行するように設定されている。なお、「読取処理」とは、2次元コードの画像をコントローラ2内に取り込んでからデコードを終了するまでの一連の処理を意味するもので、ファインダパターンの抽出処理とデコード処理とに大別される。
【0054】
なお、この実施例のファインダパターンの抽出処理では、前記モデルメモリ25内のモデルを処理対象画像に走査しながら相関演算を実行するパターンマッチング処理を実行する(以下では、このパターンマッチングによりファインダパターンを検索する処理を「相関サーチ」という。)。ただし、この相関サーチに代えて、画像上のエッジ点やその濃度勾配方向を利用した処理により、ファインダパターンを抽出することもできる。
【0055】
ここで、上記のファインダパターンの抽出処理について簡単に説明する。この処理では、まず、処理対象画像に対しエッジ抽出のための微分処理を実行する。つぎに抽出された各エッジ点において、その濃度勾配方向(黒から白に向かう方向)に直交する方向に沿って所定長さの線分を設定する。
【0056】
この処理は、刻印マーキングによる2次元コードのように、黒セルがドットのパターンとして表されるコードを処理するのに向いている。たとえば、データマトリクスのファインダパターンでは、黒セルを示すドットが所定間隔をおいてL字状に配列されるから、これらのドットの輪郭線上の各エッジ点に対し、ドットの接線に近似する線分を設定することができる。ここで、これらの線分の重なり度合いに着目すると、前記L字状の配列方向に沿う重なり度合いが最も大きくなると考えられる。よって、処理対象画像に設定された線分の中から、重なり度合いが所定値以上となる画像領域を抽出し、その中でファインダパターンの形状に近似する画像領域を抽出する方法により、ファインダパターンの位置や向きを特定することができる。
【0057】
この実施例のコントローラ2では、上記の読取処理において、2次元コードの読取に失敗したとき、その失敗の原因を判別する処理を実行するようにしている。判別処理の結果は、所定のコメント情報に変換されてモニタ4に表示される。
【0058】
図4は、前記コメント情報の設定テーブルの例を示す。この設定テーブルは、前記メインメモリ22に格納されるもので、5つのコメント情報にそれぞれ個別の識別番号を対応づけた構成をとる。なお、以下では、各コメント情報を、その識別番号を用いて、「コメント1」「コメント2」・・・というように示す。
【0059】
図4において、コメント1は2次元コード7に対する照明が明るすぎることを、コメント2は、前記照明が暗すぎることを、それぞれ示す。コメント3は、2次元コード7がカメラ3の視野に正しく含まれていないことを示すもので、2次元コード7全体、または少なくともファインダパターンを含む一部分が欠落している場合に適用される。
【0060】
コメント4は、画像上の2次元コード7がデコードできない状態にあることを示す。たとえば、コントラストが足らないためにタイミングパターンを抽出できなかったときや、白セルと黒セルとの識別処理において、2次元コードのマーキング状態が悪いために訂正が不可能な数の誤りが生じたときに、このコメント4が適用されることになる。
【0061】
コメント5は、2次元コード7の背景状態が悪いことを示す。ここで、悪い背景状態とは、凹凸や模様などにより、ファインダパターンとして誤抽出されるノイズが多い状態のことである。この実施例のように、カメラ3の視野内に2次元コード7を順次送り込んで読取処理を行う場合、毎回の読取処理には所定の割り当て時間を設定する必要がある。コメント5は、割り当て時間内にデコード処理を終了できないほどのファインダパターンの候補が抽出されたことを意味するものとなる。
【0062】
なお、図4には示していないが、この設定テーブルには、各コメント情報に対応するエラーコードも格納される。エラーコードは上位システム11に出力されるほか、コメント情報とともにモニタ4にも表示される。
【0063】
図5は、前記コントローラ2において、1つの2次元コードの画像データに対する読取処理の手順(ST1〜17)を示す。
まず上位システム11からの読取開始信号が入力されると、前記カメラ3を駆動して処理対象の2次元コードを撮像させる。カメラ3からの画像は、前記したように、入出力制御部23から画像処理部24に渡された後、画像メモリ26に格納される(ST1〜3)。
【0064】
つぎのST4で、画像処理部24は、前記画像メモリ26に格納された画像に対し、モデルメモリ25内のモデルを用いた相関サーチを行って、ファインダパターンを抽出する。なお、この相関サーチの結果は、画像処理部24からCPU21に伝送される。CPU21は、抽出されたファインダパターンの候補の数(以下、「候補数N」とする。)、およびモデルに対する各候補の類似度をメインメモリ22に一時保存する。
【0065】
前記候補数Nが0より大きい場合には、ST5が「YES」となってST6のデコード処理に進む。ここで、このデコード処理の具体的な手順について、図6を用いて説明する。
【0066】
このデコード処理は、前記ST4で抽出されたファインダパターンの各候補に対し、順に行われる。なお、処理の順序は、モデルへの類似度が高いものからとなる。
【0067】
最初のST61では、前記ファインダパターンの候補に基づき、タイミングパターンを抽出する。つぎのST62では、前記タイミングパターンのセルの配列状態に基づき、コード内部の各セルの位置を抽出する。ついで、ST63では、前記タイミングパターンに囲まれる情報表示領域について、その領域内の各セル毎に濃度値を2値化するなどして、セルが白であるか黒であるかを判別し、その判別結果に基づき、各セルの表わす光学情報を符号化する。さらに、ST64では、これらの符号を誤り訂正処理を行いつつデコードする(ST64)。
【0068】
なお、図6には記載していないが、前記ST61〜64のいずれかのステップにおいて、処理を途中で実行できない状態になった場合には、以下のステップをキャンセルしてST65へと進む。このST65では、上記各ステップによる処理に成功したかどうかを判別する。ここでいずれかのステップにおいて処理に失敗している場合には、ST65が「NO」となってST66に進み、抽出されたファインダパターンの候補すべてに対する処理を終了したかどうかをチェックする。ここで未処理の候補があれば、ST66からST61に戻り、つぎの候補に対し、同様に、ST61〜64の処理を実行することになる。
【0069】
所定の候補に対し、ST61〜64の処理により情報がデコードされると、ST65は「YES」となり、デコード処理を終了する。すなわち、前記所定の候補に対するデコードに成功した場合には、未処理の候補があっても、その候補に対するST61〜64の処理はキャンセルされることになる。
【0070】
図5に戻って、上記図6の手順によりデコードに成功すると、ST7が「YES」となってST8に進む。ST8では、デコード結果を配列して最終形式の読取データを編集し、これを上位システム11およびモニタ4に出力する。
【0071】
一方、ファインダパターンの候補のいずれに対しても情報をデコードできなかった場合には、ST7が「NO」となり、ST9において、前記候補数Nを所定のしきい値NM(NM>0)と比較する。候補数Nが前記しきい値NMより小さい場合には、ST9からST10に進み、前記モニタ4にコメント4を出力する。また、候補数Nがしきい値NM以上の値をとる場合には、ST9からST11に進み、前記モニタ4にコメント5を出力する。
【0072】
つぎに、前記ST4において、ファインダパターンを抽出できなかった場合には、ST5が「NO」となってST12に進み、処理対象画像の明るさLを算出する。なお、この算出処理は、処理対象画像中の全画素の階調を平均する方法により行われるが、これに限らず、たとえば明るさの最大値と最小値との平均値を求めてもよい。
【0073】
つぎに、ST13,14では、前記明るさLを所定のしきい値Lmax,Lmin(Lmax<Lmin)と比較する。ここで明るさLがLmaxより大きい場合には、ST13が「YES」となってST17に進み、前記モニタ4にコメント1を出力する。また、明るさLがLminより小さい場合には、ST13が「NO」、ST14が「YES」となってST16に進み、前記モニタ4にコメント2を出力する。
【0074】
前記明るさLが、Lmin≦L≦Lmaxの範囲にあれば、ST13,14がともに「NO」となってST15に進み、前記モニタ5にコメント3を出力する。
【0075】
なお、前記ST9において、候補数Nをしきい値NMと比較する場合に、ある候補が示す2次元コードの領域内に他の候補が含まれる場合には、これらの候補を1候補とみなして候補数Nを減数してもよい。
【0076】
上記図5の手順において、前記しきい値NMは、ファインダパターンの抽出のためにデコード処理のための時間を確保できなくなる場合の候補数Nに基づき設定することができる。1つの2次元コード7の読取には、あらかじめ一定の処理時間Tが割り当てられるから、前記ファインダパターンの抽出処理が終了した時点の残り時間は、候補数Nが多くなるほど少なくなると考えられる。よって、たとえば、下記の(1)式を満たすNの最小の値を、前記しきい値NMとすることができる。
T−T1<N×t ・・・(1)
【0077】
上記(1)式において、T1はN個のファインダパターンの抽出に必要な時間に所定の余裕時間を加味した値である。またtは、1つの候補に対するデコード処理に必要な時間である。tの値はコントローラ2の処理能力に応じた一定値であり、T1の値は候補数Nに応じて定めることができる。なお、割り当て時間Tは、あらかじめ所定の値に固定しておくこともできるが、これに限らず、上位システム11やコンソール5を介して設定することもできる。
このように割り当て時間Tを可変設定できるようにした場合、前記しきい値NMは、Tの値によって変動することになる。なお、割り当て時間Tは部品9の搬送速度に応じて設定することができる。
【0078】
前記明るさのしきい値Lmax,Lminの設定については、下記のようにする。
たとえば、明るさの階調を256階調にした装置の場合、濃淡識別のために必要な分解能が10階調程度であることを考慮して、Lmaxを245階調程度に設定しておく。また、Lminについては、ノイズの影響による明るさのレベルと、判別のために必要な分解能が10階調程度であることを考慮して、50階調程度に設定しておく。
上記の設定によれば、ハレーション現象などにより画像が明るすぎる場合には、明るさLはLmaxより大きくなる。また、2次元コードの黒セルと背景の黒とを視認できないほど画像が暗い場合には、明るさLはLminより小さくなる。
【0079】
上記図5の手順によれば、デコード処理に失敗した場合には、ファインダパターンの候補数Nに基づき、その失敗の原因が2次元コードにあるのか、背景にあるのかを判別することができる。また、ファインダパターンの抽出に失敗した場合には、処理対象画像の明るさに基づき、前記失敗の原因が照明にあるのか、またはカメラ3の視野に対する2次元コードの位置によるものかを、判別することができる。
【0080】
特に、照明や2次元コードの位置に不備がある場合には、判別結果に基づき、速やかにその不備を修正することができるから、装置導入時に、照明、カメラ3の視野、2次元コードの位置などを調整する際に、調整作業を効率良く進めることができる。
【0081】
また、2次元コードの状態に不備があると判別された場合には、デコード処理のいずれのステップで失敗が生じたかにより、不備の内容をより具体的に判別することができる。
たとえば、タイミングパターンが抽出できなかった場合には、コントラストが足りないと考えられるので、照明状態に問題があると判別することができる。また、タイミングパターンは抽出できたが、デコードができなかった場合には、2次元コードのマーキング状態に不備があると判別することができる。
【0082】
図7(1)(2)は、前記図5の読取処理が終了したときのモニタ4における表示例を示す。図7(1)は、読取成功時の表示例であって、2次元コードの画像31を含む処理対象画像30が表示されるとともに、前記2次元コードから得た読取データ32や「OK」のマーク33などが表示されている。
【0083】
図7(2)は、前記読取処理に失敗したときの表示例であって、読取失敗の原因の判別結果に基づくコメント情報34(図示例ではコメント1)が、対応するエラーコード35や「NG」のマーク36とともに表示されている。また、この例でも処理対象画像が表示されている。ただし、画像上の2次元コードを識別できない状態にあるため、便宜上、処理対象画像30は空白状態として図示する。
【0084】
【発明の効果】
この発明によれば、2次元コードの読取処理に失敗したとき、その読取処理における特定パターンの抽出数に基づき失敗の原因を判別し、その判別結果をユーザーに提示することができる。したがって、ユーザーは読取失敗の原因を的確に把握することができ、失敗に対し、正確な対応をとることができる。よって、本格的な読取処理を開始する前の調整時などにおいて、照明、撮像手段の視野、2次元コードの位置などの設定条件に不備があっても、その不備を速やかに取り除いて対応することができる。
【図面の簡単な説明】
【図1】 この発明が適用された2次元コード読取装置の構成を示す機能ブロック図である。
【図2】 2次元コード読取装置の外観および使用状態を示す図である。
【図3】 2次元コード読取装置の電気構成を示すブロック図である。
【図4】 コメント情報の設定テーブルを示す図である。
【図5】 読取処理の手順を示すフローチャートである。
【図6】 デコード処理の詳細な手順を示すフローチャートである。
【図7】 読取終了時の表示例を示す図である。
【図8】 2次元コードの代表例および各コードにおけるファインダパターン,タイミングパターンを示す説明図である。
【符号の説明】
1 2次元コード読取装置
2 コントローラ
3 カメラ
4 モニタ
7 2次元コード
21 CPU
22 メインメモリ
23 入出力制御部
24 画像処理部
26 画像メモリ
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to a technique for imaging a two-dimensional code in which predetermined information is encoded, performing image processing on the two-dimensional code in the generated image, and reading the content of information displayed by the two-dimensional code. . In this specification, visually recognizable information represented by a two-dimensional code (generally appearing as an array pattern of white and black cells) is referred to as “optical information”.
[0002]
[Prior art]
  The two-dimensional code is a code in which white or black small areas called “cells” are two-dimensionally arranged. Each cell represents the minimum unit of optical information. In addition to the cells that make up specific information, the cells that make up the finder pattern for identifying the position and orientation of the two-dimensional code, and the cells in the code The cell which comprises the timing pattern for carving and identifying is included.
[0003]
  FIGS. 8A and 8B show a data matrix and a QR code, which are representative two-dimensional codes, respectively. In the data matrix, an L-shaped finder pattern 40 indicating the code direction is formed on two orthogonal sides, and an L-shaped timing pattern 41 is formed on the other two orthogonal sides. The finder pattern 40 is configured by arranging black cells, and the timing pattern 41 has a configuration in which white cells and black cells are alternately arranged (hereinafter, white cells are referred to as “white cells”, and black cells are referred to as “white cells”. Black cell ").
[0004]
  On the other hand, the QR code is provided with a finder pattern 42 composed of three rectangular positioning symbols 42a, 42b and 42c. Each positioning symbol 42a, 42b, 42c is formed by arranging a white cell frame around a rectangular pattern of a plurality of black cells, and further arranging a black cell frame outside thereof. These positioning symbols 42a, 42b, and 42c are respectively arranged at positions corresponding to the vertices of the code, and white cells and black cells are alternately arranged so as to connect corners inside the respective symbols 42a, 42b, and 42c. The L-shaped timing pattern 43 thus formed is formed.
  In both the data matrix and the QR code, the relationship between the white cell and the black cell shown in the figure may be reversed depending on the background state.
[0005]
  When reading the above two-dimensional code, first, the finder patterns 40 and 42 on the image are extracted by image processing such as edge extraction processing or pattern matching processing to recognize the position and orientation of the code. Next, timing patterns 41 and 43 are extracted based on the extracted finder patterns 40 and 42.
[0006]
  The area surrounded by the timing patterns 41 and 43 is an area where specific contents of optical information are encoded (hereinafter, this area is referred to as “information display area”). When the timing patterns 41 and 43 are extracted, the position of each cell in the information display area is specified based on the arrangement of white cells and black cells in the pattern. Then, it is determined whether each cell is black and white by binarization processing or the like, and optical information represented by each cell is encoded according to the determination result. Furthermore, the optical information is decoded by arranging the code of each cell for each group of cells (symbol character) representing information for one unit such as characters. In this decoding, a process (error correction process) for correcting an error that has occurred when determining the monochrome state of a cell is also executed. Hereinafter, the process from the extraction of the timing pattern to the completion of the decoding of the optical information is referred to as “decoding process”.
[0007]
  In the above-described reading process, only one finder pattern should be originally extracted. However, if there is noise (such as a pattern or shadow) similar to the shape of the finder pattern in the background of the two-dimensional code. Noise may be extracted as a finder pattern candidate. In order to cope with such noise, the conventional two-dimensional code reader performs a decoding process for each extracted finder pattern candidate, and when one of the finder patterns is successfully decoded, the decoding is performed. Read data indicating the contents of the information is output.
[0008]
[Problems to be solved by the invention]
  In the reading process using the conventional two-dimensional code reading apparatus, the reading process is started after adjusting the installation position of the apparatus, the illumination state, the work feeding position with respect to the field of view of the camera, and the like. However, if these adjustments are poor, optical information reading may fail (hereinafter, this failure is referred to as “reading failure”). Even if the adjustment is appropriate, reading of the optical information may fail because the marking state of the two-dimensional code on the workpiece is bad or the noise is in the background of the two-dimensional code.
[0009]
  However, in the conventional reading process, even if a reading failure occurs, there is no information indicating the cause of the failure, so the user has to investigate the cause by trial and error. For this reason, there is a problem that the setting at the time of introduction takes time and the start of full-scale reading processing is delayed.
[0010]
  Patent Document 1 below describes that in the optical information reading process, when the decoding process fails, the cause is analyzed, and the cause of the reading error and the coping method are reported based on the analysis result. Yes.
[0011]
[Patent Document 1]
JP 2002-236870 A
              (See paragraphs [0008] and [0009].)
[0012]
  In the above-mentioned Patent Document 1, a barcode reading process is given as a specific example of the reading process, and the cause of the reading error is analyzed based on the overall voltage level (waveform) of the image, the bar width, the left and right margins of the code, and the like. (Refer to paragraphs [0025] to [0031].) However, for the two-dimensional code, paragraph [0039] only describes that the same method as the barcode can be applied, and there is nothing about a specific processing method for reading failure of the two-dimensional code. Not shown.
[0013]
  An object of the present invention is to make it possible to determine in detail the cause of the reading failure when the reading process for the two-dimensional code fails and to notify the user of the determination result.
[0014]
[Means for Solving the Problems]
  The two-dimensional code reading method according to the present invention includes:Consists of two-dimensional array of two types of cells with different display modesImage with 2D code as imaging targetTo form a plurality of cells respectively located outside the information display area in the two-dimensional code.Extract specific patternsAndSpecific patterns extractedBy specifying the information display area based on the image and performing a decoding process on the area,Reads optical information represented by a two-dimensional codeIs.
[0015]
  In the above methodInA pattern called a finder pattern in the existing two-dimensional code can be a specific pattern. However, the specific pattern is not limited to the finder pattern. For example, a combination of the finder pattern and the timing pattern may be the specific pattern.
[0016]
  As an example of image processing for extracting a specific pattern, pattern matching processing using a model of the specific pattern can be given. Further, if the specific pattern is a linear pattern or a pattern including a portion in which black cells or white cells are arranged in a straight line, after extracting the edge points included in the image, the density is determined for each extracted edge point. It is also possible to adopt a method in which a line segment having a predetermined length is set in a direction orthogonal to the gradient, and an image region in which the overlapping degree of the line segments is a predetermined value or more is extracted.
[0017]
  The decoding processThen, a process of extracting a timing pattern, a process of identifying and binarizing each cell in the information display area, a process of decoding the information encoded by binarization while collecting it for each symbol character, etc. Can do. Further, in the decoding process, it is possible to perform a process of correcting an error that has occurred in the identification for each cell for each symbol character.
[0018]
  On the backgroundNoise such as patterns and shadowsIf the number of extractions for a particular pattern increases due toSince the processing time required for the extraction becomes long, there is a possibility that the time required for the decoding process is insufficient and decoding becomes impossible.
[0019]
  Also, for example, if the density difference between the black cell and the white cell is small or the size of the cell is not appropriate, the timing pattern cannot be extracted or the cell is in a monochrome state. The number of errors that occurred during the determination exceeds the correctable number, and decoding is impossible. In such a caseCan be considered that the number of extractions of a specific pattern is greater than zero and less than the number of extractions when decoding is impossible due to the noise.
[0020]
  In view of the above points, in the method of reading a two-dimensional code according to the present invention, a processing time of a predetermined length is assigned to reading one two-dimensional code, and the decoding process is repeated until the processing time elapses. When a reading failure in which optical information cannot be read occurs as a result of the decoding process being executed in accordance with the extraction of the specific pattern, the number of extractions of the specific pattern is set to read the one two-dimensional code. When the number of extractions exceeds the threshold value based on the processing time assigned to the image, the number of noises erroneously extracted as the specific pattern is the cause of the reading failure. If the number of extractions of the specific pattern falls below the threshold value, it is possible that the two-dimensional code in the image cannot be decoded. So that it is determined that it is.
[0021]
  The above-mentioned patent document 1 describes that the cause of the reading failure is determined based on the brightness level of the image, the code width, and the left and right margins. Nothing is shown about using the number of extractions for a particular pattern.
[0022]
  Above methodAccording to the decoding processWhether the failure is due to the amount of noise mis-extracted as a specific pattern or because the 2D code cannot be decodedIt can be discriminated and presented clearly to the user.
[0023]
  Take the above methodOne aspectThen, the specific patternFailed to be extracted and reading failedWhen the brightness of the image is compared with a predetermined numerical range. If the brightness is within the numerical range, it is determined that the position of the two-dimensional code at the time of imaging is the cause of the reading failure. If the brightness is outside the numerical range, illumination of the two-dimensional code is determined. It is determined that the state is the cause of the reading failure.
[0024]
  In the above aspect, the brightness of the image can be obtained by averaging the gradation for each pixel constituting the image. The numerical range is preferably set based on the brightness when the image is halated and the minimum brightness when the image is not illuminated (brightness only due to the influence of noise). If the brightness is within a numerical range, it is possible to identify the shade of the image. Therefore, if there is a specific pattern in the image, it can be extracted. Nevertheless, it can be considered that the specific pattern is not included in the field of view of the imaging device when the number of extraction of the specific pattern is zero.
[0025]
  On the other hand, if the brightness exceeds the numerical range, it can be considered that the illumination is too bright. Moreover, when the said brightness is less than a numerical range, it can be considered that illumination is too dark.
  Therefore, according to the above aspect,If a specific pattern is not extracted and reading fails, the failureIt is possible to accurately determine whether or not this is due to an inadequate position of the two-dimensional code at the time of imaging, or to indicate the cause.
[0026]
  Of the two-dimensional code reading methodSecondIn the aspect ofAccording to the determination of the cause of reading failureDisplay information indicating the cause. This display information is preferably comment information that allows the user to easily understand the cause.
[0027]
  Next, the two-dimensional code reader according to the present invention is as follows.Consists of two-dimensional array of two types of cells with different display modesImage acquisition means for acquiring an image with a two-dimensional code as an imaging target, and the acquired imageTo form a plurality of cells respectively located outside the information display area in the two-dimensional code.A specific pattern extracting means for extracting a specific pattern, and a specific pattern extracted by the specific pattern extracting means;The information display area is identified based on theThe image in the regionmake use ofDecoding processing means for executing decoding processing, read data output means for outputting read data indicating the content of information decoded by the decode processing means, and reading failure in which the read data output means cannot output read data occurred. And determining means for determining the cause of the reading failure based on the number of extractions of the specific pattern, and output means for outputting a determination result by the determining means.
[0028]
  The decoding processing means is set to be able to repeat the decoding processing until a processing time allocated for reading one two-dimensional code elapses. In addition, the threshold value determined based on the processing time assigned to the reading of the one two-dimensional code is set in the determination means, and the decoding process is executed in accordance with the extraction of the specific pattern. As a result, when the reading failure occurs, the number of extractions of the specific pattern is compared with the threshold value, and when the number of extractions exceeds the threshold value, a large amount of noise erroneously extracted as the specific pattern. Is the cause of the reading failure, and when the number of extractions of the specific pattern is less than the threshold value, the reason for the reading failure is that the two-dimensional code in the image cannot be decoded. Determine that there is.
[0029]
  The image acquisition means includes at least an input interface for inputting an image generated by an imaging unit such as a camera. When an analog image signal is input, it is desirable that the image acquisition unit includes an A / D conversion circuit.
[0030]
  The specific pattern extraction unit, the decoding processing unit, and the determination unit execute the specific pattern extraction process, the decoding process, and the process of determining the cause of the reading failure described in the two-dimensional code reading method, respectively. These means can be constituted by a computer incorporating a program, and each means can be constituted by one computer. However, the function of performing image processing on an image of a two-dimensional code can be configured by a separate computer or a dedicated hardware circuit for image processing.
[0031]
  Each of the read data output unit and the determination result output unit can be configured as an interface circuit for an external device. Further, these output means can be configured as a display device for displaying the discrimination result or an audio circuit for outputting the discrimination result as audio. Moreover, even if it uses any said form, each output means can be comprised integrally.
[0032]
  First aspect of the two-dimensional code readerThen, the discrimination means isThe specific pattern isReading failed without extractionThe brightness of the image is compared with a predetermined numerical range, and if the brightness is within the numerical range, it is determined that the position of the two-dimensional code at the time of imaging is the cause of the reading failure, and the brightness Is outside the numerical range, it is determined that the illumination state for the two-dimensional code is the cause of the reading failure.
[0033]
  further,The above two-dimensional code readerSecondIn the aspect, the output means is determined by the determination means.Reading failureIt is configured to include display means for displaying information indicating the cause. In this way, when a reading failure occurs, information indicating the cause of the failure can be displayed on the two-dimensional code reader itself, so that the user at the site of the reading process can quickly and easily determine the cause of the failure. , To make it easy to understandit can.
[0034]
  AboveThe two-dimensional code reading device according to each configuration can be connected to an image pickup unit (camera, scanner, etc.) for picking up a two-dimensional code, and a monitor for displaying a reading result of the two-dimensional code. Or these image pick-up parts and a monitor can also be integrated in the inside and outside of a single housing | casing with the structure concerning the above-mentioned various means.
[0035]
  According to the above two-dimensional code reading method and apparatus, when a reading failure occurs, the cause of the failure can be presented to the user. Therefore, for example, at the time of adjustment before starting full-scale reading processing, the cause of reading failure can be quickly removed and appropriate adjustment can be performed, and the setting work can be made more efficient.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
  FIG. 1 shows the configuration of a two-dimensional code reader according to the present invention. In the figure, a lens 101 and an imaging device (CCD) 102 are for imaging a two-dimensional code 7, and an illumination lamp 6 is for illuminating the two-dimensional code 7 to be processed.
[0037]
  Further, the two-dimensional code reader 1 includes an imaging control unit 104, an illumination control unit 105, a trigger input unit 106, an A / D conversion unit 107, an image storage unit 108, an image processing unit 109, a decoding processing unit 110, a determination A processing unit 111, an output processing unit 112, and the like are included. Reference numeral 11 in the figure denotes a host system that controls the operation of the two-dimensional code reader 1, and is composed of a personal computer, a programmable controller (PLC), and the like. The monitor 4 can also be set as a component of the two-dimensional code reader 1 as will be described later.
[0038]
  The trigger input unit 106 receives a trigger signal that instructs the start of imaging from the host system 11. This trigger signal is given to the imaging control unit 104 and the illumination control unit 105. Thereby, the CCD 102 operates under illumination by the illumination lamp 6 and the two-dimensional code 7 is imaged.
[0039]
  The image signal from the CCD 102 is digitally converted by the A / D conversion unit 107 and then stored in the image storage unit 108. The image processing unit 109 extracts the finder pattern of the two-dimensional code 7 from the image data stored in the image storage unit 108 (hereinafter referred to as “processing target image”), and then based on the extraction result, The position and inclination of the two-dimensional code are discriminated. The image processing unit 109 extracts a timing pattern and recognizes the position and size of each cell in the code based on the arrangement. Further, a binarization process or the like is performed to determine whether each cell is a black cell or a white cell, or to determine a cell size.
[0040]
  The decode processing unit 110 encodes the optical information for each cell based on the processing result of the image processing unit 109. Further, the decoding processing unit 110 collects these codes for each symbol character, determines whether or not there is an error in the value (code word) indicated by the symbol character, and corrects the error if there is an error. To do. Thus, when the optical information is decoded, the decoding result is output to the output processing unit 113.
[0041]
  When the optical information reading fails in the series of processing by the image processing unit 109 or the decoding processing unit 110, the determination processing unit 111 executes processing for determining the cause of the failure. This determination result is also given to the output processing unit 112. The output processing unit 112 outputs the processing results from the decoding processing unit 110 and the determination processing unit 111 to the host system 11 and the monitor 4.
[0042]
  2 and 3 show a specific configuration example of the two-dimensional code reader 1. FIG. First, FIG. 2 shows the appearance of the two-dimensional code reading device 1 and its use state. The two-dimensional code reader 1 of this embodiment is incorporated into an information management system in a printed wiring board assembly and production line. A controller 2 incorporating a computer and a CCD camera 3 (with a cable connected to the controller 2) Hereinafter, the basic configuration is simply referred to as “camera 3”. In addition to the two connectors 8a for camera connection provided on the front surface of the controller 2, there are provided connectors 8b and 8c for connecting the monitor 4 and the console 5 (both shown in FIG. 3). In addition, the above-described illumination lamp 6 is accommodated in the camera 3.
[0043]
  The two-dimensional code reader 1 according to this embodiment is installed for the purpose of reading the two-dimensional code 7 attached to the surface of the component 9 mounted on the printed wiring board. The marking of the two-dimensional code 7 is performed upstream of the conveyor 10 by a marking device (not shown). This marking is performed by a method of directly marking the two-dimensional code 7 on the component 9 (direct marking), such as a method of forming a hole with a pin in a portion corresponding to a black cell or a method of printing a black cell with a laser beam. Done.
[0044]
  The camera 3 is installed above a conveyor 10 for conveying parts (hereinafter simply referred to as “conveyor 10”). The controller 2 is installed in the vicinity of the conveyor 10 and is connected to the host system 11 described above. The controller 2 receives the command from the host system 11 and operates the camera 3 to image the two-dimensional code 7, and then decodes optical information included in the two-dimensional code in the image.
[0045]
  The decoding result finally obtained by the controller 2 is transmitted to the host system 11. The two-dimensional code 7 stores various information necessary for assembly processing, such as the type of part, part number, part transport destination, and board number on which the part is assembled. The host system 11 performs control such as switching the route of the conveyor 10 or sending a command to an assembly robot (not shown) using such information.
[0046]
  FIG. 3 is a hardware block diagram of the two-dimensional code reader 1 with the controller 2 as the center. The controller 2 of this embodiment includes a CPU 21, a main memory 22, an input / output control unit 23, an image processing unit 24, a model memory 25, an image memory 26, and the like as main components. The camera 3, the monitor 4, the console 5, and the illumination lamp 6 in the camera 3 are connected to the input / output control unit 23 via interface circuits 203, 204, 205, and 206, respectively. The camera interface circuit 203 includes the A / D converter 107 described above.
[0047]
  The CPU 21 also exchanges data and commands with the host system 11 via the communication interface circuit 201. The trigger input unit 106 shown in FIG. 1 has a function for receiving a trigger signal in the communication interface circuit 201 and the CPU 21.
[0048]
  The input / output control unit 23 and the image processing unit 24 are connected to the CPU 21 via the CPU bus 27 and configured to exchange image data with each other via the image bus 28. The image output from the camera 3 is provided from the input / output control unit 23 to the image processing unit 24 and stored in the image memory 26. The image memory 26 corresponds to the image storage unit 108 in FIG. The image processing unit 24 reads out the image stored in the image memory 26 in accordance with an instruction from the CPU 21 and provides it to the input / output control unit 23.
[0049]
  The input / output control unit 23 can switch and display the image provided from the image processing unit 24 and the real-time image input from the camera 3 on the monitor 4. In addition to the display of the image, the result of the reading process for the image can be displayed. Further, when the reading of the two-dimensional code fails, the input / output control unit 23 receives comment information described later from the CPU 21 and displays it on the monitor 4. Further, the CPU 21 outputs an error code indicating the same content as the comment information to the upper system 11.
[0050]
  The main memory 22 stores programs necessary for the operation of the CPU 21, temporarily stores data generated in the course of processing, a comment information setting table (shown in FIG. 4), a threshold NM, Lmax, LminIt is used for the purpose of memorizing.
[0051]
  The model memory 25 is for registering a model used for extracting a finder pattern of a two-dimensional code, and is connected to the image processing unit 24 together with the image memory 26. The image processing unit 24 includes a processor dedicated to image processing and a digital arithmetic circuit, and corresponds to the image processing unit 109 of FIG.
[0052]
  The main memory 22 stores programs corresponding to the processing units of the imaging control unit 104, the illumination control unit 105, the decoding processing unit 110, the determination processing unit 111, and the output processing unit 112 in FIG. The CPU 21 can function as each processing unit by executing processing based on these programs.
[0053]
  The controller 2 of this embodiment performs a process of operating the camera 3 to capture the image of the two-dimensional code 7 and a process of reading the two-dimensional code of the image for each component 9 conveyed on the conveyor 10. , Is set to run repeatedly at high speed. The “reading process” means a series of processes from taking a two-dimensional code image into the controller 2 to ending the decoding, and is roughly divided into a finder pattern extraction process and a decoding process. The
[0054]
  In the finder pattern extraction process of this embodiment, a pattern matching process is executed in which a correlation calculation is performed while scanning the model in the model memory 25 on the processing target image (hereinafter, the finder pattern is extracted by this pattern matching). The search process is called “correlation search”.) However, instead of the correlation search, a finder pattern can be extracted by processing using an edge point on the image and its density gradient direction.
[0055]
  Here, the finder pattern extraction process will be briefly described. In this process, first, differential processing for edge extraction is performed on the processing target image. Next, at each edge point extracted, a line segment having a predetermined length is set along a direction orthogonal to the density gradient direction (direction from black to white).
[0056]
  This processing is suitable for processing a code in which black cells are represented as a dot pattern, such as a two-dimensional code by engraving marking. For example, in the finder pattern of the data matrix, dots indicating black cells are arranged in an L shape with a predetermined interval, and therefore, for each edge point on the outline of these dots, a line segment that approximates the tangent of the dot Can be set. Here, when attention is paid to the overlapping degree of these line segments, it is considered that the overlapping degree along the L-shaped arrangement direction becomes the largest. Therefore, from the line segments set in the processing target image, an image area whose degree of overlap is a predetermined value or more is extracted, and an image area that approximates the shape of the finder pattern is extracted from the image area. The position and orientation can be specified.
[0057]
  In the controller 2 of this embodiment, when the reading of the two-dimensional code fails in the above reading processing, processing for determining the cause of the failure is executed. The result of the discrimination process is converted into predetermined comment information and displayed on the monitor 4.
[0058]
  FIG. 4 shows an example of the comment information setting table. This setting table is stored in the main memory 22 and has a structure in which individual identification numbers are associated with five pieces of comment information. In the following, each comment information is indicated as “comment 1”, “comment 2”,...
[0059]
  In FIG. 4, comment 1 indicates that the illumination for the two-dimensional code 7 is too bright, and comment 2 indicates that the illumination is too dark. Comment 3 indicates that the two-dimensional code 7 is not correctly included in the field of view of the camera 3, and is applied when the entire two-dimensional code 7 or at least a part including the finder pattern is missing.
[0060]
  Comment 4 indicates that the two-dimensional code 7 on the image cannot be decoded. For example, when the timing pattern could not be extracted due to insufficient contrast, or in the identification process of white cells and black cells, there were a number of errors that could not be corrected due to the poor marking state of the two-dimensional code. Sometimes this comment 4 is applied.
[0061]
  Comment 5 indicates that the background state of the two-dimensional code 7 is bad. Here, a bad background state is a state in which there are many noises that are erroneously extracted as a finder pattern due to unevenness and patterns. As in this embodiment, when the two-dimensional code 7 is sequentially sent into the field of view of the camera 3 to perform the reading process, it is necessary to set a predetermined allocation time for each reading process. The comment 5 means that finder pattern candidates are extracted so that the decoding process cannot be completed within the allocated time.
[0062]
  Although not shown in FIG. 4, an error code corresponding to each comment information is also stored in this setting table. The error code is output to the host system 11 and also displayed on the monitor 4 together with the comment information.
[0063]
  FIG. 5 shows a reading process procedure (ST1 to ST17) for image data of one two-dimensional code in the controller 2.
  First, when a reading start signal is input from the host system 11, the camera 3 is driven to image a two-dimensional code to be processed. As described above, the image from the camera 3 is transferred from the input / output control unit 23 to the image processing unit 24 and then stored in the image memory 26 (ST1 to ST3).
[0064]
  In the next ST4, the image processing unit 24 performs a correlation search using the model in the model memory 25 on the image stored in the image memory 26, and extracts a finder pattern. The correlation search result is transmitted from the image processing unit 24 to the CPU 21. The CPU 21 temporarily stores in the main memory 22 the number of extracted finder pattern candidates (hereinafter referred to as “candidate number N”) and the similarity of each candidate to the model.
[0065]
  If the candidate number N is greater than 0, ST5 becomes “YES” and the process proceeds to ST6 decoding. Here, a specific procedure of the decoding process will be described with reference to FIG.
[0066]
  This decoding process is sequentially performed on each finder pattern candidate extracted in ST4. Note that the processing order starts from the one with the highest similarity to the model.
[0067]
  In the first ST61, a timing pattern is extracted based on the finder pattern candidate. In the next ST62, the position of each cell in the code is extracted based on the cell arrangement state of the timing pattern. Next, in ST63, for the information display area surrounded by the timing pattern, it is determined whether the cell is white or black by binarizing the density value for each cell in the area, and the like. Based on the determination result, the optical information represented by each cell is encoded. Further, in ST64, these codes are decoded while performing error correction processing (ST64).
[0068]
  Although not shown in FIG. 6, if any of the steps ST61 to 64 is in a state where the process cannot be executed, the following steps are canceled and the process proceeds to ST65. In ST65, it is determined whether or not the processing in each step has been successful. If the process has failed in any step, ST65 is “NO” and the process proceeds to ST66, where it is checked whether or not the processes for all the extracted finder pattern candidates have been completed. If there is an unprocessed candidate here, the process returns from ST66 to ST61, and the processes of ST61 to ST64 are similarly executed for the next candidate.
[0069]
  When information is decoded by the processes of ST61 to 64 for a predetermined candidate, ST65 becomes “YES” and the decoding process is terminated. That is, when the decoding for the predetermined candidate is successful, even if there is an unprocessed candidate, the processes of ST61 to ST64 for the candidate are canceled.
[0070]
  Returning to FIG. 5, if the decoding is successful by the procedure of FIG. 6, ST7 becomes “YES” and the process proceeds to ST8. In ST8, the decoding result is arranged and the read data in the final format is edited and output to the host system 11 and the monitor 4.
[0071]
  On the other hand, if the information cannot be decoded for any of the candidates for the finder pattern, ST7 is “NO”, and in ST9, the number of candidates N is compared with a predetermined threshold NM (NM> 0). To do. When the number of candidates N is smaller than the threshold value NM, the process proceeds from ST9 to ST10, and the comment 4 is output to the monitor 4. If the number of candidates N is greater than or equal to the threshold NM, the process proceeds from ST9 to ST11, and the comment 5 is output to the monitor 4.
[0072]
  Next, when the finder pattern cannot be extracted in ST4, ST5 becomes “NO” and the process proceeds to ST12, and the brightness L of the processing target image is calculated. This calculation process is performed by a method of averaging the gradations of all pixels in the processing target image. However, the present invention is not limited to this. For example, an average value of the maximum value and the minimum value of brightness may be obtained.
[0073]
  Next, in ST13 and ST14, the brightness L is set to a predetermined threshold value L.max, Lmin(Lmax<Lmin). Here brightness L is LmaxIf larger, ST13 becomes “YES” and proceeds to ST17 to output the comment 1 to the monitor 4To do.The brightness L is LminIf it is smaller, ST13 is “NO”, ST14 is “YES”, and the process proceeds to ST16 to output the comment 2 to the monitor 4.
[0074]
  The brightness L is Lmin≦ L ≦ LmaxIf it is within the range, ST13 and 14 are both “NO”, the process proceeds to ST15, and the comment 3 is output to the monitor 5.
[0075]
  In ST9, when the number of candidates N is compared with the threshold NM, if other candidates are included in the area of the two-dimensional code indicated by a candidate, these candidates are regarded as one candidate. The number of candidates N may be reduced.
[0076]
  In the procedure of FIG. 5, the threshold value NM can be set based on the number N of candidates when it is not possible to secure time for decoding processing for finder pattern extraction. Since a certain processing time T is assigned in advance to reading one two-dimensional code 7, it is considered that the remaining time at the time when the finder pattern extraction processing is completed decreases as the number N of candidates increases. Therefore, for example, the minimum value of N satisfying the following expression (1) can be set as the threshold value NM.
  T−T1 <N × t (1)
[0077]
  In the above equation (1), T1 is a value obtained by adding a predetermined margin time to the time required to extract N finder patterns. T is the time required for the decoding process for one candidate. The value of t is a constant value according to the processing capability of the controller 2, and the value of T1 can be determined according to the number of candidates N. The allocation time T can be fixed to a predetermined value in advance, but is not limited thereto, and can also be set via the host system 11 or the console 5.
  When the allocation time T can be variably set as described above, the threshold value NM varies depending on the value of T. The allocation time T can be set according to the conveyance speed of the component 9.
[0078]
  The brightness threshold Lmax, LminThe setting of is as follows.
  For example, in the case of a device with 256 gradations of brightness, considering that the resolution required for light / dark discrimination is about 10 gradations, LmaxIs set to about 245 gradations. LminIs set to about 50 gradations in consideration of the brightness level due to the influence of noise and the resolution required for discrimination being about 10 gradations.
  According to the above setting, if the image is too bright due to the halation phenomenon, the brightness L is LmaxBecome bigger. When the image is so dark that the black cell of the two-dimensional code and the black of the background cannot be visually recognized, the brightness L is LminSmaller.
[0079]
  According to the procedure shown in FIG. 5, if the decoding process fails, it can be determined whether the cause of the failure is in the two-dimensional code or in the background based on the number N of candidates for the finder pattern. If the extraction of the finder pattern fails, it is determined whether the cause of the failure is the illumination or the position of the two-dimensional code with respect to the field of view of the camera 3 based on the brightness of the processing target image. be able to.
[0080]
  In particular, if there is a deficiency in the position of the illumination or the two-dimensional code, the deficiency can be corrected promptly based on the determination result. The adjustment work can be performed efficiently when adjusting the above.
[0081]
  Further, when it is determined that the two-dimensional code state is incomplete, the content of the incompleteness can be more specifically determined depending on which step of the decoding process the failure has occurred.
  For example, when the timing pattern cannot be extracted, it is considered that the contrast is insufficient, so that it can be determined that there is a problem in the illumination state. If the timing pattern can be extracted but cannot be decoded, it can be determined that the marking state of the two-dimensional code is incomplete.
[0082]
  FIGS. 7A and 7B show display examples on the monitor 4 when the reading process of FIG. 5 is completed. FIG. 7A shows a display example when reading is successful. The processing target image 30 including the image 31 of the two-dimensional code is displayed, and the read data 32 and “OK” obtained from the two-dimensional code are displayed. A mark 33 or the like is displayed.
[0083]
  FIG. 7B is a display example when the reading process fails, and comment information 34 (comment 1 in the illustrated example) based on the determination result of the cause of the reading failure is indicated by the corresponding error code 35 or “NG”. "And the mark 36 are displayed. Also in this example, the processing target image is displayed. However, since the two-dimensional code on the image cannot be identified, the processing target image 30 is illustrated as a blank state for convenience.
[0084]
【The invention's effect】
  According to this invention, when the reading process of the two-dimensional code fails, the cause of the failure can be determined based on the number of extractions of the specific pattern in the reading process, and the determination result can be presented to the user. Therefore, the user can accurately grasp the cause of the reading failure and can take an accurate response to the failure. Therefore, even if there are deficiencies in the setting conditions such as illumination, field of view of the imaging means, and the position of the two-dimensional code during adjustments before starting full-scale reading processing, the deficiencies should be removed promptly. Can do.
[Brief description of the drawings]
FIG. 1 is a functional block diagram showing a configuration of a two-dimensional code reader to which the present invention is applied.
FIG. 2 is a diagram illustrating an appearance and a usage state of a two-dimensional code reader.
FIG. 3 is a block diagram showing an electrical configuration of the two-dimensional code reader.
FIG. 4 is a diagram showing a comment information setting table;
FIG. 5 is a flowchart illustrating a procedure of reading processing.
FIG. 6 is a flowchart showing a detailed procedure of decoding processing.
FIG. 7 is a diagram illustrating a display example at the end of reading.
FIG. 8 is an explanatory diagram showing a representative example of a two-dimensional code and a finder pattern and a timing pattern in each code.
[Explanation of symbols]
  1 Two-dimensional code reader
  2 Controller
  3 Camera
  4 Monitor
  7 Two-dimensional code
21 CPU
22 Main memory
23 Input / output control unit
24 Image processing unit
26 Image memory

Claims (6)

表示態様が異なる2種類のセルの2次元配列より成る2次元コードを撮像対象とした画像から、前記2次元コード中の情報表示領域の外側にそれぞれ位置する複数のセルが構成する特定のパターンを抽出し、抽出された特定のパターンに基づき前記情報表示領域を特定して当該領域にデコード処理を施すことによって、前記画像中の2次元コードが表す光学情報を読み取る方法において、
1つの2次元コードの読取に所定長さの処理時間を割り当てるとともに、この処理時間が経過するまで前記デコード処理を繰り返すことを許容し、
前記特定のパターンの抽出に応じてデコード処理が実行された結果、光学情報を読み取ることができない読取失敗が生じたとき、前記特定のパターンの抽出数を前記1つの2次元コードの読取に割り当てられた処理時間に基づき定めたしきい値と比較し、前記抽出数がしきい値を上回るときは、前記特定のパターンとして誤抽出されたノイズの多さが前記読取失敗の原因であると判別し、前記特定のパターンの抽出数が前記しきい値を下回るときは、画像中の2次元コードがデコードできない状態にあることが前記読取失敗の原因であると判別する、
ことを特徴とする2次元コードの読取方法。
A specific pattern formed by a plurality of cells respectively positioned outside the information display area in the two-dimensional code from an image obtained by imaging a two-dimensional code composed of a two- dimensional array of two types of cells having different display modes. In the method of reading the optical information represented by the two-dimensional code in the image by extracting and specifying the information display area based on the extracted specific pattern and performing a decoding process on the area ,
Assigning a predetermined length of processing time to reading one two-dimensional code, and allowing the decoding process to be repeated until the processing time elapses;
As a result of performing decoding processing in accordance with the extraction of the specific pattern, when a reading failure in which optical information cannot be read occurs, the number of extraction of the specific pattern is assigned to the reading of the one two-dimensional code. When the number of extractions exceeds the threshold, it is determined that the number of noises erroneously extracted as the specific pattern is the cause of the reading failure. When the number of extractions of the specific pattern is less than the threshold value, it is determined that the reading failure is caused by the fact that the two-dimensional code in the image cannot be decoded.
A method for reading a two-dimensional code.
請求項1に記載された方法において、
前記特定のパターンが抽出されずに読取失敗となったとき、前記画像の明るさを所定の数値範囲と比較し、前記明るさが前記数値範囲内にあれば撮像時の2次元コードの位置が前記読取失敗の原因であると判別し、前記明るさが前記数値範囲外にあれば2次元コードに対する照明の状態が前記読取失敗の原因であると判別する2次元コードの読取方法。
The method of claim 1, wherein
When reading fails because the specific pattern is not extracted, the brightness of the image is compared with a predetermined numerical range, and if the brightness is within the numerical range, the position of the two-dimensional code at the time of imaging is A method for reading a two-dimensional code, wherein the reading failure is determined to be the cause of the reading failure, and if the brightness is outside the numerical range, the illumination state on the two-dimensional code is determined to be the cause of the reading failure.
請求項1または2に記載された方法において、
前記読取失敗の原因の判別に応じてその判別した原因を示す情報を表示することを特徴とする2次元コードの読取方法。
The method according to claim 1 or 2, wherein
A method for reading a two-dimensional code, wherein information indicating the determined cause is displayed according to the determination of the cause of the reading failure .
表示態様が異なる2種類のセルの2次元配列より成る2次元コードを撮像対象とした画像を取得する画像取得手段と、
前記取得した画像から、前記2次元コード中の情報表示領域の外側にそれぞれ位置する複数のセルが構成する特定のパターンを抽出する特定パターン抽出手段と、
前記特定パターン抽出手段により抽出された特定のパターンに基づき前記情報表示領域を特定し、その特定された領域内の画像を用いてデコード処理を実行するデコード処理手段と、
前記デコード処理手段によりデコードされた情報の内容を示す読取データを出力する読取データ出力手段と、
前記読取データ出力手段が読取データを出力できない読取失敗が生じたとき、前記特定パターンの抽出数に基づき前記読取失敗の原因を判別する判別手段と、
前記判別手段による判別結果を出力する出力手段とを具備し、
前記デコード処理手段は、1つの2次元コードの読取のために割り当てられた処理時間が経過するまで前記デコード処理を繰り返すことが可能に設定されており、
前記判別手段には、前記1つの2次元コードの読取に割り当てられた処理時間に基づいて定められたしきい値が設定されており、前記特定のパターンの抽出に応じてデコード処理が実行された結果、前記読取失敗が生じたとき、前記特定のパターンの抽出数を前記しきい値と比較し、前記抽出数がしきい値を上回るときは、前記特定のパターンとして誤抽出されたノイズの多さが前記読取失敗の原因であると判別し、前記特定のパターンの抽出数が前記しきい値を下回るときは、画像中の2次元コードがデコードできない状態にあることが前記読取失敗の原因であると判別する2次元コード読取装置。
Image acquisition means for acquiring an image of a two-dimensional code composed of a two- dimensional array of two types of cells having different display modes ,
Specific pattern extraction means for extracting a specific pattern formed by a plurality of cells respectively located outside the information display area in the two-dimensional code from the acquired image;
Decoding processing means for specifying the information display area based on the specific pattern extracted by the specific pattern extraction means, and executing decoding processing using an image in the specified area;
Read data output means for outputting read data indicating the content of the information decoded by the decode processing means;
A discriminating unit for discriminating the cause of the reading failure based on the number of extractions of the specific pattern when a reading failure occurs in which the reading data output unit cannot output reading data;
Output means for outputting a discrimination result by the discrimination means ,
The decoding processing means is set to be able to repeat the decoding processing until the processing time allocated for reading one two-dimensional code has elapsed,
A threshold value determined based on a processing time assigned to reading the one two-dimensional code is set in the determination unit, and a decoding process is executed in accordance with the extraction of the specific pattern. As a result, when the reading failure occurs, the number of extractions of the specific pattern is compared with the threshold value, and when the number of extractions exceeds the threshold value, a large amount of noise erroneously extracted as the specific pattern. Is the cause of the reading failure, and when the number of extractions of the specific pattern is less than the threshold value, the reason for the reading failure is that the two-dimensional code in the image cannot be decoded. A two-dimensional code reading device that determines that there is .
前記判別手段は、前記特定のパターンが抽出されずに読取失敗となったとき、前記画像の明るさを所定の数値範囲と比較し、前記明るさが前記数値範囲内にあれば撮像時の2次元コードの位置が前記読取失敗の原因であると判別し、前記明るさが前記数値範囲外にあれば2次元コードに対する照明の状態が前記読取失敗の原因であると判別する請求項4に記載された2次元コード読取装置。The discriminating unit compares the brightness of the image with a predetermined numerical range when the specific pattern is not extracted and fails to read , and if the brightness is within the numerical range, 2 at the time of imaging. determines that the position of the dimension code is responsible for the reading failure, according to claim 4, wherein the brightness of the illumination to the two-dimensional code if outside the value range state is determined to be the cause of the reading failure Two-dimensional code reader. 請求項4または5に記載された装置であって、
前記出力手段は、前記判別手段が判別した読取失敗の原因を示す情報を表示する表示手段を含んで成る2次元コード読取装置。
An apparatus as claimed in claim 4 or 5 , wherein
The two-dimensional code reading device, wherein the output means includes display means for displaying information indicating the cause of reading failure determined by the determining means.
JP2003185775A 2003-06-27 2003-06-27 Two-dimensional code reading method and two-dimensional code reading apparatus Expired - Lifetime JP4100273B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003185775A JP4100273B2 (en) 2003-06-27 2003-06-27 Two-dimensional code reading method and two-dimensional code reading apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003185775A JP4100273B2 (en) 2003-06-27 2003-06-27 Two-dimensional code reading method and two-dimensional code reading apparatus

Publications (2)

Publication Number Publication Date
JP2005018649A JP2005018649A (en) 2005-01-20
JP4100273B2 true JP4100273B2 (en) 2008-06-11

Family

ID=34185122

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003185775A Expired - Lifetime JP4100273B2 (en) 2003-06-27 2003-06-27 Two-dimensional code reading method and two-dimensional code reading apparatus

Country Status (1)

Country Link
JP (1) JP4100273B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6372396B2 (en) * 2015-03-04 2018-08-15 株式会社デンソーウェーブ Information transmission system
CN110490020B (en) * 2019-07-31 2023-01-13 珠海市杰理科技股份有限公司 Bar code identification method and device, computer equipment and storage medium
JP7318545B2 (en) * 2020-01-27 2023-08-01 株式会社デンソー AUTOMATIC PARKING SYSTEM, MARKER FAILURE DETERMINATION METHOD, AND MARKER DETERMINATION PROGRAM
JP7410766B2 (en) 2020-03-19 2024-01-10 株式会社キーエンス Optical information reading device, optical information reading method, optical information reading program, computer readable recording medium, and recording device
CN116822559A (en) * 2023-07-07 2023-09-29 广州讯宝电子科技有限公司 Method for reading and engraving two-dimensional code

Also Published As

Publication number Publication date
JP2005018649A (en) 2005-01-20

Similar Documents

Publication Publication Date Title
JP3516144B1 (en) Optical information code reading method and optical information code reader
EP0978087B1 (en) System and method for ocr assisted bar code decoding
JP4058529B2 (en) Optical information reader
EP1909215B1 (en) Image region detection method, recording medium, and device therefor
JP4254724B2 (en) Bar code reading method and computer program
EP0669593A2 (en) Two-dimensional code recognition method
WO2008010513A1 (en) Optical symbol, article to which the optical symbol is attached, method for attaching optical symbol to article, optical symbol decoding method, related device, and related program
EP2507741B1 (en) Imaging-based scanner including border searching for image acquisition
US5945661A (en) Data symbol reader and method including data symbol position evaluation
JP2021119465A (en) Enhanced matrix symbol error correction method
JP2009266190A (en) Symbol information reading apparatus and symbol information reading method
JP4100273B2 (en) Two-dimensional code reading method and two-dimensional code reading apparatus
EP0576220B1 (en) Bar-code reader device
JP6330388B2 (en) Image processing method, image processing apparatus, program for executing the method, and recording medium for recording the program
JP4103909B2 (en) Portable information terminal and image processing method
JP2019021165A (en) Two-dimensional code and two-dimensional code reading device
JP2004021736A (en) Two-dimensional code reading method and two-dimensional code reader
JP4650138B2 (en) Optical information reader
JP3690281B2 (en) Information code
JP2008305058A (en) Code reading device and method
JP2009123088A (en) Data code reader and its method
JPS62120585A (en) Bar code recognizing device by image scanner
JP2722434B2 (en) Optical character reader
JP2002318997A (en) Two-dimensional code reader
JPH0520459A (en) Method and device for recognizing pattern

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050920

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070605

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070731

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080310

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

Free format text: PAYMENT UNTIL: 20110328

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4100273

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110328

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120328

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120328

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130328

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140328

Year of fee payment: 6