[go: up one dir, main page]

JP4588916B2 - Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium - Google Patents

Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium Download PDF

Info

Publication number
JP4588916B2
JP4588916B2 JP2001137612A JP2001137612A JP4588916B2 JP 4588916 B2 JP4588916 B2 JP 4588916B2 JP 2001137612 A JP2001137612 A JP 2001137612A JP 2001137612 A JP2001137612 A JP 2001137612A JP 4588916 B2 JP4588916 B2 JP 4588916B2
Authority
JP
Japan
Prior art keywords
dimensional code
data
arrangement
reading
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001137612A
Other languages
Japanese (ja)
Other versions
JP2002334297A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2001137612A priority Critical patent/JP4588916B2/en
Publication of JP2002334297A publication Critical patent/JP2002334297A/en
Application granted granted Critical
Publication of JP4588916B2 publication Critical patent/JP4588916B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は画像生成装置、画像生成方法、その方法をコンピュータで実施するためのプログラムを記録した記録媒体、及びそのプログラムに係り、特にカラーの2次元コードを生成し,印刷することが可能な印刷装置を構成する画像生成装置,そのための方法,およびコンピュータによってカラーの2次元コードを生成するためのプログラムを記録した記録媒体、並びにそのプログラムに関する。
【0002】
【従来の技術】
従来からデジタルデータを機械読み取り可能な形態に変換して紙,フィルムなどの可視の記録媒体に印刷し,当該デジタルデータを管理する方法が知られている。
【0003】
機械読み取り可能な形態としては,流通,販売,在庫などの商品管理の分野で一般に広く普及している一次元のバーコードが周知である.これらは,所定の長さのバーが横一列に複数並べられたものであり,光学的読取装置でバーコードに埋められた情報を読み出すことができる。しかしながら,一次元のバーコードに埋められるデータ量は非常に少なく,高々英数字20字程度である。
【0004】
また,バーコードに埋められるデータ量を増やすことを目的として多種の2次元バーコードが開発され,最近になって普及してきている。代表的なものとしては,データマトリックス,QRコード,ベリコードなどがあり,自動認識協会(AIM)によって規格化されている。これらのコードでは,データ量に応じてサイズを変えたり,複数のコードを連結したりしてコードに埋め込むことの出来るデータ量を増加させている。しかしながら、これらのコードに埋め込み可能なデータ量は,エラー訂正符号をどれだけ入れるかにもよるが,大体2,3キロバイトが限界である。
【0005】
これらの用途とは別だが、より大きなデータ量を埋め込み可能なコードも世の中には存在している。例えば,特開平6-343132号公報では、データをエンコードして数枚分の2次元コードを作成し,ファクシミリによってデータを伝送し,受け手ではそれをデコードしてデータを得るという構成が開示されている。この場合には,解像度にもよるが,10から20キロバイトぐらいのデータをA4一枚の紙に埋める(含ませる)ことが可能である。
【0006】
さらには,コードのカラー化も検討されており,前記特開平6-343132号公報,特開平6-214859号公報,特開平10-55420号公報などでは、2次元コードのカラー化について開示されている。特に,特開平6-214859号公報,特開平10-55420号公報では、カラーの2次元コードを作成する場合の具体的な方法が開示されている。これらの構成では、シアン,マゼンタ,イエローの3色のカラーを使用して埋め込み可能なデータ量を,白黒を使う場合と比較して3倍程度に向上させている。
【0007】
【発明が解決しようとする課題】
上記のように,2次元バーコード化,カラーの使用などにより,バーコードに多くの情報を埋められるようになってはきたが,A4一枚に埋め込み可能なデータ量はせいぜい100〜200キロバイトがこれまでの普及技術では限界であり,デジタル化された画像情報や,音声情報のようなソースをコード化しようとする場合,元の画質や音質を維持しようとするとコードサイズが大きくなりすぎ,紙に印刷した場合には何枚もの紙に渡り,管理するのが難しかった。また,一枚の紙に収めようとするならば,データ圧縮の圧縮比を高くしてソース情報の画質や音質を著しく劣化させなければならず,結果として復元される画像や音声は見聞きするのに耐え難い品質となる可能性があった。
【0008】
このため,印刷物を用いてデジタルデータを保管する目的で、少ない面積により多くの情報を埋め込み可能な方法が望まれていた。
【0009】
本発明は,上記課題を解決するためになされたものであり,2次元コードに埋め込み可能なデータ量を飛躍的に増大させることを目的とし,さらに,それを実用化する画像生成装置及び画像生成方法を提供することを目的とする。
【0010】
【課題を解決するための手段】
請求項1に記載の発明は、マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された2次元コードの画像データを処理する2次元コード読み取り装置であって、
前記2次元コードの領域を抽出する領域抽出手段と、
前記2次元コードの領域に対し読み取り画素位置を設定する読み取り画素位置設定手段と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り手段とを含む2次元コード読み取り装置である。
請求項2に記載の発明は、マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された2次元コードの画像データを処理する2次元コード読み取り方法であって、
前記2次元コードの領域を抽出する領域抽出段階と、
前記2次元コードの領域に対し読み取り画素位置を設定する読み取り画素位置設定段階と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り段階とを含む2次元コード読み取り方法である。
請求項3に記載の発明は、マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された2次元コードの画像データを処理する2次元コード読み取り方法をコンピュータに実行させる2次元コード読み取りプログラムであって、コンピュータに、
前記2次元コードの領域を抽出する領域抽出段階と、
前記2次元コードの領域に対して読み取り画素位置を設定する読み取り画素位置設定段階と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り段階とを実行させる2次元コード読み取りプログラムである。
【0017】
【発明の実施の形態】
図1に本発明で使用されるカラー2次元コードの例を示す。
【0018】
101は2次元コードが印刷される記録担体で,通常は紙,フィルムなどよりなる。102は2次元コードの全領域である。2次元コードはセル103という最小の単位の矩形の集合であり,各セルには2のn乗通りの色のうちの一色が割り当てられて印刷される。
【0019】
この2次元コードは,その周囲に黒色の枠を有する。2次元コードの四隅には水平・垂直方向に黒2セル,黒3セルあるいは黒4セルのパターンを設け,その間には,白黒1セルずつが交互に現れるパターンを設ける。これら周囲の黒のパターンを利用することにより、2次元コードの領域と向きの検出を行い,さらに読み取り画素位置を決定する。
【0020】
その他の内側のセル103の各々には、埋め込むデータに応じた色(図中、ハッチング又は模様で示す)が割り当てられる。
【0021】
このカラー2次元コードの実際のデータは図2に示すように小領域201の集合よりなる。この小領域201は例えば,16×16セルで構成され,1領域あたり256個のセル103を収納可能である。n=8の時には1領域に全てのリファレンスパターン(後述)がちょうど配置できるので都合がよい。
【0022】
図2においてハッチングパターンで示した四隅の小領域には上記リファレンスパターンを印刷し,これは読み取り時に2次元コードに使用されている色のデータを正確に再現するのに使用される。仮にこのリファレンスパターンが無いとすると、例えば2次元コードがそのコードで使用できる全階調を使用しなかった場合、セルの色と復元されるデータが一対一に対応せず,データの正確な復元ができなくなり、また、プリンタの調子の変化,プリンタ機種の変更,スキャナの調子の変化,スキャナの機種の変更などにも対応できないこととなる。すなわち、このリファレンスパターンの使用により,どのようなデータを扱う場合でも,またどのようなプリンタとスキャナの組み合わせの場合でも,2次元コードを読みとって正確なデータを再現することが可能になるのである.なお、上記リファレンスパターンは2次元コード内に配置する構成に限られず、2次元コード外に配置するような構成でも構わない。
【0023】
また,各小領域201へのデータの配置の方法であるが,図3に示すように一つの小領域201中の各セルに0から255までランダムに番号をつけ,0から順にデータを色に変換したものを配置するということを行なう。そのアルゴリズムは,例えば次に示すようなものである。なお、2次元コードは図2に示されたものを使用するものとする。
【0024】
アルゴリズム1:Start。
【0025】
▲1▼初期化として,I=0,J=0とする。
【0026】
▲2▼J=L*5+Kとして配置する小領域Reg(K,L)を選択する。ただし,K,Lが0,4以外の場合のみとする。ここでK,Lが0,4の値しか持たない場合は,当該領域はリファレンスパターンを配置する領域なので、JをインクリメントしてK,Lを再計算するものとする。
【0027】
▲3▼配置する位置として,M=I mod 256を選択する。ただし,A mod BとはAをBで割った余りを示す。
【0028】
▲4▼次にI,Jをインクリメントする。
【0029】
▲5▼▲2▼戻る。
【0030】
アルゴリズム1:End。
【0031】
このように配置することによって色のデータが2次元コード全体に均等に配置され,2次元コードに汚れ,欠損,追記などがあっても読み取り誤りが分散し,読み取り時にはエラー訂正によりデータを復元することが可能となる。
【0032】
次に,リファレンスパターンのテーブルを図4に示す。左端の欄に配置用のアドレスとして0から255まで番号をふり,それぞれのアドレスにCMY(シアン、マゼンタ、イエロー)の各色データを割り当てる。この例では,C,Mにそれぞれ3ビットずつ,Yに2ビットを割り当て,CMY三色で計8ビットを割り当てる。図3に示した小領域201のセルに割り当てた配置番号と一致するアドレスの色を,該当するセルに割り当てるものとする。こうしてランダムに色が並んだリファレンスパターン領域を4個作成する。但し、これら4個のリファレンスパターン領域の色配列パターンは互いに等しい(図4のテーブルは共通に使用される)。このようにリファレンスパターンの領域を4個作成するのは,印刷位置による印刷階調特性の違い,コードが欠損,汚損した場合等に備えるためである。
【0033】
次に図5を用いて,本発明の2次元コード生成装置の一実施例を説明する。なお入力データはテキスト,数字,バイナリデータ,実行可能データ等、いかなる情報でよく,ビット列で表現可能なデータならばいかなるものでもよい。
【0034】
まず、このような入力データを圧縮器501で圧縮し、圧縮後のデータサイズの情報を得られたデータの先頭に付加する。圧縮方法としては,LZH,あるいはLZWなどを採用するものとする。いずれも,高効率な圧縮方式であり,コンピュータの技術分野では広く普及しているものである。
【0035】
次に,誤り訂正信号付加器502で誤り訂正信号を付加する。誤り訂正方式も多々存在するが,ここではブロック誤り訂正可能で広く一般に普及しているリードソロモン方式を使用するものとする。圧縮されたデータ16ワード(1ワード=1バイト)に対して,32ワードの誤り訂正符号を生成し,計48ワードの誤り訂正付き信号を生成する。
【0036】
この場合16ワードに対する誤り訂正ができるので,誤り訂正率は,16/48=33%となる。データの最後で16ワードに満たない部分については0の値をもつパディングワードで埋めて16ワードにした後、誤り訂正信号の付加を行うものとする。
【0037】
誤り訂正符号付加終了時には,48バイトの倍数分のデータが誤り訂正信号付加器から出力される。
【0038】
この時に,出力されるデータサイズに応じて不図示のCPUがそのデータを収納できる(表現可能な)最小の2次元コードの大きさを決定し,同じく不図示のレジスタにそれを記憶する。このレジスタの値を配置アドレス生成器510が読み出してアドレス生成に利用する。この配置アドレス生成器の詳細な動作に関しては後述する。
【0039】
次に,ブロック化器503において入力されたデータはnビットずつのブロックにブロック化(ブロック分け)される。データの最後でnビットに満たないデータが存在する場合には,パディングビットを付加してnビットにするものとする。本実施例のようにn=8の場合には,パディングビットを付加する必要はない。
【0040】
次に,nビットずつにブロック化されたデータは色信号生成器504で色信号CMYに変換される。色信号生成器504は,nビットのデータを受け取ると,その値をアドレスとしてリファレンスパターンメモリからCMYのデータを読み出し,CMYデータを出力する.リファレンスパターンメモリの内容は,図4に示したリファレンスパターンのテーブルと同一であるものとする。
【0041】
色信号生成器504から出力されたCMYデータは黒信号生成器505に入力され,UCR/UCA変換されC’M’Y’K信号として出力される.UCR/UCA変換は,例えば次式で示す方式で行うものとする。
【0042】
【数1】

Figure 0004588916
ここで,min()は最小値を選択する関数とする。また,2^nは2のn乗を示す。n=8の場合には256となる。
【0043】
このようにして変換されて得られたC’M’Y’Kデータは画像メモリ506へ出力され、そこで一時的に記憶される。
【0044】
画像メモリに格納するアドレスの決定は,配置アドレス生成器510が上記アルゴリズム1を実現するように構成されており,以下のように動作することによってなされる。
【0045】
ブロック化器503からデータブロックが出力されるたびにI,Jをインクリメントする。JからK,Lを計算してデータを配置する小領域201を決定する。K,Lが0,4の値しか持たない場合はJをインクリメントしK,Lを再計算する。また,Iにより色データを配置する位置番号Mを決定する。配置アドレス生成器510は,図3の配置位置が記憶されている配置メモリ511からMをアドレスとして小領域201の中で配置されるセル103位置を読み出す。読み出したセル位置と上記K,LとからC’M’Y’Kデータを記憶すべき画像メモリのアドレスを算出する。
【0046】
このようにして入力データの書き込みが終了した後,リファレンスパターンのデータを書き込む動作を行う。
【0047】
まず色信号生成器504はリファレンスパターンメモリからアドレス順にCMYデータを読み出す。そしてこの動作を4回行う。このように読み出されたCMYデータは黒信号生成器505でC’M’Y’Kデータに変換された後,配置アドレス生成器によって指定された画像メモリ中のアドレス(図2に示すReg(0,0),Reg(4,0),Reg(0,4),Reg(4,4)内のセル位置)に格納される。さらに,周囲の白黒パターンを黒信号生成器で生成し,画像メモリに書き込む。
【0048】
このようにして画像メモリへの書き込みが終了の後、そのデータはガンマ補正器507によって,例えば図6にあるようなガンマカーブを用いてC’M’Y’Kデータの補正が施され、印刷器508によって印刷用に階調処理が行われた後、紙などに印刷される。階調処理はプリンタエンジンの種類によって異なるが,(多値)ディザ,(多値)誤差拡散などが行われるものとする。カラーレーザープリンタの場合には,1ドットで多階調を再現することが可能であり,通常は,小さい領域での多値ディザを採用するものとする。また,インクジェットプリンタの場合には,インクが各色1濃度しかない場合、2階調誤差拡散が行われている。また,特に付加的な淡色インクを使用しているインクジェット方式では3階調誤差拡散が利用される。2階調誤差拡散と比較して3階調誤差拡散は印刷時の粒状性に優れており,図7(b)に示すように,小さな領域で平均濃度を表すことができる。これは,2次元コードの読み取りの際に各セルのデータをサンプリングする場合,サンプリングする領域が小さくて済むため処理が高速にできるという効果を有する。
【0049】
次にこのようにして印刷された2次元コードをデコードする読み取り器について、図8を用いて説明する。
【0050】
まず、紙等に印刷された2次元コードをスキャナ701で読み込む。この場合、2次元コードがカラー印刷されているため、RGB各色8ビットずつのフルカラー読み取りが行なわれる必要がある。
【0051】
このようにして読み取った画像データに対しガンマ変換器702でガンマ変換を行う。このガンマ変換はいわゆるLOG変換であり,反射率データから濃度データへの変換を意味する。これにより後述する色補正処理においてデータの線形性がよくなるので色補正の精度が向上し,もって読み取り精度が向上する。
【0052】
このようにしてガンマ変換したのち,領域抽出器703で2次元コードの領域を抽出する。領域抽出器703の詳細な構成を図9に示す。ここで、ガンマ変換された画像は,まず画像縮小器801に入力される。
【0053】
画像縮小器801は図10のフローチャートを実現する回路構成を有するものとする。ここではまず、画像のグリーンのみを使用し,その画像を8×8画素単位でブロック化する。次にブロック内全画素値の論理和演算を行った後,所定の閾値で二値化を行う。この処理で2次元コード周囲の白黒交互のセルは黒線に変換され,読み取った2次元コードは黒枠で囲まれた閉領域となる。
【0054】
画像縮小器801から出力された二値画像に対し、閉領域検出器802で、この閉領域の検出を行う。この閉領域検出は,二値画像において,白黒画素の境界を追跡することによって閉領域を認識し,領域が矩形の場合に当該閉領域を2次元コード候補領域として認識するものである。この閉領域検出の詳しいフローチャートを図11に示す(詳細は後述する)。
【0055】
図9に戻り、領域マッピング器803では,抽出された閉領域を元のスキャンしたRGB画像にマッピングして出力し,以後、このようにして得られたデータから2次元コードの読み取り処理を行う。
【0056】
このようにして2次元コード候補領域が抽出できたので,次は,各セルの値をサンプリングするために,読み取り画素位置を設定する必要がある。これは読み取り画素位置設定器713で行われる。2次元コードは図1に示されるように規格化されているので,水平・垂直に何セルずつあるかについては,2次元コード周囲の白黒交互パターンを数えることによって求められる。
【0057】
このようにして2次元コードの大きさが検出された後,各セルの中心を求める。図12はこの場合のサンプリング点を示したものである。実線で描かれた正方形がそれぞれ2次元コードの各セル103に該当する。破線は,それぞれそれらセルの中心を通る直線であり,破線の交差した部分がサンプリングすべき点である。なお、上記の如く2次元コードのサイズ(画素数)が検出されたので、上記破線を引く位置は、それに応じて求められる。
【0058】
このようにしてサンプリングする点が決定した後,画像データ読み取り器705,リファレンスパターン読み取り器710によって、その中心座標を中心とした3×3画素のデータをRGB画像データから読み取り、それらの平均をとる。リファレンスパターンメモリ714はリファレンスパターンメモリ509と同様の構成を有し、配置メモリ712と配置アドレス生成器704は,それぞれ配置メモリ511,配置アドレス生成器510と同様の構成を有する。
【0059】
ここで,3×3画素のデータを読み取り平均を取るのは各セルの正確な色を読み取るためであり,特に,一画素あたりの印字階調数が比較的少ないインクジェット方式のプリンタで印刷された2次元コードの場合には有効である。また,1色1濃度の2階調誤差拡散を使用するインクジェット方式で印刷した2次元コードを読み取る場合にはもう少し大きな領域,例えば5×5や9×9画素の範囲で読み取らないと正確なセルの色を読み取ることができない可能性がある。
【0060】
リファレンスパターン読み取り器710で読み取ったデータは,色補正パラメータ作成器711で処理され,色補正パラメータとして記憶される。
【0061】
上記の如くリファレンスパターンは一つの2次元コードに4個存在するので、同色が夫々4個づつ取得される。その平均をRi,Gi,Bi(i=0〜255)とする。その値とリファレンスパターンメモリに格納されているCMYの値とを関係づけ、図13に示す如くのテーブルを作成する。
【0062】
そしてこのテーブルを用いて色補正器706において,画像データ読み取り器706で読み取った2次元コードの各セルの色を補正し,Rc,Gc,Bcを出力する。色補正の方法としては,例えば,三角柱補間方法(特許第2899461号参照)等が高速で精度も良いので実用的である.
色補正器706で色補正された色データは,データ変換器707で元のブロック化されたnビットのデータに変換される。すなわち、上記色データRc,Gc,Bcが,リファレンスパターンメモリに記憶されている各CMYが表す色のどれに最も近いかを判定する。その判定方法は,(Rc,Gc,Bc),(C,M,Y)の二つの座標の距離が最短であるCMYを選択するというものとする。
【0063】
このようにしてCMYが選択されると、それに対応したアドレスがリファレンスパターンメモリに格納されているので、そのアドレスに応じたnビットの値をデータ変換器707が出力する。このようにして元のnビットのデータに変換されたデータは誤り訂正器708で誤っているコードが訂正される。誤り訂正信号を付加した方法が既知であるので、その誤り訂正を行うのは容易となる。もし,誤りの数が誤り訂正の能力を超えるようならば,この場合の2次元コードの読み取りは失敗になる。
【0064】
この誤り訂正処理で,誤りがないか,もしくは誤りが訂正できたならば,2次元コード生成時に付加された誤り訂正信号をデータから除去し,元の情報を有するデータだけを出力する。そのデータは伸長器709で伸長され,元のデータが得られる。なお、上記の如くデータ圧縮時にデータサイズの情報が付加されているので、データ伸長時にはそのデータサイズに対応した部分だけを利用すればよい。
【0065】
以上のようにして2次元コードの読み取りが行われ,元のデータが復元される。
【0066】
次の本発明の一実施例の2次元コード作成方法について,説明する。
【0067】
図14は上記2次元コード作成方法のフローチャートである。
【0068】
まず、2次元コードに埋め込むべき(2次元コードで表現しようとする)データをステップS1001で入力し,次にステップS1002では、そのデータを圧縮し,圧縮データのサイズの情報をデータの先頭に付加する。この圧縮には、LZH,LZWなどの効率のよい圧縮方法が採用される。
【0069】
データ圧縮の後,ステップS1003では誤り訂正信号が付加される。誤り訂正方式はブロック誤り訂正が可能であり、具体的には広く普及しているリードソロモン符号を使用する。まずデータを8ビットのコードワードに分割し,16ワードのデータに対し,32ワードの誤り訂正コードを生成して,都合48ワードのデータを生成する。入力データの最後が16ワードに満たない場合にはパディングワードを付加して16ワードを形成する。
【0070】
このようにして誤り訂正信号が付加されたデータに対し、ステップS1004でnビット単位のブロック化が行われる.ブロック化の詳細なフローを図15に示す。図15の処理は、nビットのデータ列を入力するステップS1101,nビットが実際に入力できたかを判定するステップS1102,nビットが入力できなかった場合にパディングビットを付加するステップS1103,nビットデータを出力するステップS1104、及びデータの終了を判定するステップS1105からなる。
【0071】
次に,nビット毎にブロック化されたデータから色信号を生成する。色信号生成ステップS1005の詳細を図16に示す。この処理は、nビットのデータを入力するステップS1201,リファレンスパターンメモリから、nビットのデータの値をアドレスとしてCMYの値を読み出すステップS1202,CMYデータを出力するステップS1203,データの終了を判定するステップS1204からなる。
【0072】
色信号生成の後,黒信号生成及びUCR/UCA変換ステップS1006で、黒信号の生成と,UCR/UCA変換とが行われる。この詳細を図17のフローチャートで示す。この処理は、CMYデータを入力するステップS1301,CMYデータから黒信号を生成するステップS1302,黒信号KとCMY信号とを使用してUCR/UCA処理を行ってC’M’Y’信号を生成するステップS1303,配置アドレスを生成する配置アドレス生成ステップS1304,CMYKデータを画像メモリの配置アドレスへ出力するステップS1305,データの終了を判定するステップS1306からなる。
【0073】
上記黒信号生成ステップS1302では,CMYの最小値を使用してKを生成する。UCR/UCA処理を行うステップS1303では、上記の数式(数1)の処理を行う。ステップS1304では,上記アルゴリズム1を実行して配置アドレスを計算する。
【0074】
次に、図14のガンマ補正ステップS1007では,例えば図6で示すようなプリンタの特性に合わせたガンマカーブを使用してガンマ補正を画像データに施す。ガンマ補正を施されたデータは印刷ステップS1008で階調処理が施され,このようにして得られた2次元コードの画像が紙等に印刷される。
【0075】
上記階調処理はプリンタエンジンの種類によって異なるが,上述の如く、(多値)ディザ,(多値)誤差拡散などが行われる。カラーレーザープリンタの場合には,1ドットで多階調を再現することが可能であり,通常は,小さい領域で多値ディザを使用している。また,インクジェットプリンタの場合には,インクが各色1濃度しかない場合には2階調誤差拡散が行われている。また,特に付加的な淡色インクを使用しているインクジェット方式では3階調誤差拡散が利用されている。2階調誤差拡散と比較して3階調誤差拡散は,印刷時の粒状性に優れており,図7(b)に示すように,小さな領域で平均濃度を表すことができる。これは,2次元コードの読み取りの際に各セルのデータをサンプリングする場合,サンプリングする領域が小さくて済むため処理が高速にできるという効果を有する。
【0076】
次にこのようにして印刷された2次元コードをデコードする読み取り方法について説明する。
【0077】
図18は、この方法を示すそのフローチャートである。
【0078】
この方法は、紙等に印刷された2次元コードをスキャナ等を用いて読み込む画像入力ステップS1501,読み込んだ画像をLog変換するガンマ変換ステップS1502,ガンマ変換した画像データから2次元コードの領域を抽出する領域抽出ステップS1503,抽出した領域に対して読み取り画素位置を設定する読み取り画素位置設定ステップS1504,設定された読み取り画素位置を用いて画像データからリファレンスパターンを取得するリファレンスパターン取得ステップS1505,取得したリファレンスパターンから色補正パラメータを作成する色補正パラメータ作成ステップS1506,上記読み取り画素位置を用いて画像データからコードデータを取得するコードデータ取得ステップS1507,取得したコードデータの色補正を行う色補正ステップS1508,色補正したデータから元のnビットのデータを取得するデータ変換ステップS1509,変換したデータの誤りを訂正し、必要な情報データのみを取得する誤り訂正ステップS1510,取得した情報データを伸長する伸長ステップS1511,伸長して復元したデータを出力するステップS1512からなる。
【0079】
上述の如く、上記ステップS1501では、2次元コードがカラー印刷されているのでRGB各色8ビットずつのフルカラー読み取りでなければならない。そして、読み取った画像データに対しガンマ変換ステップS1502でガンマ変換を行うが、このガンマ変換はいわゆるLog変換であり,反射率データから濃度データへの変換である。これにより、後述する色補正においてデータの線形性がよくなるため色補正の精度が向上し,コード読み取り精度が向上する。
【0080】
ガンマ変換の後、領域抽出ステップS1503で2次元コードの領域を抽出するが、この領域抽出ステップの詳細なフローチャートを図19に示す。ここでは、ガンマ変換された画像が,まず画像縮小ステップS1601で処理される。画像縮小ステップS1601は,さらに図10のフローチャートの各ステップに分解される。
【0081】
図10の処理では、画像のグリーンのみ使用し,その画像を8×8画素単位でブロック化する(ステップS1701)。次にブロック内全画素値の論理和演算を行った(ステップS1702)後,このようにして得られた値に対し、所定の閾値で二値化(ステップS1703)を行う.この処理で2次元コード周囲の白黒交互のセルは黒線に変換され,2次元コードは黒枠で囲まれた閉領域となる。
【0082】
図19に戻り、このようにして画像縮小ステップS1601で得られた二値画像に対し、閉領域検出ステップS1602で閉領域の検出を行う。この閉領域検出の詳しいフローチャートを図11に示す。閉領域検出処理では,二値画像において,黒画素を検出し(ステップS1803),白黒画素の境界を追跡し(ステップS1804),追跡始点に戻った(ステップS1805)後,領域が矩形の場合(ステップS1806)に当該閉領域を2次元コード候補領域として認識する(ステップS1807)。
【0083】
次に図19の領域マッピングステップS1603では,抽出された閉領域を元のスキャンしたRGB画像にマッピングして出力し,以降,2次元コードの読み取りを行う。
【0084】
次に、図18に戻り、このようにして2次元コード候補領域が抽出できたため,次は,各セルの値をサンプリングするために,読み取り画素位置を設定する。
この処理は,読み取り画素位置設定ステップS1504で行われる。
【0085】
2次元コードは図1に示される如くに規格化されているため,水平・垂直に何セルずつあるかは,2次元コード周囲の白黒交互パターンを数えることによって求められる。このようにして2次元コードの大きさがわかった後,各セルの中心を求める。
【0086】
図12はこのためのサンプリング点を示したものである。上述の如く、実線で描かれた正方形が2次元コードの各セル103に該当し,破線は,それらの中心を通る直線であり、破線の交差した点が上記サンプリングする点である。
【0087】
このようにしてサンプリングする点が決定した後,コードデータ取得ステップS1507,リファレンスパターン取得ステップS1505でその座標を中心とした3×3画素のデータをRGB画像データから読み取りそれらの平均をとる。
【0088】
ここで,上述の如く、3×3画素のデータを読み取り平均を取るのは,セルの正確な色を検出するためであり,特に,インクジェット方式の場合には有効である。また,1色1濃度の2階調誤差拡散を使用するインクジェット方式で印刷した2次元コードを読み取る場合にはもう少し大きな領域,例えば5×5や9×9画素の範囲で読み取らないと正確なセルの色を読み取ることができない可能性がある。
【0089】
このようにしてリファレンスパターン取得ステップS1505で読み取ったデータは,色補正パラメータ作成ステップS1506で処理され,色補正パラメータとして記憶される。図20は、この処理のフローチャートを示す。リファレンスパターンは一つの2次元コードに4個存在するため,同色が4通り取得出来ることになる。それらの平均をRi,Gi,Bi(i=0〜255)とする(ステップS2001)。その値とリファレンスパターンテーブル(図4)に格納されているCMYの値とを関係づけ図13に示す如くのテーブルを作成する(ステップS2002、S2003)。
【0090】
そして、このテーブルを用いて色補正ステップS1508において,コードデータ取得ステップS1507で読み取った2次元コードのセルの色を補正し,Rc,Gc,Bcを出力する。色補正の方法としては,例えば,上記の如く三角柱補間方法(特許第2899461号)等が高速で精度も良いので実用的である。
【0091】
色補正ステップS1508で色補正された色データは,データ変換ステップS1509で元のブロック化されたnビットのデータに変換される。すなわち、色データRc,Gc,Bcが,リファレンスパターンテーブルに記憶されている各CMYが表す色のどれに最も近いかを判定する.その判定方法としては,例えば(Rc,Gc,Bc),(C,M,Y)という二つの座標の距離が最短であるCMYを選択する方法をとる。このようにしてCMYが選択されると、それに対応したアドレスがリファレンスパターンテーブルに格納されているので、その値をデータ変換ステップS1509で得る。
【0092】
このようにして元のnビットのデータに変換されたデータは誤り訂正ステップS1510で誤っているコードを訂正される。誤り訂正信号を付加した方法が既知であるのでその誤り訂正を行うのは容易である。もし,誤りの数が誤り訂正の能力を超えるようならば,2次元コードの読み取りは失敗となる。
【0093】
誤り訂正処理の結果,誤りがないか,もしくは誤りが訂正できたならば,2次元コード生成時に付加された誤り訂正信号をデータから除去し,元の情報をもつデータだけを出力する。そのデータは伸長ステップS1511で伸長され,元のデータが得られる。データ圧縮時にデータサイズの情報が付加されているのでデータ伸長時にはそのデータの部分だけを利用すればよい。
【0094】
以上のようにして2次元コードの読み取りが行われ,元のデータが復元される。
【0095】
次に本発明の他の実施例のシステム構成を図21に示す。
【0096】
図21において、ディスク装置1902(ハードディスク装置、フロッピディスク装置、CD−ROM駆動装置等であり、PC1901に含まれていても良い)のディスク(情報記録媒体)には,上記本発明の2次元コード生成方法や2次元コード読み取り方法をPC1901上で実現するためのプログラムが記憶されており,2次元コード生成時や2次元コード読み取り時には同プログラムがPC1901のメモリ(RAM等)にロードされ、そのCPUによって実行される。
【0097】
2次元コード生成プログラムが実行される場合には,ディスク装置1902に格納されているかあるいはネットワークから受信するデータから上記2次元コード生成方法によって2次元コードを生成し,カラーレーザプリンタ1904やカラーインクジェットプリンタ1905で印刷する。
【0098】
2次元コード読み取りプログラムが実行される場合には,スキャナ1903で2次元コードが印刷された紙等をスキャンし,そのようにして入力された画像データはPC1901で上述の如くの2次元コード読み取り方法にしたがって処理され,もって元のデータが復元され,ディスク装置1902に保存されたり,PC1901で実行されたり,あるいはネットワークを介して他端末へ送信されたりする。
【0099】
なお、成として、次のものが考えられる。
【0100】
構成1: デジタル形式で表現された情報をn(n>1)ビットずつのブロック毎に分割する分割手段と、
上記各ブロックのnビットのデータを2次元のマトリクスの各要素に配置する配置手段と、
上記2次元マトリクスの各要素をnビットデータに応じた色に変換し,2次元マトリクスから印刷すべき画像を形成する画像形成手段と、
上記画像を複数の色材を用いて印刷することのできる印刷手段とで構成される2次元コードの生成装置であって、
上記配置手段は,2次元マトリクス内にある複数の所定の要素位置にあらかじめ所定の値を配置することを特徴とする2次元コード生成装置。
【0101】
構成2:前記配置手段は,あらかじめ所定の値を配置する要素位置と前記所定の値を記憶する要素位置記憶手段よりなることを特徴とする上記構成1の2次元コード生成装置。
【0102】
構成3:上記あらかじめ所定の要素位置に配置する値は,ランダムであることを特徴とする上記構成1の2次元コード生成装置。
【0103】
構成4:前記印刷手段は,シアン,マゼンタ,イエロー,ブラックの4色の色材を用いて印刷を行なうことを特徴とする構成1の2次元コード生成装置。
【0104】
構成5:前記印刷手段は,シアン,マゼンタ,イエローを用いて無彩色で印刷する指示が与えられた場合,使用する色材をブラック単色に置き換えることを特徴とする構成4の次元コード生成装置。
【0105】
構成6:前記印刷手段は,少なくとも一色について、二つの異なる濃度の色材を用いて印刷することを特徴とする構成4の2次元コード生成装置。
【0106】
構成7;デジタル形式で表現された情報をn(n>1)ビットずつのブロック毎に分割する分割段階と、
上記各ブロックのnビットのデータを2次元のマトリクスの各要素に配置する配置段階と、
上記2次元マトリクスの各要素を上記nビットデータに応じた色に変換し,2次元マトリクスから印刷すべき画像を形成する画像形成段階と、
上記画像を複数の色材を用いて印刷する印刷段階とよりなる2次元コード生成方法であって、
上記配置段階は,2次元マトリクス内にある所定の複数の要素位置にあらかじめ所定の値を配置する段階よりなることを特徴とする2次元コード生成方法。
【0107】
構成8:前記配置段階は,あらかじめ所定の値を配置する要素位置と前記所定の値を記憶した要素位置記憶メモリからデータを読み出す段階よりなることを特徴とする構成7の2次元コード生成方法。
【0108】
構成9:上記あらかじめ所定の要素位置に配置する値は,ランダムであることを特徴とする構成7の2次元コード生成方法。
【0109】
構成10:前記印刷段階では、シアン,マゼンタ,イエロー,ブラックの4色の色材を用いて印刷する構成7の2次元コード生成方法。
【0110】
構成11:前記印刷段階では,シアン,マゼンタ,イエローを用いて無彩色で印刷するよう指示された場合,使用する色材をブラック単色に置き換えることを特徴とする構成10の2次元コード生成方法。
【0111】
構成12:前記印刷段階では,少なくとも一色については二つの異なる濃度の色材を用いて印刷することを特徴とする構成10の2次元コード生成方法。
【0112】
構成13:構成7乃至12のうちのいずれか2次元コード生成方法をコンピュータで実行するためのプログラムを記録したコンピュータによって読み取り可能な固定あるいは着脱可能な情報記録媒体。
【0113】
構成14:構成7乃至12のうちのいずれかの2次元コード生成方法をコンピュータで実行するためのプログラム。
上記構成1、7によれば,カラーの2次元コードを印刷する際に,リファレンスカラーパターン(前記所定の要素位置に配置された所定の値によるパターン)を設けることにより色の基準を設定することが可能となり、もって2次元カラーコードについて正確な色の読み取りが可能となる。もって実用的に多階調カラーを使用することが可能になり,その結果2次元コードに埋められるデータ量を飛躍的に増加させることが可能となる。
上記構成2、8によれば,上記リファレンスカラーパターンをあらかじめ決定して記憶させておくことにより,2次元コードの読み取りシステムとの互換性を容易にとることが可能になる。
上記構成3、9によれば,印刷手段の印刷濃度の偏りを軽減し,2次元コードの読み取り誤りを減少させることが可能になる。
上記構成4、10によれば,通常のインクジェットプリンタ,レーザープリンタ,サーマルプリンタを使用することができ,特別な印刷装置を用意しなくても本発明によるカラーの2次元コードを印刷することが可能になる。
上記構成5、11によれば,無彩色の再現を容易にして2次元コードの読み取り精度の向上が可能になるとともに,色材の消費量を減らすことが可能になる。
上記構成6、12によれば,ディザや誤差拡散などの階調処理による局所的な色の変化を抑えることにより,2次元コードの読み取りを容易にすることが可能になる。
上記構成13によれば,本発明による次元コード生成方法をコンピュータで実行するためのプログラムを記憶,保存することが可能になる。
【0114】
【発明の効果】
請求項1,2および3に記載の発明によれば、あらかじめマトリクスの所定の位置に所定の値を配置しておくことにより、その要素はその値に応じた所定の色とされ、印刷された後に読み取られる際、本来の情報を含む色に対する基準として使用され得る。したがって、印刷手段、読み取り手段等の状況によって、具体的に印刷され、或いは読み取られる色がばらついたとしても、上記基準の色を基準として補正可能となり、正確な読み取りが可能となる。
【図面の簡単な説明】
【図1】本発明の2次元コードの一例の典型的パターンを説明するための図である。
【図2】図1に示す2次元コードの構成を説明するための図である。
【図3】図1に示す2次元コードを構成する各小領域におけるセルの配置パターンを示す図である。
【図4】本発明の2次元コードの生成、読み取りに使用されるリファレンスパターンテーブルの一例を示す図である。
【図5】本発明の2次元コード生成装置の一実施例のブロック構成図である。
【図6】ガンマ変換の一例を説明するためのグラフである。
【図7】淡色インクの有無によるインクジェットプリンタで印刷した場合印刷状態の相異を示す図である。
【図8】本発明の一実施例の2次元コード読み取り装置のブロック構成図である。
【図9】図8に示す領域抽出器のブロック構成図である。
【図10】本発明の画像縮小処理のフローチャートを示す図である。
【図11】本発明の閉領域検出処理のフローチャートを示す図である。
【図12】2次元コードの読み取り位置を説明するための図である。
【図13】本発明の2次元コード読み取り処理で作成される色補正パラメータテーブルの一例を示す図である。
【図14】本発明の2次元コード生成方法のフローチャートを示す図である。
【図15】本発明のデータのnビットブロック化処理のフローチャートを示す図である。
【図16】本発明の色信号生成処理のフローチャートを示す図である。
【図17】本発明の黒信号生成及びUCR/UCA変換処理のフローチャートを示す図である。
【図18】本発明の2次元コード読み取り方法のフローチャートを示す図である。
【図19】本発明の領域抽出処理のフローチャートを示す図である。
【図20】本発明の色補正パラメータ作成処理のフローチャートを示す図である。
【図21】本発明の2次元コード生成方法、読み取り方法を実現可能なパーソナルコンピュータを使用した構成を示す図である。
【符号の説明】
503 ブロック化器
504 色信号生成器
505 黒信号生成器
506 画像メモリ
509 リファレンスパターンメモリ
510 配置アドレス生成器
511 配置メモリ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image generation apparatus, an image generation method, a recording medium on which a program for executing the method on a computer is recorded, and the program, and in particular, printing capable of generating and printing a color two-dimensional code. The present invention relates to an image generation apparatus that constitutes the apparatus, a method therefor, a recording medium that records a program for generating a color two-dimensional code by a computer, and the program.
[0002]
[Prior art]
Conventionally, a method for managing digital data by converting the digital data into a machine-readable form, printing it on a visible recording medium such as paper or film, and the like is known.
[0003]
As a machine-readable form, one-dimensional barcodes that are widely used in the field of merchandise management such as distribution, sales, and inventory are well known. In these, a plurality of bars having a predetermined length are arranged in a horizontal row, and information embedded in a barcode can be read by an optical reader. However, the amount of data embedded in a one-dimensional bar code is very small, at most about 20 alphanumeric characters.
[0004]
In addition, a variety of two-dimensional barcodes have been developed for the purpose of increasing the amount of data embedded in barcodes, and have recently become widespread. Typical examples include data matrix, QR code, Vericode, etc., which are standardized by the Automatic Recognition Association (AIM). In these codes, the data amount that can be embedded in the code is increased by changing the size according to the data amount or connecting a plurality of codes. However, the amount of data that can be embedded in these codes is limited to a few kilobytes, although it depends on how many error correction codes are inserted.
[0005]
Apart from these uses, there are also codes that can embed a larger amount of data. For example, Japanese Patent Laid-Open No. 6-343132 discloses a configuration in which data is encoded to create two-dimensional codes for several sheets, the data is transmitted by facsimile, and the receiver decodes the data to obtain data. Yes. In this case, depending on the resolution, it is possible to embed (include) 10 to 20 kilobytes of data on a single A4 sheet.
[0006]
Furthermore, colorization of the code is also being studied, and the above-mentioned Japanese Patent Laid-Open Nos. 6-343132, 6-214859, and 10-55420 disclose the colorization of the two-dimensional code. Yes. In particular, Japanese Patent Laid-Open Nos. 6-214859 and 10-55420 disclose specific methods for creating a color two-dimensional code. In these configurations, the amount of data that can be embedded using three colors of cyan, magenta, and yellow is improved to about three times that in the case of using black and white.
[0007]
[Problems to be solved by the invention]
As mentioned above, it has become possible to embed a lot of information in a barcode by making it into a two-dimensional barcode, using colors, etc., but the amount of data that can be embedded in one A4 sheet is 100 to 200 kilobytes at most. Until now, it has been a limit in the spread technology, and when trying to code sources such as digitized image information and audio information, the code size becomes too large when trying to maintain the original image quality and sound quality. When it was printed on, it was difficult to manage over several sheets of paper. Also, if you want to fit on a piece of paper, you must increase the compression ratio of the data compression to significantly degrade the quality and sound quality of the source information. As a result, you can see and hear the restored image and sound. There was a possibility that the quality would be unbearable.
[0008]
For this reason, in order to store digital data using printed matter, a method capable of embedding a large amount of information in a small area has been desired.
[0009]
The present invention has been made to solve the above-described problems, and has an object to dramatically increase the amount of data that can be embedded in a two-dimensional code. It aims to provide a method.
[0010]
[Means for Solving the Problems]
  The invention described in claim 1Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory When,Image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image;The arrangement means arranges the arranged data at the arrangement address generated by the arrangement address generation means,At multiple predetermined element positions in the matrixIsPredeterminedcolorTo generate a reference patternTheA two-dimensional code reading device for processing image data of a two-dimensional code generated by an image generation device that generates image data of a two-dimensional code including the reference pattern,
  A region extracting means for extracting a region of the two-dimensional code;
  Reading pixel position setting means for setting a reading pixel position with respect to the area of the two-dimensional code;
  It is a two-dimensional code reading device including reference pattern reading means for obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
  The invention described in claim 2Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory When,Image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image;The arrangement means arranges the arranged data at the arrangement address generated by the arrangement address generation means,At multiple predetermined element positions in the matrixIsPredeterminedcolorTo generate a reference patternTheA two-dimensional code reading method for processing image data of a two-dimensional code generated by an image generation device that generates image data of a two-dimensional code including the reference pattern,
  A region extracting step of extracting a region of the two-dimensional code;
  A reading pixel position setting step for setting a reading pixel position with respect to the area of the two-dimensional code;
  A two-dimensional code reading method including a reference pattern reading step of obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
  The invention according to claim 3Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory When,Image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image;The arrangement means arranges the arranged data at the arrangement address generated by the arrangement address generation means,At multiple predetermined element positions in the matrixIsPredeterminedcolorTo generate a reference patternTheA two-dimensional code reading program for causing a computer to execute a two-dimensional code reading method for processing image data of a two-dimensional code generated by an image generation device that generates image data of a two-dimensional code including the reference pattern, On the computer,
  A region extracting step of extracting a region of the two-dimensional code;
  A reading pixel position setting step of setting a reading pixel position with respect to the area of the two-dimensional code;
  This is a two-dimensional code reading program that executes a reference pattern reading step for obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows an example of a color two-dimensional code used in the present invention.
[0018]
Reference numeral 101 denotes a record carrier on which a two-dimensional code is printed, which is usually made of paper, film or the like. Reference numeral 102 denotes the entire area of the two-dimensional code. The two-dimensional code is a set of rectangles of the smallest unit of cells 103, and each cell is assigned with one of 2 n colors and printed.
[0019]
This two-dimensional code has a black frame around it. At the four corners of the 2D code, a pattern of black 2 cells, black 3 cells or black 4 cells is provided in the horizontal and vertical directions, and a pattern in which black and white cells alternately appear is provided between them. By using these surrounding black patterns, the area and orientation of the two-dimensional code are detected, and the read pixel position is determined.
[0020]
Each of the other inner cells 103 is assigned a color (indicated by hatching or pattern in the figure) according to the data to be embedded.
[0021]
The actual data of this color two-dimensional code consists of a set of small areas 201 as shown in FIG. The small area 201 is composed of 16 × 16 cells, for example, and can store 256 cells 103 per area. When n = 8, all reference patterns (described later) can be arranged in one area, which is convenient.
[0022]
In FIG. 2, the reference patterns are printed in the small areas at the four corners indicated by hatching patterns, which are used to accurately reproduce the color data used in the two-dimensional code at the time of reading. If this reference pattern does not exist, for example, if the 2D code does not use all the gradations that can be used in the code, the cell color and the restored data do not correspond one-to-one, and the data is accurately restored. It is also impossible to cope with changes in printer tone, printer model changes, scanner tone changes, scanner model changes, and the like. In other words, the use of this reference pattern makes it possible to reproduce accurate data by reading a two-dimensional code regardless of what data is handled or what combination of printer and scanner is used. . The reference pattern is not limited to the configuration arranged in the two-dimensional code, and may be arranged outside the two-dimensional code.
[0023]
Further, as shown in FIG. 3, each cell in one small area 201 is randomly assigned a number from 0 to 255, and the data is colored in order from 0, as shown in FIG. Place the converted one. The algorithm is as follows, for example. It is assumed that the two-dimensional code shown in FIG. 2 is used.
[0024]
Algorithm 1: Start.
[0025]
(1) As initialization, I = 0 and J = 0.
[0026]
(2) Select a small area Reg (K, L) to be arranged as J = L * 5 + K. However, only when K and L are other than 0 and 4. Here, when K and L have only values of 0 and 4, since the relevant area is an area in which the reference pattern is arranged, J and J are incremented and K and L are recalculated.
[0027]
(3) Select M = I mod 256 as the position to be arranged. A mod B is the remainder of A divided by B.
[0028]
(4) Next, I and J are incremented.
[0029]
▲ 5 ▼ ▲ 2 ▼ Return
[0030]
Algorithm 1: End.
[0031]
By arranging in this way, color data is evenly distributed throughout the two-dimensional code, and even if the two-dimensional code is dirty, missing, or additionally written, reading errors are dispersed, and at the time of reading, the data is restored by error correction. It becomes possible.
[0032]
Next, a reference pattern table is shown in FIG. Numbers from 0 to 255 are assigned as addresses for arrangement in the leftmost column, and each color data of CMY (cyan, magenta, yellow) is assigned to each address. In this example, 3 bits are assigned to each of C and M, 2 bits are assigned to Y, and a total of 8 bits are assigned to CMY three colors. Assume that the color of an address that matches the arrangement number assigned to the cell of the small area 201 shown in FIG. 3 is assigned to the corresponding cell. In this way, four reference pattern areas in which colors are randomly arranged are created. However, the color arrangement patterns of these four reference pattern areas are equal to each other (the table in FIG. 4 is used in common). The reason why four reference pattern areas are created in this way is to prepare for a case where a difference in printing gradation characteristics depending on a printing position, a code is lost or damaged, and the like.
[0033]
Next, an embodiment of the two-dimensional code generation apparatus of the present invention will be described with reference to FIG. The input data may be any information such as text, numbers, binary data, executable data, and any data that can be expressed in a bit string.
[0034]
First, such input data is compressed by the compressor 501, and information on the data size after compression is added to the head of the obtained data. As the compression method, LZH or LZW is adopted. Both are highly efficient compression methods and are widely used in the technical field of computers.
[0035]
Next, the error correction signal adder 502 adds an error correction signal. There are many error correction methods, but here, it is assumed that a Reed-Solomon method that can correct block errors and is widely used is used. An error correction code of 32 words is generated for 16 words of compressed data (1 word = 1 byte), and a signal with error correction of 48 words in total is generated.
[0036]
In this case, since error correction for 16 words can be performed, the error correction rate is 16/48 = 33%. It is assumed that a portion less than 16 words at the end of the data is filled with padding words having a value of 0 to make 16 words, and then an error correction signal is added.
[0037]
At the end of error correction code addition, data for a multiple of 48 bytes is output from the error correction signal adder.
[0038]
At this time, the CPU (not shown) determines the minimum two-dimensional code size (can be expressed) according to the output data size, and stores it in a register (not shown). The arrangement address generator 510 reads the value of this register and uses it for address generation. The detailed operation of this arrangement address generator will be described later.
[0039]
Next, the data input in the block generator 503 is divided into blocks each having n bits (block division). If there is data less than n bits at the end of the data, padding bits are added to make it n bits. When n = 8 as in this embodiment, it is not necessary to add padding bits.
[0040]
Next, the data block-formed every n bits is converted into a color signal CMY by a color signal generator 504. When the color signal generator 504 receives n-bit data, it reads CMY data from the reference pattern memory using the value as an address, and outputs CMY data. The contents of the reference pattern memory are the same as those in the reference pattern table shown in FIG.
[0041]
The CMY data output from the color signal generator 504 is input to the black signal generator 505, UCR / UCA converted, and output as a C'M'Y'K signal. For example, UCR / UCA conversion is performed by the following formula.
[0042]
[Expression 1]
Figure 0004588916
Here, min () is a function that selects the minimum value. 2 ^ n indicates 2 to the nth power. When n = 8, the value is 256.
[0043]
The C′M′Y′K data obtained by the conversion in this way is output to the image memory 506 where it is temporarily stored.
[0044]
The address to be stored in the image memory is determined so that the arrangement address generator 510 realizes the above algorithm 1 and operates as follows.
[0045]
Each time a data block is output from the block generator 503, I and J are incremented. K and L are calculated from J, and a small area 201 in which data is arranged is determined. If K and L have only values of 0 and 4, J is incremented and K and L are recalculated. Also, position number M where color data is arranged is determined by I. The arrangement address generator 510 reads the position of the cell 103 arranged in the small area 201 from the arrangement memory 511 storing the arrangement position of FIG. The address of the image memory in which C′M′Y′K data is to be stored is calculated from the read cell position and the above K and L.
[0046]
After the input data has been written in this manner, an operation of writing the reference pattern data is performed.
[0047]
First, the color signal generator 504 reads CMY data from the reference pattern memory in the order of addresses. And this operation is performed 4 times. The CMY data read in this way is converted into C′M′Y′K data by the black signal generator 505, and then the address in the image memory designated by the arrangement address generator (Reg (shown in FIG. 2) 0,0), Reg (4,0), Reg (0,4), and cell position in Reg (4,4)). Further, the surrounding black and white pattern is generated by the black signal generator and written to the image memory.
[0048]
After the writing to the image memory is completed in this way, the data is corrected by the gamma corrector 507 using, for example, a gamma curve as shown in FIG. 6 to print the C'M'Y'K data. After gradation processing is performed for printing by the device 508, printing is performed on paper or the like. Gradation processing varies depending on the type of printer engine, but (multi-value) dither, (multi-value) error diffusion, etc. are performed. In the case of a color laser printer, it is possible to reproduce multiple gradations with a single dot, and usually a multi-value dither in a small area is adopted. In the case of an ink jet printer, two-tone error diffusion is performed when the ink has only one density for each color. In particular, three-tone error diffusion is used in the inkjet method using additional light color ink. Compared with 2-tone error diffusion, 3-tone error diffusion is superior in graininess at the time of printing, and the average density can be expressed in a small area as shown in FIG. This has the effect that when the data of each cell is sampled at the time of reading the two-dimensional code, the area to be sampled can be small, so that the processing can be performed at high speed.
[0049]
Next, a reader for decoding the two-dimensional code printed in this way will be described with reference to FIG.
[0050]
First, a two-dimensional code printed on paper or the like is read by the scanner 701. In this case, since the two-dimensional code is color-printed, it is necessary to perform full-color reading of 8 bits for each RGB color.
[0051]
The gamma converter 702 performs gamma conversion on the image data read in this way. This gamma conversion is so-called LOG conversion and means conversion from reflectance data to density data. As a result, the linearity of the data is improved in the color correction processing described later, so that the accuracy of color correction is improved and the reading accuracy is improved.
[0052]
After performing gamma conversion in this way, a region extractor 703 extracts a two-dimensional code region. A detailed configuration of the region extractor 703 is shown in FIG. Here, the gamma-converted image is first input to the image reducer 801.
[0053]
It is assumed that the image reducer 801 has a circuit configuration that realizes the flowchart of FIG. Here, first, only the image green is used, and the image is blocked in units of 8 × 8 pixels. Next, after performing an OR operation on all pixel values in the block, binarization is performed with a predetermined threshold. In this process, the black and white alternating cells around the two-dimensional code are converted to black lines, and the read two-dimensional code becomes a closed region surrounded by a black frame.
[0054]
The closed region is detected by the closed region detector 802 for the binary image output from the image reducer 801. This closed area detection is for recognizing a closed area by tracking the boundary of black and white pixels in a binary image, and recognizing the closed area as a two-dimensional code candidate area when the area is rectangular. A detailed flowchart of this closed region detection is shown in FIG. 11 (details will be described later).
[0055]
Returning to FIG. 9, the region mapper 803 maps the extracted closed region to the original scanned RGB image and outputs it, and thereafter, reads the two-dimensional code from the data thus obtained.
[0056]
Since the two-dimensional code candidate area can be extracted in this way, it is necessary to set the reading pixel position next in order to sample the value of each cell. This is performed by the read pixel position setting unit 713. Since the two-dimensional code is standardized as shown in FIG. 1, the number of horizontal and vertical cells can be obtained by counting the black and white alternating patterns around the two-dimensional code.
[0057]
After the size of the two-dimensional code is detected in this way, the center of each cell is obtained. FIG. 12 shows sampling points in this case. Each square drawn with a solid line corresponds to each cell 103 of the two-dimensional code. Each broken line is a straight line passing through the center of each cell, and a portion where the broken lines intersect is a point to be sampled. Since the size (number of pixels) of the two-dimensional code is detected as described above, the position where the broken line is drawn is determined accordingly.
[0058]
After the sampling points are determined in this way, the image data reader 705 and the reference pattern reader 710 read 3 × 3 pixel data centered on the center coordinates from the RGB image data, and take the average thereof. . The reference pattern memory 714 has the same configuration as the reference pattern memory 509, and the arrangement memory 712 and the arrangement address generator 704 have the same configuration as the arrangement memory 511 and the arrangement address generator 510, respectively.
[0059]
Here, 3 × 3 pixel data is read and averaged in order to read the exact color of each cell, and in particular, it was printed by an ink jet printer with a relatively small number of print gradations per pixel. This is effective in the case of a two-dimensional code. In addition, when reading a two-dimensional code printed by an inkjet method using two-tone error diffusion of one color and one density, an accurate cell must be read in a slightly larger area, for example, a 5 × 5 or 9 × 9 pixel range. The color may not be read.
[0060]
Data read by the reference pattern reader 710 is processed by a color correction parameter generator 711 and stored as a color correction parameter.
[0061]
Since there are four reference patterns in one two-dimensional code as described above, four of the same color are acquired. The average is defined as Ri, Gi, Bi (i = 0 to 255). The table is created as shown in FIG. 13 by associating the value with the CMY value stored in the reference pattern memory.
[0062]
Using this table, the color corrector 706 corrects the color of each cell of the two-dimensional code read by the image data reader 706, and outputs Rc, Gc, and Bc. As a color correction method, for example, a triangular prism interpolation method (see Japanese Patent No. 2899461) is practical because it is fast and accurate.
The color data color-corrected by the color corrector 706 is converted by the data converter 707 into the original n-bit block data. That is, it is determined which color data Rc, Gc, Bc is closest to the color represented by each CMY stored in the reference pattern memory. The determination method is to select CMY having the shortest distance between two coordinates (Rc, Gc, Bc) and (C, M, Y).
[0063]
When CMY is selected in this way, an address corresponding to the CMY is stored in the reference pattern memory, so that the data converter 707 outputs an n-bit value corresponding to the address. In this way, the error code is corrected by the error corrector 708 in the data converted into the original n-bit data. Since the method of adding an error correction signal is known, it is easy to correct the error. If the number of errors exceeds the error correction capability, reading the 2D code in this case will fail.
[0064]
If there is no error or the error can be corrected by this error correction processing, the error correction signal added at the time of generating the two-dimensional code is removed from the data, and only the data having the original information is output. The data is decompressed by the decompressor 709 to obtain the original data. Since the data size information is added at the time of data compression as described above, only the portion corresponding to the data size needs to be used at the time of data decompression.
[0065]
As described above, the two-dimensional code is read and the original data is restored.
[0066]
A two-dimensional code creation method according to an embodiment of the present invention will be described below.
[0067]
FIG. 14 is a flowchart of the two-dimensional code creation method.
[0068]
First, the data to be embedded in the two-dimensional code (to be expressed by the two-dimensional code) is input in step S1001, and then in step S1002, the data is compressed, and the compressed data size information is added to the head of the data. To do. For this compression, an efficient compression method such as LZH or LZW is employed.
[0069]
After data compression, an error correction signal is added in step S1003. The error correction method is capable of block error correction, and specifically uses a Reed-Solomon code that is widely used. First, the data is divided into 8-bit code words, a 32-word error correction code is generated for 16-word data, and 48-word data is generated for convenience. If the end of the input data is less than 16 words, a padding word is added to form 16 words.
[0070]
In step S1004, the data with the error correction signal added is blocked in units of n bits. The detailed flow of blocking is shown in FIG. The process of FIG. 15 is the step S1101 for inputting the n-bit data string, the step S1102 for determining whether or not the n bit was actually inputted, the step S1103 for adding the padding bit when the n bit could not be inputted, and the n bit It comprises step S1104 for outputting data and step S1105 for determining the end of data.
[0071]
Next, a color signal is generated from the data blocked every n bits. Details of the color signal generation step S1005 are shown in FIG. In this process, step S1201 for inputting n-bit data, step S1202 for reading out the value of CMY from the reference pattern memory using the value of the n-bit data as an address, step S1203 for outputting CMY data, and determining the end of data. It consists of step S1204.
[0072]
After the color signal generation, black signal generation and UCR / UCA conversion are performed in black signal generation and UCR / UCA conversion step S1006. The details are shown in the flowchart of FIG. This process is step S1301 for inputting CMY data, step S1302 for generating a black signal from CMY data, and generating a C'M'Y 'signal by performing UCR / UCA processing using the black signal K and CMY signal. Step S1303, Step S1304 for generating a placement address, Step S1305 for outputting CMYK data to the placement address of the image memory, and Step S1306 for determining the end of the data.
[0073]
In the black signal generation step S1302, K is generated using the minimum value of CMY. In step S1303 for performing UCR / UCA processing, the processing of the above mathematical formula (Equation 1) is performed. In step S1304, the algorithm 1 is executed to calculate the arrangement address.
[0074]
Next, in a gamma correction step S1007 in FIG. 14, for example, gamma correction is performed on the image data using a gamma curve that matches the characteristics of the printer as shown in FIG. The data subjected to gamma correction is subjected to gradation processing in printing step S1008, and the image of the two-dimensional code obtained in this way is printed on paper or the like.
[0075]
Although the gradation processing differs depending on the type of printer engine, as described above, (multi-value) dither, (multi-value) error diffusion, and the like are performed. In the case of a color laser printer, it is possible to reproduce multiple gradations with one dot, and usually multi-value dither is used in a small area. In the case of an ink jet printer, two-tone error diffusion is performed when the ink has only one density for each color. In particular, the inkjet method using additional light-colored ink uses three-tone error diffusion. Compared with 2-tone error diffusion, 3-tone error diffusion is superior in graininess at the time of printing, and the average density can be expressed in a small area as shown in FIG. This has the effect that when the data of each cell is sampled at the time of reading the two-dimensional code, the area to be sampled can be small, so that the processing can be performed at high speed.
[0076]
Next, a reading method for decoding the two-dimensional code printed in this way will be described.
[0077]
FIG. 18 is a flowchart showing this method.
[0078]
This method consists of an image input step S1501 for reading a two-dimensional code printed on paper using a scanner, a gamma conversion step S1502 for converting the read image into a log, and extracting a two-dimensional code area from the gamma-converted image data. Area extraction step S1503, reading pixel position setting step S1504 for setting a reading pixel position for the extracted area, reference pattern acquisition step S1505 for acquiring a reference pattern from image data using the set reading pixel position Color correction parameter creating step S1506 for creating a color correction parameter from the reference pattern, code data obtaining step S1507 for obtaining code data from image data using the read pixel position, and color correction step S1508 for performing color correction on the obtained code data , Original from color corrected data Data conversion step S1509 for acquiring n-bit data, error correction step S1510 for correcting the converted data error and acquiring only necessary information data, decompression step S1511, decompressing the obtained information data, decompressing and restoring Step S1512 for outputting the processed data.
[0079]
As described above, in step S1501, the two-dimensional code is color-printed, so full-color reading of 8 bits for each RGB color must be performed. Then, gamma conversion is performed on the read image data in gamma conversion step S1502. This gamma conversion is so-called log conversion, which is conversion from reflectance data to density data. As a result, the linearity of the data is improved in color correction described later, so that the accuracy of color correction is improved and the code reading accuracy is improved.
[0080]
After gamma conversion, a region of a two-dimensional code is extracted in region extraction step S1503. FIG. 19 shows a detailed flowchart of this region extraction step. Here, the gamma-converted image is first processed in image reduction step S1601. The image reduction step S1601 is further broken down into steps in the flowchart of FIG.
[0081]
In the process of FIG. 10, only green of the image is used, and the image is blocked in units of 8 × 8 pixels (step S1701). Next, after performing a logical OR operation on all pixel values in the block (step S1702), the value obtained in this way is binarized with a predetermined threshold (step S1703). With this process, the black and white alternating cells around the 2D code are converted to black lines, and the 2D code becomes a closed region surrounded by a black frame.
[0082]
Returning to FIG. 19, the closed region is detected in the closed region detection step S1602 for the binary image obtained in the image reduction step S1601 in this way. A detailed flowchart of this closed region detection is shown in FIG. In the closed area detection process, black pixels are detected in the binary image (step S1803), the boundary of the monochrome pixels is tracked (step S1804), and after returning to the tracking start point (step S1805), the area is rectangular ( In step S1806), the closed region is recognized as a two-dimensional code candidate region (step S1807).
[0083]
Next, in region mapping step S1603 in FIG. 19, the extracted closed region is mapped and output to the original scanned RGB image, and thereafter, the two-dimensional code is read.
[0084]
Next, returning to FIG. 18, since the two-dimensional code candidate region can be extracted in this way, next, the reading pixel position is set in order to sample the value of each cell.
This process is performed in reading pixel position setting step S1504.
[0085]
Since the two-dimensional code is standardized as shown in FIG. 1, the number of cells horizontally and vertically can be obtained by counting the black and white alternating patterns around the two-dimensional code. After the size of the two-dimensional code is known in this way, the center of each cell is obtained.
[0086]
FIG. 12 shows sampling points for this purpose. As described above, a square drawn with a solid line corresponds to each cell 103 of the two-dimensional code, a broken line is a straight line passing through the center thereof, and a point where the broken lines intersect is a sampling point.
[0087]
After the points to be sampled are determined in this way, 3 × 3 pixel data centered on the coordinates are read from the RGB image data at the code data acquisition step S1507 and the reference pattern acquisition step S1505, and the average is obtained.
[0088]
Here, as described above, the 3 × 3 pixel data is read and averaged in order to detect the accurate color of the cell, and is particularly effective in the case of the ink jet system. In addition, when reading a two-dimensional code printed by an inkjet method using two-tone error diffusion of one color and one density, an accurate cell must be read in a slightly larger area, for example, a 5 × 5 or 9 × 9 pixel range. The color may not be read.
[0089]
The data read in the reference pattern acquisition step S1505 in this way is processed in the color correction parameter creation step S1506 and stored as a color correction parameter. FIG. 20 shows a flowchart of this process. Since there are four reference patterns in one two-dimensional code, four types of the same color can be acquired. The average of them is Ri, Gi, Bi (i = 0 to 255) (step S2001). A table as shown in FIG. 13 is created by associating the value with the CMY value stored in the reference pattern table (FIG. 4) (steps S2002 and S2003).
[0090]
Then, using this table, in the color correction step S1508, the color of the cell of the two-dimensional code read in the code data acquisition step S1507 is corrected, and Rc, Gc, and Bc are output. As a color correction method, for example, the triangular prism interpolation method (Japanese Patent No. 2899461) as described above is practical because it is fast and accurate.
[0091]
The color data color-corrected in the color correction step S1508 is converted into the original n-bit block data in the data conversion step S1509. That is, it is determined which color data Rc, Gc, Bc is closest to the color represented by each CMY stored in the reference pattern table. As the determination method, for example, a method of selecting CMY having the shortest distance between two coordinates (Rc, Gc, Bc) and (C, M, Y) is employed. When CMY is selected in this way, the corresponding address is stored in the reference pattern table, and its value is obtained in the data conversion step S1509.
[0092]
In this way, the data converted into the original n-bit data is corrected in error code in error correction step S1510. Since the method of adding an error correction signal is known, it is easy to correct the error. If the number of errors exceeds the error correction capability, reading the two-dimensional code will fail.
[0093]
As a result of the error correction processing, if there is no error or the error can be corrected, the error correction signal added at the time of generating the two-dimensional code is removed from the data, and only the data having the original information is output. The data is decompressed at decompression step S1511 to obtain the original data. Since data size information is added at the time of data compression, only the data portion needs to be used at the time of data decompression.
[0094]
As described above, the two-dimensional code is read and the original data is restored.
[0095]
Next, FIG. 21 shows a system configuration of another embodiment of the present invention.
[0096]
In FIG. 21, a disk (information recording medium) of a disk device 1902 (a hard disk device, a floppy disk device, a CD-ROM drive device, etc., which may be included in the PC 1901) has a two-dimensional code of the present invention. A program for realizing the generation method and 2D code reading method on the PC1901 is stored. When generating a 2D code or reading a 2D code, the program is loaded into the PC1901 memory (RAM, etc.) and the CPU Executed by.
[0097]
When a two-dimensional code generation program is executed, a two-dimensional code is generated by the above two-dimensional code generation method from data stored in the disk device 1902 or received from the network, and a color laser printer 1904 or a color inkjet printer is generated. Printing is performed at 1905.
[0098]
When the two-dimensional code reading program is executed, the scanner 1903 scans the paper or the like on which the two-dimensional code is printed, and the image data thus input is read by the PC 1901 as described above. Thus, the original data is restored and stored in the disk device 1902, executed on the PC 1901, or transmitted to another terminal via the network.
[0099]
  In addition,StructureAs a result, the following can be considered.
[0100]
  Configuration 1: Dividing means for dividing information expressed in digital format into blocks each having n (n> 1) bits;
  N-bit data for each block aboveTArrangement means for arranging each element of the two-dimensional matrix;
  Image forming means for converting each element of the two-dimensional matrix into a color corresponding to n-bit data and forming an image to be printed from the two-dimensional matrix;
  A two-dimensional code generating device configured with printing means capable of printing the image using a plurality of color materials,
  The two-dimensional code generation device, wherein the arrangement means arranges predetermined values in advance at a plurality of predetermined element positions in the two-dimensional matrix.
[0101]
Configuration 2: The two-dimensional code generation apparatus according to Configuration 1, wherein the placement unit includes an element position where a predetermined value is placed in advance and an element position storage unit which stores the predetermined value.
[0102]
Configuration 3: The two-dimensional code generation device according to Configuration 1, wherein a value to be arranged at the predetermined element position in advance is random.
[0103]
Configuration 4: The two-dimensional code generation device according to Configuration 1, wherein the printing unit performs printing using four color materials of cyan, magenta, yellow, and black.
[0104]
Configuration 5: The dimensional code generation device according to Configuration 4, wherein the printing unit replaces the color material to be used with a single black color when an instruction to print with achromatic colors using cyan, magenta, and yellow is given.
[0105]
Configuration 6: The two-dimensional code generation device according to Configuration 4, wherein the printing unit performs printing using two color materials having different densities for at least one color.
[0106]
  Configuration 7: a division stage for dividing information expressed in digital format into blocks each having n (n> 1) bits;
  N-bit data for each block aboveTAn arrangement stage for arranging each element of the two-dimensional matrix;
  An image forming step of converting each element of the two-dimensional matrix into a color corresponding to the n-bit data and forming an image to be printed from the two-dimensional matrix;
  A two-dimensional code generation method comprising a printing stage for printing the image using a plurality of color materials,
  2. The two-dimensional code generation method according to claim 1, wherein the arranging step includes a step of arranging a predetermined value in advance at a plurality of predetermined element positions in the two-dimensional matrix.
[0107]
Configuration 8: The two-dimensional code generation method according to Configuration 7, wherein the placement step includes a step of reading data from an element position storing a predetermined value in advance and an element position storage memory storing the predetermined value.
[0108]
Configuration 9: The two-dimensional code generation method according to Configuration 7, wherein a value to be placed in advance at a predetermined element position is random.
[0109]
Configuration 10: The two-dimensional code generation method according to Configuration 7, in which printing is performed using four color materials of cyan, magenta, yellow, and black in the printing stage.
[0110]
Configuration 11: The two-dimensional code generation method according to Configuration 10, wherein, in the printing step, when an instruction is given to print with achromatic colors using cyan, magenta, and yellow, the color material to be used is replaced with a single black color.
[0111]
Configuration 12: The two-dimensional code generation method according to Configuration 10, wherein in the printing step, at least one color is printed using two color materials having different densities.
[0112]
Configuration 13: A fixed or detachable information recording medium readable by a computer on which a program for executing any two-dimensional code generation method of configurations 7 to 12 is executed by a computer.
[0113]
  Configuration 14: A program for executing the two-dimensional code generation method according to any one of Configurations 7 to 12 on a computer.
According to the above configurations 1 and 7, when printing a two-dimensional color code, a color reference is set by providing a reference color pattern (a pattern with a predetermined value arranged at the predetermined element position). Therefore, accurate color reading can be performed for the two-dimensional color code. This makes it possible to use multi-tone colors practically, and as a result, the amount of data embedded in the two-dimensional code can be dramatically increased.
According to the configurations 2 and 8, the reference color pattern is determined and stored in advance, so that compatibility with a two-dimensional code reading system can be easily obtained.
According to the above-described configurations 3 and 9, it is possible to reduce the deviation of the printing density of the printing means and reduce the reading error of the two-dimensional code.
According to the configurations 4 and 10 described above, a normal inkjet printer, laser printer, or thermal printer can be used, and the color two-dimensional code according to the present invention can be printed without preparing a special printing device. become.
According to the configurations 5 and 11, it is possible to easily reproduce achromatic colors and improve the reading accuracy of the two-dimensional code, and to reduce the consumption of the color material.
According to the configurations 6 and 12 described above, it is possible to easily read the two-dimensional code by suppressing local color change due to gradation processing such as dithering and error diffusion.
According to the configuration 13, the program for executing the dimension code generation method according to the present invention on a computer can be stored and saved.
[0114]
【The invention's effect】
  According to the first, second, and third aspects of the present invention, a predetermined value is arranged in a predetermined position of the matrix in advance, so that the element has a predetermined color corresponding to the value and is printed. When read later, it can be used as a reference for a color that contains the original information. Therefore, even if the color that is specifically printed or read varies depending on the situation of the printing means, the reading means, etc., it can be corrected with the reference color as a reference, and accurate reading is possible.
[Brief description of the drawings]
FIG. 1 is a diagram for explaining a typical pattern of an example of a two-dimensional code of the present invention.
FIG. 2 is a diagram for explaining the configuration of the two-dimensional code shown in FIG. 1;
FIG. 3 is a diagram showing a cell arrangement pattern in each small region constituting the two-dimensional code shown in FIG. 1;
FIG. 4 is a diagram illustrating an example of a reference pattern table used for generating and reading a two-dimensional code according to the present invention.
FIG. 5 is a block configuration diagram of an embodiment of the two-dimensional code generation apparatus of the present invention.
FIG. 6 is a graph for explaining an example of gamma conversion.
FIG. 7 is a diagram illustrating a difference in printing state when printing is performed by an ink jet printer with or without light color ink.
FIG. 8 is a block diagram of a two-dimensional code reading apparatus according to an embodiment of the present invention.
9 is a block configuration diagram of the region extractor shown in FIG. 8. FIG.
FIG. 10 is a diagram illustrating a flowchart of image reduction processing according to the present invention.
FIG. 11 is a flowchart of closed region detection processing according to the present invention.
FIG. 12 is a diagram for explaining a reading position of a two-dimensional code.
FIG. 13 is a diagram showing an example of a color correction parameter table created by the two-dimensional code reading process of the present invention.
FIG. 14 is a flowchart of a two-dimensional code generation method according to the present invention.
FIG. 15 is a diagram illustrating a flowchart of n-bit blocking processing of data according to the present invention.
FIG. 16 is a flowchart of color signal generation processing according to the present invention.
FIG. 17 is a diagram illustrating a flowchart of black signal generation and UCR / UCA conversion processing according to the present invention.
FIG. 18 is a flowchart of a two-dimensional code reading method according to the present invention.
FIG. 19 is a diagram showing a flowchart of region extraction processing of the present invention.
FIG. 20 is a flowchart of color correction parameter creation processing according to the present invention.
FIG. 21 is a diagram showing a configuration using a personal computer capable of realizing the two-dimensional code generation method and the reading method of the present invention.
[Explanation of symbols]
503 Blocker
504 color signal generator
505 Black signal generator
506 Image memory
509 Reference pattern memory
510 Placement Address Generator
511 Placement memory

Claims (4)

マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、
前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された2次元コードの画像データを処理する2次元コード読み取り装置であって、
前記2次元コードの領域を抽出する領域抽出手段と、
前記2次元コードの領域に対し読み取り画素位置を設定する読み取り画素位置設定手段と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り手段とを含む2次元コード読み取り装置。
Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory And image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image,
The arrangement unit arranges the arranged data at the arrangement address generated by the arrangement address generation unit, arranges a predetermined color at a plurality of predetermined element positions in the matrix, and sets a reference pattern. generated and, a two-dimensional code reading apparatus for processing image data of the two-dimensional code generated by the image generating device for generating image data of the two-dimensional code including the reference pattern,
A region extracting means for extracting a region of the two-dimensional code;
Reading pixel position setting means for setting a reading pixel position with respect to the area of the two-dimensional code;
A two-dimensional code reading device including reference pattern reading means for obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、
前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された2次元コードの画像データを処理する2次元コード読み取り装置であって、
前記2次元コードの領域を抽出する領域抽出段階と、
前記2次元コードの領域に対し読み取り画素位置を設定する読み取り画素位置設定段階と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り段階とを含む2次元コード読み取り方法。
Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory And image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image,
The arrangement unit arranges the arranged data at the arrangement address generated by the arrangement address generation unit, arranges a predetermined color at a plurality of predetermined element positions in the matrix, and sets a reference pattern. generated and, a two-dimensional code reading apparatus for processing image data of the two-dimensional code generated by the image generating device for generating image data of the two-dimensional code including the reference pattern,
A region extracting step of extracting a region of the two-dimensional code;
A reading pixel position setting step for setting a reading pixel position with respect to the area of the two-dimensional code;
A two-dimensional code reading method including a reference pattern reading step of obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
マトリクスの各要素にランダムに、配置する順である番号を付与し、配置位置を記憶した配置メモリと、前記配置メモリから配置されるデータの配置アドレスを生成する配置アドレス生成手段とからなる配置手段と、前記マトリクスの各要素を、前記データに応じた色に変換してマトリクス画像を形成する画像形成手段とを有し、
前記配置手段は,前記配置されるデータを、前記配置アドレス生成手段で生成された配置アドレスに配置し、マトリクス内にある複数の所定の要素位置には、所定のを配置してリファレンスパターンを生成し、当該リファレンスパターンを含む2次元コードの画像データを生成する画像生成装置により生成された画像データを処理する2次元コード読み取り方法をコンピュータに実行させる2次元コード読み取りプログラムであって、コンピュータに、
前記2次元コードの領域を抽出する領域抽出段階と、
前記2次元コードの領域に対して読み取り画素位置を設定する読み取り画素位置設定段階と、
読み取り画素位置に基づいて特定されたサンプリング点を中心とする画素データの平均値を求めるリファレンスパターン読み取り段階とを実行させる2次元コード読み取りプログラム。
Arrangement means comprising: an arrangement memory that randomly assigns numbers in the order of arrangement to each element of the matrix, stores arrangement positions, and arrangement address generation means that generates arrangement addresses of data arranged from the arrangement memory And image forming means for converting each element of the matrix into a color corresponding to the data to form a matrix image,
The arrangement unit arranges the arranged data at the arrangement address generated by the arrangement address generation unit, arranges a predetermined color at a plurality of predetermined element positions in the matrix, and sets a reference pattern. generated and, a two-dimensional code reading program for executing a 2-dimensional code reading method of processing image data generated by the image generating device for generating image data of the two-dimensional code including the reference pattern to a computer, the computer In addition,
A region extracting step of extracting a region of the two-dimensional code;
A reading pixel position setting step of setting a reading pixel position with respect to the area of the two-dimensional code;
A two-dimensional code reading program for executing a reference pattern reading step for obtaining an average value of pixel data centered on a sampling point specified based on a reading pixel position.
請求項3に記載のプログラムを格納した、コンピュータによって読み取り可能な固定あるいは着脱可能な情報記録媒体。  A computer-readable fixed or detachable information recording medium storing the program according to claim 3.
JP2001137612A 2001-05-08 2001-05-08 Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium Expired - Fee Related JP4588916B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001137612A JP4588916B2 (en) 2001-05-08 2001-05-08 Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001137612A JP4588916B2 (en) 2001-05-08 2001-05-08 Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium

Publications (2)

Publication Number Publication Date
JP2002334297A JP2002334297A (en) 2002-11-22
JP4588916B2 true JP4588916B2 (en) 2010-12-01

Family

ID=18984696

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001137612A Expired - Fee Related JP4588916B2 (en) 2001-05-08 2001-05-08 Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium

Country Status (1)

Country Link
JP (1) JP4588916B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007138698A1 (en) * 2006-05-31 2007-12-06 Global Peace And Environment Center, Inc. Information display memory mark
US8113432B2 (en) 2006-07-19 2012-02-14 B-Core Inc. Apparatus for recognizing an optical recognition code in which a code symbol of a 1-dimensional color bit code indicative of certain data is divided into a plurality of code symbols
JP4766069B2 (en) * 2008-05-07 2011-09-07 株式会社デンソーウェーブ 2D information code display method
JP5218281B2 (en) * 2009-05-26 2013-06-26 株式会社デンソーウェーブ Information code reader
JP5907823B2 (en) * 2012-06-29 2016-04-26 シャープ株式会社 Cooker
JP5904889B2 (en) * 2012-06-29 2016-04-20 シャープ株式会社 Information processing device
JP2017123675A (en) * 2017-02-21 2017-07-13 パイオニア株式会社 Imaging apparatus and image processing method
CN110348554B (en) * 2019-07-17 2023-10-27 北京迈格威科技有限公司 Digital information encoding and decoding methods, devices, electronic equipment and storage media

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5369261A (en) * 1992-02-12 1994-11-29 Shamir; Harry Multi-color information encoding system
JPH10283446A (en) * 1997-04-08 1998-10-23 Nippon I D Tec Kk Multicolor recording type matrix code recording sheet
JPH11353436A (en) * 1998-06-04 1999-12-24 Toyota Central Res & Dev Lab Inc Representation code and its coding method

Also Published As

Publication number Publication date
JP2002334297A (en) 2002-11-22

Similar Documents

Publication Publication Date Title
JP3813387B2 (en) Information embedding method and apparatus, and recording medium
JP3923796B2 (en) Two-dimensional code, two-dimensional code creation method, two-dimensional code decoding method, apparatus for executing the method, program for executing the method on a computer, and computer-readable recording medium recording the program
JP5395286B2 (en) Two-dimensional color barcode, two-dimensional color barcode generation method and program
JP4732488B2 (en) Image processing apparatus, image forming apparatus, image reading apparatus, image processing method, image processing program, and computer-readable recording medium
US7308155B2 (en) Image processing apparatus, image processing method, image processing program, and storage medium
JP5558767B2 (en) Image processing apparatus and processing method thereof
US7844120B2 (en) Method and device for compressing image data
CN101253760B (en) Image processing apparatus and method thereof
CN101800827B (en) Apparatus and method
JP4861967B2 (en) Image processing apparatus, image processing method, image processing program, image forming apparatus, and storage medium
JP2004228811A (en) Image processor, image processing method and program for computer to perform execution
US5231482A (en) Image filing apparatus and method for thereby encoding and storing various documents
US12219112B2 (en) Information processing apparatus, image processing method, and medium
US7215440B2 (en) Fast interpolation of large color lookup tables
JP4588916B2 (en) Two-dimensional code reading device, two-dimensional code reading method, two-dimensional code reading program, and computer-readable recording medium
CN101123663B (en) Image processing device and method
JP2004007410A (en) Decoding method of data encoded in monochrome medium
JP3346051B2 (en) Image processing device
JP2000295469A (en) Image forming device
JP4109793B2 (en) Image processing apparatus and method
JP2020043461A (en) Image processing system and image processing method, and program
JP2010200018A (en) Encoder, decoder, image forming apparatus, image reader, encoding method, decoding method, program, and recording medium thereof
JP5606223B2 (en) Image processing apparatus and processing method thereof
CN101237518A (en) Image processing method and device
JP2003078745A (en) Image processor, image forming device provided with the image processor, image processing method, computer program for executing this image processing method, and computer-readable recording medium for recording the computer program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060925

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20091117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091201

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100511

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100712

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100909

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

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees