JP4013027B2 - Two-dimensional code reader - Google Patents
Two-dimensional code reader Download PDFInfo
- Publication number
- JP4013027B2 JP4013027B2 JP2001121098A JP2001121098A JP4013027B2 JP 4013027 B2 JP4013027 B2 JP 4013027B2 JP 2001121098 A JP2001121098 A JP 2001121098A JP 2001121098 A JP2001121098 A JP 2001121098A JP 4013027 B2 JP4013027 B2 JP 4013027B2
- Authority
- JP
- Japan
- Prior art keywords
- pattern
- dimensional code
- code
- finder pattern
- finder
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000001514 detection method Methods 0.000 claims description 27
- 238000003860 storage Methods 0.000 claims description 14
- 238000013500 data storage Methods 0.000 claims description 12
- 238000003384 imaging method Methods 0.000 claims description 9
- 238000000605 extraction Methods 0.000 claims description 5
- 239000011159 matrix material Substances 0.000 description 38
- 238000000034 method Methods 0.000 description 37
- 238000010586 diagram Methods 0.000 description 31
- 238000012545 processing Methods 0.000 description 26
- 230000015654 memory Effects 0.000 description 23
- 230000006870 function Effects 0.000 description 14
- 230000004044 response Effects 0.000 description 11
- 238000012937 correction Methods 0.000 description 8
- 238000007781 pre-processing Methods 0.000 description 5
- 230000004069 differentiation Effects 0.000 description 4
- 238000010330 laser marking Methods 0.000 description 4
- 238000012790 confirmation Methods 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 3
- 208000011580 syndromic disease Diseases 0.000 description 3
- 230000005859 cell recognition Effects 0.000 description 2
- 238000009499 grossing Methods 0.000 description 2
- 238000010438 heat treatment Methods 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- 235000012431 wafers Nutrition 0.000 description 2
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000001704 evaporation Methods 0.000 description 1
- 230000008020 evaporation Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 239000002245 particle Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
- 238000003466 welding Methods 0.000 description 1
Images
Landscapes
- Image Analysis (AREA)
- Image Processing (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、2進コードで表わされるデータをセル化して2次元のマトリクス上にパターンとして配置した2次元コードを読み取るための2次元コード読取装置に関する。
【0002】
【従来の技術】
マトリクス式の2次元コードとして、QRコード、データマトリクスコード等が知られている。これらの2次元コードには、ファインダパターン(位置検出パターン又は位置決め用シンボル)なる特徴部分がある。
【0003】
図18はQRコードの一例を示す図である。QRコードは、特定寸法比率の正方形を組み合わせたファインダパターンを3個有する。QRコードの内部は、n×nの正方形の升目(これをセルという)に区切られている。ファインダパターンは、例えば、一辺の長さが7セルに相当する黒い正方形と、一辺の長さが5セルに相当する白い正方形と、一辺の長さが3セルに相当する黒い正方形とを同心状に組み合わせてなる。
【0004】
図19はデータマトリクスコードの一例を示す図である。データマトリクスコードは、ファインダパターンとしてL字を形成する2辺と、その対角に位置し白黒が交互に並ぶタイミングパターンとを有する。
【0005】
一般的に2次元コードの読み取りは次のようにしてなされている。(1)画像メモリ上でファインダパターンを検出する。(2)セルの部分の白黒を認識する。(3)白を0、黒を1のデータに並べ替える。(4)デコード処理を行ない、文字情報への変換を行なう。
【0006】
図20は従来のQRコード読み取りのフローチャートである。ステップS1で、画像メモリの画素値の白と黒の中間値をグローバルしきい値とする。ステップS2で、画像メモリ内のX軸方向に対して、位置検出パターン(ファインダパターン)の比率の検出を行ない、位置検出パターンの外縁のポイントを記憶する。そして、画像メモリ内の隣接するピクセル線についてこれを繰り返す。次にステップS3で、画像メモリ内のY軸方向に対してステップS2と同様の処理を繰り返す。ステップS4で、X軸,Y軸の検出結果から位置検出パターンの中心位置を求める。ステップS5で、他の2個の位置検出パターンの中心位置を求める。ステップS6で、3個の位置検出パターンの中心位置に基づいてシンボルの向きを求める。ステップS7で、データ部のセルをしきい値に基づいてそれらが明暗のいずれであるかを決める。暗の画素を1とし、明の画素を0とする。ステップS8で、データの解析処理を行ない、デコード処理を行なう。
【0007】
なお、特許2867904号公報には、ファインダパターンを現す周波数特性(周波数成分比)を検出して、ファインダパターンの位置を検出するようにした2次元コード読取装置が開示されている。
【0008】
データマトリクスコードのファインダパターンは一般的に次の方法で検出される。画像メモリ上の直線を検出し、L字を構成する候補を選出する。画像取り込み時にエッジを抽出し、エッジ抽出データを元に画像メモリからエッジコードを算出し、ラベリング処理を行なう。ラベリング処理されたデータに基づいて直線を検出する。
【0009】
【発明が解決しようとする課題】
電子部品や液晶,PDP等では2次元コードの印字スペースが極めて小さく、コードは小さく印字する必要がある。マーキングについては、対象物に直接、コードのマーキングを行なうダイレクトマーキングが行なわれるのが一般的である。マーキングの方法として次の2つの方法があるが、いずれも、コードの1つ1つのセルはドットで形成されることが多い。
(1)レーザマーキング レーザ加工の持つ優れた特長(非接触、高自由度、高速精密加工)を活かして非加工物表面にレーザ光を照射し、加熱・溶接蒸発といった熱加工原理によりマーキングを行なう。ICパッケージ、シリコンウェハ、液晶基板、高熱処理または洗浄処理を行なう基板・部材等にレーザマーキングが用いられる。
(2)露光方式によるマーキング 露光方式はレーザ方式と比較し、パーティクルが発生しない、より微細なマーキングが可能になるなどの特長がある。露光工程を有する半導体ウェハ、液晶パネル、カラーフィルタ等で露光方式のマーキングが用いられる。
【0010】
QRコード読み取りに際して、従来の読み取りは図21に示すアルゴリズムで読み取りが行なわれる。カメラで撮像して得た画像データは、2次元コード読取装置に取り込まれて(ステップS11)、メモリ上に展開される(ステップS12)。ステップS13では、コードの切り出しがなされる。このコードの切り出し(ステップS13)は、カメラから取り込んだ画像データの中から必要なデータを抽出するプロセスであり、背景を含めて取り込んだ画像データから2次元コードの画像のみを切り出す。ステップS14で、コードの位置、大きさ、傾きが検出され、ステップS15で各セルの白黒が認識され、ステップS16で誤り訂正がなされる。この誤り訂正(ステップS16)では、データに誤りが存在した際に、データの訂正がなされる。そして、ステップS17のデコード処理で、2値データから文字列への変換がなされる。
【0011】
QRコードの読み取りでは、3箇所のファインダパターンを検出することで、コードの位置、傾き、大きさを検出し、コードの切り出しがなされる。
【0012】
2次元コードの読取りには、通常1セル5画素以上にコードを映し出すことが行われているが、1セル5画素程度に2次元コードを映した場合には、ファインダパターンが小さくなってファインダパターンの登録作業が難しいという課題がある。
【0013】
本発明はこのような課題を解決するためになされたもので、その目的は2次元コードの画像データからファインダパターンを自動的に検出し、検出したファインダパターンに基づいて画像データから2次元コードを高速に読み取ることができる利便性の高い2次元コード読取装置を提供することにある。
【0014】
【課題を解決するための手段】
前記課題を解決するため本発明に係る2次元コード読取装置は、2次元コードをカメラで撮像して得た画像データを格納する画像データ格納部と、2次元コードをカメラで撮像して得た画像データを格納するモデルパターン格納部と、モデルパターンとして予め設定したファインダパターンを格納するモデルパターン格納部と、前記モデルパターンと前記画像データとを照合し、その相関度合に基づいてファインダパターンを検出するファインダパターン検出手段と、前記ファインダパターンの検出に基づいて前記2次コードの内容を読み取るコード読取り手段とを備えた2次元コード読取装置であって、前記画像データ格納部に格納された画像に対し、2次元コードのファインダパターンの位置を特定するための少なくとも始点と終点を含む位置情報の入力をユーザが行う入力手段と、前記入力手段により入力された位置情報に基づいて画像を抽出する領域を定める領域確定手段と、さらに、前記領域確定手段により定められた領域の少なくとも3角部を、モデルパターンとして抽出して前記モデルパターン格納部に格納する角部抽出手段とを備えたことを特徴とし、また、前記角部抽出手段は、所定数の余白部と共に前記モデルパターン格納部に格納することを特徴とするとともに、さらに、前記モデルパターン格納部に格納されたモデルパターンの画像を表示する表示手段を、備えたことを特徴とするものである。
【0015】
また、本発明に係るファインダパターン検出手段は、2次元コードであるQR(Quick Response)コードの1:1:3:1:1という比率のファインダパターンを検出することを特徴とする。
【0016】
さらに、本発明に係るファインダパターン検出手段は、2次元コードであるデータマトリクス(Data Matrix)のL字型パターンのファインダパターンを検出することを特徴とする。
【0017】
本発明に係る2次元コード読取装置は、撮像した画像データの中からQR(Quick Response)コードを形成する白黒(または、明暗)パターンの幅の1:1:3:1:1という比率、またはデータマトリクス(Data Matrix)の黒(または、暗)パターンのL字型パターンなど、2次元コードのファインダパターンの特徴点を画像処理で自動的に検出するファインダパターン検出手段を備えたので、検出したファインダパターンに基づいて画像データの2次元コードを読み取るので、2次元コードのファインダパターンの検出作業を効率的に行なうことができ、利便性の向上を図ることができる。
【0018】
また、本発明に係る2次元コード読取装置は、2次元コードをカメラで撮像して得た画像データを格納する画像データ格納部と、画像データ格納部に格納された画像データの中から2次元コードのファインダパターンの特徴点を画像処理で自動的に検出するファインダパターン検出手段と、ファインダパターン検出手段で検出したファインダパターンを自動的に登録するファインダパターン登録手段と、ファインダパターン登録手段に登録されたファインダパターンに基づいて画像データ格納部に格納された画像データの2次元コードを読み取るコード読取装置とを備えたことを特徴とする。
【0019】
さらに、本発明に係るファインダパターン検出手段は、2次元コードであるQR(Quick Response)コードの1:1:3:1:1という比率のファインダパターンを検出することを特徴とする。
【0020】
また、本発明に係るファインダパターン検出手段は、2次元コードであるデータマトリクス(Data Matrix)のL字型パターンのファインダパターンを検出することを特徴とする。
【0021】
本発明に係る2次元コード読取装置は、撮像した画像データの中からQR(Quick Response)コード形成する白黒(または、明暗)パターンの幅の1:1:3:1:1という比率、またはデータマトリクス(Data Matrix)の黒(または、暗)パターンのL字型パターンなど、2次元コードのファインダパターンの特徴点を画像処理で自動的に検出し、検出したファインダパターンを自動登録した後、自動登録したファインダパターンに基づいて画像データの2次元コードを読み取るので、2次元コードの読取りの効率化ならびに高速化を図ることができる。
【0022】
さらに、本発明に係るファインダパターン検出手段は、画像データを所定の画素間隔で間引いたファインダパターンを生成するとともに、間引いたファインダパターンに基づいて画像データの2次元コードを読み取ることを特徴とする。
【0023】
また、本発明に係るファインダパターン検出手段は、1つのファインダパターンを検出すると、予め設定したファインダパターン配置情報を参照して他のファインダパターンが存在すべき位置を推測することを特徴とする。
【0024】
本発明に係るファインダパターン検出手段は、画像データを所定の画素間隔で間引いたファインダパターンを生成したり、1つのファインダパターンを検出すると、他のファインダパターンが存在すべき位置を推測することができるので、より高速に画像データの中から2次元コードを特定し、読み取ることができる。
【0025】
さらに、本発明に係る2次元コード読取装置は、2次元コードをカメラで撮像して得た画像データを格納する画像データ格納部と、モデルパターンとして予め設定したファインダパターンを格納するモデルパターン格納部と、モデルパターンと画像データとを照合し、その相関度合に基づいてファインダパターンを検出するファインダパターン検出手段と、ファインダパターンの検出に基づいて2次元コードの内容を読み取るコード読取手段とを備えたことを特徴とする。
【0026】
また、本発明に係る2次元コード読取装置は、2次元コードをカメラで撮像して得た画像データの中からファインダパターンを検出し、検出したファインダパターンをモデルパターンとして登録するモデルパターン登録手段を備えたことを特徴とする。
【0027】
さらに、本発明に係る2次元コード読取装置は、2次元コードのモデルパターンが、QR(Quick Response)コードのファインダパターンであることを特徴とする。
【0028】
また、本発明に係る2次元コード読取装置は、2次元コードのモデルパターンが、データマトリクス(Data Matrix)のL字型パターンであることを特徴とする。
【0029】
本発明に係る2次元コード読取装置は、予め登録されたQR(Quick Response)コードパターンまたはデータマトリクス(Data Matrix)のL字型パターンなど、2次元コードのファインダパターンをモデルパターンとして登録し、モデルパターンと画像データとを照合し、その相関度合に基づいてファインダパターンを検出して画像データの2次元コードを読み取るので、2次元コードがダイレクトマーキングで形成されている場合でも、2次元コードを確実に読み取ることができる。また、ファインダパターンに欠けや汚れがあってもファインダパターンを的確に検出することができる。
【0030】
【発明の実施の形態】
以下、本発明の実施の形態を添付図面に基づいて説明する。図1は本発明に係る2次元コード読取装置のシステム構成図である。
【0031】
本発明に係る2次元コード読取装置は、コントローラ1と、カメラ2と、ビデオモニタ3と、パソコン/PLC4と、コンソールユニット5と、PLC/タイミングSW6とからなる。
【0032】
コントローラ1は、カメラI/F11と、専用画像処理ASIC12と、フレームバッファ13と、モニタI/F14と、グラフィックメモリ15と、第1の画像メモリ16と、第2の画像メモリ17と、モデルメモリ18と、CPUバス19と、CPU20と、RS−232CI/F21と、コンソールI/F22と、パラレルI/OI/F23と、FLASH−ROM24と、DRAM25とからなる。
【0033】
専用画像処理ASIC12、CPU20、コンソールI/F22、パラレルI/OI/F23、FLASH−ROM24及びDRAM25は、CPUバス19を介してそれぞれ接続されている。
【0034】
カメラ2で撮像した画像は、カメラI/F11を介して専用画像処理ASIC12に供給される。専用画像処理ASIC12及びCPU20は、カメラI/F11を介してカメラ2で撮像した画像の取り込みを制御する。専用画像処理ASIC12には、グラフィックメモリ15、各画像メモリ16,17及びモデルメモリがそれぞれ接続されている。また、専用画像処理ASIC12には、フレームバッファ13が接続されており、このフレームバッファ13に格納された画像データはモニタI/F14を介してビデオモニタ3へ供給される。これにより、モニタ画像をフレームバッファ13に書き込むことで、ビデオモニタ3にモニタ画像を表示させることができる。
【0035】
CPU20とパソコン/PLC4とはRS−232CI/F21を介して接続している。したがって、CPU20とパソコン/PLC4とはシリアルデータ通信が可能である。コンソールユニット5は、コンソールI/F22を介してCPUバス19に接続されている。コンソールI/F22と専用画像処理ASIC12とは専用の信号線で接続されている。PLC/タイミングSW6はパラレルI/OI/F23を介してCPUバス19に接続されている。PLC/タイミングSW6と専用画像処理ASIC12とは専用の信号線で接続されている。
【0036】
なお、本実施の形態では、専用画像処理ASIC12によってファインダパターン検出手段、コード読取手段、ファインダパターン登録手段及びモデルパターン登録手段を構成している。また、各画像メモリ16,17によって画像データ格納部を構成し、モデルメモリ18によってファインダパターン記憶手段及びモデルパターン格納部を構成している。
【0037】
ファインダパターン検出手段は、画像データ格納部に格納された画像データの中から2次元コードのファインダパターンの特徴点を画像処理で自動的に検出する。また、ファインダパターン検出手段は、画像データを所定の画素間隔で間引いたファインダパターンを生成する。さらに、ファインダパターン検出手段は、1つのファインダパターンを検出すると、予め設定したファインダパターン配置情報を参照して他のファインダパターンが存在すべき位置を推測する。
【0038】
QR(Quick Response)コードのファインダパターンは、白黒(または、明暗)パターンの幅の1:1:3:1:1という比率から検出する。また、QR(Quick Response)コードがレーザマーキング等で形成され、●状のドットパターンの場合には、前処理として●状のドットの画像に膨張処理を施してドットパターンを平滑化した後、ファインダパターンを白黒(または、明暗)パターンの幅の1:1:3:1:1という比率から検出する。
【0039】
データマトリクス(Data Matrix)のファインダパターンは、黒(または、暗)パターンのL字型パターンから検出する。また、データマトリクス(Data Matrix)がレーザマーキング等で形成され、●状のドットパターンの場合には、前処理として●状のドットの画像に膨張処理を施してドットパターンを平滑化した後、ファインダパターンを黒(または、暗)パターンのL字型パターンから検出する。なお、データマトリクス(Data Matrix)のファインダパターン検出は、直接L字をサーチせずに、L字の縦一辺(I)または横一辺(−)をサーチすることにより、L字型ファインダパターンの存在を推定することもできる。
【0040】
ファインダパターン登録手段は、ファインダパターン検出手段で検出したファインダパターンを自動的に登録する。
【0041】
コード読取手段は、ファインダパターン記憶手段に記憶されたファインダパターンに基づいて画像データ格納部に格納された画像データの2次元コードを読み取る。また、コード読取手段は、ファインダパターン登録手段に登録されたファインダパターンに基づいて画像データ格納部に格納された画像データの2次元コードを読み取る。
【0042】
モデルパターン登録手段は、2次元コードをカメラで撮像して得た画像データの中からファインダパターンを検出し、検出したファインダパターンをモデルパターンとして登録する。
【0043】
図2は本発明に係る2次元コード読取手段におけるコード切り出し動作(パターンサーチ)を示す図である。モデルメモリ18には、ドットで形成されたファインダパターンをモデルとして登録している。一方、QRコードをカメラ2で撮像して得られた画像データは、画像メモリ16に格納される。そして、専用画像処理ASIC12(ファインダパターン検出手段)は、カメラ2から取り込まれた画像とモデル画像とを照合して、入力画像からQRコードに含まれる3つのファインダパターンを検出する。
【0044】
従来の1:1:3:1:1という定型のパターンを探すのではなく、予め対象となるコードのファインダパターンをモデルとして登録しておくため、マーキング方式の特徴に左右されずに、また、ドットの欠け等にも対応することができ、ファインダパターンを高精度で検出でき、ダイレクトマーキングされたQRコードの読取性能を大幅に向上させることができる。
【0045】
また、実施の形態に係る2次元コード読取手段では、読取エラー発生の際のユーザ側での原因究明の対策として、次の4つの機能を搭載している。
【0046】
(1)セル認識位置表示機能:2次元コードの読取において、白と黒のセルの認識の際、黒と認識した点をモニタ表示する機能である。この機能により、コードに不具合がある場合にも、コードの白黒認識点はビデオモニタ3を見て確認することができる。
【0047】
(2)セル認識照合機能:ある1つのコードに関するセルの白黒情報を基準データとして登録しておき、読取の際に一致判定し、モニタ出力を行なう機能である。この機能により、同じコードを読み取る場合、汚れたり欠けたりしている部分をチェックすることができ、マーキングの安定性を解析できる。
【0048】
(3)画像解析機能:読取を行なった画像データに対する解析機能である。下記の3つの機能があり、ユーザ側にて読取エラーの原因解析をすることができる。
(a)ラインブライト:水平、垂直方向の任意の1ライン上の濃度分布がグラフ表示される。
(b)画素値表示:特定エリアの濃度情報が0〜255の数値で表示される。
(c)画像拡大:特定エリアの画像が拡大表示される。
【0049】
(4)NG画像保存機能:読取エラーの画面を24面まで画像で保存することが可能であり、どのような読取エラーが発生したかを保存画像で確認することができる。
【0050】
以上の4機能により、読取エラーが生じた場合にも、ユーザ側にて原因の解析と対策を行なうことが可能である。
【0051】
2次元コードにはリードソロモン符号による誤り訂正が使用されている。このリードソロモン符号による誤り訂正では、元データにその一部が破損しても復元できるような符号理論を駆使した誤り訂正コードを加えて、データ領域に配置している。これにより、コードの位置が汚れたり欠けたりしても、元のデータを復元できる。
【0052】
本実施の形態に係る2次元コード読取手段では、図3に示す誤り訂正アルゴリズムを用いることで、誤り訂正の情報も出力できるようにしている。
▲1▼:2次元コードから得られたデータを元にシンドロームの演算を行なう。ここで、シンドロームとは、誤りの有無を検出する演算子であり、誤りがない場合には全てのシンドローム値が0の値をもつ。
▲2▼:誤り位置多項式用の変数を求める。
▲3▼:誤り位置多項式を解くことにより、誤り位置が検出される。
▲4▼:誤り位置に対応する誤りの値を求める。
▲5▼:誤りの位置からそれに対応する値を差し引くことで誤りが訂正される。
【0053】
次に本発明に係る2次元コード読取手段の読取操作方法を説明する。図4〜図8は、QRコードの読取操作方法を示す図である。なお、図4〜図8は、モニタ画面の表示内容を示している。図4(a)は確認状態の画面を示している。図4(b)は設定状態の指定する画面を示している。図4(c)は設定状態で画像入力モードを指定する画面を示している。図4(d)は画像入力モードで画像前処理を設定する画面を示している。
【0054】
図5(a)は画像前処理で平滑度合を設定する画面を示している。なお、画像前処理では、平滑化弱、平滑化強、エッジ強調の何れかを選択指定できる。図5(b)は図4(c)に示した状態に戻った状態を示している。図5(c)は読取QRパターンを指定する画面を示している。図5(b)はパターン設定を指定する画面を示している。
【0055】
図6(a)はモデル登録を指定する画面である。図6(b)はQRコードのバージョンを設定する画面である。図6(c)及び図6(d)はファインダパターンの領域を設定する画面である。図6(c)でファインダパターン(FP)を取り囲む始点を選択し、図6(d)で終点を選択する。
【0056】
図7(a)はモデル参照を指定する画面であり、図7(b)はモデル参照の画面である。このモデル参照の画面で登録したモデル(ファインダパターン)を確認できる。図7(c)は図4(a)に示した確認状態の画面である。図7(d)は読取画面である。TRIG入力でファインダパターンの検出がなされ、コードの読取が行なわれる。画面中のOKの表示は、コードの読取が正常になされたことを示している。また、画面中の247msの表示は、コードの読取に要した時間を示している。図8(a)に示す画面で読取設定を設定すると、図8(b)に示す画面で各種読取パラメータを変更できる。
【0057】
図9及び図10はDM(データマトリクス)コードの読取操作方法を示す図である。図9(a)はDMパターン設定でモデル登録を指定する画面であり、モデル登録を指定すると、図9(b)に示す画面でバージョンの指定を行なう。次に、図9(c)でファインダパターンを取り囲む始点を選択し、図9(d)でファインダパターンの終点を選択する。これにより、モデルの登録がなされる。
【0058】
図10(a)でモデル参照を指定すると、図10(b)に示すように、登録されたモデルを確認できる。DM(データマトリクス)コードでは、L字パターンの各角部である3点がそれぞれモデルとして登録される。そして、図10(c)に示す確認画面に戻った状態で、図10(d)に示すように、TRIG入力を行なうとモデルパターンが検出され、DM(データマトリクス)コードの読取がなされる。
【0059】
図11はQRコードの読取手順を示す図である。画像が取り込まれると、3箇所のファインダパターンがそれぞれ検出され、各ファインダパターンに基づいてQRコードの切り出しがなされる。そして、切り出されたQRコードの傾き、大きさが認識され、その認識に基づいて各セルの認識がなされる。次に、各セルの白,黒が認識され、デコード処理によって2進数で表記された内容の復号がなされ、RS232C等のシリアルインタフェースを介して読み取りデータがパソコン等の上位装置へ供給される。
【0060】
図12はデータマトリクスコードの読取手順を示す図である。画像が取り込まれると、L字の切り出しパターンが検索され、さらにL字の対角の白黒交互パターンが認識される。そして、これらの認識結果から傾き,大きさが認識され、その認識に基づいて各セルの認識がなされる。次に、各セルの白,黒が認識され、デコード処理によって2進数で表記された内容の復号がなされ、RS232C等のシリアルインタフェースを介して読み取りデータがパソコン等の上位装置へ供給される。
【0061】
図13は2値化方式と微分方式の比較を示す図である。本実施の形態に係る2次元コード読取手段は、グラデーションに強くまた照明等による変動に強い微分方式を採用している。
【0062】
図14は微分方式によるQRコードの読取方法を示す図である。QRコードの読取では、「設定」濃淡値で設定された値を用いて、ファインダパターンを検出する。これは、画素間の差(微分値)が濃淡値以上変化した際に、白と黒が反転したと認識する方法である。読取濃淡値リトライをONにすることにより、ファインダパターンの検出失敗の際に、濃淡値を変化させてリトライする。この機能により、ワークの経時変化に対しても対応可能である。
【0063】
図15はデータ部の白黒認識動作を示す図である。スレッシュ値は、ファインダパターンが検出された後、データ部のセルの白黒を認識する際に用いる。したがって、3点のファインダパターンが検出されていなければ、スレッシュ値は使用されない。
【0064】
図16は相関サーチ自動登録モデル例を示す図である。QRコードでは、3箇所にあるファインダパターンの中からいずれか1つがモデルとして自動登録される。データマトリクスコードでは、L字パターンの3角部がそれぞれモデルとして自動登録される。ここで、各角部は所定セル数の白部とともに登録される。ベリコードでは、黒の四角枠の各角部がそれぞれモデルとして自動登録される。ここで、各角部は所定セル数の白部とともに登録される。
【0065】
図17はQRコードの相関サーチ方法を示す図である。ファインダパターンが1点検出された場合には、検出されたファインダパターンPの位置に対して他の2点のファインダパターンが存在する可能性のある位置A,B,C,Dのそれぞれに対してファインダパターンの検出を行なう。
【0066】
ファインダパターンが2点検出された場合には、検出された2点のファインダパターンP,Qに対して他の1点のファインダパターンが存在する可能性のある位置A’,B’,C’,D’のそれぞれに対してファインダパターンの検出を行なう。
【0067】
このように、先に検出されたファインダパターンの位置に基づいて、他のファインダパターンの検索範囲を限定することで、全てのファインダパターンを検出するまでの時間を短縮できる。
【0068】
2次元コードの読み取りには、1セルが5画素以上になるように撮像するのが通常である。また、大きく写した方がコードをより確実に読み取ることができる。これに対して、1セルが5画素程度に2次元コードを撮像した際には、モデルとなるファインダパターンが小さくなり、モデルの登録作業が難しいという問題が生ずる。また、モデルの登録にもノウハウがあり、マージン(余白部)を含ませることが必要である。
【0069】
本発明に係る2次元コード読取手段は、モデルとなるファインダパターンの自動登録機能を備えているので、画像メモリ上の2次元コードのファインダパターンの位置検出を行ない、相関サーチのモデルの登録位置を決定し、モデル領域を自動的に登録することができる。
【0070】
さらに、本発明に係る2次元コード読取手段は、画像データを所定の画素間隔で間引いて登録画像を生成し、この登録画像とモデルパターンとを照合しその相関度合に基づいてファインダパターンを検出することができるので、ファインダパターンの検索時間を短縮できる。
【0071】
【発明の効果】
以上説明したように、本発明に係る2次元コード読取装置は、撮像した画像データの中からQR(Quick Response)コードの1:1:3:1:1という比率またはデータマトリクス(Data Matrix)のL字型パターンなど、2次元コードのファインダパターンの特徴点を画像処理で自動的に検出し、検出したファインダパターンに基づいて画像データの2次元コードを読み取るので、2次元コードのファインダパターンの検出作業を効率的に行なうことができ、利便性の向上を図ることができる。
【0072】
また、本発明に係る2次元コード読取装置は、撮像した画像データの中からQR(Quick Response)コードの1:1:3:1:1という比率またはデータマトリクス(Data Matrix)のL字型パターンなど、2次元コードのファインダパターンの特徴点を画像処理で自動的に検出し、検出したファインダパターンを自動登録した後、自動登録したファインダパターンに基づいて画像データの2次元コードを読み取るので、2次元コードの読取りの効率化ならびに高速化を図ることができる。
【0073】
さらに、本発明に係るファインダパターン検出手段は、画像データを所定の画素間隔で間引いたファインダパターンを生成したり、1つのファインダパターンを検出すると、他のファインダパターンが存在すべき位置を推測することができるので、より高速に画像データの中から2次元コードを特定し、読み取ることができる。
【0074】
また、本発明に係る2次元コード読取装置は、予め登録されたQR(Quick Response)コードパターンまたはデータマトリクス(Data Matrix)のL字型パターンなど、2次元コードのファインダパターンをモデルパターンとして登録し、モデルパターンと画像データとを照合し、その相関度合に基づいてファインダパターンを検出して画像データの2次元コードを読み取るので、2次元コードがダイレクトマーキングで形成されている場合でも、2次元コードを確実に読み取ることができる。また、ファインダパターンに欠けや汚れがあってもファインダパターンを的確に検出することができる。
【図面の簡単な説明】
【図1】本発明に係る2次元コード読取装置のシステム構成図
【図2】本発明に係る2次元コード読取装置におけるコード切り出し動作(パターンサーチ)を示す図
【図3】リードソロモン誤り訂正アルゴリズムのフローチャート
【図4】QRコードの読取操作方法を示す図(その1)
【図5】QRコードの読取操作方法を示す図(その2)
【図6】QRコードの読取操作方法を示す図(その3)
【図7】QRコードの読取操作方法を示す図(その4)
【図8】QRコードの読取操作方法を示す図(その5)
【図9】DM(データマトリクス)コードの読取操作方法を示す図(その1)
【図10】DM(データマトリクス)コードの読取操作方法を示す図(その2)
【図11】QRコードの読取手順を示す図
【図12】データマトリクスコードの読取手順を示す図
【図13】2値化方式と微分方式の比較を示す図
【図14】微分方式によるQRコードの読取方法を示す図
【図15】データ部の白黒認識動作を示す図
【図16】相関サーチ自動登録モデル例を示す図
【図17】QRコードの相関サーチ方法を示す図
【図18】QRコードの一例を示す図
【図19】データマトリクスコードの一例を示す図
【図20】従来のQRコード読み取りのフローチャート
【図21】従来のQRコード読み取りのアルゴリズムを示す図
【符号の説明】
1 コントローラ
2 カメラ
3 ビデオモニタ
4 パソコン/PLC
5 コンソールユニット
6 PLC/タイミングSW
11 カメラI/F
12 専用画像処理ASIC
13 フレームバッファ
14モニタI/F
15 グラフィックメモリ
16,17 画像メモリ
18 モデルメモリ
20 CPU[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a two-dimensional code reader for reading a two-dimensional code in which data represented by a binary code is converted into cells and arranged as a pattern on a two-dimensional matrix.
[0002]
[Prior art]
As a matrix type two-dimensional code, a QR code, a data matrix code, and the like are known. These two-dimensional codes have a characteristic part called a finder pattern (position detection pattern or positioning symbol).
[0003]
FIG. 18 is a diagram illustrating an example of a QR code. The QR code has three finder patterns that combine squares having a specific dimension ratio. The inside of the QR code is divided into n × n square cells (this is called a cell). The finder pattern is, for example, a black square whose side is equivalent to 7 cells, a white square whose side is equivalent to 5 cells, and a black square whose side is equivalent to 3 cells. In combination.
[0004]
FIG. 19 is a diagram illustrating an example of a data matrix code. The data matrix code has two sides that form an L-shape as a finder pattern, and a timing pattern that is positioned diagonally and in which black and white are alternately arranged.
[0005]
In general, reading of a two-dimensional code is performed as follows. (1) A finder pattern is detected on the image memory. (2) Recognize the black and white of the cell portion. (3) Rearrange white into 0 and black into 1 data. (4) A decoding process is performed and conversion into character information is performed.
[0006]
FIG. 20 is a flowchart of conventional QR code reading. In step S1, an intermediate value between white and black pixel values of the image memory is set as a global threshold value. In step S2, the ratio of the position detection pattern (finder pattern) is detected with respect to the X-axis direction in the image memory, and the outer edge point of the position detection pattern is stored. This is repeated for adjacent pixel lines in the image memory. Next, in step S3, the same processing as in step S2 is repeated for the Y-axis direction in the image memory. In step S4, the center position of the position detection pattern is obtained from the detection results of the X and Y axes. In step S5, the center positions of the other two position detection patterns are obtained. In step S6, the direction of the symbol is obtained based on the center positions of the three position detection patterns. In step S7, the cells of the data portion are determined to be light or dark based on the threshold value. Dark pixels are set to 1 and bright pixels are set to 0. In step S8, data analysis processing is performed and decoding processing is performed.
[0007]
Japanese Patent No. 2867904 discloses a two-dimensional code reading apparatus that detects a frequency characteristic (frequency component ratio) representing a finder pattern and detects the position of the finder pattern.
[0008]
The finder pattern of the data matrix code is generally detected by the following method. A straight line on the image memory is detected, and candidates for forming an L-shape are selected. Edges are extracted at the time of image capture, edge codes are calculated from the image memory based on the edge extraction data, and labeling processing is performed. A straight line is detected based on the labeled data.
[0009]
[Problems to be solved by the invention]
Electronic parts, liquid crystals, PDPs and the like have a very small space for printing a two-dimensional code, and the code needs to be printed small. As for marking, direct marking for marking a code directly on an object is generally performed. There are the following two marking methods. In either case, each cell of the code is often formed of dots.
(1) Laser marking Using the excellent features of laser processing (non-contact, high degree of freedom, high-speed precision processing), the surface of non-processed material is irradiated with laser light, and marking is performed using the thermal processing principle such as heating and welding evaporation. . Laser marking is used for IC packages, silicon wafers, liquid crystal substrates, substrates and members that perform high heat treatment or cleaning treatment, and the like.
(2) Marking by exposure method Compared with the laser method, the exposure method has features such as no generation of particles and finer marking. Exposure type marking is used in semiconductor wafers, liquid crystal panels, color filters and the like having an exposure process.
[0010]
When reading the QR code, the conventional reading is performed by the algorithm shown in FIG. Image data obtained by imaging with the camera is captured by the two-dimensional code reader (step S11) and developed on the memory (step S12). In step S13, the code is cut out. This code extraction (step S13) is a process of extracting necessary data from the image data acquired from the camera, and only the image of the two-dimensional code is extracted from the image data including the background. In step S14, the position, size, and inclination of the code are detected. In step S15, the black and white of each cell is recognized, and error correction is performed in step S16. In this error correction (step S16), the data is corrected when an error exists in the data. Then, in the decoding process in step S17, the binary data is converted into a character string.
[0011]
In reading the QR code, the position, inclination, and size of the code are detected by detecting three finder patterns, and the code is cut out.
[0012]
When reading a two-dimensional code, the code is usually projected on 5 pixels or more in one cell. However, when a two-dimensional code is projected on about 5 pixels in one cell, the finder pattern becomes smaller and the finder pattern is displayed. There is a problem that registration work is difficult.
[0013]
The present invention has been made to solve such a problem, and an object thereof is to automatically detect a finder pattern from image data of a two-dimensional code, and to detect a two-dimensional code from image data based on the detected finder pattern. An object of the present invention is to provide a highly convenient two-dimensional code reader capable of reading at high speed.
[0014]
[Means for Solving the Problems]
In order to solve the above problems, a two-dimensional code reader according to the present invention includes an image data storage unit that stores image data obtained by imaging a two-dimensional code with a camera; A model pattern storage unit that stores image data obtained by imaging a two-dimensional code with a camera, a model pattern storage unit that stores a finder pattern preset as a model pattern, and the model pattern and the image data are collated A two-dimensional code reader comprising: a finder pattern detecting means for detecting a finder pattern based on the degree of correlation; and a code reading means for reading the content of the secondary code based on the detection of the finder pattern, An input unit that allows a user to input position information including at least a start point and an end point for specifying the position of the finder pattern of the two-dimensional code for the image stored in the image data storage unit, and is input by the input unit Area determining means for determining an area from which an image is to be extracted based on the obtained position information; To, at least three corners of the area defined by the area determination means, the corner portion extracting means for extracting a model pattern stored in said model pattern storage unit And features And also Said The corner extraction means is characterized in that it is stored in the model pattern storage unit together with a predetermined number of margins, and further comprises display means for displaying the model pattern image stored in the model pattern storage unit. It is characterized by that The
[0015]
The finder pattern detecting means according to the present invention is characterized by detecting a finder pattern having a ratio of 1: 1: 3: 1: 1 of a QR (Quick Response) code which is a two-dimensional code.
[0016]
Furthermore, the finder pattern detection means according to the present invention is characterized by detecting a finder pattern of an L-shaped pattern of a data matrix (Data Matrix) which is a two-dimensional code.
[0017]
The two-dimensional code reader according to the present invention has a ratio of 1: 1: 3: 1: 1 of the width of a monochrome (or light / dark) pattern forming a QR (Quick Response) code from captured image data, or Finder pattern detection means that automatically detects the feature points of the finder pattern of the two-dimensional code such as an L-shaped pattern of a black (or dark) pattern of a data matrix (Data Matrix). Since the two-dimensional code of the image data is read based on the finder pattern, the finder pattern detection operation of the two-dimensional code can be performed efficiently, and the convenience can be improved.
[0018]
The two-dimensional code reading apparatus according to the present invention also includes an image data storage unit that stores image data obtained by imaging a two-dimensional code with a camera, and a two-dimensional code out of the image data stored in the image data storage unit. Registered in the finder pattern detection means for automatically detecting the feature point of the finder pattern of the code by image processing, the finder pattern registration means for automatically registering the finder pattern detected by the finder pattern detection means, and the finder pattern registration means And a code reader for reading a two-dimensional code of the image data stored in the image data storage unit based on the finder pattern.
[0019]
Further, the finder pattern detecting means according to the present invention is characterized by detecting a finder pattern having a ratio of 1: 1: 3: 1: 1 of a QR (Quick Response) code which is a two-dimensional code.
[0020]
The finder pattern detecting means according to the present invention is characterized by detecting a finder pattern of an L-shaped pattern of a data matrix (Data Matrix) which is a two-dimensional code.
[0021]
The two-dimensional code reader according to the present invention has a ratio of 1: 1: 3: 1: 1 of the width of a monochrome (or light / dark) pattern that forms a QR (Quick Response) code from captured image data, or data. The feature points of the 2D code finder pattern, such as the black (or dark) pattern of the matrix (Data Matrix), are automatically detected by image processing, and the detected finder pattern is automatically registered and then automatically Since the two-dimensional code of the image data is read based on the registered finder pattern, it is possible to increase the efficiency and speed of reading the two-dimensional code.
[0022]
Furthermore, the finder pattern detection means according to the present invention generates a finder pattern obtained by thinning out image data at a predetermined pixel interval, and reads a two-dimensional code of the image data based on the thinned finder pattern.
[0023]
Further, the finder pattern detection means according to the present invention is characterized in that when one finder pattern is detected, a position where another finder pattern should exist is estimated with reference to preset finder pattern arrangement information.
[0024]
The finder pattern detecting means according to the present invention can generate a finder pattern obtained by thinning out image data at a predetermined pixel interval, or can detect a position where another finder pattern should exist when one finder pattern is detected. Therefore, it is possible to identify and read the two-dimensional code from the image data at higher speed.
[0025]
Furthermore, the two-dimensional code reader according to the present invention includes an image data storage unit that stores image data obtained by imaging a two-dimensional code with a camera, and a model pattern storage unit that stores a finder pattern set in advance as a model pattern. And a finder pattern detecting means for collating the model pattern with the image data and detecting a finder pattern based on the degree of correlation, and a code reading means for reading the contents of the two-dimensional code based on the detection of the finder pattern. It is characterized by that.
[0026]
Further, the two-dimensional code reader according to the present invention includes a model pattern registration means for detecting a finder pattern from image data obtained by imaging a two-dimensional code with a camera and registering the detected finder pattern as a model pattern. It is characterized by having.
[0027]
Furthermore, the two-dimensional code reader according to the present invention is characterized in that the model pattern of the two-dimensional code is a finder pattern of a QR (Quick Response) code.
[0028]
The two-dimensional code reader according to the present invention is characterized in that the model pattern of the two-dimensional code is an L-shaped pattern of a data matrix.
[0029]
A two-dimensional code reader according to the present invention registers a finder pattern of a two-dimensional code as a model pattern, such as a QR (Quick Response) code pattern registered in advance or an L-shaped pattern of a data matrix (Data Matrix), Since the pattern and image data are collated and the finder pattern is detected based on the degree of correlation and the two-dimensional code of the image data is read, even if the two-dimensional code is formed by direct marking, the two-dimensional code is ensured Can be read. In addition, the finder pattern can be accurately detected even if the finder pattern is chipped or dirty.
[0030]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. FIG. 1 is a system configuration diagram of a two-dimensional code reader according to the present invention.
[0031]
The two-dimensional code reader according to the present invention comprises a
[0032]
The
[0033]
The dedicated
[0034]
An image captured by the
[0035]
The
[0036]
In the present embodiment, the dedicated
[0037]
The finder pattern detection means automatically detects the feature point of the finder pattern of the two-dimensional code from the image data stored in the image data storage unit by image processing. Further, the finder pattern detection means generates a finder pattern obtained by thinning out image data at a predetermined pixel interval. Further, when one finder pattern is detected, the finder pattern detection unit estimates a position where another finder pattern should exist with reference to preset finder pattern arrangement information.
[0038]
The finder pattern of the QR (Quick Response) code is detected from the ratio of 1: 1: 3: 1: 1 of the width of the black and white (or light and dark) pattern. In addition, when a QR (Quick Response) code is formed by laser marking or the like, and in the case of a ● -shaped dot pattern, as a pre-processing, an image of the ● -shaped dot is subjected to an expansion process to smooth the dot pattern, and then a finder. The pattern is detected from a ratio of 1: 1: 3: 1: 1 of the width of the black and white (or light and dark) pattern.
[0039]
The data matrix (Data Matrix) finder pattern is detected from a black (or dark) L-shaped pattern. In addition, when a data matrix (Data Matrix) is formed by laser marking or the like, and in the case of a ● -shaped dot pattern, as a pre-processing, the dot pattern is subjected to expansion processing to smooth the dot pattern, and then the finder. The pattern is detected from a black (or dark) L-shaped pattern. The finder pattern detection of the data matrix (Data Matrix) does not directly search for the L character, but searches for the vertical side (I) or the horizontal side (-) of the L character to find the presence of the L-shaped finder pattern. Can also be estimated.
[0040]
The finder pattern registration means automatically registers the finder pattern detected by the finder pattern detection means.
[0041]
The code reading unit reads the two-dimensional code of the image data stored in the image data storage unit based on the finder pattern stored in the finder pattern storage unit. The code reading unit reads the two-dimensional code of the image data stored in the image data storage unit based on the finder pattern registered in the finder pattern registration unit.
[0042]
The model pattern registration means detects a finder pattern from image data obtained by imaging a two-dimensional code with a camera, and registers the detected finder pattern as a model pattern.
[0043]
FIG. 2 is a diagram showing a code cutting operation (pattern search) in the two-dimensional code reading means according to the present invention. In the
[0044]
Rather than searching for a conventional pattern of 1: 1: 3: 1: 1, the finder pattern of the target code is registered as a model in advance, so that it is not affected by the characteristics of the marking method. It is possible to deal with missing dots and the like, the finder pattern can be detected with high accuracy, and the reading performance of the direct-marked QR code can be greatly improved.
[0045]
Further, the two-dimensional code reading means according to the embodiment is equipped with the following four functions as countermeasures for investigating the cause on the user side when a reading error occurs.
[0046]
(1) Cell recognition position display function: This is a function for monitoring and displaying a point recognized as black when white and black cells are recognized in reading a two-dimensional code. With this function, even when there is a defect in the code, the black and white recognition point of the code can be confirmed by looking at the
[0047]
(2) Cell recognition / collation function: A function for registering black and white information of a cell relating to a certain code as reference data, determining coincidence at the time of reading, and performing monitor output. With this function, when the same code is read, it is possible to check a dirty or missing portion and analyze the stability of the marking.
[0048]
(3) Image analysis function: An analysis function for the read image data. There are the following three functions, and the cause of the reading error can be analyzed on the user side.
(A) Line Bright: A density distribution on an arbitrary line in the horizontal and vertical directions is displayed in a graph.
(B) Pixel value display: The density information of the specific area is displayed as a numerical value of 0-255.
(C) Image enlargement: An image of a specific area is enlarged and displayed.
[0049]
(4) NG image saving function: Up to 24 reading error screens can be saved as images, and what kind of reading error has occurred can be confirmed with the saved images.
[0050]
With the above four functions, even when a reading error occurs, the user can analyze the cause and take countermeasures.
[0051]
Error correction by Reed-Solomon code is used for the two-dimensional code. In the error correction using the Reed-Solomon code, an error correction code that makes full use of code theory that can be restored even if a part of the original data is damaged is added to the data area. Thereby, even if the position of the code is dirty or missing, the original data can be restored.
[0052]
The two-dimensional code reading means according to the present embodiment can output error correction information by using the error correction algorithm shown in FIG.
{Circle around (1)} Syndrome is calculated based on data obtained from a two-dimensional code. Here, the syndrome is an operator that detects the presence or absence of an error. When there is no error, all syndrome values have a value of 0.
(2): A variable for an error position polynomial is obtained.
(3): An error position is detected by solving an error position polynomial.
{Circle around (4)} An error value corresponding to an error position is obtained.
(5): The error is corrected by subtracting the corresponding value from the error position.
[0053]
Next, a reading operation method of the two-dimensional code reading unit according to the present invention will be described. 4 to 8 are diagrams illustrating a QR code reading operation method. 4 to 8 show the display contents of the monitor screen. FIG. 4A shows a confirmation screen. FIG. 4B shows a screen for specifying the setting state. FIG. 4C shows a screen for designating the image input mode in the setting state. FIG. 4D shows a screen for setting image preprocessing in the image input mode.
[0054]
FIG. 5A shows a screen for setting the degree of smoothness in the image preprocessing. In the image preprocessing, any one of smoothing weakness, smoothing strength, and edge enhancement can be selected and designated. FIG. 5B shows a state returned to the state shown in FIG. FIG. 5C shows a screen for designating a read QR pattern. FIG. 5B shows a screen for designating pattern settings.
[0055]
FIG. 6A is a screen for designating model registration. FIG. 6B is a screen for setting a QR code version. FIG. 6C and FIG. 6D are screens for setting a finder pattern area. In FIG. 6C, the start point surrounding the finder pattern (FP) is selected, and in FIG. 6D, the end point is selected.
[0056]
FIG. 7A is a screen for designating model reference, and FIG. 7B is a screen for model reference. The registered model (finder pattern) can be confirmed on this model reference screen. FIG. 7C shows the confirmation state screen shown in FIG. FIG. 7D shows a reading screen. The finder pattern is detected by the TRIG input, and the code is read. The OK display in the screen indicates that the code has been read normally. The display of 247 ms on the screen indicates the time required for reading the code. When reading settings are set on the screen shown in FIG. 8A, various reading parameters can be changed on the screen shown in FIG.
[0057]
9 and 10 are diagrams showing a method for reading DM (data matrix) codes. FIG. 9A shows a screen for designating model registration in DM pattern setting. When model registration is designated, the version is designated on the screen shown in FIG. 9B. Next, the start point surrounding the finder pattern is selected in FIG. 9C, and the end point of the finder pattern is selected in FIG. 9D. As a result, the model is registered.
[0058]
When model reference is specified in FIG. 10A, the registered model can be confirmed as shown in FIG. In the DM (data matrix) code, three points that are corners of the L-shaped pattern are registered as models. Then, in the state where the confirmation screen shown in FIG. 10C is returned, as shown in FIG. 10D, when a TRIG input is performed, a model pattern is detected and a DM (data matrix) code is read.
[0059]
FIG. 11 is a diagram showing a QR code reading procedure. When an image is captured, three finder patterns are detected, and QR codes are cut out based on each finder pattern. Then, the inclination and size of the cut QR code are recognized, and each cell is recognized based on the recognition. Next, white and black of each cell are recognized, the contents expressed in binary numbers are decoded by decoding processing, and read data is supplied to a host device such as a personal computer via a serial interface such as RS232C.
[0060]
FIG. 12 is a diagram showing a data matrix code reading procedure. When the image is captured, an L-shaped cut-out pattern is searched, and an L-shaped diagonal black-and-white alternating pattern is recognized. The inclination and size are recognized from these recognition results, and each cell is recognized based on the recognition. Next, white and black of each cell are recognized, the contents expressed in binary numbers are decoded by decoding processing, and read data is supplied to a host device such as a personal computer via a serial interface such as RS232C.
[0061]
FIG. 13 is a diagram showing a comparison between the binarization method and the differentiation method. The two-dimensional code reading means according to the present embodiment employs a differentiation method that is strong against gradation and strong against fluctuations due to illumination or the like.
[0062]
FIG. 14 is a diagram showing a QR code reading method by a differential method. In reading the QR code, a finder pattern is detected by using a value set in the “setting” gray value. This is a method of recognizing that white and black are inverted when a difference (differential value) between pixels changes by a gray value or more. By turning on the read gray value retry, when the finder pattern detection fails, the gray value is changed to retry. With this function, it is possible to cope with changes in the work over time.
[0063]
FIG. 15 is a diagram showing the monochrome recognition operation of the data portion. The threshold value is used when the black and white of the cell in the data portion is recognized after the finder pattern is detected. Accordingly, the threshold value is not used unless a three-point finder pattern is detected.
[0064]
FIG. 16 is a diagram showing an example of a correlation search automatic registration model. In the QR code, any one of the three finder patterns is automatically registered as a model. In the data matrix code, the three corners of the L-shaped pattern are automatically registered as models. Here, each corner is registered together with a predetermined number of white portions. In Vericode, each corner of the black square frame is automatically registered as a model. Here, each corner is registered together with a predetermined number of white portions.
[0065]
FIG. 17 shows a QR code correlation search method. When one finder pattern is detected, each of the positions A, B, C, and D where two other finder patterns may exist with respect to the position of the detected finder pattern P. The finder pattern is detected.
[0066]
When two finder patterns are detected, positions A ′, B ′, C ′, where another one finder pattern may exist with respect to the two detected finder patterns P and Q. A finder pattern is detected for each of D ′.
[0067]
In this way, by limiting the search range of other finder patterns based on the position of the finder pattern detected previously, the time until all the finder patterns are detected can be shortened.
[0068]
For reading a two-dimensional code, it is usual to take an image so that one cell has 5 pixels or more. In addition, a larger image can be read more reliably. On the other hand, when a two-dimensional code is captured by about 5 pixels in one cell, a finder pattern as a model becomes small, and there is a problem that it is difficult to register a model. There is also know-how in model registration, and it is necessary to include a margin (margin).
[0069]
Since the two-dimensional code reading means according to the present invention has an automatic registration function of a finder pattern as a model, the position of the finder pattern of the two-dimensional code on the image memory is detected, and the registration position of the correlation search model is determined. The model area can be registered automatically.
[0070]
Further, the two-dimensional code reading means according to the present invention generates a registered image by thinning out image data at a predetermined pixel interval, collates the registered image with a model pattern, and detects a finder pattern based on the degree of correlation. Therefore, the search time for the finder pattern can be shortened.
[0071]
【The invention's effect】
As described above, the two-dimensional code reader according to the present invention has a QR (Quick Response) code ratio of 1: 1: 3: 1: 1 or a data matrix (Data Matrix) out of captured image data. The feature point of the finder pattern of the two-dimensional code such as an L-shaped pattern is automatically detected by image processing, and the two-dimensional code of the image data is read based on the detected finder pattern. The work can be performed efficiently and the convenience can be improved.
[0072]
Also, the two-dimensional code reader according to the present invention has a QR (Quick Response) code ratio of 1: 1: 3: 1: 1 or an L-shaped pattern of a data matrix (Data Matrix) among captured image data. Since the feature point of the finder pattern of the two-dimensional code is automatically detected by image processing, and the detected finder pattern is automatically registered, the two-dimensional code of the image data is read based on the automatically registered finder pattern. It is possible to increase the efficiency and speed of reading the dimension code.
[0073]
Furthermore, the finder pattern detection means according to the present invention generates a finder pattern obtained by thinning out image data at a predetermined pixel interval, or when one finder pattern is detected, estimates a position where another finder pattern should exist. Therefore, it is possible to identify and read a two-dimensional code from image data at a higher speed.
[0074]
The two-dimensional code reading apparatus according to the present invention registers a finder pattern of a two-dimensional code as a model pattern, such as a QR (Quick Response) code pattern registered in advance or an L-shaped pattern of a data matrix (Data Matrix). Since the model pattern and the image data are collated, the finder pattern is detected based on the degree of correlation, and the two-dimensional code of the image data is read, so even if the two-dimensional code is formed by direct marking, the two-dimensional code Can be read reliably. In addition, the finder pattern can be accurately detected even if the finder pattern is chipped or dirty.
[Brief description of the drawings]
FIG. 1 is a system configuration diagram of a two-dimensional code reader according to the present invention.
FIG. 2 is a diagram showing a code cut-out operation (pattern search) in the two-dimensional code reader according to the present invention.
FIG. 3 is a flowchart of the Reed-Solomon error correction algorithm.
FIG. 4 is a diagram illustrating a QR code reading operation method (part 1);
FIG. 5 is a diagram illustrating a QR code reading operation method (part 2);
FIG. 6 is a diagram illustrating a QR code reading operation method (part 3);
FIG. 7 is a diagram illustrating a QR code reading operation method (part 4);
FIG. 8 is a diagram illustrating a QR code reading operation method (part 5);
FIG. 9 is a diagram illustrating a DM (data matrix) code reading operation method (part 1);
FIG. 10 is a diagram showing a DM (data matrix) code reading operation method (part 2);
FIG. 11 is a diagram showing a QR code reading procedure;
FIG. 12 is a diagram showing a data matrix code reading procedure;
FIG. 13 is a diagram showing a comparison between a binarization method and a differentiation method.
FIG. 14 is a diagram illustrating a QR code reading method based on a differentiation method;
FIG. 15 is a diagram showing a black and white recognition operation of the data portion.
FIG. 16 is a diagram showing an example of a correlation search automatic registration model
FIG. 17 is a diagram showing a correlation search method for QR codes.
FIG. 18 is a diagram showing an example of a QR code
FIG. 19 is a diagram showing an example of a data matrix code
FIG. 20 is a flowchart of conventional QR code reading.
FIG. 21 is a diagram showing a conventional QR code reading algorithm;
[Explanation of symbols]
1 Controller
2 Camera
3 Video monitor
4 PC / PLC
5 Console unit
6 PLC / Timing SW
11 Camera I / F
12 Dedicated image processing ASIC
13 Frame buffer
14 monitor I / F
15 Graphic memory
16, 17 Image memory
18 Model memory
20 CPU
Claims (3)
前記画像データ格納部に格納された画像に対し、2次元コードのファインダパターンの位置を特定するための少なくとも始点と終点を含む位置情報の入力を行う入力手段と、
前記入力手段により入力された位置情報に基づいて画像を抽出する領域を定める領域確定手段と、
さらに、前記領域確定手段により定められた領域の少なくとも3角部を、モデルパターンとして抽出して前記モデルパターン格納部に格納する角部抽出手段と、
を備えたことを特徴とする2次元コード読取装置。An image data storage unit that stores image data obtained by imaging a two-dimensional code with a camera, a model pattern storage unit that stores image data obtained by imaging a two-dimensional code with a camera, and preset as the model pattern A model pattern storage unit for storing the finder pattern, a finder pattern detection unit for comparing the model pattern with the image data, and detecting a finder pattern based on the degree of correlation, and based on the detection of the finder pattern A two-dimensional code reading device comprising code reading means for reading the contents of the secondary code,
Input means for inputting position information including at least a start point and an end point for specifying the position of the finder pattern of the two-dimensional code for the image stored in the image data storage unit;
Area determination means for determining an area from which an image is extracted based on the position information input by the input means;
Further, corner extraction means for extracting at least three corners of the region determined by the region determination means as a model pattern and storing it in the model pattern storage unit ;
A two-dimensional code reading device comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001121098A JP4013027B2 (en) | 2001-04-19 | 2001-04-19 | Two-dimensional code reader |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001121098A JP4013027B2 (en) | 2001-04-19 | 2001-04-19 | Two-dimensional code reader |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2002318997A JP2002318997A (en) | 2002-10-31 |
| JP4013027B2 true JP4013027B2 (en) | 2007-11-28 |
Family
ID=18971032
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001121098A Expired - Fee Related JP4013027B2 (en) | 2001-04-19 | 2001-04-19 | Two-dimensional code reader |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4013027B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20230097901A1 (en) * | 2021-09-23 | 2023-03-30 | Sigmastar Technology Ltd. | Image correction method and processor |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7667217B2 (en) * | 2007-07-13 | 2010-02-23 | International Business Machines Corporation | Apparatus for observing and capturing latent images on objects, and method for using same |
| JP5465641B2 (en) * | 2010-09-17 | 2014-04-09 | 株式会社キーエンス | Optical information reading improvement support device |
| CN102708349B (en) * | 2012-05-11 | 2014-11-05 | 深圳市天朗时代科技有限公司 | Method for decoding matrix two-dimensional code |
| JP2015032213A (en) * | 2013-08-05 | 2015-02-16 | 株式会社東芝 | Information processing apparatus, information processing method, and information processing program |
| JP6634952B2 (en) * | 2016-04-28 | 2020-01-22 | 株式会社リコー | Recognition device, recognition method and recognition program, and management system and transport system |
| JP2023079339A (en) * | 2021-11-29 | 2023-06-08 | 株式会社キーエンス | Optical information reading device and optical information reading method |
-
2001
- 2001-04-19 JP JP2001121098A patent/JP4013027B2/en not_active Expired - Fee Related
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20230097901A1 (en) * | 2021-09-23 | 2023-03-30 | Sigmastar Technology Ltd. | Image correction method and processor |
| US11908108B2 (en) * | 2021-09-23 | 2024-02-20 | Sigmastar Technology Ltd. | Image correction method and processor |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2002318997A (en) | 2002-10-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7622596B2 (en) | IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND IMAGE PROCESSING PROGRAM | |
| JP2002133426A (en) | Ruled line extraction device for extracting ruled lines from multi-valued images | |
| JPH07234915A (en) | Image recognizing device | |
| JP2008071076A (en) | Image extraction device | |
| JP4013027B2 (en) | Two-dimensional code reader | |
| JP3936436B2 (en) | Table recognition method | |
| JP2000187705A (en) | Document reading apparatus and method and storage medium | |
| CN112733829A (en) | Feature block identification method, electronic device and computer-readable storage medium | |
| JP3494388B2 (en) | Fingerprint matching method and fingerprint matching device | |
| WO2022211064A1 (en) | Information reading device | |
| JP2022184098A (en) | Image processing device, image processing method and program | |
| JP3838091B2 (en) | Pattern recognition apparatus and program for model registration for pattern recognition | |
| JP3794285B2 (en) | Optical character reader | |
| JP2006266943A (en) | Apparatus and method for inspecting defect | |
| JP2988401B2 (en) | Stamp recognition device | |
| JP2007072642A (en) | Image processing apparatus and image processing apparatus control method | |
| JPH10207978A (en) | Pattern matching method and device for characters etc. | |
| JP4194301B2 (en) | Character recognition system and character recognition program | |
| JPH05108800A (en) | Image defect discrimination processing device | |
| JPH09147056A (en) | Mark appearance inspection method and its equipment | |
| CN113902610B (en) | A data augmentation method, device and electronic device for remote sensing images | |
| JP3412441B2 (en) | Image processing device | |
| JP2007140703A (en) | Method for reading insurance policy, system thereof, and insurance policy recognition system | |
| JP2022158916A (en) | Information reader | |
| JPH117493A (en) | Character recognition processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040908 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20061026 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061107 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061214 |
|
| 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: 20070815 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070828 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100921 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100921 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110921 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110921 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120921 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130921 Year of fee payment: 6 |
|
| LAPS | Cancellation because of no payment of annual fees |