JP3726395B2 - Two-dimensional code and two-dimensional code reading method - Google Patents

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

Info

Publication number
JP3726395B2
JP3726395B2 JP01647797A JP1647797A JP3726395B2 JP 3726395 B2 JP3726395 B2 JP 3726395B2 JP 01647797 A JP01647797 A JP 01647797A JP 1647797 A JP1647797 A JP 1647797A JP 3726395 B2 JP3726395 B2 JP 3726395B2
Authority
JP
Japan
Prior art keywords
size
dimensional code
code
positioning symbol
positioning
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
JP01647797A
Other languages
Japanese (ja)
Other versions
JPH10214317A (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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP01647797A priority Critical patent/JP3726395B2/en
Publication of JPH10214317A publication Critical patent/JPH10214317A/en
Application granted granted Critical
Publication of JP3726395B2 publication Critical patent/JP3726395B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、2次元コードおよび2次元コードの読取方法に関する。
【0002】
【従来の技術】
従来、提案されている2次元コードの例としては特開平7−254037号公報記載のものがあり、この2次元コードの読取装置の例としては特開平8−180125号記載のものがある。
【0003】
2次元コードは、図14(b)に一例を示すごとく情報が2次元的な広がりを持ち、図14(a)に示すバーコードに比べて格段に大量の情報を記録できるが、構造は複雑なものとなっているため、2次元コードの全体形状を迅速に確定することが重要視されている。
【0004】
そのため、従来の2次元コードでは、図15に示すごとく、特定寸法比率の正方形を組み合わせた3つの位置決め用シンボル310a,310b,310cを、2次元コード300の4つの頂点の内の3頂点にそれぞれ配している。
この位置決め用シンボル310a,310b,310cは、例えば、一辺の長さが7セルに相当する黒い枠状正方形312、一辺の長さが5セルに相当する白い枠状正方形314、一辺の長さが3セルに相当する黒い正方形316を同心状に重ね合わせた時にできる図形を採用している。
【0005】
この位置決め用シンボル310a,310b,310cの中心付近を直線的に横切ると、黒、白、黒、日、黒のパターンが1:1:3:1:1の比率で検出される。このような比率の検出はハード的にもソフト的には比較的容易に検出できるので、前記比率で黒と白が交互に検出された場合、そのパターンを位置決め用シンボル310a,310b,310cの有力な候補であると迅速に判断でき、その位置・形状を迅速に決定することができる。
【0006】
このように迅速に3つの位置決め用シンボル310a,310b,310cの位置と形状とが決定できれば、2次元コード300の各頂点が定まるとともに、2次元コード300を構成しているデータセル330の内容を、迅速かつ正確に読み取ることができる。(図15ではデータセル330の白黒のパターンは省略されている。)
したがって、これら3つの位置決め用シンボル310a,310b,310cの存在は、2次元コード300の存在位置を迅速かつ正確に確定するためには重要なものであった。
【0007】
【発明が解決しようとする課題】
このように、大量のデータを記録している2次元コードを短時間で解読するためには、従来は3つの位置決めシンボルを持つ必要があったが、2次元コードに記録される情報量が比較的少ない場合には、従来の2次元コードは、必ずしも好適な構成をなしているものとは言えなかった。
【0008】
例えば、前述した2次元コード300では、情報量が少なくなると2次元コード300全体の面積に占める位置決めシンボル310a,310b,310cの面積の比率が大きくなり、極端な場合は、図16のように、2次元コード400全体の面積の大半を、3つの位置決めシンボル410a,410b,410cが占めるようになり、情報量を減らしても2次元コードはほとんど小さくならないという問題が発生した。したがって、情報量が少ないのにかかわらず、情報以外の部分で大きな面積を必要とするので、用途に応じて2次元コードを小さくして、省スペース化を達成するという需要に応えられない。例えばICの樹脂面などの小さいスペースに、情報量を減らして小さくした2次元コードを印刷したいというような需要があるにもかかわらず、応えられないという一面があった。
【0009】
このような問題を解決するためには、位置決め用シンボルの数を減らすことが考えられる。例えば、特開平2−56091号においては、2次元コードの中央に置かれた1つの位置決め用シンボルから一定の範囲が2次元コードのサイズであるとして、1つのみの位置決め用シンボルしか配置されていない。
【0010】
しかし、特開平2−56091号に記載された2次元コードは、位置決め用シンボルが1つであるため、予め全体の大きさを一定としなくてはならず、情報量を更に少なくした場合にもその一定の大きさが必要となる。したがって、用途に応じて2次元コードを、もっと小さくして、一層の省スペース化を達成するという需要には応えられない。
【0011】
更に、読取処理する場合も、必ず予め決められた一定の範囲は読み取らなくてはならないので、データ量が少なくても、迅速に読取処理できるとは言えなかった。
また逆に情報量を多くしようとして、2次元コードのみを大きくしても、読取処理では、予め決められた一定の範囲のみの読み取りであるため、大きくした2次元コードに対処するためには読取処理を行う読取装置のハードやソフトの構成を変更しなくてはならず、用途に応じて迅速に対処できないという問題があった。
【0012】
本発明は、用途に合わせてサイズを容易に変更することができる2次元コードおよびその読取方法の提供を目的とするものである。
【0013】
【課題を解決するための手段及び発明の効果】
本発明の2次元コードは、複数の異なる方向または複数の異なる位置において走査した場合に1:1:3:1:1の周波数成分比が得られる正方形形状のパターンであり、正方形形状の2次元コードの位置を特定する位置決め用シンボル以外に、位置決め用シンボルに対する所定位置であって位置決め用シンボルの4辺のうちデータセルが存在する側の2辺に沿った位置にそれぞれ配置されて、セルの分布パターンで2次元コードのサイズを表す2つのサイズコードが備えられている。そして、サイズコードは、所定セル数で異なる分布パターンを有する複数のサイズコードの中から2次元コードのサイズを示す分布パターンが選択されて配置されている。
【0014】
このため、例え、位置決め用シンボルが1つでも、サイズコードの情報から、2次元コードのサイズが判明するので、読取装置は読み取るべきサイズを特定することができる。このように、読取装置側では、サイズコードの情報から2次元コードのサイズを読み取るようにしておくだけで、以後、2次元コードのサイズが変更されても、そのハードやソフトを変更することはなく、直ちに対処でき、無駄な読み取りや読みこぼしを無くして、正確に2次元コードを読み取ることができる。
【0015】
サイズコードは、位置決め用シンボルのような最初に検出されるパターンではなく、サイズを表すのみで良いことから、比較的小さい面積を占めるもので良く、2次元コードを小さくする場合にもほとんど阻害要因とはならない。
また、上述したことは、サイズコードの内容の変更のみで、自由に2次元コードのサイズを変更できることを意味し、用途に応じて2次元コードのサイズを迅速に対処させることができる。
【0016】
また、このように2次元コードのサイズが、位置決め用シンボルの配置状態からでなく、サイズコードの内容から読み取られるため、位置決め用シンボルが3つ存在している必要はなく、2つでも1つでも、2次元コードのサイズが容易に検出できることになる。このため、位置決め用シンボルの数を減らすことができ、小さなサイズの2次元コードが必要とされる用途でも、2次元コードのほとんどが3つの位置決め用シンボルに占められるために小さくできないと言う問題点を解決して、2次元コードを十分に小さいものとできる。したがって、IC等の小さい2次元コードを必要とする用途にも広く使用できるようになる。
【0017】
さらに、サイズコードは、2次元コードの情報を表しているデータセルと同じ様式のセルの分布パターンで表すことができるため、読取装置もソフト的に容易に2次元コードのサイズを読み取ることが可能となる。したがって、従来の2次元コード読取装置でも、プログラムを変更するのみで対処できる。
【0018】
なお、サイズコードが表す2次元コードのサイズは、正方形の位置決め用シンボルのサイズに対する比率で表しても良い。位置決め用シンボルは最初にその位置や形状が決定されるので、以後、この位置決め用シンボルの形状を基準として、比率で2次元コードのサイズを検出すれば、迅速・容易に2次元コードのサイズを決定することができる。例えば、位置決め用シンボルの2倍、3倍、4倍、……等であり、また整数倍ばかりでなく、1.7倍、2.7倍、3.3倍、15/7倍、23/7倍、……等の小数倍または分数倍を意味するものであっても良い。
【0019】
えば、サイズコードのセルの分布パターンと比率とを対応させておき、読取装置は対応表を基に、読み取ったサイズコードのセルの分布パターンから比率を求めて、2次元コードのサイズを決定し、そのサイズからデータセルの内容を読み出す。
【0020】
お、2次元コード内でのサイズコードの配置としては、例えば、位置決め用シンボルに隣接して配置される。このように、位置決め用シンボル隣接して存在することにより、離れた位置に存在するよりも、サイズコードの位置決めの誤差が小さい。したがって、位置決め用シンボルの位置に基づいて正確にサイズコードが検出されるので、2次元コードの解読処理が一層正確かつ迅速となる。
【0022】
また、例えば、1つの位置決め用シンボルを2次元コードの4つの頂点の内のいずれかに配置した構成とし、サイズコードを2次元コードの縦および横のサイズを表すものとしても良い。
矩形としては例えば正方形であれば、縦と横のサイズは同じなので、サイズコードは1つのサイズを表すものであっても良い。
【0023】
2つのサイズコードが、位置決め用シンボルの4辺の内、データセルが存在する側の2辺にそれぞれ配置され、各サイズコードは、配置された位置決め用シンボルの各辺側での2次元コードのサイズを表す構成としても良い。この構成により、サイズコードの位置が検出されれば、同時に、データセルが存在する方向とその範囲が判るので、効率的に処理ができる。
【0024】
この場合、2次元コードが正方形であれば、2つのサイズコードが表すサイズは同一となる。したがっていずれか一方のサイズコードを省略して設けなくても良い。ただし、この場合でも、省略されたサイズコードが示すべきデータセルの存在方向を、省略されていないサイズコードに対していずれの方向であるかを、予め決定しておく必要がある。
【0025】
なお、同一のサイズを表すサイズコードを2つ設けた場合には、両者が同一かどうかを読取処理時に比較することにより、同一でなければ読取エラーであるとして、エラー処理を実行するようにしても良い。
上述した2次元コードを読み取る方法しては、次のような方法が挙げられる。
【0026】
まず、2次元コードの走査等により、2次元コードの画像を得るとともに、画像中での位置決め用シンボルを検出する2次元コード位置決め処理を行う。次に、検出された位置決め用シンボルに基づいてサイズコードを検出し、このサイズコードを形成するセルの分布パターンを検出し、この分布パターンを解読することで、サイズコードが表す2次元コードのサイズを取得するサイズ取得処理を行う。次に、取得された2次元コードのサイズに基づいて、2次元コードの情報を読み取るデコード処理を行う。
【0027】
このように、サイズ取得処理において、サイズコードが表す2次元コードのサイズを取得し、この2次元コードのサイズに基づいて、デコード処理にて2次元コードの情報を読み取っている。したがって、情報を読み取ろうとしている2次元コードのサイズが2次元コード毎に変化しても、各2次元コードに含まれているサイズコードにより直ちに対応でき、2次元コードの情報を、無駄な読み取りをしたり読みこぼしをしたりすることなく、正確に読み取ることができる。
【0028】
より具体的には次のように構成することができる。すなわち、2次元コード位置決め処理は、2次元コードの走査等により、2次元コードの画像を得るとともに、画像中での位置決め用シンボルの位置と形状とを検出する。サイズ取得処理は、検出された位置決め用シンボルの位置と形状とに基づいて、サイズコードの位置(位置決め用シンボルに対する所定位置)を検出し、この位置からサイズコードを形成するセルの分布パターンを検出し、この分布パターンを解読することで、サイズコードが表す2次元コードのサイズを取得する。デコード処理は、取得された2次元コードのサイズと位置決め用シンボルの形状とに基づいて、2次元コードの情報を表すデータセルの位置を検出し、この位置から2次元コードの情報を読み取る。
【0029】
なお、2次元コードが、2つのサイズコードが位置決め用シンボルの4辺の内、データセルが存在する側の2辺にそれぞれ配置され、各サイズコードが、配置された位置決め用シンボルの各辺側に存在するデータセルのサイズを表しているものである場合は、次のような2次元コード読取方法を採用しても良い。
【0030】
すなわち、2次元コードの走査等により、2次元コードの画像を得るとともに、この画像中での位置決め用シンボルの位置と形状とを検出する2次元コード位置決め処理を行い、次に、検出された位置決め用シンボルの位置と形状とに基づいて、位置決め用シンボルの4つの辺側の所定位置を検査することで、2つのサイズコードの存在を検出して、このサイズコードが表す2次元コードのサイズを取得するサイズ取得処理を行い、次に、サイズコードが検出された位置決め用シンボルの2つの各辺側について、サイズコードから取得された2次元コードのサイズと位置決め用シンボルの形状とに基づいて、データセルの位置を検出して、このデータセルから2次元コードの情報を読み取るデコード処理を行う。
【0031】
なお、このような2次元コードの読取方法を実行する機能は、例えば、コンピュータシステム側で起動するプログラムとして備えられる。このようなプログラムの場合、例えば、フロッピーディスク、光磁気ディスク、CD−ROM、ハードディスク等の機械読み取り可能な記憶媒体に記憶し、必要に応じてコンピュータシステムにロードして起動することにより用いることができる。この他、ROMやバックアップRAMを機械読み取り可能な記憶媒体として前記プログラムを記憶しておき、このROMあるいはバックアップRAMをコンピュータシステムに組み込んで用いても良い。
【0032】
【発明の実施の形態】
図1のブロック図に、上述した発明が適用された2次元コード読取装置2の概略構成を示す。
2次元コード読取装置2は、CCD4、2値化回路6、画像メモリ8、クロック信号出力回路14、アドレス発生回路16、変化点検出回路18、比検出回路20、アドレス記憶メモリ22および制御回路28から構成されている。
【0033】
制御回路28は、CPU、ROM、RAM、I/O等を備えたコンピュータシステムとして構成され、ROMに記憶されているプログラムに従って、後述する2次元コード読取処理等を実行し、2次元コード読取装置2の各構成を制御している。
【0034】
ここで、2次元コード読取装置2にて検出される上述した発明が適用された2次元コードの一例の概略図を図2に示す。この2次元コード52は、白色の台紙53の上に印刷されており、1個の位置決め用シンボル54、データ領域56、および2個のサイズコード60,62から構成されている。これら全体のサイズは、15セル×15セルの正方形状とされている。各セルは、光学的に異なった2種類のセルから選ばれており、図および説明上では白(明)・黒(暗)で区別して表す。なお、図2では便宜上、データ領域56のデータセルの白黒のパターンは省略している。実際の2次元コード52は、図3に一例として示すごとくである。
【0035】
位置決め用シンボル54は、2次元コード52の4つの頂点の内の1つに配置されている。この位置決め用シンボル54のセルの明暗配置は、図4(A)に示すごとく、1セル幅の黒からなる枠状正方形55a内の中心部分に、1セル幅の白からなる縮小した枠状正方形55bが形成され、その内側の中心部分に黒からなる3セル×3セルの大きさの正方形55cが形成されているパターンである。
【0036】
また、サイズコード60,62は、データ領域56の内、位置決め用シンボル54にセル1つ分離れた隣接位置、その内でもデータ領域56が存在する側の位置決め用シンボル54の2辺54a,54bに沿って配置されている。サイズコード60,62は、それぞれ6個のセルが直列に配列した構成である。サイズコード60,62は、データ領域56から見て、左側から、黒セルと白セルとが交互に並んだ配列となっている。サイズコード60,62はこの配列のセル分布パターンにより、2次元コード52のサイズ情報を表している。
【0037】
サイズコードとして設定され得るセル分布パターンとしては、2の6乗=64種類を設けることができるが、ここではサイズコードとしては、3種類のみと決められているものとする。特に、特に黒セルと白セルとの分布が偏らないように、図6(a),(b),(c)の3種類のパターンを利用している。この内、図6(a)が図2で用いられるサイズコード60,62に対応し、サイズ情報として15/7を表している。このサイズ情報は、位置決め用シンボル54の大きさに対する2次元コード52の比率(ここでは倍率)を表している。すなわち、図2の位置決め用シンボル54は正方形であり、1辺の長さは7セル分である。したがって、2次元コード52の1辺の長さは、7セル×15/7=15セルであることがサイズコード60,62から判る。
【0038】
また、図6(b)のサイズコード70,72では、比率11/7を表しているので、図7に示すごとく、位置決め用シンボル76のサイズに対して11/7(11セル)である2次元コード74に用いられる。
また、図6(c)のサイズコード80,82では、比率21/7を表しているので、図8に示すごとく、位置決め用シンボル86のサイズに対して21/7(21セル)である2次元コード84に用いられる。
【0039】
なお、ここでは、2次元コード52と位置決め用シンボル54とは正方形であるとの前提で、2つサイズコード60,62は全く同じものを使用している。ただ、2次元コード52あるいは位置決め用シンボル54を正方形でない矩形あるいは場合により平行四辺形等の四角形のものも含まれているとすれば、例えば、辺54a側にあるサイズコード60は、位置決め用シンボル54のx方向のサイズに対する2次元コード52のx方向のサイズの比率を表しているものとし、辺54b側にあるサイズコード62は、位置決め用シンボル54のy方向のサイズに対する2次元コード52のy方向のサイズの比率を表しているものとする。
【0040】
制御回路28は、以下に述べるごとくの2次元コード読取制御を行う。
まず制御回路28の指示により、2次元画像検出手段としてのCCD4にて2次元コード52が通過する場所の2次元画像を検出する。CCD4は、2次元画像を検出すると、図5(a)に示すごとくのアナログ的なレベルからなる信号にて2次元画像データを出力する。この2次元画像データを、2値化回路6が制御回路28から指示された閾値にて2値化して、図5(b)に示すごとくの1(ハイ)/0(ロー)の2つのレベルからなる信号に変換する。
【0041】
一方、CCD4から出力される同期パルスに応じて、クロック信号出力回路14がCCD4から出力される2次元画像データのパルスより十分に細かいクロックパルスを出力する。アドレス発生回路16はこのクロックパルスをカウントして、画像メモリ8に対するアドレスを発生させる。2値化された2次元画像データは、このアドレス毎に8ビット単位で書き込まれる。
【0042】
一方、2値化回路6からの信号における「1」から「0」への変化あるいは「0」から「1」への変化時に、変化点検出回路18は、比検出回路20にパルス信号を出力する。比検出回路20は、変化点検出回路18からのパルス信号入力から次のパルス信号入力までに、クロック信号出力回路14から出力されたクロックパルスをカウントすることにより、2次元画像の中の明(1)の連続する長さおよび暗(0)の連続する長さを求める。この長さの比から、2次元コード52の位置決め用シンボル54に該当するパターンを検出する。
【0043】
図4(A)に示したごとく、位置決め用シンボル54のほぼ中心を代表的な角度で横切るCCD4の走査線(a),(b),(c)での明暗パターンは、図4(B)に示すごとく、すべて同じ明暗成分比を持つ構造になっている。すなわち、位置決め用シンボル54の中心を横切るそれぞれの走査線(a),(b),(c)の明暗成分比は暗:明:暗:明:暗=1:1:3:1:1となっている。勿論、走査線(a),(b),(c)の中間の角度の走査線においても比率は1:1:3:1:1である。また、図4(A)の図形が、CCD4側から見て斜めの面に配置されていたとしても、前記走査線(a),(b),(c)の明暗成分比は暗:明:暗:明:暗=1:1:3:1:1を維持する。なお、図4(B)は、2値化回路6からの2値化された信号に該当する。
【0044】
このことにより、比検出回路20は、この「1:1:3:1:1」なる明暗成分比を検出し、検出した場合は、そのタイミングにアドレス発生回路16にて発生されている画像メモリ8のアドレスをアドレス記憶メモリ22に記憶する。
したがって、CCD4が1フレーム分の2次元画像データを検出すると、画像メモリ8には、2値化された2次元画像データが記憶され、アドレス記憶メモリ22には、検出された分の位置決め用シンボル54のアドレスが記憶されている。
【0045】
なお、最初の2次元画像の1フレーム分の画像が得られると、制御回路28は、画像メモリ8およびアドレス記憶メモリ22のデータに基づいて後述する2次元コード読取処理を行い、この処理が終了すれば、制御回路28は、続けて、CCD4に次の1フレームの2次元画像の検出を指示する。したがって、CCD4からは、再度、2次元画像が2値化回路6に出力され、上述したごとくの処理が繰り返される。
【0046】
次に、1フレーム分の2次元コード52の画像とその位置決め用シンボル54のアドレスが、画像メモリ8とアドレス記憶メモリ22とにそれぞれ記憶された後に、制御回路28は、2次元コード読取処理を実行する。この2次元コード読取処理を図9のフローチャートに示す。
【0047】
処理が開始されると、まず、位置決め用シンボル54の検出処理が行われる(S100)。
この処理では、画像メモリ8およびアドレス記憶メモリ22に対してアクセスし、その記憶内容から位置決め用シンボル54が適切な位置に存在しているか否かの判断と位置決め用シンボル54の画像上での正確な形状と中心位置とを決定する。
【0048】
この処理は、まずアドレス記憶メモリ22に記憶されている位置決め用シンボル54のアドレスが、位置的に1つのグループに分けられるかを、そのアドレス値と画像メモリ8の画像とを参照しつつ判断する。
次に、ステップS100にて適切な位置決め用シンボル54が1つのみ検出されたか否かが判定され(S110)、検出されていなければ(S110で「NO」)、次の画像の検出をCCD4に指示して(S180)、処理を終了する。
【0049】
適切な位置決め用シンボル54が1つ検出されると(S110で「YES」)、次に新しい2次元コード52か否かが判定される(S120)。この処理は、前回以前に検出された2次元コード52がいまだCCD4により検出され続けている場合に、別の2次元コードとして解読するのを防止するためである。例えば、前回または所定回数前の本処理にて、適切な位置決め用シンボル54が検出され、更にそのコード内容も既に適切に読み取られていた場合には、同一の2次元コード52を検出しているものとして(S120で「NO」)、次の画像の検出をCCD4に指示して(S180)、処理を終了する。
【0050】
新しい2次元コード52であると判定すると(S120で「YES」)、次に画像メモリ8の1(白)/0(黒)のパターンから、位置決め用シンボル54を構成する各セルの形状と中心位置が計算される(S121)。
具体的に説明する。図10に一部を示すごとく、2次元コード52の画像が得られているものとする。位置決め用シンボル54の画像の内、アドレス記憶メモリ22に記憶されているアドレスは、明暗成分比が暗:明:暗:明:暗=1:1:3:1:1として検出された走査線部分Ls(ここでは9本が該当する。)の画像に相当する。したがって、前記アドレスに基づいて、前記明暗成分比の内で位置決め用シンボル54の内側の3セル×3セルの大きさの黒からなる正方形55cに該当する部分、すなわち暗成分の比が「3」である部分(正方形55c内で一点鎖線で示す線分で表される画像部分Ls0〜Ls8)の画像上の位置を特定することができる。
【0051】
そして、この内で先頭のアドレスの画像部分Ls0と、末尾のアドレスの画像部分Ls8とを選択して、先頭の画像部分Ls0の両端点A01,A02のアドレスと、末尾の画像部分Ls8の両端点A11,A12のアドレスとを求める。そして、そのアドレスを画像の座標系(ここでは図示するごとく左上を原点とするxy座標系である。)に変換する。
【0052】
この両端点A01,A02の中央点Ac0、および両端点A11,A12の中央点Ac1の座標を求める。次に、両中央点Ac0,Ac1の中央の座標を求め、位置決め用シンボル54の画像の中心座標Sc(Xa,Ya)とする。
次に、前述した4つの端点A01,A02,A11,A12の内、黒からなる正方形55cの頂点に近い端点A02,A11を抽出する。すなわち、画像部分Ls0,Ls8のそれぞれにおいて、いずれの端点が黒の正方形55cの頂点に近いかを判断して決定する。
【0053】
例えば、先頭の画像部分Ls0よりアドレスが小さい側で隣接する領域E0では、黒と認識されたアドレスは一点鎖線で示すごとく、正方形55cの頂点に遠い端点A01側に偏っている。更に末尾の画像部分Ls8よりアドレスが大きい側で隣接する領域E1では、一点鎖線で示すごとく、黒と認識されたアドレスは正方形55cの頂点に遠い端点A12側に偏っている。
【0054】
したがって、走査線部分Lsよりも外側に隣接する領域E0,E1に該当するアドレスでの黒の配置の偏りを判断することで、黒が偏っていない方の端点A02,A11を、正方形55cの頂点に近い端点としてを抽出することができる。なお、2つの端点A02,A11を、上述した処理にて正方形55cの頂点に近い端点であると、個々に判定しなくても、2つの端点A02,A11の内のいずれか一方の端点について前述の処理にて正方形55cの頂点に近いと決定できれば、もう一方については、決定した端点とは対角に存在する端点が正方形55cの頂点に近いものであることから、対角に存在する端点を抽出するだけでも良い。
【0055】
次に、2つの端点A02,A11を結ぶ直線を、長さを1.5倍して、端点A02側への伸ばした端を、黒の枠状正方形55aの頂点セルの仮の中心位置f′とし、逆に端点A11側へ伸ばした端を、黒の枠状正方形55aの頂点セルの仮の中心位置g′とする。
【0056】
次に、この仮の中心位置f′,g′の周辺画像をそれぞれ精査して、枠状正方形55aの頂点の黒のエッジの形状の特徴等から、正確な頂点セルの中心位置f,gを求める。
次に、枠状正方形55aの残りの2つ頂点セルの中心位置h,iは、中心位置f,gを結ぶ直線とは各直線の中央でかつ中心Scで直交する同長の直線の端部に存在することから、中心位置h,iの座標h(Xh,Yh),i(Xi,Yi)を、中心位置f,gの座標f(Xf,Yf),g(Xg,Yg)および中心座標Sc(Xa,Ya)に基づいて計算で求める。
【0057】
一方の頂点セル中心位置h(Xh,Yh)は、図11に示すごとく、位置決め用シンボル54の中心Scを通る水平線Lvに対して中心位置hからの垂線の交点Shと中心位置hと中心Scとを頂点とする三角形と、水平線Lvに対して中心位置fからの垂線の交点Sfと中心位置fと中心Scとを頂点とする三角形とが同一形状であるとの関係に基づいて、次の連立方程式を解くことにより得られる。
【0058】
【数1】

Figure 0003726395
【0059】
また他方の頂点セル中心位置i(Xi,Yi)についても同様な関係から次の連立方程式を解くことにより得られる。
【0060】
【数2】
Figure 0003726395
【0061】
こうして求められた2つ頂点セルの中心位置h,iの周辺画像をそれぞれ精査して、枠状正方形55aの頂点のエッジの形状等から、正確な頂点セルの中心座標を求めて、その座標を正式に中心位置h,iの座標とする。
そして、隣接する頂点セルの中心位置h,f,i,gの間を6等分することにより、黒の枠状正方形55aを構成するセルの中心位置と、1セルのサイズとを決定する。
【0062】
こうして、位置決め用シンボル54の形状と中心位置Scとが決定する。
次に位置決め用シンボル54に基づいてサイズコード60,62の検出処理を行う(S123)。
まず、図11に示すごとく、対角にある頂点セルの中心位置f,gを結ぶ直線を、この直線の長さの1/3分、各頂点側へそれぞれ延長した端点F,Gを求める。同様に、対角にある頂点セルの中心位置h,iを結ぶ直線を、この直線の長さの1/3分、各頂点側へそれぞれ延長した端点H,Iを求める。
【0063】
この端点F,G,H,Iの内、隣接する端点H,Fの間を直線状に辿ってセル内容を読み込む。すなわち、位置決め用シンボル54の辺54dから1.5セル分離れた位置で、辺54dに沿ってセルの内容を読み取る処理が行われる。同様に、隣接する端点F,Iの間を辺54aに沿って、隣接する端点I,Gの間を辺54bに沿って、および隣接する端点G,Hの間を辺54cに沿って、それぞれセルの内容を読み取る処理が行われる。
【0064】
図2に示したごとく、位置決め用シンボル54の隣接する2つの辺54a,54bに沿って、1セル離れてサイズコード60,62が配列している。すなわち、2つの辺54a,54bから1.5セル分離れた位置は、サイズコード60,62のセルの中心位置を通ることになる。
【0065】
したがって、端点F,G,H,I間の4つの読取処理により、図6に示したサイズコードのいずれかが、2つの読取処理にてそれぞれ検出される。
次に、同一サイズコードが2つ検出されたか否かが判定され(S124)、もし、1つのみ検出されたり、3つ以上検出されたり、全く検出されなかったり、あるいはサイズコードが検出されても両者の内容が異なっていたりした場合には(S124で「NO」)、エラーとしてステップS180に移る。
【0066】
同一サイズコードが2つのみ検出されれば(S124で「YES」)、次に2次元コード52の形状の決定がなされる(S125)。
すなわち、ステップS123で読み取られたサイズコード60,62の位置および内容に基づいて、位置決め用シンボル54に対していずれの辺側にデータセルが存在するか、更に、どれだけのサイズまで広がっているかを決定する。
【0067】
つまり、位置決め用シンボル54の辺54a〜54dの内、サイズコード60,62が検出された側の辺方向に、データセルが存在すると決定する。そして、得られたサイズコード60,62の種類から、比率を決定し、2次元コード52が位置決め用シンボル54のサイズの何倍かを決定する。ここでは、比率が15/7のサイズコード60,62が得られたので、2次元コード52は、図2に示したサイズ15セル×15セルであると決定する。
【0068】
次に、各データセルの位置決定と、データセルの白黒の種類を決定する(S140)。すなわち、ステップS121にて決定されている位置決め用シンボル54の1セルのサイズ、および位置決め用シンボル54の位置から、辺54a,54b側へ、それぞれ、位置決め用シンボル54のサイズも含めて15セル分の範囲にあるデータセルの各中心位置を計算して求めて、その中心位置から各データセルの黒か白かの種類を読み取ってデコードし、2次元コード52が表している情報を得る。
【0069】
次にこのコード内容が正常なものか否かが判定される(S160)。例えば、白と黒とのセル数が予め決められている特定の数になっているか否か、あるいは表されているデータを所定の計算方法で計算した結果が、2次元コード52の所定位置に表示されているデータと一致するか否かを検査すること等により、正常にコードが読み取られているか否かが判定される。
【0070】
正常なコードでなければ(S160で「NO」)、次の画像の検出をCCD4に指示して(S180)、処理を終了する。
正常なコードであれば(S160で「YES」)、そのコード内容をホストコンピュータ等の他の装置へ出力したり、そのコード内容を特定のメモリに記憶したり、そのコード内容に対応した処理を実行したり、あるいはそのコード内容に対応した指示を出力したりする処理が行われる(S170)。
【0071】
そして、次の新たな2次元コードの読み取りのために、画像の検出をCCD4に指示して(S180)、処理を終了する。
なお、他のサイズコード70,72でサイズが表されている11セル×11セルの2次元コード74(図7)、およびサイズコード80,82でサイズが表されている21セル×21セルの2次元コード84(図8)についても、同一の処理で、無駄な読み取りをしたり読みこぼしをしたりすることなく、データ領域78,88の内容を正確に読み取ることができる。なお、各位置決め用シンボル76,86は、図2の2次元コード52の位置決め用シンボル54と同一である。
【0072】
本実施の形態は、上述したごとく、位置決め用シンボル54の2つの辺54a,54b側に隣接する位置に、サイズコード60,62,70,72,80,82を配置し、位置決め用シンボル54が検出されれば、位置決め用シンボル54の形状と位置とに基づいて直ちに、サイズコード60〜82を検出して、そのサイズコード60〜82の位置と内容とによりデータセルの存在する方向とその範囲を決定している。
【0073】
このため、位置決め用シンボル54は1つでも、データセルが位置決め用シンボル54に対してどのような位置にどのような範囲で存在するのかが直ちに判明し、2次元コード52の情報を、無駄な読み取りをしたり読みこぼしをしたりすることなく正確に読み取ることができる。
【0074】
したがって、小さなサイズの2次元コード52が必要とされる用途でも、2次元コード52に3つの位置決め用シンボル54を用いなくても良いので、3つの位置決め用シンボル54を存在させるために生じる2次元コード52の小型化の限界を、十分に小さいものとでき、IC等の小さい2次元コード52を必要とする用途にも広く使用できるようになる。
また、サイズコード60〜82は、例えば、2次元コード52の情報を表しているデータセルと同じ様式のセルの分布パターンで表されるので、2次元コード読取装置2もソフト的に容易に、2次元コード52のサイズ(ここではデータセルの方向と範囲)を決定することが可能となる。したがって、位置決め用シンボル54,76,86のように、変化点検出回路18、比検出回路20およびアドレス記憶メモリ22と言ったハードを特別に備えなくても、従来の2次元コード読取装置でも、プログラムを変更するのみで対処できる。
【0075】
更に、サイズコード60〜82は、2次元コード52のサイズを、最初に位置や形状が検出される位置決め用シンボル54のサイズに対する比率で表しているので、位置決め用シンボル54が最初にその位置や大きさが決定された後、この位置決め用シンボル54の大きさを基準として、比率で2次元コード52のサイズを検出すれば、迅速・容易に2次元コード52のサイズを決定することができる。
【0076】
この比率は、本実施の形態では、分数で表していたが、例えば、2倍、3倍、4倍、……等の整数あるいは、1.7倍、2.7倍、3.3倍、……等の小数で表すものであっても良い。
また、本実施の形態ではサイズコード60〜82の種類も3種類であったが、1種類または2種類でも良く、4種類以上でも良い。
【0077】
また、本実施の形態ではサイズコード60〜82は、6セルが直線状に配列されたものであったが、マトリックス状に配列されたものでも良く、セル数も必要に応じて増減できる
【0078】
本実施の形態では、サイズコード60〜82は、位置決め用シンボル54から1セル離れた隣接位置に配置されていたので、少ない誤差でサイズコード60〜82が検出でき、2次元コードの解読処理が、より正確かつ迅速となるが、2次元コード内での配置としては、予め決定しておけば、位置決め用シンボル54から2セル以上離れた近傍位置あるいは位置決め用シンボル54とは反対側の2次元コード52の端部あるいはこの端部に近い位置でも良い。
【0079】
また、位置決め用シンボル54は、複数の異なる方向または複数の異なる位置において走査した場合に特定の周波数成分比が得られるパターンであるので、走査によりハード的にもソフト的にも迅速に位置決め用シンボルが検出できる。
また、2次元コード52が正方形をなし、サイズコード60〜82の配置そのものが、データセルの存在方向を表しているので、特に、データセルの存在方向を示すマーク等が必要ない。
【0080】
また、2次元コード52が長方形であれば、2つのサイズコード60〜82を2次元コード52の縦と横とのサイズを表すものとしても良い。
本実施の形態では、2次元コード52と位置決め用シンボル54とが正方形であり、2つのサイズコード60〜82が表す比率は同一となることから、2次元コード52に対して、いずれか一方のサイズコード60〜82の配置を省略しても良い。ただし、この場合でも、配置が省略されたサイズコード60〜82が示すべきデータセルの存在方向を、存在するサイズコード60〜82に対していずれの方向であるかを、予め決定しておく必要がある。
【0081】
本実施の形態において、CCD4、2値化回路6、クロック信号出力回路14、タイミングにアドレス発生回路16、変化点検出回路18および比検出回路20が行う処理と制御回路28が行うステップS100,S121とが2次元コード位置決め処理に該当し、ステップS123,S125がサイズ取得処理に該当し、ステップS140がデコード処理に該当する。
【0082】
[その他]
前記実施の形態では、位置決め用シンボル54,76,86を二重の正方形で、中心を横切る周波数成分比が黒:白:黒:白:黒=1:1:3:1:1の図形で表していたが、図12(a)のように円形でもよく、図12(b)のように六角形でもよく、また他の正多角形でも良い。即ち、同心状に相似形の図形が重なり合う形に形成したものであればよい。さらに、中心を横切る周波数成分比があらゆる角度で同じならば、図12(c)に示すごとく、図形を何重にしても良い。更に、位置決め用シンボル54,76,86は、上述のような周波数成分比で表されるものでなくても、ハード的あるいはソフト的に検出し易く、区別し易い形状であれば、他の形状でも良い。
【0083】
位置決め用シンボルの配置数や間隔は、シンボルの検出し易さや歪みの反映の程度、必要なデータ量の確保の点から適宜決定する。
また、前記実施の形態では位置決め用シンボル54,76,86は、2次元コード52,74,84の4つの頂点の内、1つに配置されていたが、2次元コード52,74,84内での配置は任意である。また必要なら1つの2次元コード52,74,84に2つの位置決め用シンボルを設けても良い。例えば、図13に示すごとく、2次元コード92の隣接する頂点に、2つの位置決め用シンボル93,94を配置し、データ領域96に、サイズコード97,98を設けても良い。サイズコード97,98は、位置決め用シンボル93,94に対して、それぞれ位置決め用シンボル93,94が存在しない隣接する2次元コード92の頂点側に配置されているので、この方向における2次元コード92のサイズを決定している。そして、そのサイズコード97,98の種類から図の縦方向のサイズは21セルであることが判る。なお、図の横方向のサイズは、位置決め用シンボル93,94の配置により決定されているので、サイズコードの配置は不要である。
【図面の簡単な説明】
【図1】 実施の形態における2次元コード読取装置の概略構成を表すブロック図である。
【図2】 実施の形態における2次元コードの一例の概略構成説明図である。
【図3】 実施の形態における2次元コードの一例の詳細構成説明図である。
【図4】 実施の形態における位置決め用シンボルを走査した場合の明暗検出の説明図である。
【図5】 実施の形態におけるCCDと2値化回路との出力信号の説明図である。
【図6】 実施の形態におけるサイズコードの種類の説明図である。
【図7】 実施の形態における2次元コードの小さい例の概略構成説明図である。
【図8】 実施の形態における2次元コードの大きい例の概略構成説明図である。
【図9】 実施の形態における2次元コード読取処理のフローチャートである。
【図10】 実施の形態における処理手順説明図である。
【図11】 実施の形態における処理手順説明図である。
【図12】 位置決め用シンボルの他の形状の例を示す説明図である。
【図13】 他の2次元コードの一例の概略構成説明図である。
【図14】 従来のバーコードおよび2次元コードの説明図である。
【図15】 従来の2次元コードの概略構成説明図である。
【図16】 従来の2次元コードの詳細構成説明図である。
【符号の説明】
2…2次元コード読取装置 4…CCD 6…2値化回路
8…画像メモリ 14…クロック信号出力回路
16…アドレス発生回路 18…変化点検出回路 20…比検出回路
22…アドレス記憶メモリ 28…制御回路
52,74,84,92…2次元コード
54,76,86,93,94…位置決め用シンボル
56,78,88,96…データ領域
60,62,70,72,80,82,97,98…サイズコード[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a two-dimensional code and a two-dimensional code reading method.
[0002]
[Prior art]
Conventionally, as an example of a proposed two-dimensional code, there is one disclosed in Japanese Patent Laid-Open No. 7-254037, and as an example of this two-dimensional code reader, there is one disclosed in Japanese Patent Laid-Open No. 8-180125.
[0003]
The two-dimensional code has a two-dimensional spread of information as shown in FIG. 14B, and can record a much larger amount of information than the barcode shown in FIG. 14A, but the structure is complicated. Therefore, it is important to quickly determine the entire shape of the two-dimensional code.
[0004]
Therefore, in the conventional two-dimensional code, as shown in FIG. 15, three positioning symbols 310 a, 310 b, and 310 c combined with squares having a specific size ratio are respectively set to three vertices among the four vertices of the two-dimensional code 300. Arranged.
The positioning symbols 310a, 310b, and 310c include, for example, a black frame-shaped square 312 whose length of one side corresponds to 7 cells, a white frame-shaped square 314 whose length of one side corresponds to 5 cells, and a length of one side. A figure formed by concentrically overlapping black squares 316 corresponding to three cells is employed.
[0005]
When the vicinity of the center of the positioning symbols 310a, 310b, 310c is linearly crossed, black, white, black, date, and black patterns are detected at a ratio of 1: 1: 3: 1: 1. Since the detection of such a ratio can be detected relatively easily in terms of hardware and software, when black and white are alternately detected at the above ratio, the pattern is determined to be the dominant of the positioning symbols 310a, 310b, 310c. It is possible to quickly determine that it is a candidate, and it is possible to quickly determine its position and shape.
[0006]
If the positions and shapes of the three positioning symbols 310a, 310b, and 310c can be quickly determined in this way, each vertex of the two-dimensional code 300 is determined, and the contents of the data cell 330 constituting the two-dimensional code 300 are determined. Can be read quickly and accurately. (In FIG. 15, the black and white pattern of the data cell 330 is omitted.)
Therefore, the presence of these three positioning symbols 310a, 310b, and 310c is important for quickly and accurately determining the location of the two-dimensional code 300.
[0007]
[Problems to be solved by the invention]
Thus, in order to decode a two-dimensional code recording a large amount of data in a short time, conventionally it was necessary to have three positioning symbols, but the amount of information recorded in the two-dimensional code is compared. However, the conventional two-dimensional code cannot always be said to have a suitable configuration.
[0008]
For example, in the above-described two-dimensional code 300, when the amount of information decreases, the ratio of the area of the positioning symbols 310a, 310b, and 310c to the total area of the two-dimensional code 300 increases. In an extreme case, as shown in FIG. The three positioning symbols 410a, 410b, and 410c occupy most of the entire area of the two-dimensional code 400, and there is a problem that the two-dimensional code is hardly reduced even if the amount of information is reduced. Therefore, although the amount of information is small, a large area is required in a portion other than the information, so that it is not possible to meet the demand for space saving by reducing the two-dimensional code according to the application. For example, although there is a demand for printing a small two-dimensional code by reducing the amount of information in a small space such as a resin surface of an IC, there is one aspect that it cannot be met.
[0009]
In order to solve such a problem, it is conceivable to reduce the number of positioning symbols. For example, in Japanese Patent Application Laid-Open No. 2-56091, only one positioning symbol is arranged on the assumption that a certain range is the size of the two-dimensional code from one positioning symbol placed in the center of the two-dimensional code. Absent.
[0010]
However, since the two-dimensional code described in Japanese Patent Laid-Open No. 2-56091 has one positioning symbol, the overall size must be constant in advance, and even when the amount of information is further reduced That constant size is required. Therefore, the demand for further reducing the space by reducing the two-dimensional code depending on the application cannot be met.
[0011]
Further, even when reading processing is performed, a predetermined range must be read, so that even if the amount of data is small, it cannot be said that reading processing can be performed quickly.
On the contrary, even if only the two-dimensional code is enlarged to increase the amount of information, the reading process only reads a predetermined range, so reading is necessary to deal with the enlarged two-dimensional code. There is a problem in that the hardware and software configuration of the reading apparatus that performs processing must be changed, and it cannot be quickly dealt with depending on the application.
[0012]
An object of the present invention is to provide a two-dimensional code whose size can be easily changed according to the application and a reading method thereof.
[0013]
[Means for Solving the Problems and Effects of the Invention]
  The two-dimensional code of the present invention provides a 1: 1: 3: 1: 1 frequency component ratio when scanned in a plurality of different directions or in a plurality of different positions.Square shapePattern,squareIn addition to the positioning symbol that specifies the position of the two-dimensional code of the shape, a predetermined position relative to the positioning symbolAnd each of the four sides of the positioning symbol at a position along two sides on the side where the data cell exists.Arranged and represents the size of the two-dimensional code with the cell distribution patternTwoA size code is provided. The size code is arranged by selecting a distribution pattern indicating the size of the two-dimensional code from a plurality of size codes having different distribution patterns for a predetermined number of cells.
[0014]
For this reason, even if there is only one positioning symbol, the size of the two-dimensional code can be determined from the size code information, so that the reading device can specify the size to be read. In this way, the reading device side only reads the size of the two-dimensional code from the size code information, and thereafter, even if the size of the two-dimensional code is changed, the hardware or software can be changed. The two-dimensional code can be read accurately without any unnecessary reading or reading spillage.
[0015]
Since the size code is not a pattern that is detected first like a positioning symbol, it only needs to represent the size, so it occupies a relatively small area and is almost a hindrance even when the two-dimensional code is reduced. It will not be.
Further, the above description means that the size of the two-dimensional code can be freely changed only by changing the contents of the size code, and the size of the two-dimensional code can be quickly dealt with according to the application.
[0016]
Further, since the size of the two-dimensional code is read from the contents of the size code, not from the positioning state of the positioning symbols, there is no need for three positioning symbols, and two or one is required. However, the size of the two-dimensional code can be easily detected. For this reason, the number of positioning symbols can be reduced, and even in applications where a small-sized two-dimensional code is required, the two-dimensional code is mostly occupied by three positioning symbols and cannot be reduced. By solving this problem, the two-dimensional code can be made sufficiently small. Therefore, it can be widely used for applications that require a small two-dimensional code such as an IC.
[0017]
  furtherThe size code is2It can be expressed by the cell distribution pattern in the same format as the data cell that represents the dimension code information.ForThe reading device can also easily read the size of the two-dimensional code in terms of software. Therefore, even a conventional two-dimensional code reader can cope with the problem only by changing the program.
[0018]
  The size of the two-dimensional code represented by the size code isSquareIt may be expressed as a ratio to the size of the positioning symbol. Since the position and shape of the positioning symbol are determined first, the size of the two-dimensional code can be quickly and easily detected by detecting the size of the two-dimensional code by the ratio based on the shape of the positioning symbol. Can be determined. For example, it is 2 times, 3 times, 4 times,..., Etc. of the positioning symbol, and not only an integer number but also 1.7 times, 2.7 times, 3.3 times, 15/7 times, 23 / It may mean a fractional or fractional multiple such as 7 times,.
[0019]
ExampleFor example, the size code cell distribution pattern is associated with the ratio, and the reader determines the size of the two-dimensional code by obtaining the ratio from the read size code cell distribution pattern based on the correspondence table. Read the contents of the data cell from the size.
[0020]
NaFor example, the arrangement of the size code in the two-dimensional code is adjacent to the positioning symbol.ArrangePlaced. Thus, the positioning symbolInadjacentExistThus, the positioning error of the size code is smaller than that at a distant position. Therefore, since the size code is accurately detected based on the position of the positioning symbol, the two-dimensional code decoding process becomes more accurate and rapid.
[0022]
AlsoFor example, one positioning symbol may be arranged at any one of the four vertices of the two-dimensional code, and the size code may represent the vertical and horizontal sizes of the two-dimensional code.
  For example, if the rectangle is a square, the vertical and horizontal sizes are the same, so the size code may represent one size.
[0023]
Two size codes are arranged on each of the four sides of the positioning symbol on the side where the data cell exists, and each size code is a two-dimensional code on each side of the arranged positioning symbol. It is good also as a structure showing a size. With this configuration, if the position of the size code is detected, the direction in which the data cell exists and the range thereof can be determined at the same time, so that processing can be performed efficiently.
[0024]
In this case, if the two-dimensional code is a square, the sizes represented by the two size codes are the same. Therefore, it is not necessary to omit one of the size codes. However, even in this case, it is necessary to determine in advance which direction the existence direction of the data cell to be indicated by the omitted size code is with respect to the size code that is not omitted.
[0025]
When two size codes representing the same size are provided, the error processing is executed by comparing whether or not the two are the same at the time of the reading process, and assuming that it is a reading error if they are not the same. Also good.
Examples of the method for reading the above-described two-dimensional code include the following methods.
[0026]
  First, a two-dimensional code image is obtained by scanning a two-dimensional code or the like, and performing a two-dimensional code positioning process for detecting a positioning symbol in the image. Next, based on the detected positioning symbolTDetect the Izu code and thisBy detecting the distribution pattern of the cells forming the size code and decoding this distribution pattern,A size acquisition process for acquiring the size of the two-dimensional code represented by the size code is performed. Next, based on the acquired size of the two-dimensional code, a decoding process for reading the information of the two-dimensional code is performed.
[0027]
Thus, in the size acquisition process, the size of the two-dimensional code represented by the size code is acquired, and based on the size of the two-dimensional code, the information of the two-dimensional code is read in the decoding process. Therefore, even if the size of the two-dimensional code from which information is to be read changes for each two-dimensional code, it can be immediately handled by the size code included in each two-dimensional code, and the information of the two-dimensional code can be read wastefully. It can be read accurately without reading or spilling.
[0028]
More specifically, it can be configured as follows. That is, in the two-dimensional code positioning process, a two-dimensional code image is obtained by scanning the two-dimensional code, and the position and shape of the positioning symbol in the image are detected. The size acquisition processing detects the position of the size code (predetermined position with respect to the positioning symbol) based on the detected position and shape of the positioning symbol, and detects the distribution pattern of the cells forming the size code from this position. Then, by decoding this distribution pattern, the size of the two-dimensional code represented by the size code is acquired. The decoding process detects the position of the data cell representing the information of the two-dimensional code based on the acquired size of the two-dimensional code and the shape of the positioning symbol, and reads the information of the two-dimensional code from this position.
[0029]
The two-dimensional code is arranged on each of the two sides where the data cell exists among the four sides of the positioning symbol, and each size code is on each side of the arranged positioning symbol. The following two-dimensional code reading method may be employed if the data cell size is represented.
[0030]
That is, a two-dimensional code image is obtained by scanning the two-dimensional code, and a two-dimensional code positioning process for detecting the position and shape of the positioning symbol in the image is performed. Next, the detected positioning is performed. The presence of two size codes is detected by inspecting the predetermined positions on the four sides of the positioning symbol based on the position and shape of the symbol for use, and the size of the two-dimensional code represented by this size code is determined. Perform the size acquisition process to be acquired, and then, for each of the two sides of the positioning symbol for which the size code is detected, based on the size of the two-dimensional code acquired from the size code and the shape of the positioning symbol, The position of the data cell is detected, and a decoding process for reading the information of the two-dimensional code from the data cell is performed.
[0031]
Note that the function of executing such a two-dimensional code reading method is provided as a program that is activated on the computer system side, for example. In the case of such a program, for example, it is stored in a machine-readable storage medium such as a floppy disk, a magneto-optical disk, a CD-ROM, or a hard disk, and is used by being loaded into a computer system and started up as necessary. it can. In addition, the ROM or backup RAM may be stored as a machine-readable storage medium, and the ROM or backup RAM may be incorporated into a computer system.
[0032]
DETAILED DESCRIPTION OF THE INVENTION
The block diagram of FIG. 1 shows a schematic configuration of a two-dimensional code reader 2 to which the above-described invention is applied.
The two-dimensional code reader 2 includes a CCD 4, a binarization circuit 6, an image memory 8, a clock signal output circuit 14, an address generation circuit 16, a change point detection circuit 18, a ratio detection circuit 20, an address storage memory 22, and a control circuit 28. It is composed of
[0033]
The control circuit 28 is configured as a computer system including a CPU, a ROM, a RAM, an I / O, and the like, and executes a two-dimensional code reading process, which will be described later, according to a program stored in the ROM. 2 is controlled.
[0034]
Here, FIG. 2 shows a schematic diagram of an example of a two-dimensional code to which the above-described invention detected by the two-dimensional code reader 2 is applied. The two-dimensional code 52 is printed on a white mount 53, and is composed of one positioning symbol 54, a data area 56, and two size codes 60 and 62. The overall size is a square shape of 15 cells × 15 cells. Each cell is selected from two types of optically different cells. In the drawings and description, the cells are distinguished by white (bright) and black (dark). In FIG. 2, the black and white pattern of the data cells in the data area 56 is omitted for convenience. The actual two-dimensional code 52 is as shown in FIG. 3 as an example.
[0035]
The positioning symbol 54 is arranged at one of the four vertices of the two-dimensional code 52. As shown in FIG. 4 (A), the light and dark arrangement of the positioning symbol 54 cell is a reduced frame-shaped square made of white having a width of 1 cell at the center of the frame-shaped square 55a made of black having a width of 1 cell. 55b is formed, and a square 55c having a size of 3 cells × 3 cells made of black is formed in a central portion inside thereof.
[0036]
The size codes 60 and 62 are adjacent positions separated by one cell from the positioning symbol 54 in the data area 56, and two sides 54a and 54b of the positioning symbol 54 on the side where the data area 56 exists. Are arranged along. Each of the size codes 60 and 62 has a configuration in which six cells are arranged in series. The size codes 60 and 62 are arranged such that black cells and white cells are alternately arranged from the left side when viewed from the data area 56. The size codes 60 and 62 represent the size information of the two-dimensional code 52 by the cell distribution pattern of this array.
[0037]
As the cell distribution pattern that can be set as the size code, 2 6 = 64 types can be provided. Here, it is assumed that only three types of size codes are determined. In particular, three types of patterns shown in FIGS. 6A, 6B, and 6C are used so that the distribution of black cells and white cells is not biased. Among these, FIG. 6A corresponds to the size codes 60 and 62 used in FIG. 2, and represents 15/7 as size information. This size information represents the ratio (here, magnification) of the two-dimensional code 52 to the size of the positioning symbol 54. That is, the positioning symbol 54 in FIG. 2 is a square, and the length of one side is 7 cells. Therefore, it can be seen from the size codes 60 and 62 that the length of one side of the two-dimensional code 52 is 7 cells × 15/7 = 15 cells.
[0038]
In addition, since the size codes 70 and 72 in FIG. 6B represent the ratio 11/7, as shown in FIG. 7, 2 is 11/7 (11 cells) with respect to the size of the positioning symbol 76. Used for the dimension code 74.
In addition, since the size codes 80 and 82 in FIG. 6C represent the ratio 21/7, as shown in FIG. 8, the size of the positioning symbol 86 is 21/7 (21 cells). Used for the dimension code 84.
[0039]
Here, on the assumption that the two-dimensional code 52 and the positioning symbol 54 are square, the two size codes 60 and 62 are exactly the same. However, if the two-dimensional code 52 or the positioning symbol 54 includes a non-square rectangle or a rectangular shape such as a parallelogram in some cases, for example, the size code 60 on the side 54a side is a positioning symbol. 54 represents the ratio of the size in the x direction of the two-dimensional code 52 to the size in the x direction of 54, and the size code 62 on the side 54b side of the two-dimensional code 52 with respect to the size in the y direction of the positioning symbol 54 It is assumed that the size ratio in the y direction is expressed.
[0040]
The control circuit 28 performs two-dimensional code reading control as described below.
First, in accordance with an instruction from the control circuit 28, a two-dimensional image of a place where the two-dimensional code 52 passes is detected by the CCD 4 as a two-dimensional image detection means. When detecting a two-dimensional image, the CCD 4 outputs two-dimensional image data with a signal having an analog level as shown in FIG. The two-dimensional image data is binarized by the binarizing circuit 6 at the threshold value instructed from the control circuit 28, and two levels of 1 (high) / 0 (low) as shown in FIG. Convert to a signal consisting of
[0041]
On the other hand, the clock signal output circuit 14 outputs a clock pulse sufficiently finer than the pulse of the two-dimensional image data output from the CCD 4 according to the synchronization pulse output from the CCD 4. The address generation circuit 16 counts the clock pulses and generates an address for the image memory 8. The binarized two-dimensional image data is written in units of 8 bits for each address.
[0042]
On the other hand, the change point detection circuit 18 outputs a pulse signal to the ratio detection circuit 20 when the signal from the binarization circuit 6 changes from “1” to “0” or from “0” to “1”. To do. The ratio detection circuit 20 counts the clock pulses output from the clock signal output circuit 14 from the input of the pulse signal from the change point detection circuit 18 to the input of the next pulse signal, thereby increasing the brightness ( Determine the continuous length of 1) and the continuous length of dark (0). From this length ratio, a pattern corresponding to the positioning symbol 54 of the two-dimensional code 52 is detected.
[0043]
As shown in FIG. 4A, the light-dark pattern on the scanning lines (a), (b), and (c) of the CCD 4 that crosses substantially the center of the positioning symbol 54 at a representative angle is shown in FIG. As shown in Fig. 4, all have the same light / dark component ratio. That is, the light / dark component ratio of each scanning line (a), (b), (c) crossing the center of the positioning symbol 54 is dark: bright: dark: bright: dark = 1: 1: 3: 1: 1. It has become. Of course, the ratio is 1: 1: 3: 1: 1 even in the scanning line having an intermediate angle between the scanning lines (a), (b), and (c). 4A is arranged on an oblique surface when viewed from the CCD 4 side, the light / dark component ratio of the scanning lines (a), (b), and (c) is dark: bright: Dark: light: dark = 1: 1: 3: 1: 1. FIG. 4B corresponds to the binarized signal from the binarization circuit 6.
[0044]
As a result, the ratio detection circuit 20 detects the light / dark component ratio of “1: 1: 3: 1: 1”, and if detected, the image memory generated by the address generation circuit 16 at that timing. 8 addresses are stored in the address storage memory 22.
Therefore, when the CCD 4 detects two-dimensional image data for one frame, the image memory 8 stores the binarized two-dimensional image data, and the address storage memory 22 stores the detected positioning symbols. 54 addresses are stored.
[0045]
When an image for one frame of the first two-dimensional image is obtained, the control circuit 28 performs a two-dimensional code reading process, which will be described later, based on the data in the image memory 8 and the address storage memory 22, and this process ends. Then, the control circuit 28 instructs the CCD 4 to detect the next one-frame two-dimensional image. Therefore, a two-dimensional image is output from the CCD 4 to the binarization circuit 6 again, and the processing as described above is repeated.
[0046]
Next, after the image of the two-dimensional code 52 for one frame and the address of the positioning symbol 54 are stored in the image memory 8 and the address storage memory 22 respectively, the control circuit 28 performs the two-dimensional code reading process. Execute. This two-dimensional code reading process is shown in the flowchart of FIG.
[0047]
When the processing is started, first, the positioning symbol 54 is detected (S100).
In this processing, the image memory 8 and the address storage memory 22 are accessed, and whether or not the positioning symbol 54 exists at an appropriate position from the stored contents and the positioning symbol 54 is accurately displayed on the image. The correct shape and center position are determined.
[0048]
In this process, first, it is determined with reference to the address value and the image in the image memory 8 whether the address of the positioning symbol 54 stored in the address storage memory 22 is positionally divided into one group. .
Next, in step S100, it is determined whether or not only one appropriate positioning symbol 54 has been detected (S110). If not detected (“NO” in S110), the next image is detected by the CCD 4. Instructed (S180), the process is terminated.
[0049]
When one appropriate positioning symbol 54 is detected (“YES” in S110), it is next determined whether or not it is a new two-dimensional code 52 (S120). This process is to prevent the two-dimensional code 52 detected before the previous time from being decoded as another two-dimensional code when it is still being detected by the CCD 4. For example, if an appropriate positioning symbol 54 has been detected in the previous process or a predetermined number of times before, and the code content has already been read appropriately, the same two-dimensional code 52 is detected. As a result ("NO" in S120), the CCD 4 is instructed to detect the next image (S180), and the process is terminated.
[0050]
If it is determined that the code is the new two-dimensional code 52 (“YES” in S120), then the shape and center of each cell constituting the positioning symbol 54 from the 1 (white) / 0 (black) pattern in the image memory 8 The position is calculated (S121).
This will be specifically described. Assume that an image of the two-dimensional code 52 is obtained as shown in part in FIG. Among the images of the positioning symbols 54, the addresses stored in the address storage memory 22 have the light / dark component ratios detected as dark: bright: dark: bright: dark = 1: 1: 3: 1: 1. This corresponds to the image of the portion Ls (here, 9 corresponds). Therefore, based on the address, the portion corresponding to the square 55c of black of the size of 3 cells × 3 cells inside the positioning symbol 54 in the light / dark component ratio, that is, the dark component ratio is “3”. It is possible to specify the position on the image of the portion (image portions Ls0 to Ls8 represented by a dashed line in the square 55c).
[0051]
Then, the image portion Ls0 at the head address and the image portion Ls8 at the tail address are selected, and the addresses of the end points A01 and A02 of the head image portion Ls0 and the end points of the tail image portion Ls8 are selected. The addresses A11 and A12 are obtained. Then, the address is converted into an image coordinate system (here, as shown, an xy coordinate system having the upper left as the origin).
[0052]
The coordinates of the center point Ac0 of the end points A01 and A02 and the center point Ac1 of the end points A11 and A12 are obtained. Next, the center coordinates of both center points Ac0 and Ac1 are obtained and set as the center coordinates Sc (Xa, Ya) of the image of the positioning symbol 54.
Next, out of the four end points A01, A02, A11, and A12 described above, end points A02 and A11 that are close to the vertex of the black square 55c are extracted. That is, in each of the image portions Ls0 and Ls8, it is determined by determining which end point is close to the vertex of the black square 55c.
[0053]
For example, in the area E0 adjacent on the side where the address is smaller than the head image portion Ls0, the address recognized as black is biased toward the end point A01 far from the apex of the square 55c, as indicated by the alternate long and short dash line. Further, in the area E1 adjacent on the side where the address is larger than the last image portion Ls8, as indicated by the alternate long and short dash line, the address recognized as black is biased toward the end A12 far from the apex of the square 55c.
[0054]
Therefore, by determining the black arrangement bias at the addresses corresponding to the areas E0 and E1 adjacent to the outside of the scanning line portion Ls, the end points A02 and A11 on which black is not biased are determined as the vertices of the square 55c. Can be extracted as an end point close to. It should be noted that the two end points A02 and A11 are the end points described above for either one of the two end points A02 and A11 without being individually determined as the end points close to the apex of the square 55c in the above-described processing. If it can be determined that it is close to the apex of the square 55c in the process of (2), since the end point that is diagonally opposite to the determined end point is close to the apex of the square 55c, the end point that exists diagonally is determined. You can just extract it.
[0055]
Next, the straight line connecting the two end points A02 and A11 is multiplied by 1.5 and the end extended to the end point A02 side is set as the temporary center position f ′ of the apex cell of the black frame-like square 55a. On the contrary, the end extended to the end point A11 side is set as a temporary center position g ′ of the apex cell of the black frame-like square 55a.
[0056]
Next, the peripheral images of the temporary center positions f ′ and g ′ are examined closely, and the accurate vertex cell center positions f and g are determined from the characteristics of the shape of the black edge of the vertex of the frame-like square 55a. Ask.
Next, the center positions h and i of the remaining two vertex cells of the frame-like square 55a are the ends of straight lines of the same length perpendicular to the straight line connecting the center positions f and g and at the center Sc. Therefore, the coordinates h (Xh, Yh), i (Xi, Yi) of the center positions h, i are changed to the coordinates f (Xf, Yf), g (Xg, Yg) and the center of the center positions f, g. It is obtained by calculation based on the coordinates Sc (Xa, Ya).
[0057]
As shown in FIG. 11, one vertex cell center position h (Xh, Yh) is an intersection point Sh, a center position h, and a center Sc of a perpendicular line from the center position h with respect to a horizontal line Lv passing through the center Sc of the positioning symbol 54. Based on the relationship between the triangle having the vertices and the intersection Sf of the perpendicular line from the center position f to the horizontal line Lv and the triangle having the vertices of the center position f and the center Sc have the same shape, It is obtained by solving simultaneous equations.
[0058]
[Expression 1]
Figure 0003726395
[0059]
The other vertex cell center position i (Xi, Yi) can also be obtained by solving the following simultaneous equations from the same relationship.
[0060]
[Expression 2]
Figure 0003726395
[0061]
Each of the peripheral images of the center positions h and i of the two vertex cells thus obtained is scrutinized, and an accurate center coordinate of the vertex cell is obtained from the shape of the edge of the vertex of the frame-like square 55a. Formally, the coordinates of the center positions h and i are used.
Then, by dividing the center positions h, f, i, and g of adjacent vertex cells into six equal parts, the center position of the cells constituting the black frame-like square 55a and the size of one cell are determined.
[0062]
Thus, the shape of the positioning symbol 54 and the center position Sc are determined.
Next, the size code 60, 62 is detected based on the positioning symbol 54 (S123).
First, as shown in FIG. 11, end points F and G obtained by extending a straight line connecting the center positions f and g of the vertex cells on the diagonal to each vertex side by 1/3 of the length of the straight line are obtained. Similarly, end points H and I obtained by extending a straight line connecting the center positions h and i of the vertex cells on the diagonal to each vertex side by 1/3 of the length of the straight line are obtained.
[0063]
Among the end points F, G, H, and I, the cell contents are read by tracing between the adjacent end points H and F in a straight line. That is, the process of reading the cell contents along the side 54d is performed at a position 1.5 cells away from the side 54d of the positioning symbol 54. Similarly, between the adjacent end points F and I along the side 54a, between the adjacent end points I and G along the side 54b, and between the adjacent end points G and H along the side 54c, respectively. Processing to read the contents of the cell is performed.
[0064]
As shown in FIG. 2, the size codes 60 and 62 are arranged one cell apart along two adjacent sides 54 a and 54 b of the positioning symbol 54. That is, the position separated by 1.5 cells from the two sides 54a and 54b passes through the center position of the cells of the size codes 60 and 62.
[0065]
Accordingly, any of the size codes shown in FIG. 6 is detected by the two reading processes by the four reading processes between the end points F, G, H, and I.
Next, it is determined whether or not two identical size codes are detected (S124). If only one code is detected, three or more are detected, no size code is detected, or no size code is detected. If both contents are different ("NO" in S124), the process proceeds to step S180 as an error.
[0066]
If only two identical size codes are detected (“YES” in S124), then the shape of the two-dimensional code 52 is determined (S125).
That is, based on the position and contents of the size codes 60 and 62 read in step S123, on which side the data cell exists with respect to the positioning symbol 54, and to what size it is expanded To decide.
[0067]
That is, it is determined that a data cell exists in the direction of the side where the size codes 60 and 62 are detected among the sides 54a to 54d of the positioning symbol 54. Then, the ratio is determined from the types of the obtained size codes 60 and 62, and it is determined how many times the two-dimensional code 52 is the size of the positioning symbol 54. Here, since the size codes 60 and 62 having the ratio of 15/7 are obtained, the two-dimensional code 52 is determined to be the size 15 cells × 15 cells shown in FIG.
[0068]
Next, the position of each data cell is determined, and the monochrome type of the data cell is determined (S140). That is, the size of one cell of the positioning symbol 54 determined in step S121 and the size of the positioning symbol 54 from the position of the positioning symbol 54 to the sides 54a and 54b, respectively, including the size of the positioning symbol 54. The center position of each data cell in the range is calculated and obtained, and the black or white type of each data cell is read and decoded from the center position, and information represented by the two-dimensional code 52 is obtained.
[0069]
Next, it is determined whether or not the code content is normal (S160). For example, whether or not the number of cells of white and black is a predetermined number, or the result of calculating the data represented by a predetermined calculation method is a predetermined position of the two-dimensional code 52 It is determined whether or not the code is normally read by checking whether or not it matches the displayed data.
[0070]
If the code is not normal (“NO” in S160), the CCD 4 is instructed to detect the next image (S180), and the process is terminated.
If the code is normal (“YES” in S160), the code content is output to another device such as a host computer, the code content is stored in a specific memory, or a process corresponding to the code content is performed. A process of executing or outputting an instruction corresponding to the code content is performed (S170).
[0071]
Then, in order to read the next new two-dimensional code, the CCD 4 is instructed to detect an image (S180), and the process is terminated.
Note that the 11-cell × 11-cell two-dimensional code 74 (FIG. 7) whose size is represented by other size codes 70 and 72 and the 21-cell × 21-cell whose size is represented by size codes 80 and 82. With respect to the two-dimensional code 84 (FIG. 8), the contents of the data areas 78 and 88 can be accurately read by the same processing without wasteful reading or spilling. Each positioning symbol 76, 86 is the same as the positioning symbol 54 of the two-dimensional code 52 in FIG.
[0072]
In the present embodiment, as described above, the size codes 60, 62, 70, 72, 80, 82 are arranged at positions adjacent to the two sides 54a, 54b of the positioning symbol 54, and the positioning symbol 54 is If detected, the size code 60-82 is immediately detected based on the shape and position of the positioning symbol 54, and the direction and range in which the data cell exists according to the position and content of the size code 60-82. Is determined.
[0073]
For this reason, even if there is only one positioning symbol 54, it is immediately determined in what position and in what range the data cell is located with respect to the positioning symbol 54, and the information of the two-dimensional code 52 is wasted. It can be read accurately without reading or spilling.
[0074]
Therefore, even in applications where a small size of the two-dimensional code 52 is required, the three positioning symbols 54 need not be used in the two-dimensional code 52. The limit of miniaturization of the code 52 can be made sufficiently small, and it can be widely used in applications that require a small two-dimensional code 52 such as an IC.
In addition, since the size codes 60 to 82 are represented by, for example, a cell distribution pattern in the same format as the data cell representing the information of the two-dimensional code 52, the two-dimensional code reader 2 can be easily softwareized. It is possible to determine the size of the two-dimensional code 52 (here, the direction and range of the data cell). Therefore, even if the conventional two-dimensional code reader is not provided with hardware such as the change point detection circuit 18, the ratio detection circuit 20, and the address storage memory 22 like the positioning symbols 54, 76, 86, It can be dealt with just changing the program.
[0075]
Furthermore, since the size codes 60 to 82 represent the size of the two-dimensional code 52 as a ratio to the size of the positioning symbol 54 from which the position or shape is first detected, the positioning symbol 54 first displays its position or After the size is determined, the size of the two-dimensional code 52 can be quickly and easily determined by detecting the size of the two-dimensional code 52 by using the size of the positioning symbol 54 as a reference.
[0076]
In the present embodiment, this ratio is represented by a fraction, but for example, an integer such as 2 times, 3 times, 4 times,..., 1.7 times, 2.7 times, 3.3 times, It may be expressed in decimals such as.
In this embodiment, there are three types of size codes 60 to 82, but one or two types may be used, and four or more types may be used.
[0077]
  In the present embodiment, the size codes 60 to 82 are such that 6 cells are arranged in a straight line, but may be arranged in a matrix, and the number of cells can be increased or decreased as necessary..
[0078]
In the present embodiment, since the size codes 60 to 82 are arranged at adjacent positions one cell away from the positioning symbol 54, the size codes 60 to 82 can be detected with a small error, and the decoding process of the two-dimensional code can be performed. However, if it is determined in advance as the arrangement in the two-dimensional code, the two-dimensional code is located in the vicinity of two or more cells away from the positioning symbol 54 or on the side opposite to the positioning symbol 54. The end of the cord 52 or a position close to this end may be used.
[0079]
Further, since the positioning symbol 54 is a pattern in which a specific frequency component ratio is obtained when scanning is performed in a plurality of different directions or a plurality of different positions, the positioning symbol 54 can be quickly positioned both in terms of hardware and software by scanning. Can be detected.
In addition, since the two-dimensional code 52 is square and the arrangement of the size codes 60 to 82 indicates the direction in which the data cell exists, there is no need for a mark or the like indicating the direction in which the data cell exists.
[0080]
If the two-dimensional code 52 is a rectangle, the two size codes 60 to 82 may represent the vertical and horizontal sizes of the two-dimensional code 52.
In the present embodiment, the two-dimensional code 52 and the positioning symbol 54 are square, and the ratios represented by the two size codes 60 to 82 are the same. The arrangement of the size codes 60 to 82 may be omitted. However, even in this case, it is necessary to determine in advance which direction the existence direction of the data cell to be indicated by the size codes 60 to 82 whose arrangement is omitted is with respect to the existing size codes 60 to 82. There is.
[0081]
In this embodiment, the CCD 4, the binarization circuit 6, the clock signal output circuit 14, the processing performed by the address generation circuit 16, the change point detection circuit 18 and the ratio detection circuit 20 at the timing, and the steps S100 and S121 performed by the control circuit 28. Corresponds to the two-dimensional code positioning process, steps S123 and S125 correspond to the size acquisition process, and step S140 corresponds to the decode process.
[0082]
[Others]
In the above embodiment, the positioning symbols 54, 76, 86 are double squares, and the frequency component ratio across the center is a graphic of black: white: black: white: black = 1: 1: 3: 1: 1. Although shown, it may be circular as shown in FIG. 12 (a), hexagonal as shown in FIG. 12 (b), or another regular polygon. In other words, any shape may be used as long as similar figures overlap in a concentric manner. Furthermore, as long as the frequency component ratio across the center is the same at all angles, as shown in FIG. Further, the positioning symbols 54, 76, and 86 are not represented by the frequency component ratio as described above, but may be other shapes as long as they are easily detected and distinguished in hardware or software. But it ’s okay.
[0083]
The number and interval of positioning symbols are determined as appropriate from the viewpoint of ease of symbol detection, the degree of reflection of distortion, and securing of a necessary amount of data.
In the above embodiment, the positioning symbols 54, 76, 86 are arranged at one of the four vertices of the two-dimensional codes 52, 74, 84, but in the two-dimensional codes 52, 74, 84. The arrangement at is arbitrary. If necessary, two positioning symbols may be provided in one two-dimensional code 52, 74, 84. For example, as shown in FIG. 13, two positioning symbols 93 and 94 may be arranged at adjacent vertices of the two-dimensional code 92, and size codes 97 and 98 may be provided in the data area 96. Since the size codes 97 and 98 are arranged on the apex side of the adjacent two-dimensional code 92 where the positioning symbols 93 and 94 do not exist with respect to the positioning symbols 93 and 94, respectively, the two-dimensional code 92 in this direction. The size is determined. From the types of the size codes 97 and 98, it can be seen that the vertical size in the figure is 21 cells. Note that the size in the horizontal direction in the figure is determined by the arrangement of the positioning symbols 93 and 94, so the arrangement of the size code is not necessary.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a schematic configuration of a two-dimensional code reading device according to an embodiment.
FIG. 2 is a schematic configuration explanatory diagram of an example of a two-dimensional code in the embodiment.
FIG. 3 is an explanatory diagram of a detailed configuration of an example of a two-dimensional code in the embodiment.
FIG. 4 is an explanatory diagram of light / dark detection when a positioning symbol is scanned in the embodiment.
FIG. 5 is an explanatory diagram of output signals from the CCD and the binarization circuit in the embodiment.
FIG. 6 is an explanatory diagram of types of size codes in the embodiment.
FIG. 7 is a schematic configuration explanatory diagram of a small example of a two-dimensional code in the embodiment.
FIG. 8 is a schematic configuration explanatory diagram of a large example of a two-dimensional code in the embodiment.
FIG. 9 is a flowchart of a two-dimensional code reading process in the embodiment.
FIG. 10 is an explanatory diagram of a processing procedure in the embodiment.
FIG. 11 is an explanatory diagram of a processing procedure in the embodiment.
FIG. 12 is an explanatory diagram illustrating an example of another shape of a positioning symbol.
FIG. 13 is an explanatory diagram of a schematic configuration of an example of another two-dimensional code.
FIG. 14 is an explanatory diagram of a conventional barcode and a two-dimensional code.
FIG. 15 is an explanatory diagram of a schematic configuration of a conventional two-dimensional code.
FIG. 16 is a diagram illustrating a detailed configuration of a conventional two-dimensional code.
[Explanation of symbols]
2 ... Two-dimensional code reader 4 ... CCD 6 ... Binary circuit
8 ... Image memory 14 ... Clock signal output circuit
16 ... Address generation circuit 18 ... Change point detection circuit 20 ... Ratio detection circuit
22 ... Address storage memory 28 ... Control circuit
52, 74, 84, 92 ... 2D code
54, 76, 86, 93, 94 ... positioning symbols
56, 78, 88, 96 ... data area
60, 62, 70, 72, 80, 82, 97, 98 ... size code

Claims (8)

セルの分布パターンにより情報を表現する正方形形状の2次元コードであって、
2次元コード内の所定位置に配置され、複数の異なる方向または複数の異なる位置において走査した場合に1:1:3:1:1の周波数成分比が得られる正方形形状のパターンであり、2次元コードの位置を特定する位置決め用シンボルと、
前記位置決め用シンボルに対する所定位置であって該位置決め用シンボルの4辺のうちデータセルが存在する側の2辺に沿った位置にそれぞれ配置されて、セルの分布パターンで2次元コードのサイズを表す2つのサイズコードと、
を備え、前記サイズコードは、所定セル数で異なる分布パターンを有する複数のサイズコードの中から前記2次元コードのサイズを示す分布パターンが選択されて配置されていることを特徴とする2次元コード。
A square- shaped two-dimensional code expressing information by a cell distribution pattern,
A square-shaped pattern which is arranged at a predetermined position in a two-dimensional code and can obtain a frequency component ratio of 1: 1: 3: 1: 1 when scanned in a plurality of different directions or in a plurality of different positions. A positioning symbol that identifies the position of the code;
It is arranged at a predetermined position with respect to the positioning symbol and along the two sides on the side where the data cell exists among the four sides of the positioning symbol, and the size of the two-dimensional code is represented by the cell distribution pattern. Two size codes,
And the size code is arranged by selecting a distribution pattern indicating the size of the two-dimensional code from a plurality of size codes having different distribution patterns for a predetermined number of cells. .
前記サイズコードは、正方形の位置決め用シンボルのサイズに対する比率で、2次元コードのサイズを表すことを特徴とする請求項1記載の2次元コード。  2. The two-dimensional code according to claim 1, wherein the size code represents a size of the two-dimensional code by a ratio to a size of a square positioning symbol. 前記サイズコードは、前記位置決め用シンボルに隣接して配置されていることを特徴とする請求項1または2記載の2次元コード。  3. The two-dimensional code according to claim 1, wherein the size code is arranged adjacent to the positioning symbol. 1つの前記位置決め用シンボルが、2次元コードの4つの頂点の内のいずれかに配置され、前記サイズコードは、2次元コードの縦および横のサイズを表していることを特徴とする請求項1〜のいずれか記載の2次元コード。The one positioning symbol is arranged at any one of four vertices of a two-dimensional code, and the size code represents a vertical and horizontal size of the two-dimensional code. The two-dimensional code according to any one of to 3 . 2つの前記サイズコードが、前記位置決め用シンボルの4辺の内、データセルが存在する側の2辺にそれぞれ配置され、各サイズコードは、配置された位置決め用シンボルの各辺側での2次元コードのサイズを表していることを特徴とする請求項記載の2次元コード。Two of the size codes are respectively arranged on two sides on the side where the data cell exists among the four sides of the positioning symbol, and each size code is two-dimensional on each side of the arranged positioning symbol. 5. The two-dimensional code according to claim 4, which represents a size of the code. 請求項1〜のいずれか記載の2次元コードの読取方法であって、
前記2次元コードの画像を得るとともに、前記画像中での前記位置決め用シンボルを検出する2次元コード位置決め処理を行い、
次に、検出された前記位置決め用シンボルに基づいて前記サイズコードを検出し、該サイズコードを形成するセルの分布パターンを検出して該分布パターンを解読することで該サイズコードが表す2次元コードのサイズを取得するサイズ取得処理を行い、
次に、取得された前記2次元コードのサイズに基づいて、2次元コードの情報を読み取るデコード処理を行うことを特徴とする2次元コードの読取方法。
A method for reading a two-dimensional code according to any one of claims 1 to 5 ,
Obtaining an image of the two-dimensional code and performing a two-dimensional code positioning process for detecting the positioning symbol in the image;
Next, the size code is detected based on the detected positioning symbol, the distribution pattern of the cells forming the size code is detected, and the distribution pattern is decoded to represent the two-dimensional code represented by the size code Perform the size acquisition process to acquire the size of
Next, a two-dimensional code reading method comprising performing a decoding process of reading information of the two-dimensional code based on the acquired size of the two-dimensional code.
前記2次元コード位置決め処理は、前記2次元コードの画像を得るとともに、前記画像中での前記位置決め用シンボルの位置と形状とを検出し、
前記サイズ取得処理は、検出された前記位置決め用シンボルの位置と形状とに基づいて前記サイズコードの位置を検出し、該位置から前記サイズコードを形成するセルの分布パターンを検出して該分布パターンを解読することで前記サイズコードが表す2次元コードのサイズを取得し、
前記デコード処理は、取得された前記2次元コードのサイズと前記位置決め用シンボルの形状とに基づいて、2次元コードの情報を表すデータセルの位置を検出し、該位置から2次元コードの情報を読み取ることを特徴とする請求項記載の2次元コードの読取方法。
The two-dimensional code positioning process obtains an image of the two-dimensional code, detects the position and shape of the positioning symbol in the image,
The size acquisition process detects the position of the size code based on the detected position and shape of the positioning symbol, detects a distribution pattern of cells forming the size code from the position, and detects the distribution pattern. To obtain the size of the two-dimensional code represented by the size code,
The decoding process detects the position of the data cell representing the information of the two-dimensional code based on the acquired size of the two-dimensional code and the shape of the positioning symbol, and obtains the information of the two-dimensional code from the position. The two-dimensional code reading method according to claim 6 , wherein the two-dimensional code is read.
請求項記載の2次元コードの読取方法であって、
前記2次元コードの画像を得るとともに、前記画像中での前記位置決め用シンボルの位置と形状とを検出する2次元コード位置決め処理を行い、
次に、検出された前記位置決め用シンボルの位置と形状とに基づいて、前記位置決め用シンボルの4つの辺側の所定位置を検査することで、2つのサイズコードの存在を検出して該サイズコードが表す2次元コードのサイズを取得するサイズ取得処理を行い、
次に、前記サイズコードが検出された前記位置決め用シンボルの2つの各辺側について、前記サイズコードから取得された前記2次元コードのサイズと前記位置決め用シンボルの形状とに基づいて、データセルの位置を検出して、該データセルから2次元コードの情報を読み取るデコード処理を行うことを特徴とする2次元コードの読取方法。
A method for reading a two-dimensional code according to claim 5 ,
Obtaining an image of the two-dimensional code and performing a two-dimensional code positioning process for detecting the position and shape of the positioning symbol in the image,
Next, based on the detected position and shape of the positioning symbol, the presence of two size codes is detected by inspecting predetermined positions on the four sides of the positioning symbol. Perform size acquisition processing to acquire the size of the two-dimensional code represented by
Next, for each of the two sides of the positioning symbol where the size code is detected, based on the size of the two-dimensional code acquired from the size code and the shape of the positioning symbol, A method for reading a two-dimensional code, comprising: performing a decoding process of detecting a position and reading information of the two-dimensional code from the data cell.
JP01647797A 1997-01-30 1997-01-30 Two-dimensional code and two-dimensional code reading method Expired - Lifetime JP3726395B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01647797A JP3726395B2 (en) 1997-01-30 1997-01-30 Two-dimensional code and two-dimensional code reading method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01647797A JP3726395B2 (en) 1997-01-30 1997-01-30 Two-dimensional code and two-dimensional code reading method

Publications (2)

Publication Number Publication Date
JPH10214317A JPH10214317A (en) 1998-08-11
JP3726395B2 true JP3726395B2 (en) 2005-12-14

Family

ID=11917368

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01647797A Expired - Lifetime JP3726395B2 (en) 1997-01-30 1997-01-30 Two-dimensional code and two-dimensional code reading method

Country Status (1)

Country Link
JP (1) JP3726395B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3361419A1 (en) 2017-02-09 2018-08-15 Aitek S.P.A. Tamper-proof barcode, system and method for generating and authenticating credentials on the basis of said code
US11900208B2 (en) 2021-04-07 2024-02-13 Ingamo, Llc Scannable code having a unique identifier

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4661580B2 (en) * 2005-12-22 2011-03-30 富士ゼロックス株式会社 Image processing apparatus and program
JP4911340B2 (en) * 2006-02-10 2012-04-04 富士ゼロックス株式会社 Two-dimensional code detection system and two-dimensional code detection program
JP4591372B2 (en) * 2006-02-14 2010-12-01 コニカミノルタビジネステクノロジーズ株式会社 Image forming apparatus and image forming method
JP4838387B2 (en) * 2008-05-29 2011-12-14 カラーコード・テクノロジーズ株式会社 Information code and information code decoding method
CN103679164A (en) 2012-09-21 2014-03-26 阿里巴巴集团控股有限公司 A method and a system for identifying and processing a mark based on a mobile terminal
JP6115750B2 (en) * 2012-10-25 2017-04-19 株式会社デンソーウェーブ Image recognition system, image recognition method, and portable terminal
CN107742146B (en) * 2014-05-14 2020-12-22 共同印刷株式会社 Two-dimensional code analysis system
JP6561757B2 (en) * 2015-10-16 2019-08-21 セイコーエプソン株式会社 Image processing apparatus, robot, and marker
US10311596B2 (en) 2015-10-16 2019-06-04 Seiko Epson Corporation Image processing device, robot, robot system, and marker
US11615254B2 (en) 2019-11-19 2023-03-28 International Business Machines Corporation Content sharing using address generation

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3361419A1 (en) 2017-02-09 2018-08-15 Aitek S.P.A. Tamper-proof barcode, system and method for generating and authenticating credentials on the basis of said code
US11900208B2 (en) 2021-04-07 2024-02-13 Ingamo, Llc Scannable code having a unique identifier

Also Published As

Publication number Publication date
JPH10214317A (en) 1998-08-11

Similar Documents

Publication Publication Date Title
JP2938338B2 (en) Two-dimensional code
EP1456811B1 (en) Reconstruction of virtual raster
JP3726395B2 (en) Two-dimensional code and two-dimensional code reading method
US20050031208A1 (en) Apparatus for extracting ruled line from multiple-valued image
US20130050724A1 (en) Information input/output method using dot pattern
JPH07234915A (en) Image recognizing device
JPH10208001A (en) Two-dimensional code and two-dimensional reading method
CN103428511A (en) Pattern processing device, pattern processing method
US7263228B2 (en) Apparatus and method for detecting a pattern
JP3887947B2 (en) Two-dimensional code reading method and recording medium
JP3873450B2 (en) 2D code
JP3698867B2 (en) Circular pattern determination method, apparatus and recording medium
JP3814334B2 (en) Image processing apparatus and method
US8441692B2 (en) Image processing apparatus, image forming apparatus, image processing method and computer readable medium
JP3339392B2 (en) Two-dimensional code reader and storage medium
JPH11312215A (en) Two-dimensional code decoder and storage medium thereof
JP4552757B2 (en) Image processing apparatus, image processing method, and image processing program
JP3499220B2 (en) Two-dimensional code, two-dimensional code reading method, program, and computer-readable recording medium
JPS6057264B2 (en) Binary pattern expansion method
JPH10187868A (en) Two-dimensional code reader and storage medium
US20030002062A1 (en) Image processing apparatus, method and program, and storage medium
JP2000276564A (en) Two-dimensional code
KR950004219B1 (en) Method and apparatus for font storage
JPH0535872A (en) Contour tracing system for binary image
JPH02125381A (en) Image signal processor

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041105

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041130

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050308

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050628

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050706

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050919

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20091007

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091007

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20101007

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101007

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111007

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111007

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121007

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121007

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121007

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121007

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121007

Year of fee payment: 7

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20131007

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20131007

Year of fee payment: 8

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term