JP2001167222A - Error correcting method, method and device for reading two-dimensional code and recording medium - Google Patents

Error correcting method, method and device for reading two-dimensional code and recording medium

Info

Publication number
JP2001167222A
JP2001167222A JP2000220761A JP2000220761A JP2001167222A JP 2001167222 A JP2001167222 A JP 2001167222A JP 2000220761 A JP2000220761 A JP 2000220761A JP 2000220761 A JP2000220761 A JP 2000220761A JP 2001167222 A JP2001167222 A JP 2001167222A
Authority
JP
Japan
Prior art keywords
area
error
dimensional code
error correction
defect
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.)
Pending
Application number
JP2000220761A
Other languages
Japanese (ja)
Inventor
Masahiro Hara
昌宏 原
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 JP2000220761A priority Critical patent/JP2001167222A/en
Publication of JP2001167222A publication Critical patent/JP2001167222A/en
Pending legal-status Critical Current

Links

Landscapes

  • Error Detection And Correction (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve the efficiency of correction when correcting an error in reading a two-dimensional (2D) code. SOLUTION: Error detection using the RS code word of redundant data for error correction is not performed but on the basis of the feature of a 2D code image, a defective code word is estimated as the error position of an encoded block (S1000). By specifying the error position of a code like this way, afterwards, elimination correction is performed for correcting the error only by calculating the size of the error (S1010). On the assumption that a QR code is made random, for example, the defective code word can be selected as a code word composed of only white or black cells.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、2次元コードを読
み取る際、リードソロモン(RS)符号等の誤り訂正符
号を用いて誤り訂正を行う技術に関する。
The present invention relates to a technique for performing error correction using an error correction code such as a Reed-Solomon (RS) code when reading a two-dimensional code.

【0002】[0002]

【従来の技術】従来、2次元コード読取装置は、2次元
コードを画像として取り込み、取り込んだ2次元コード
画像に基づきデコード処理を実行して、2次元コードと
して記録された情報を読み取る。
2. Description of the Related Art Conventionally, a two-dimensional code reader fetches a two-dimensional code as an image, executes a decoding process based on the fetched two-dimensional code image, and reads information recorded as a two-dimensional code.

【0003】最初に2次元コードについて説明する。2
次元コードは、図13(b)に一例を示す如く情報が2
次元的な広がりを持ち、図13(a)に示すバーコード
に比べて格段に大量の情報を記録できるが、構造は複雑
なものとなっている。図13(b)の2次元コードはQ
Rコードと呼ばれ、図14に示す如く、取り込んだ画像
中で2次元コード500の存在位置を特定するための、
特定寸法比率の正方形を組み合わせた位置決め用シンボ
ル510a,510b,510cや、それら3個の位置
決め用シンボル510a,510b,510c相互間に
設けられ、白と黒とが交互に組み合わせられた各データ
セル位置の指標となる基準パターンであるタイミングセ
ル520a,520bを備えている。
[0003] First, a two-dimensional code will be described. 2
As shown in an example of FIG.
Although it has a dimensional spread and can record a much larger amount of information than the barcode shown in FIG. 13A, the structure is complicated. The two-dimensional code in FIG.
An R code, as shown in FIG. 14, is used to specify the position of the two-dimensional code 500 in the captured image.
Positioning symbols 510a, 510b, and 510c combining squares of a specific size ratio, and data cell positions provided between the three positioning symbols 510a, 510b, and 510c, where white and black are alternately combined. And timing cells 520a and 520b, which are reference patterns serving as indices of the above.

【0004】2次元コード500の内部は、n×nの正
方形の升目(これが「セル」に相当する。)に区切られ
ており、QRコードの有する位置決め用シンボル510
a,510b,510cは、例えば、一辺の長さが7セ
ルに相当する黒い正方形512、一辺の長さが5セルに
相当する白い正方形514、一辺の長さが3セルに相当
する黒い正方形516を同心状に重ね合わせた時にでき
る図形である。そのため、この位置決め用シンボル51
0a,510b,510cの中心付近を直線的に横切る
と、黒、白、黒、白、黒のパターンが1:1:3:1:
1の比率で検出される。したがって、この性質を利用し
て、上述した比率で黒と白が交互に検出された場合、そ
のパターンを位置決め用シンボル510a,510b,
510cの有力な候補と判断し、2次元コード500の
存在位置を確定するために優先的に検査する。
The inside of the two-dimensional code 500 is divided into n × n square cells (corresponding to “cells”), and positioning symbols 510 of the QR code are provided.
a, 510b, and 510c are, for example, a black square 512 having a side length of 7 cells, a white square 514 having a side length of 5 cells, and a black square 516 having a side length of 3 cells. Are concentrically superimposed. Therefore, this positioning symbol 51
When crossing the vicinity of the centers of 0a, 510b, and 510c linearly, black, white, black, white, and black patterns are 1: 1: 3: 1:
It is detected at a ratio of 1. Therefore, by utilizing this property, when black and white are alternately detected at the above-described ratio, the pattern is determined by positioning symbols 510a, 510b,
It is determined that the two-dimensional code 500 is a promising candidate, and the two-dimensional code 500 is inspected preferentially to determine the existing position.

【0005】そして、2次元コード500の形状は、3
個の位置決め用シンボル510a,510b,510c
で一義的に決まる平行四辺形の範囲であると推定でき
る。なお、データは、位置決め用シンボルや基準パター
ンなどを除外した情報記録領域530のセル(すなわ
ち、データセル)で表され、各データセルを白(明)あ
るいは黒(暗)に色分けすることにより、各データセル
を1ビットのデータに対応させている。ただし、図14
ではデータセルの白黒のパターンは判り易くするために
省略されている。各データセルの位置は、3個の位置決
め用シンボル510a,510b,510cの中心と2
つのタイミングセル520a,520bを、それぞれ縦
方向と横方向の座標の指標として、簡単な計算により求
めることができる。このように位置が決定した、各デー
タセルの中心付近が黒であるか白であるかを判定して、
黒を例えば1,白を例えば0に対応させることにより、
2値データとして認識でき、解読することができる。
The shape of the two-dimensional code 500 is 3
Positioning symbols 510a, 510b, 510c
It can be estimated that this is a range of a parallelogram uniquely determined by. The data is represented by cells (that is, data cells) of the information recording area 530 excluding the positioning symbols and the reference pattern, and each data cell is color-coded white (bright) or black (dark). Each data cell corresponds to 1-bit data. However, FIG.
In FIG. 3, the black and white pattern of the data cell is omitted for easy understanding. The position of each data cell is the center of three positioning symbols 510a, 510b, 510c and 2
The two timing cells 520a and 520b can be obtained by simple calculations as indices of vertical and horizontal coordinates, respectively. It is determined whether the position near the center of each data cell determined in this way is black or white,
By associating black with, for example, 1 and white with, for example, 0,
It can be recognized as binary data and decoded.

【0006】そして、2次元コード読取装置では、取り
込んだ2次元コード画像に基づくデコード処理に際し、
誤り訂正を行うのが一般的である。これは、2次元コー
ドの一部が破損や汚れによって読み取れない場合であっ
ても、データ解読を可能にする機能である。
In the two-dimensional code reader, decoding processing based on the captured two-dimensional code image
Generally, error correction is performed. This is a function that enables data decoding even when a part of the two-dimensional code cannot be read due to damage or dirt.

【0007】2次元コードには、高度な訂正能力を有す
る誤り訂正符号が用いられるようになってきている。Q
Rコードを例に挙げれば図4に示すように、領域530
がデータブロックと誤り訂正ブロックとに分割され、リ
ード・ソロモン(以下「RS」と記述する。)符号化さ
れている。ここで誤り訂正ブロックは、RS符号化のた
めの冗長データである。なお、データブロック及び誤り
訂正ブロックは、コードワードと呼ばれる8ビットの情
報が一単位となって構成されている。図4に示すD1〜
D46及びE1〜E88で示すそれぞれがコードワード
に対応する。以下、誤り訂正ブロックを「RSブロッ
ク」と記述し、このRSブロックを構成するコードワー
ドを「RSコードワード」と記述する。一方、データブ
ロックを構成するコードワードを「データコードワー
ド」と記述する。
As the two-dimensional code, an error correction code having a high correction capability has been used. Q
Taking the R code as an example, as shown in FIG.
Is divided into a data block and an error correction block, and encoded by Reed-Solomon (hereinafter, referred to as “RS”). Here, the error correction block is redundant data for RS encoding. Note that the data block and the error correction block are configured with one unit of 8-bit information called a codeword. D1 shown in FIG.
Each of D46 and E1 to E88 corresponds to a codeword. Hereinafter, the error correction block is described as an “RS block”, and the codewords constituting the RS block are described as an “RS codeword”. On the other hand, a code word that forms a data block is described as a “data code word”.

【0008】ここで図20に例示するQRコードでは、
D1〜D23のデータコードワードとE1〜E44のR
Sコードワードとからなるブロック1、及びD24〜D
46のデータコードワードとE45〜E88のRSコー
ドワードとからなるブロック2という2つのブロックを
有しており、このブロック1、ブロック2の単位で、R
S符号化がなされており、誤り訂正が行われる。以下、
このブロック1及び2を「符号化ブロック」と呼ぶこと
にする。
Here, in the QR code illustrated in FIG.
Data code words of D1 to D23 and R of E1 to E44
Block 1 consisting of S code words and D24 to D24
46, which is a block 2 composed of 46 data codewords and RS codewords E45 to E88.
S encoding is performed, and error correction is performed. Less than,
These blocks 1 and 2 will be referred to as “encoded blocks”.

【0009】次に、一般的な誤り訂正について説明す
る。誤り訂正には、多項式を用いて誤り位置を検出する
方式(以下「検出訂正」と記述する。)及び消失訂正と
呼ばれる方式の2種類が存在する。検出訂正は、大きく
は以下3つのステップから構成される。
Next, general error correction will be described. There are two types of error correction: a method of detecting an error position using a polynomial (hereinafter referred to as “detection correction”) and a method called erasure correction. The detection and correction roughly includes the following three steps.

【0010】 符号からシンドローム多項式を求める。 シンドローム多項式から誤り位置多項式及び誤り数値
多項式を求める。 誤り位置多項式からチェンサーチ法により誤り位置を
求め、その位置に対する誤りの大きさ(誤りパターン)
を求めて誤り訂正を行う。
[0010] A syndrome polynomial is obtained from the code. An error position polynomial and an error numerical polynomial are obtained from the syndrome polynomial. The error location is found from the error location polynomial by the Chien search method, and the magnitude of the error for that location (error pattern)
Error correction.

【0011】上述したQRコードの例で言えば、符号化
ブロックからシンドローム多項式を求め、シンドローム
多項式から誤り位置多項式及び誤り数値多項式を求め
る。そして、誤り位置多項式から誤り位置としてのコー
ドワードを特定し、そのコードワードの誤りの大きさを
求めて誤り訂正を行うという具合である。
In the example of the QR code described above, a syndrome polynomial is obtained from the coding block, and an error position polynomial and an error value polynomial are obtained from the syndrome polynomial. Then, a codeword as an error position is specified from the error locator polynomial, and error correction is performed by determining the magnitude of the error of the codeword.

【0012】一方、消失訂正は、誤りである符号の位置
(これを消失位置という。)、すなわち誤りのあるコー
ドワードが予め分かっていることを前提として、誤りの
大きさのみを求めて誤り訂正を行うものである。消失訂
正は、大きくは以下3つのステップから構成される。
On the other hand, the erasure correction is performed by obtaining only the magnitude of the error, assuming that the position of the erroneous code (this is referred to as the erasure position), that is, the erroneous codeword is known in advance. Is what you do. Erasure correction is roughly composed of the following three steps.

【0013】符号からシンドローム多項式を求める。 消失位置から得られる消失多項式を用い、シンドロー
ム多項式を修正し、消失数値多項式を求める。 消失位置に対して誤りの大きさを求めて誤り訂正を行
う。
A syndrome polynomial is obtained from the code. Using the erasure polynomial obtained from the erasure position, the syndrome polynomial is corrected to obtain an erasure numerical polynomial. Error correction is performed for the erasure position by determining the magnitude of the error.

【0014】すなわち、消失訂正では、誤り位置が分か
っていることを前提として誤りの大きさのみを求めるた
め、検出訂正と異なり、シンドローム多項式から求める
多項式は消失数値多項式の1つだけとなる。したがっ
て、訂正能力は検出訂正の2倍になる。
That is, in the erasure correction, only the magnitude of the error is obtained on the premise that the error position is known. Therefore, unlike the detection correction, only one erasure numerical polynomial is obtained from the syndrome polynomial. Therefore, the correction capability is twice that of the detection correction.

【0015】例えば、これを上述したQRコードで具体
的に説明すると、上述した検出訂正と消失訂正とでは、
訂正に必要となるRSコードワード(冗長データ)の数
が変わってくる。つまり、検出訂正を行えば、上述した
ように多項式を2つ求める必要があるため、1つのコー
ドワードの訂正に計2つの訂正コードワード(冗長デー
タ)が必要となる。したがって、検出訂正を行う場合、
訂正できるコードワードの総数tが、RSコードワード
(冗長データ)の数をRSとすると、次の式で示され
る。 t=RS/2 …[式1] これに対して、消失訂正を行えば、上述したように多項
式を1つしか求めなくてもよいため、1つのコードワー
ドの訂正に1つのRSコードワードがあれば足りる。し
たがって、消失訂正を行う場合、訂正できるコードワー
ドの総数tは、RSコードワード(冗長データ)の数を
RSとすると、次の式で示される。 t=RS …[式2] このように、RSコードワードの数が同じであっても、
誤っているコードワードが予め特定できれば、消失訂正
を行うことで訂正可能なコードワードの総数は2倍にな
り、その訂正効率が上がることになる。言い換えれば、
訂正可能なコードワード数(訂正能力)を同じにして
も、消失訂正だけを行うのであれば、必要なRSコード
ワードの数は半分で足りる。
For example, when this is specifically explained by the above-mentioned QR code, the above-described detection correction and erasure correction are as follows.
The number of RS code words (redundant data) required for correction changes. That is, if the detection and correction are performed, it is necessary to obtain two polynomials as described above. Therefore, a correction of one codeword requires a total of two correction codewords (redundant data). Therefore, when performing detection and correction,
The total number t of codewords that can be corrected is represented by the following equation, where RS is the number of RS codewords (redundant data). t = RS / 2 ... [Equation 1] On the other hand, if erasure correction is performed, only one polynomial expression may be obtained as described above. Therefore, one RS codeword is corrected for one codeword. If there is enough. Therefore, when performing erasure correction, the total number t of codewords that can be corrected is represented by the following equation, where the number of RS codewords (redundant data) is RS. t = RS ... [Equation 2] Thus, even if the number of RS codewords is the same,
If an erroneous codeword can be identified in advance, the total number of codewords that can be corrected by performing erasure correction doubles, and the correction efficiency increases. In other words,
Even if the number of correctable codewords (correction capability) is the same, if only erasure correction is performed, the required number of RS codewords is half.

【0016】なお、消失訂正において、符号の誤り位置
のいくつかが分かっていない場合、分かっている誤り位
置を消失位置として訂正し、分かっていない誤り位置に
対しては、その誤り位置を検出して誤り訂正することも
できる。この場合、訂正効率は検出訂正の2倍にはなら
ないが、いくつかの消失位置が特定されている分だけ、
検出訂正よりも訂正効率は高くなる。本明細書では、単
に消失訂正という場合には、この訂正手法を含むものと
し、特に区別する場合には、この訂正手法を「消失検出
訂正」と呼ぶ。
In the erasure correction, if some of the error positions of the code are not known, the known error position is corrected as the erasure position, and the error position is detected for the unknown error position. Error correction. In this case, the correction efficiency is not twice as high as the detection and correction, but only a few erasure positions are specified.
The correction efficiency is higher than the detection and correction. In this specification, the term “erasure correction” is used to include this correction method, and when it is particularly distinguished, this correction method is referred to as “erasure detection correction”.

【0017】[0017]

【発明が解決しようとする課題】以上述べたように、消
失訂正処理は訂正能力が検出訂正処理よりも優れている
ものの、誤り位置が予め分かっていることが前提となる
ため、常に同じ位置が汚れる場合には有効な手段である
ものの、いずれの領域に汚れが発生するか予測できない
場合には利用できないという問題がある。そのため、従
来は検出訂正処理のみが行われていたが、この検出訂正
処理では、上記式1のように訂正コードワードの半分の
コードワードしか訂正できないために訂正能力が低くな
り、訂正効率が低くなってしまうという問題がある。
As described above, although the erasure correction processing has a better correction capability than the detection correction processing, it is premised that the error position is known in advance, so that the same position is always used. Although it is an effective means when it becomes dirty, there is a problem that it cannot be used when it is not possible to predict in which area the stain will occur. Therefore, conventionally, only the detection and correction processing was performed. However, in this detection and correction processing, only half the codeword of the correction codeword can be corrected as in the above equation 1, so that the correction capability is reduced and the correction efficiency is reduced. There is a problem that it becomes.

【0018】本発明は、上述した問題点を解決するため
になされたものであり、2次元コードの読み取りにおけ
る誤り訂正において、その訂正効率を向上させることを
目的とする。
The present invention has been made to solve the above-described problem, and has as its object to improve the correction efficiency in error correction in reading a two-dimensional code.

【0019】[0019]

【課題を解決するための手段及び発明の効果】上述した
目的を達成するためになされた請求項1に記載の誤り訂
正方法は、セルの分布パターンによって情報を表現する
2次元コードを画像として取り込み、当該2次元コード
画像に基づいて情報を読み取るにあたり、2次元コード
画像に不具合がある場合には、2次元コードに含まれる
誤り訂正データを用い、2次元コード画像の不具合によ
って生じる誤りを訂正する方法である。
According to the first aspect of the present invention, there is provided an error correction method for capturing a two-dimensional code representing information by a cell distribution pattern as an image. In reading information based on the two-dimensional code image, if there is a defect in the two-dimensional code image, the error caused by the defect in the two-dimensional code image is corrected by using error correction data included in the two-dimensional code image. Is the way.

【0020】ここでいう誤り訂正データは、2次元コー
ドの情報の一部として付加される冗長データを意味し、
この冗長データを用いて、2次元コード全体で、あるい
は、上述したような符号化ブロックの単位で符号化され
ている。また、2次元コード画像の不具合とは、光学情
報記録面に記録された2次元コードの汚れや破損などに
よって2次元コード画像の一部が正しく読み取れなくな
っている状況をいう。このような不具合は、光学情報記
録面に記録された2次元コード自体の汚れや破損に限ら
ず、例えば画像として取り込む過程で生じることも考え
られる。例えば、CCDエリアセンサの視野から読取対
象の2次元コードの一部がはみ出し画像中に2次元コー
ドの一部が画像として取り込まれなかった場合や、光学
情報記録面にて鏡面反射が生じた場合がそれである。
The error correction data referred to here means redundant data added as a part of information of a two-dimensional code,
Using this redundant data, encoding is performed for the entire two-dimensional code or for each encoded block as described above. In addition, the defect of the two-dimensional code image refers to a situation in which a part of the two-dimensional code image cannot be correctly read due to dirt or damage of the two-dimensional code recorded on the optical information recording surface. Such a defect is not limited to dirt or damage to the two-dimensional code itself recorded on the optical information recording surface, but may occur in a process of capturing as an image, for example. For example, when a part of the two-dimensional code to be read out of the field of view of the CCD area sensor protrudes, and a part of the two-dimensional code is not captured as an image in the image, or when specular reflection occurs on the optical information recording surface. That is it.

【0021】本発明では最初に、不具合領域推定処理を
実行する。この不具合領域推定処理では、2次元コード
画像の特徴に基づいて、上述したような不具合がある単
位情報領域を不具合領域として推定する。単位情報領域
は、2次元コードとして記録された情報を構成する単位
となる領域であり、所定ビットで構成される。上記図4
に示したQRコードの例では、8ビットで構成されるコ
ードワードがこれに相当する。不具合領域は、符号の誤
り位置に相当する。つまり、この不具合領域推定処理
は、誤り訂正データを用いた誤り位置の検出に代わるも
のである。
In the present invention, first, a defective area estimation process is executed. In the defect area estimation processing, a unit information area having the above-described defect is estimated as a defect area based on the characteristics of the two-dimensional code image. The unit information area is an area which is a unit constituting information recorded as a two-dimensional code, and is formed of predetermined bits. FIG. 4 above
In the example of the QR code shown in (1), a code word composed of 8 bits corresponds to this. The defective area corresponds to a code error position. That is, this defective area estimation processing replaces the detection of an error position using error correction data.

【0022】そして、次に消失訂正処理を実行する。こ
の消失訂正処理では、不具合領域推定処理にて推定され
た単位情報領域に対し、誤り訂正データを用い、誤り量
を計算して誤り訂正を行う。つまり、本発明では、誤り
訂正データを用いた不具合領域の特定(誤り検出)を行
わず、2次元コード画像の特徴に基づいて不具合領域を
推定するのである。そして、誤りの大きさのみを計算し
て誤りを訂正する消失訂正を行う。その結果、不具合領
域推定処理にて不具合領域が確実に推定されれば、従来
の検出訂正による誤り訂正と比べて、誤り訂正データの
数が従来と同じであった場合、誤り訂正効率は2倍とな
る。逆に、訂正能力を従来と同様にするのであれば、誤
り訂正データの数は従来の半分で足りることになる。こ
れによって、訂正効率を向上させることができる。
Then, an erasure correction process is executed. In the erasure correction process, the error correction is performed on the unit information area estimated in the defective area estimation process by using the error correction data and calculating the amount of error. That is, in the present invention, the defective area is estimated based on the features of the two-dimensional code image without specifying the defective area using the error correction data (error detection). Then, erasure correction for correcting the error by calculating only the magnitude of the error is performed. As a result, if the defect area is reliably estimated by the defect area estimation processing, the error correction efficiency is doubled when the number of error correction data is the same as the conventional error correction by the conventional error correction by detection and correction. Becomes Conversely, if the correction capability is the same as in the conventional case, the number of error correction data is half that in the conventional case. Thereby, the correction efficiency can be improved.

【0023】なお、「不具合領域推定処理にて不具合領
域が確実に推定されれば」としたのは、実際には不具合
があるにもかかわらず、不具合領域と推定されない単位
情報領域が存在する可能性も考えられるからである。し
たがって、従来技術として述べた消失検出訂正を行うよ
うにすることが望ましい。すなわち、請求項2に示すよ
うに、消失訂正処理を、不具合領域推定処理にて推定さ
れた単位情報領域以外の単位情報領域に対し、誤り訂正
データを用い、不具合の有無を検出すると共に誤り量を
計算して誤りを訂正する処理とするとよい。この場合、
不具合領域として推定されなかった単位情報領域につい
ては、誤り訂正データを用いて誤り検出及び訂正が行わ
れる。そのため、不具合領域として推定されなかった単
位情報領域があれば、その分だけ訂正効率は低下する
が、不具合推定処理にて不具合領域が推定される分、従
来の検出訂正に比べれば訂正効率は高くなる。
The reason that "if the defective area is reliably estimated by the defective area estimation processing" is that there is a unit information area that is not estimated as a defective area even though there is actually a defect. It is because sex is also considered. Therefore, it is desirable to perform the erasure detection and correction described in the related art. That is, as described in claim 2, the erasure correction processing is performed on a unit information area other than the unit information area estimated in the defect area estimation processing by using error correction data to detect the presence or absence of a defect and to determine an error amount. May be calculated to correct the error. in this case,
For the unit information area not estimated as the defective area, error detection and correction are performed using the error correction data. Therefore, if there is a unit information area that is not estimated as a defective area, the correction efficiency is reduced by that much, but the correction efficiency is higher than the conventional detection and correction because the defective area is estimated in the defect estimation processing. Become.

【0024】ところで、上述した不具合領域推定処理
は、2次元コード画像の特徴に基づいて不具合領域を推
定するものであればよい。以下に不具合領域推定処理の
具体例を挙げる。ただし、以下に例示する処理に限定さ
れないことは言うまでもない。 (1)2次元コードでは、白・黒のセルがランダムに分
布する場合が多い。したがって、取り込んだ2次元コー
ド画像にも、白・黒のセルがランダムに分布する。この
ような前提に立てば、次のような構成を採用することが
考えられる。
By the way, the above-mentioned defective area estimation processing may be any processing as long as the defective area is estimated based on the characteristics of the two-dimensional code image. A specific example of the defective area estimation processing will be described below. However, it is needless to say that the processing is not limited to the processing exemplified below. (1) In a two-dimensional code, white and black cells are often randomly distributed. Therefore, white and black cells are also randomly distributed in the captured two-dimensional code image. Under such a premise, it is conceivable to adopt the following configuration.

【0025】つまり、上述した不具合領域推定処理を、
白又は黒のいずれか一方のセルが所定割合以上で偏って
分布している所定面積以上の領域を検出し、当該領域に
少なくともその一部が含まれる単位情報領域を不具合領
域として推定する処理とすることが考えられる(請求項
3)。
That is, the above-described problem area estimation processing is performed by
A process of detecting an area having a predetermined area or more in which one of white or black cells is unevenly distributed at a predetermined rate or more, and estimating a unit information area including at least a part of the area as a defective area; (Claim 3).

【0026】ここで所定割合や所定面積は、2次元コー
ドの種類に基づいて例えば実験的に決定できる。一般に
2次元コードを局所的に見れば、白・黒のいずれか一方
のセルが偏って分布している可能性が高い。このセルの
偏り度合いが2次元コードの種類によって異なるため、
適正な状況下で生じるセルの偏りと、2次元コードの汚
れ等によって生じる不適切なセルの偏りとを区別できる
程度の面積・割合を設定すればよい。例えば、不具合が
ない時にコード領域全体の1/4の領域を見ると白又は
黒のセルの偏りが70%を越えることが稀な2次元コー
ドであれば、例えば所定割合80%以上で偏って分布し
ているコード面積の1/4以上の領域を検出するという
具合である。
Here, the predetermined ratio and the predetermined area can be experimentally determined based on the type of the two-dimensional code. Generally, when the two-dimensional code is viewed locally, it is highly likely that one of the white and black cells is unevenly distributed. Since the degree of the cell bias varies depending on the type of the two-dimensional code,
It is sufficient to set an area and a ratio enough to discriminate a cell bias generated under an appropriate situation from an improper cell bias caused by contamination of a two-dimensional code or the like. For example, in the case of a two-dimensional code in which the deviation of white or black cells rarely exceeds 70% when looking at an area of 1/4 of the entire code area when there is no defect, the deviation is biased at a predetermined ratio of 80% or more. In other words, a region of 1 / or more of the distributed code area is detected.

【0027】このようにすれば、2次元コードの汚れ等
によって白であるはずのセルが黒として取り込まれた
り、逆に2次元コードの破損等によって黒であるはずの
セルが白として取り込まれたりした場合に有効である。 (2)QRコードでは、読み取り易くするための工夫と
して、白・黒のセルをランダムに配置するように、適当
なランダムパターンとの排他的論理和をとるランダム化
がなされることがある。したがって、このように故意に
白・黒のセルがランダム化された2次元コードでは、上
記(1)の構成に代えて以下の構成を採用することも考
えられる。
In this way, cells that should be white due to dirt on the two-dimensional code are captured as black, and cells that should be black due to damage to the two-dimensional code are captured as white. It is effective when doing. (2) In the QR code, as a device for making it easier to read, there is a case where randomization is performed by taking an exclusive OR with an appropriate random pattern so that white and black cells are randomly arranged. Therefore, in the two-dimensional code in which the white and black cells are intentionally randomized, the following configuration may be adopted instead of the configuration (1).

【0028】つまり、不具合領域推定処理を、白又は黒
のいずれか一方のセルだけで構成された単位情報領域を
不具合領域として推定する処理とすることが考えられる
(請求項4)。例えばランダム化されたQRコードで
は、図4に示したコードワードである単位情報領域が白
又は黒のいずれか一方のセルだけで構成される確率が約
0.01%位になる。したがって、このような白又は黒
のいずれか一方のセルだけで構成される単位情報領域
は、不具合領域である可能性が極めて高い。このように
すれば、単位情報領域毎に処理することができ、上記
(1)に示したように一定の条件を満たす領域を検出す
る必要がないため、不具合領域推定処理が簡単になると
いう点で有利である。
That is, it is conceivable that the defective area estimation processing is processing for estimating a unit information area composed of only one of white and black cells as a defective area (claim 4). For example, in the randomized QR code, the probability that the unit information area, which is the code word shown in FIG. 4, is composed of only one of white and black cells is about 0.01%. Therefore, such a unit information area composed of only one of the white and black cells is extremely likely to be a defective area. By doing so, processing can be performed for each unit information area, and it is not necessary to detect an area that satisfies certain conditions as shown in (1) above, so that the defective area estimation processing is simplified. Is advantageous.

【0029】(3)また、上記(2)で検出された単位
情報領域に隣接する単位情報領域にも不具合がある可能
性が高い。例えば2次元コードの汚れによって黒のセル
だけの単位情報領域が生じている場合、隣接する単位情
報領域の黒セルの部分もまた、その汚れが原因で白セル
が黒セルとして取り込まれている可能性があるためであ
る。
(3) Also, there is a high possibility that the unit information area adjacent to the unit information area detected in the above (2) has a defect. For example, when a unit information area consisting of only black cells is generated due to dirt of a two-dimensional code, white cells may be captured as black cells due to the dirt in a black cell part of an adjacent unit information area. It is because there is.

【0030】そこで、不具合領域推定処理を、白又は黒
のいずれか一方のセルだけで構成された単位情報領域に
加え、当該単位情報領域に隣接する単位情報領域を不具
合領域として推定する処理としてもよい(請求項5)。
このようにすれば、不具合のある可能性の高い単位情報
領域を確実に推定できる可能性が高くなる。
Therefore, the defective area estimation processing may be performed as processing for estimating a unit information area adjacent to the unit information area as a defective area in addition to a unit information area composed of only one of white and black cells. Good (claim 5).
This increases the possibility of reliably estimating a unit information area that is likely to have a defect.

【0031】(4)ところで、上記(1)〜(3)は、
2値データとして取り込まれた2次元コード画像に基づ
く処理とすることが考えられる。この場合は、例えばC
CDエリアセンサからの走査信号が2値化回路等で
「0」又は「1」の信号に変換されて画像データとされ
る。一方、多値データとして取り込まれた2次元コード
画像に基づく処理とすることが考えられる。2次元コー
ド画像が多値データとして取り込まれる場合、上述した
不具合領域推定処理の中でこの多値データに対し微分処
理などを行い2値化することになる。
(4) By the way, the above (1) to (3)
It is conceivable that the processing is based on a two-dimensional code image captured as binary data. In this case, for example, C
The scanning signal from the CD area sensor is converted into a signal of “0” or “1” by a binarizing circuit or the like, and is converted into image data. On the other hand, processing based on a two-dimensional code image captured as multi-valued data may be considered. When a two-dimensional code image is taken in as multi-valued data, the multi-valued data is binarized by performing a differentiation process or the like on the multi-valued data in the above-described problem area estimation processing.

【0032】しかし、2次元コード画像の不具合によっ
て適正な2値化ができない状況が生じ得る。例えば2次
元コードがグレーのインク等で汚れた場合等、白セルの
部分が白とも黒とも判定できなくなることが考えられ
る。多値データの振幅(レベル変化)が小さくなってし
まうからである。
[0032] However, a situation may occur where proper binarization cannot be performed due to a defect in the two-dimensional code image. For example, when the two-dimensional code is stained with gray ink or the like, it is conceivable that the white cell portion cannot be determined as white or black. This is because the amplitude (level change) of the multi-value data becomes small.

【0033】そこで、2次元コード画像が多値データで
ある場合、不具合領域推定処理を、多値データの適正な
2値化が不可能な振幅部分に対応する領域を検出し、当
該領域に少なくとも一部が含まれる単位情報領域を不具
合領域として推定する処理とすることが考えられる(請
求項6)。
Therefore, when the two-dimensional code image is multi-valued data, the defect region estimation processing detects a region corresponding to an amplitude portion where binarization of the multi-valued data cannot be properly performed, and at least detects the region corresponding to the amplitude portion. It is conceivable that the unit information area including a part is estimated as a defective area (claim 6).

【0034】このようにすれば、適正な2値化ができな
い可能性の高い領域を含む単位情報領域が不具合領域と
して選択される。 (5)なお、2次元コード画像の不具合は、2次元コー
ド自体の汚れや破損だけでなく、2次元コードを画像と
して取り込む過程でも発生することは既に述べた。その
一例として、CCDエリアセンサの視野から読取対象の
2次元コードの一部がはみ出し、画像中に2次元コード
の一部が画像として取り込まれない状況が考えられる。
In this way, a unit information area including an area where it is highly likely that proper binarization cannot be performed is selected as a defective area. (5) As described above, the defect of the two-dimensional code image occurs not only in the case where the two-dimensional code itself is stained or damaged, but also in the process of capturing the two-dimensional code as an image. As an example, a situation can be considered in which a part of the two-dimensional code to be read protrudes from the field of view of the CCD area sensor and a part of the two-dimensional code is not captured as an image in an image.

【0035】このような状況を考えると、不具合領域推
定処理を、2次元コード画像に2次元コードの一部の領
域が写っていない場合、当該領域に少なくともその一部
が含まれる単位情報領域を不具合領域として推定する処
理とすることが考えられる(請求項7)。
In consideration of such a situation, when the defect area estimation processing does not include a part of the two-dimensional code in the two-dimensional code image, the unit information area including at least a part of the two-dimensional code is determined. It is conceivable to perform a process of estimating it as a defective area (claim 7).

【0036】この場合は、画像中に写っている部分を特
定すれば、写っていない領域が分かり、その領域に少な
くともその一部が含まれる単位情報領域が分かる。この
単位情報領域は、画像中に少なくとも一部が写っていな
いものであるため、不具合領域としてもよい。
In this case, by specifying a portion that is reflected in the image, a region that is not reflected can be determined, and a unit information region including at least a part of the region can be determined. Since the unit information area is at least partially not shown in the image, it may be a defective area.

【0037】(6)また、2次元コードには一般的に、
画像中のコード領域やセル位置を特定するための位置決
め用シンボル、タイミングセルといった機能パターンが
含まれる。例えばQRコードで言えば、図14に示した
位置決め用シンボル510a,510b,510c及び
タイミングセル520a,520bがここでいう機能パ
ターンである。
(6) In general, a two-dimensional code includes:
It includes functional patterns such as a positioning symbol for specifying a code region and a cell position in an image, and a timing cell. For example, in the case of a QR code, the positioning symbols 510a, 510b, and 510c and the timing cells 520a and 520b shown in FIG.

【0038】そこで、不具合領域推定処理を、2次元コ
ード画像中に含まれる機能パターンに不具合があるか否
かを判断し、当該機能パターンに不具合があれば、当該
機能パターンの周辺に位置する単位情報領域を不具合領
域として推定する処理としてもよい(請求項8)。
Therefore, the defect area estimation processing determines whether or not there is a defect in the function pattern included in the two-dimensional code image. If there is a defect in the function pattern, a unit located around the function pattern is determined. The information area may be estimated as a defective area (claim 8).

【0039】機能パターンは、決まったセルで構成され
ている。例えばQRコードの有する位置決め用シンボル
510a,510b,510cは、例えば、一辺の長さ
が7セルに相当する黒い正方形512、一辺の長さが5
セルに相当する白い正方形514、一辺の長さが3セル
に相当する黒い正方形516を同心状に重ね合わせた時
にできる図形である(図14参照)。
The function pattern is composed of fixed cells. For example, the positioning symbols 510a, 510b, and 510c included in the QR code are, for example, black squares 512 each having a side length of 7 cells, and each side having a length of 5 cells.
This is a figure formed when a white square 514 corresponding to a cell and a black square 516 having a side length of 3 cells are superimposed concentrically (see FIG. 14).

【0040】したがって、この機能パターンが決まった
セルで構成されていない場合、機能パターンに不具合が
あるとしてよい。このような機能パターンの不具合は例
えば2次元コードの汚れや破損などで生じることが考え
られる。そのため、この機能パターンの周辺に位置する
単位情報領域にも不具合がある可能性が高い。そこで、
機能パターンの周辺に位置する単位情報領域を不具合領
域として推定する。なお、「周辺」に位置する単位情報
領域は、例えば機能パターンに隣接するものとすること
が考えられる。また、さらにその外側の単位情報領域を
含めてもよい。どこまでの単位情報領域を周辺に位置す
るものとするかは、例えば2次元コードの使用環境に応
じて決めればよい。例えば2次元コードの汚れ等が広い
範囲で生じるような環境であれば「周辺」を比較的大き
な領域とする。逆に2次元コードの汚れ等が狭い範囲で
生じるような環境であれば「周辺」を比較的小さな領域
とする。
Therefore, when this function pattern is not composed of fixed cells, it may be determined that there is a defect in the function pattern. Such a defect in the functional pattern may be caused by, for example, dirt or breakage of the two-dimensional code. Therefore, there is a high possibility that the unit information area located around the functional pattern also has a defect. Therefore,
A unit information area located around the function pattern is estimated as a defective area. The unit information area located in the “periphery” may be, for example, adjacent to the function pattern. Further, a unit information area outside the area may be included. How far the unit information area should be located in the periphery may be determined according to the use environment of the two-dimensional code, for example. For example, in an environment in which dirt or the like of a two-dimensional code occurs in a wide range, the “periphery” is a relatively large area. Conversely, if the environment is such that dirt or the like of the two-dimensional code occurs in a narrow range, the “periphery” is a relatively small area.

【0041】このようにすれば、汚れ等が原因で生じる
機能パターン周囲の単位情報領域の不具合を確実に検査
することができる。 (7)さらにまた、2次元コードの単位情報領域には、
任意情報を示すデータ以外に、ある決まった値又はある
決まった範囲の値が記憶される領域がある。例えばQR
コードを例に挙げれば、数字・英字・漢字などの記録形
式(モード)を記憶しておく領域や、データ文字数を示
す文字数インジケータを記憶しておく領域が挙げられ
る。
In this way, it is possible to reliably inspect the unit information area around the function pattern for a defect caused by dirt or the like. (7) Furthermore, in the unit information area of the two-dimensional code,
In addition to the data indicating the arbitrary information, there is an area where a certain fixed value or a certain range of values is stored. For example, QR
Examples of codes include an area for storing a recording format (mode) such as numbers, alphabetic characters, and kanji, and an area for storing a character number indicator indicating the number of data characters.

【0042】そこで、不具合領域推定処理を、ある決ま
った値又はある決まった範囲の値が記憶される単位情報
領域に当該値又は当該範囲内の値が記録されていない場
合には、当該単位情報領域を不具合領域として推定する
処理としてもよい(請求項9)。
Therefore, if the value or a value within the range is not recorded in the unit information area in which a certain value or a certain range of values is stored, the defective area estimation processing is performed. A process for estimating an area as a defective area may be employed.

【0043】この場合、この特定の単位情報領域に対し
ては、確実に不具合があることが判定できる。以上不具
合推定処理について具体例を挙げて説明したが、上記
(4)〜(7)で説明した処理はいずれも特殊な状況を
想定しての処理であるため、上記(1)〜(3)のいず
れかと組み合わせて用いると有効である。
In this case, it can be reliably determined that there is a defect in the specific unit information area. Above, the failure estimation process has been described with a specific example. However, since the processes described in the above (4) to (7) are all processes assuming a special situation, the above (1) to (3) It is effective to use in combination with any of the above.

【0044】ところで、不具合領域推定処理にて推定さ
れた単位情報領域に不具合がないことも考えられる。こ
のような不具合のない単位情報領域が多くなると、却っ
て訂正効率が悪くなり誤りの訂正ができなくなる可能性
がある。これについて説明する。
Incidentally, it is conceivable that there is no defect in the unit information area estimated in the defect area estimation processing. If the number of unit information areas free of such a problem increases, the correction efficiency may be worsened, and errors may not be corrected. This will be described.

【0045】上述したように図4に示したQRコードの
D1〜D23の23個のデータコードワードとE1〜E
44の44個のRSコードワードとで構成されるブロッ
ク1の符号化ブロックを考える。この符号化されたブロ
ック1における誤り訂正を消失訂正にて行う場合、44
個のRSコードワードが付加されているため、44個の
コードワードの訂正が可能である。ところが、例えば上
述した不具合領域推定処理にて45個のコードワード
(単位情報領域)が不具合領域として推定された場合、
誤りの訂正はできない。このとき、実際には、不具合の
あるコードワードが20個であって、25個のコードワ
ードには不具合がないことがあり得る。このような状況
を考慮すれば、請求項10に示す方法にて誤りの訂正を
行うようにするとよい。
As described above, the 23 data code words D1 to D23 of the QR code shown in FIG.
Consider a coded block of block 1 composed of 44 44 code words. When error correction in the encoded block 1 is performed by erasure correction, 44
Since 44 RS codewords are added, 44 codewords can be corrected. However, for example, when 45 codewords (unit information area) are estimated as the defective area in the above-described defective area estimation processing,
Errors cannot be corrected. At this time, actually, there may be 20 defective codewords and 25 codewords have no defective. In consideration of such a situation, it is preferable to correct an error by the method described in claim 10.

【0046】それは、さらに、前記不具合領域推定処理
及び前記誤り訂正処理に加え、誤り訂正データを用いて
単位情報領域の誤り検出を行うと共に当該誤り検出結果
に基づく誤り訂正を行う検出訂正処理を、以下の(イ)
又は(ロ)のいずれかの順序で実行することを特徴とす
る方法である。
Further, in addition to the defect area estimation processing and the error correction processing, a detection and correction processing for detecting an error in the unit information area using the error correction data and for performing an error correction based on the error detection result is performed. The following (a)
Or (b) the order of execution.

【0047】(イ)最初に不具合領域推定処理及び消失
訂正処理を実行し、誤りを訂正できない場合には、次に
検出訂正処理を実行する。 (ロ)最初に検出訂正処理を実行し、誤りを訂正できな
い場合には、次に不具合領域推定処理及び消失訂正処理
を実行する。
(A) First, the defective area estimation processing and the erasure correction processing are executed. If the error cannot be corrected, the detection and correction processing is executed next. (B) First, the detection and correction processing is executed, and if the error cannot be corrected, the defective area estimation processing and the erasure correction processing are next executed.

【0048】つまり、上述した不具合推定領域にて実際
には不具合のない単位情報領域が不具合領域として推定
される可能性を考えると、消失訂正にて誤り訂正した方
がよい場合と、従来からの検査訂正にて誤り訂正した方
がよい場合とが存在するのである。
That is, in consideration of the possibility that a unit information area that does not actually have a defect in the above-mentioned defect estimation area is estimated as a defect area, there are cases where it is better to perform error correction by erasure correction, There are cases where it is better to perform error correction by inspection correction.

【0049】例えば図4に示したようにQRコードの符
号化ブロックが44個の訂正コードワードを有している
場合、不具合のあるコードワードを特定した結果が44
個までならば消失訂正にて誤り訂正できる。一方、検出
訂正にて誤り訂正を行う場合は、22個までのコードワ
ードの誤りが訂正できる。
For example, if the coding block of the QR code has 44 correction code words as shown in FIG. 4, the result of specifying the defective code word is 44
If it is up to the number, the error can be corrected by erasure correction. On the other hand, when error correction is performed by detection and correction, errors in up to 22 codewords can be corrected.

【0050】したがって、実際には、不具合のあるコー
ドワードが20個であるにもかかわらず不具合領域推定
処理にて25個の不具合領域が特定される状況下では、
消失訂正では誤りが訂正できないが、検出訂正によれば
誤りが訂正できる。一方、実際に不具合のあるコードワ
ードが23個であり、不具合領域推定処理にて40個の
不具合領域が特定される状況下では、逆に検出訂正では
誤りが訂正できないが、消失訂正によれば誤りが訂正で
きる。
Therefore, in a situation where 25 defective areas are specified in the defective area estimation processing in spite of the fact that there are 20 defective code words,
Although the erasure correction cannot correct the error, the detection correction can correct the error. On the other hand, under the situation where there are actually 23 defective codewords and 40 defective areas are specified in the defective area estimation processing, errors cannot be corrected by detection and correction. Errors can be corrected.

【0051】そのため、上述した(イ)又は(ロ)のよ
うに、検出訂正及び消失検出訂正を併用することによっ
て、その訂正効率をさらに向上させることができる。以
上は誤り訂正方法の発明として説明してきたが、上述し
たような誤り訂正方法は2次元コードを画像として取り
込み、この2次元コード画像に基づくデコード処理の一
部として位置づけられる。
Therefore, as described in (a) or (b) above, by using the detection correction and the erasure detection correction together, the correction efficiency can be further improved. Although the invention has been described as an error correction method, the error correction method as described above captures a two-dimensional code as an image and is positioned as a part of a decoding process based on the two-dimensional code image.

【0052】したがって、上述した誤り訂正方法を用い
て誤りを訂正し、2次元コード画像に基づいて2次元コ
ードとして記録された情報を読み取ることを特徴とする
2次元コード読取方法の発明として実現することもでき
る。また、この2次元コード読取方法を用いて2次元コ
ードとして記録された情報を読み取ることを特徴とする
2次元コード読取装置の発明として実現することもでき
る。
Therefore, the present invention is realized as a two-dimensional code reading method characterized in that an error is corrected using the above-described error correction method, and information recorded as a two-dimensional code is read based on a two-dimensional code image. You can also. Further, the present invention can be realized as an invention of a two-dimensional code reading apparatus characterized by reading information recorded as a two-dimensional code using the two-dimensional code reading method.

【0053】なお、上述した誤り訂正方法又は2次元コ
ード読取方法を実行する機能は、例えばディジタル回路
やコンピュータシステム側で起動するプログラムとして
備えることができる。このようなプログラムの場合、例
えば、フロッピー(登録商標)ディスク、光磁気ディス
ク、CD−ROM、ハードディスク等のコンピュータ読
み取り可能な記録媒体に記録し、必要に応じてコンピュ
ータシステムにロードして起動することにより用いるこ
とができる。この他、ROMやバックアップRAMをコ
ンピュータ読み取り可能な記録媒体として前記プログラ
ムを記録しておき、このROMあるいはバックアップR
AMをコンピュータシステムに組み込んで用いてもよ
い。
The function of executing the above-described error correction method or two-dimensional code reading method can be provided, for example, as a program activated on a digital circuit or a computer system. In the case of such a program, for example, it is recorded on a computer-readable recording medium such as a floppy (registered trademark) disk, a magneto-optical disk, a CD-ROM, and a hard disk, and is loaded into a computer system as needed and activated. Can be used. In addition, the ROM or the backup RAM is used to record the program as a computer-readable recording medium, and the ROM or the backup RAM is stored.
The AM may be incorporated in a computer system and used.

【0054】[0054]

【発明の実施の形態】以下、本発明を具体化した実施例
を図面を参照して説明する。 [第1実施例]図1は、第1実施例の2次元コード読取
装置1のブロック図である。本実施例の2次元コード読
取装置1は、制御回路10と、照明用発光ダイオード
(照明LED)11と、CCDエリアセンサ12と、増
幅回路13と、A/D変換回路14と、アドレス発生回
路17と、同期パルス発生回路16と、画像メモリ20
と、スイッチ群31と、液晶表示器32と、通信I/F
回路33と中心にして構成されている。
Embodiments of the present invention will be described below with reference to the drawings. [First Embodiment] FIG. 1 is a block diagram of a two-dimensional code reader 1 according to a first embodiment. The two-dimensional code reader 1 according to the present embodiment includes a control circuit 10, a light emitting diode (illumination LED) 11, a CCD area sensor 12, an amplification circuit 13, an A / D conversion circuit 14, an address generation circuit, 17, a synchronization pulse generating circuit 16, and an image memory 20.
, Switch group 31, liquid crystal display 32, communication I / F
It is configured centering on the circuit 33.

【0055】制御回路10は、CPU、ROM、RA
M、I/O等を備えたコンピュータシステムとして構成
されている。制御回路10は、ROMに記憶されている
プログラムに従って後述する読取処理等を実行する。ま
た、制御回路10には、スイッチ群31、液晶表示器3
2及び通信I/F回路33が接続されており、入出力制
御も行う。
The control circuit 10 includes a CPU, ROM, RA
It is configured as a computer system having M, I / O, and the like. The control circuit 10 executes a reading process and the like to be described later according to a program stored in the ROM. The control circuit 10 includes a switch group 31 and a liquid crystal display 3.
2 and the communication I / F circuit 33, and also performs input / output control.

【0056】照明LED11は、読取対象の光学情報で
ある2次元コードに対して照明用の赤色光を照射するも
のである。CCDエリアセンサ12は、2次元的に配列
された複数の受光素子であるCCDを有しており、外界
を撮像してその2次元画像を水平方向の走査線信号とし
て出力する。なお、本実施例では、このCCDエリアセ
ンサ12からの走査線信号は増幅回路13によって増幅
されA/D変換回路14に出力される。
The illumination LED 11 illuminates red light for illumination on a two-dimensional code which is optical information to be read. The CCD area sensor 12 has a plurality of two-dimensionally arranged CCDs, which are light receiving elements, captures the outside world, and outputs the two-dimensional image as a horizontal scanning line signal. In this embodiment, the scanning line signal from the CCD area sensor 12 is amplified by the amplifier circuit 13 and output to the A / D conversion circuit 14.

【0057】この増幅回路13は、制御回路10からの
ゲインコントロール電圧に対応する増幅率で、CCDエ
リアセンサ12から出力された走査線信号を増幅する。
A/D変換回路14はアナログの走査線信号をディジタ
ル信号に変換して、画像メモリ20に出力する。A/D
変換回路14にてディジタル信号に変換されたデータは
多値データであり、この多値データは画像メモリ20に
記憶される。また、この多値データは、各画素が8ビッ
ト(「0」〜「255」)の階調値を有するものとなっ
ている。
The amplification circuit 13 amplifies the scanning line signal output from the CCD area sensor 12 with an amplification factor corresponding to the gain control voltage from the control circuit 10.
The A / D conversion circuit 14 converts an analog scanning line signal into a digital signal and outputs the digital signal to the image memory 20. A / D
The data converted into a digital signal by the conversion circuit 14 is multi-valued data, and the multi-valued data is stored in the image memory 20. Further, in the multi-valued data, each pixel has a gradation value of 8 bits (“0” to “255”).

【0058】同期パルス発生回路16は、CCDエリア
センサ12から出力される2次元画像データのパルスよ
り十分に細かい同期パルスを出力する。アドレス発生回
路17はこの同期パルスをカウントして、画像メモリ2
0に対するアドレスを発生させる。多値データは、アド
レス毎に8ビット単位で書き込まれる。
The synchronizing pulse generating circuit 16 outputs a synchronizing pulse sufficiently finer than the two-dimensional image data pulse output from the CCD area sensor 12. The address generation circuit 17 counts this synchronization pulse, and
Generate an address for 0. The multilevel data is written in 8-bit units for each address.

【0059】スイッチ群31は、利用者が読取処理の開
始を指示するための読取スイッチや、テンキーあるいは
各種ファンクションキーを備えており、情報入力のため
に用いられる。液晶表示器32は、例えば2階調表示の
LCDとして構成されており、読み込んだ光学情報など
を表示するためなどに用いられる。
The switch group 31 includes a reading switch for instructing a user to start reading processing, a numeric keypad, and various function keys, and is used for inputting information. The liquid crystal display 32 is configured as, for example, a two-tone LCD, and is used for displaying read optical information and the like.

【0060】通信I/F回路33は、ホストコンピュー
タなどとの間で通信を行うものであり、例えば図示しな
い通信用発光素子を介してデータを外部装置に送信した
り、図示しない通信用受光素子を介して外部装置からの
信号(例えばシステムを動かすためのプログラムや、解
読した2次元コードのデータ送信を指示する命令等)を
受信する。もちろん、ホストコンピュータと有線で接続
する構成を採用してもよい。
The communication I / F circuit 33 communicates with a host computer or the like. For example, the communication I / F circuit 33 transmits data to an external device via a communication light emitting element (not shown), or transmits light to a communication light receiving element (not shown). (For example, a program for operating the system, a command for instructing data transmission of the decoded two-dimensional code, etc.) from the external device. Needless to say, a configuration for connecting to the host computer by a wire may be adopted.

【0061】このような構成を備えた本実施例の2次元
コード読取装置1は、CCDエリアセンサ12から出力
される走査線信号を増幅回路13によって増幅し、その
増幅された走査線信号をA/D変換回路14によって多
値データに変換して画像メモリ20に記憶する。そし
て、制御回路10が、画像メモリ20に記憶された多値
データに基づき、2次元コードをデコードする。
In the two-dimensional code reader 1 of this embodiment having such a configuration, the scanning line signal output from the CCD area sensor 12 is amplified by the amplifier circuit 13, and the amplified scanning line signal is output to the A line. The data is converted into multi-value data by the / D conversion circuit 14 and stored in the image memory 20. Then, the control circuit 10 decodes the two-dimensional code based on the multi-value data stored in the image memory 20.

【0062】本実施例の2次元コード読取装置では、2
次元コードの読み取り時における、いわゆる誤り訂正に
特徴を有している。本実施例のQRコードは、8ビット
のコードワードの単位で情報が記録されている。具体的
には、図4に示すように、D1〜D23の23個のデー
タコードワードからなるデータブロック1、E1〜E4
4の44個のRSコードワードからなるRSブロック
1、D24〜D46の23個のデータコードワードから
なるデータブロック2、及びE45〜E88の44個の
RSコードワードからなるRSブロック2を備えてい
る。そして、データブロック1とRSブロック1とから
なるブロック1、データブロック2とRSブロック2と
からなるブロック2の単位でRS符号化がなされてお
り、このブロック1、2(符号化ブロック)の単位で誤
り訂正がなされる。また、本実施例のQRコードでは、
セルを読み易くするためのランダム化がなされている。
ランダム化とは、白・黒のセルが偏らないように故意に
分布させることをいう。例えば2次元コードに対応する
適当なランダムパターンとの排他的論理和をとることで
ランダム化がなされる。もちろん、デコード時には、こ
のランダムパターンを用いてデコードする。
In the two-dimensional code reader of this embodiment,
It is characterized by so-called error correction when reading a dimensional code. In the QR code of this embodiment, information is recorded in units of 8-bit code words. More specifically, as shown in FIG. 4, data blocks 1, E1 to E4 each including 23 data code words D1 to D23.
4, RS block 1 consisting of 44 RS code words, data block 2 consisting of 23 data code words D24 to D46, and RS block 2 consisting of 44 RS code words E45 to E88. . Then, the RS encoding is performed in units of a block 1 composed of the data block 1 and the RS block 1 and a block 2 composed of the data block 2 and the RS block 2. Error correction is performed. In the QR code of the present embodiment,
Randomization has been performed to make the cells easier to read.
The randomization means that white and black cells are intentionally distributed so as not to be biased. For example, randomization is performed by taking an exclusive OR with an appropriate random pattern corresponding to a two-dimensional code. Of course, at the time of decoding, decoding is performed using this random pattern.

【0063】このようなQRコードを前提として、制御
回路10にて実行される読取処理を図2のフローチャー
トに基づいて説明する。まず最初のステップS1000
では、不具合推定処理を行う。この処理は、2次元コー
ド画像のコードワードの中で不具合のあるコードワード
を推定する処理である。ここでは、不具合があるコード
ワードに対してフラグがセットされる。このS1000
の処理は、符号化されたブロック1,2の誤り位置を検
出する処理に相当する。
On the premise of such a QR code, the reading process executed by the control circuit 10 will be described with reference to the flowchart of FIG. First step S1000
Then, a failure estimation process is performed. This process is a process of estimating a defective codeword among the codewords of the two-dimensional code image. Here, a flag is set for a code word having a defect. This S1000
Corresponds to the process of detecting the error position of the encoded blocks 1 and 2.

【0064】ここで不具合推定処理を図3のフローチャ
ートに基づいて説明する。最初のステップS2000に
おいて、1つのコードワードを選択する。本不具合推定
処理では、コードワード毎に不具合があるか否かを判断
していくため、コードワードを1つずつ選択していく。
不具合推定処理が繰り返され、このS2000の処理が
繰り返されると、D1から順に、D2→D3→・・・→
D46→E1→・・・→E88という具合にコードワー
ドが1つずつ選択される。続くS2010では、選択し
たコードワードをデコードする。
Here, the failure estimation processing will be described with reference to the flowchart of FIG. In a first step S2000, one codeword is selected. In this defect estimation process, codewords are selected one by one in order to determine whether or not there is a defect for each codeword.
When the failure estimation processing is repeated and the processing of S2000 is repeated, D2 → D3 →.
Codewords are selected one by one in the order of D46 → E1 →... → E88. At S2010, the selected codeword is decoded.

【0065】そして次のS2020では、特定のコード
ワードであるか否かを判断する。データコードワードD
1〜D46の中には、任意の値をとるいわゆるデータ以
外に、ある決まった値又はある決まった範囲の値をとる
モード、文字数インジケータ、ターミネータ、ダミーデ
ータと呼ばれるデータコードワードがある。ここでは、
このようにある決まった値又はある決まった範囲の値を
とるデータコードワードを特定のコードワードとして判
断する。ここで特定のコードワードであると判断された
場合(S2020:YES)、S2030へ移行する。
一方、特定のコードワードでないと判断された場合(S
2020:NO)、S2050へ移行する。
Then, in the next S2020, it is determined whether or not the codeword is a specific codeword. Data code word D
In addition to the so-called data having an arbitrary value, 1 to D46 include a mode having a certain fixed value or a certain range of values, a character number indicator, a terminator, and a data code word called dummy data. here,
Thus, a data codeword having a certain value or a certain range of values is determined as a specific codeword. If it is determined that the codeword is a specific codeword (S2020: YES), the process proceeds to S2030.
On the other hand, if it is determined that the codeword is not a specific codeword (S
2020: NO), and proceeds to S2050.

【0066】選択したコードワードが特定のコードワー
ドであったときに移行するS2030では、S2010
のデコード値が正常であるか否かを判断する。例えばあ
るQRコードについてこの特定コードワードの値を示す
と、モードは16進表示で「01」,「02」,「0
3」,「04」,「08」のいずれかの値をとる。ま
た、文字数インジケータは、10進表示で1〜106ま
での値となる。ターミネータは16進表示で「00」で
あり、ダミーデータは16進表示で「EC」及び「1
1」の繰り返しとなる。したがって、特定のコードワー
ドがこれら以外の値をとる場合には、ここで否定判断さ
れる。ここでコードワードのデコード値が正常であると
判断された場合(S2030:YES)、S2040の
処理を実行せず、S2070へ移行する。一方、コード
ワードのデコード値が正常でないと判断された場合(S
2030:NO)、S2040にてそのコードワードに
対応するフラグをセットし、その後、S2070へ移行
する。
At S2030 to which the process proceeds when the selected codeword is a specific codeword, at S2010
It is determined whether the decoded value of is normal. For example, when the value of this specific codeword is shown for a certain QR code, the mode is “01”, “02”, “0” in hexadecimal notation.
3 "," 04 ", or" 08 ". The character number indicator has a value of 1 to 106 in decimal notation. The terminator is “00” in hexadecimal notation, and the dummy data is “EC” and “1” in hexadecimal notation.
1 ". Therefore, if the specific codeword takes any other value, a negative determination is made here. If it is determined that the decoded value of the codeword is normal (S2030: YES), the process proceeds to S2070 without executing the process of S2040. On the other hand, when it is determined that the decoded value of the codeword is not normal (S
2030: NO), the flag corresponding to the code word is set in S2040, and then the flow shifts to S2070.

【0067】選択したコードワードが特定のコードワー
ドでなかったときに移行するS2050では、コードワ
ードが白又は黒のいずれか一方のセルのみで構成されて
いるか否かを判断する。ここでコードワードが白・黒の
両方のセルで構成されていると判断された場合(S20
50:NO)、S2060の処理を実行せず、S207
0へ移行する。一方、白又は黒のセルのみで構成されて
いると判断された場合(S2050:YES)、S20
60にてコードワードに対応するフラグをセットし、そ
の後、S2070へ移行する。
At S2050 to which the process proceeds when the selected codeword is not a specific codeword, it is determined whether or not the codeword is composed of only one of white and black cells. Here, when it is determined that the code word is composed of both white and black cells (S20)
50: NO), the process of S2060 is not performed, and S207
Move to 0. On the other hand, if it is determined that the image data is composed of only white or black cells (S2050: YES), S20
At 60, the flag corresponding to the code word is set, and thereafter, the flow shifts to S2070.

【0068】例えば図5(a)に示すようなコードの汚
れや図5(b)に示すようなコードの破損部分は、黒又
は白のセルのみで構成される可能性が高い。そのため、
上述したように白又は黒のいずれか一方のセルのみで構
成されているコードワードに不具合があるとしてフラグ
をセットするのである。これによって、例えば図6中の
斜線を施したコードワードD33〜D37,E5〜E9
に対応してフラグがセットされる。
For example, it is highly possible that a stain on the code as shown in FIG. 5A or a damaged portion of the code as shown in FIG. 5B is constituted only by black or white cells. for that reason,
As described above, the flag is set on the assumption that there is a defect in the code word composed of only one of the white and black cells. Thereby, for example, the codewords D33 to D37, E5 to E9 hatched in FIG.
The flag is set corresponding to.

【0069】S2070では、全てのコードワードを選
択したか否かを判断する。D1〜D46及びE1〜E8
8の134個のコードワードが全て選択された場合に
は、ここで肯定判断される。ここで全てのコードワード
が選択されたと判断された場合(S2070:YE
S)、本不具合推定処理を終了する。一方、選択されて
いないコードワードが残っている場合には(S207
0:NO)、S2000からの処理を繰り返す。
In S2070, it is determined whether all codewords have been selected. D1 to D46 and E1 to E8
If all of the 134 codewords No. 8 have been selected, a positive determination is made here. Here, when it is determined that all codewords have been selected (S2070: YE
S), the fault estimation processing ends. On the other hand, if there is a codeword that has not been selected (S207).
0: NO), and repeat the processing from S2000.

【0070】ここで図2のフローチャートの説明に戻
る。S1010では、消失検出訂正を行う。消失検出訂
正とは、上述したように符号の誤り位置が特定されてい
ることを前提として、誤りの大きさを計算して誤り訂正
を行うものである。なお、特定されていない誤り位置が
ある可能性を考え、特定された誤り位置(消失位置)以
外では、誤り位置の検出及び訂正を行う。ここでは、S
1000にてフラグがセットされたコードワードに対
し、このコードワードの誤りの大きさを計算して誤り訂
正を行う。一方、フラグがセットされていないコードワ
ードに対しては、誤り位置の検出及び訂正を行う。
The description returns to the flowchart of FIG. In S1010, erasure detection and correction are performed. The erasure detection and correction is to perform error correction by calculating the magnitude of the error on the assumption that the error position of the code is specified as described above. In consideration of the possibility that there is an unspecified error position, error positions are detected and corrected at positions other than the specified error position (erasure position). Here, S
For the code word for which the flag has been set at 1000, the error magnitude of this code word is calculated and error correction is performed. On the other hand, for a code word for which a flag is not set, error position detection and correction are performed.

【0071】例えば図6に示すD33〜D37,E5〜
E9のコードワードにフラグがセットされた場合、符号
化されたブロック1の誤り位置は、E5〜E9のコード
ワードとして特定される。また、符号化されたブロック
2の誤り位置は、D33〜D37のコードワードとして
特定される。
For example, D33 to D37 and E5 shown in FIG.
When the flag is set in the code word of E9, the error position of the encoded block 1 is specified as the code words of E5 to E9. The error position of the encoded block 2 is specified as a codeword of D33 to D37.

【0072】したがって、ブロック1については、次に
ようにして誤り訂正を行う。 D1〜D23のデータコードワードとE1〜E44の
RSコードワードからなる符号からシンドローム多項式
を求める。 E5〜E9のコードワード(消失位置)から得られる
消失多項式を用い、シンドローム多項式を修正し、消失
数値多項式を求める。
Therefore, for block 1, error correction is performed as follows. A syndrome polynomial is obtained from a code composed of data code words D1 to D23 and RS code words E1 to E44. Using the erasure polynomial obtained from the code words E5 to E9 (erasure positions), the syndrome polynomial is corrected to obtain the erasure numerical polynomial.

【0073】E5〜E9のコードワード(消失位置)
に対して誤りの大きさを求めて誤り訂正を行う。ブロッ
ク2についても同様である。次のS1020では、訂正
できたか否かを判断する。本実施例のQRコード500
はブロック1、2の単位で符号化されており、それぞれ
のブロック1,2に44個のRSコードワードが付加さ
れている。したがって、S1000で推定されたブロッ
ク1,2内のコードワードが44個までなら消失検出訂
正が可能となる。ここで訂正できたと判断された場合
(S1020:YES)、S1050へ移行する。一
方、訂正できなかったと判断された場合(S1020:
NO)、S1030へ移行する。
Code words E5 to E9 (erasure positions)
And error correction is performed by calculating the magnitude of the error. The same applies to block 2. In the next step S1020, it is determined whether or not the correction was successful. QR code 500 of this embodiment
Are encoded in units of blocks 1 and 2, and 44 RS code words are added to each of blocks 1 and 2. Therefore, if the number of codewords in blocks 1 and 2 estimated in S1000 is up to 44, erasure detection and correction can be performed. If it is determined that the correction has been made (S1020: YES), the process proceeds to S1050. On the other hand, when it is determined that the correction could not be performed (S1020:
NO), and it transfers to S1030.

【0074】S1030では、検出訂正を行う。検出訂
正とは、符号の誤り位置を検出し、さらに、誤りの大き
さを計算して誤り訂正を行うものである。例えばブロッ
ク1について誤り訂正ができなかった場合、次のように
して誤り訂正を行う。 D1〜D23のデータコードワードとE1〜E44の
RSコードワードからなる符号からシンドローム多項式
を求める。
In S1030, detection and correction are performed. The detection and correction is to detect an error position of a code and to calculate the magnitude of the error to correct the error. For example, if the error cannot be corrected for the block 1, the error is corrected as follows. A syndrome polynomial is obtained from a code composed of data code words D1 to D23 and RS code words E1 to E44.

【0075】シンドローム多項式から誤り位置多項式
及び誤り数値多項式を求める。 誤り位置多項式からチェンサーチ法により誤りのある
コードワード(誤り位置)を求め、そのコードワードに
対する誤りの大きさを求めて誤り訂正を行う。なお、S
1010及びS1030の消失検出訂正処理や検出訂正
処理については従来からその計算手法は当業者の間でよ
く知られているため、詳細な説明は省略する。例えばコ
ンピュータシステムにて実現する場合、ユークリッド法
やピーターソン法などを用いる。例えば特開平6−77
844号公報には、ユークリッド法を用いた計算手法が
開示されている。
An error locator polynomial and an error numerical polynomial are obtained from the syndrome polynomial. An error codeword (error position) is determined from the error locator polynomial by the Chien search method, and the magnitude of the error with respect to the codeword is determined to perform error correction. Note that S
The calculation methods of the erasure detection and correction processing and the detection and correction processing of 1010 and S1030 have been well known among those skilled in the art, and thus detailed description thereof will be omitted. For example, when it is realized by a computer system, the Euclidean method, the Peterson method, or the like is used. For example, JP-A-6-77
No. 844 discloses a calculation method using the Euclidean method.

【0076】次のS1040では、訂正できたか否かを
判断する。本実施例のQRコードではブロック1、2の
単位で符号化されており、それぞれの符号化ブロックに
44個のRSコードワードが付加されている。検出訂正
では、誤り位置多項式及び誤り数値多項式の2つを求め
るため、1つのコードワードの訂正に2つのRSコード
ワードが必要となる。したがって、符号化ブロック内の
22個までのコードワードの誤りを訂正できる。ここで
訂正できたと判断された場合(S1040:YES)、
S1050へ移行する。一方、訂正できなかったと判断
された場合(S1040:NO)、S1060へ移行す
る。
In the next step S1040, it is determined whether or not the correction has been made. In the QR code according to the present embodiment, encoding is performed in units of blocks 1 and 2, and 44 RS code words are added to each encoded block. In detection and correction, two error code polynomials and an error numerical polynomial are obtained, so that two RS codewords are required to correct one codeword. Therefore, errors in up to 22 codewords in an encoded block can be corrected. If it is determined that the correction has been made (S1040: YES),
The process moves to S1050. On the other hand, if it is determined that the correction has failed (S1040: NO), the process proceeds to S1060.

【0077】誤り訂正ができた場合に移行するS105
0ではデコード処理を行い、その後、本読取処理を終了
する。このデコード処理によって2次元コードとして記
録された情報を読み取る。一方、誤り訂正ができなかっ
た場合に移行するS1060ではエラー処理を行い、そ
の後、本読取処理を終了する。
Step S105 when error correction is successful
At 0, the decoding process is performed, and thereafter, the main reading process ends. The information recorded as a two-dimensional code is read by this decoding process. On the other hand, in S1060 to which the process proceeds when error correction has not been performed, error processing is performed, and then the main reading processing ends.

【0078】つまり、本実施例では、2次元コード画像
の特徴に基づき、不具合のあるコードワード領域を推定
するのである(図2中のS1000,図3参照)。そし
て、誤りの大きさを計算して誤りを訂正する消失検出訂
正を行う(図2中のS1010)。その結果、不具合推
定処理にて不具合のあるコードワードが確実に推定され
れば、従来の検出訂正による誤り訂正と比べて、誤り訂
正効率は2倍となる。検出訂正では1つのコードワード
の訂正に2つのRSコードワードが必要になるが、消失
検出訂正では、誤り位置が特定されていることを前提と
しており、訂正処理において誤り位置を特定する必要が
ないため、1つのRSコードワードがあれば誤り訂正が
可能だからである。逆に、訂正能力を従来と同様にする
のであれば、RSコードワードの数は従来の半分で足り
る。これによって、訂正効率を向上させることができ
る。
That is, in this embodiment, a defective code word area is estimated based on the features of the two-dimensional code image (S1000 in FIG. 2, see FIG. 3). Then, erasure detection and correction for correcting the error by calculating the magnitude of the error are performed (S1010 in FIG. 2). As a result, if a faulty codeword is reliably estimated in the fault estimation process, the error correction efficiency is doubled as compared with the conventional error correction by detection and correction. In detection and correction, two RS codewords are required to correct one codeword. However, in erasure detection and correction, it is assumed that an error position is specified, and there is no need to specify an error position in correction processing. Therefore, if there is one RS codeword, error correction is possible. Conversely, if the correction capability is the same as the conventional one, the number of RS code words is half that of the conventional one. Thereby, the correction efficiency can be improved.

【0079】なお、消失検出訂正では、不具合のあるコ
ードワードのうちのいくつかが不具合推定処理にて推定
できないこともあるため、不具合があると特定されなか
ったコードワードについては、誤りの検出及び訂正を行
う。推定できない不具合コードワードが検出された場
合、全ての不具合コードワードが推定されたときと比べ
て訂正効率は低下する。しかし、そうであっても、推定
された不具合コードワードについて誤りの大きさのみを
計算して誤りを訂正しているため、従来の手法と比べれ
ば訂正効率は向上する。
In the erasure detection and correction, some of the defective codewords may not be able to be estimated by the defect estimation process. Make corrections. When a defective codeword that cannot be estimated is detected, the correction efficiency is lower than when all the defective codewords are estimated. However, even in such a case, since only the magnitude of the error is calculated for the estimated defective codeword and the error is corrected, the correction efficiency is improved as compared with the conventional method.

【0080】さらに、S1010の消失検出訂正にて誤
りが訂正できない場合であっても、すなわち推定された
不具合コードワードの数がRSコードワードの数を越え
ている場合であっても、実際の不具合コードワードがR
Sコードワードの半分以下であれば、従来の検出訂正に
て誤りが訂正できる。そこで、本実施例では、消失検出
訂正にて訂正できたか否かを判断し(図2中のS102
0)、訂正できなかった場合には(S1020:N
O)、従来と同様の検出訂正を行うようにした(S10
30)。これによって、さらに訂正効率を向上させるこ
とができる。
Further, even if the error cannot be corrected by the erasure detection and correction in S1010, that is, even if the estimated number of faulty codewords exceeds the number of RS codewords, the actual faulty Codeword is R
If it is less than half the S code word, the error can be corrected by conventional detection and correction. Therefore, in the present embodiment, it is determined whether or not the correction has been made by the erasure detection and correction (S102 in FIG. 2).
0), if it cannot be corrected (S1020: N
O), the same detection and correction as in the prior art is performed (S10).
30). As a result, the correction efficiency can be further improved.

【0081】また、本実施例の不具合推定処理は、読み
取り易くするための工夫として、白・黒のセルをランダ
ムに配置するように、適当なランダムパターンとの排他
的論理和をとるランダム化がQRコードに対しなされて
いることに着目した。ランダム化されたQRコード50
0では、図4に示す各コードワードが白又は黒のいずれ
か一方のセルだけで構成される確率が約0.01%程度
になる。
In the defect estimating process of the present embodiment, as a device for making it easier to read, randomization is performed by taking an exclusive OR with an appropriate random pattern so that white and black cells are randomly arranged. We focused on what has been done for QR codes. Randomized QR code 50
At 0, the probability that each codeword shown in FIG. 4 is composed of only one of white and black cells is about 0.01%.

【0082】したがって、白又は黒のセルのみで構成さ
れたコードワードには不具合のある可能性が極めて高
い。本実施例では、コードワードが白又は黒のセルのみ
で構成されているか否かを判断し(図3中のS205
0)、構成されている場合には(S2050:YE
S)、そのコードワードに不具合があるとしてフラグを
セットする(S2060)。これによって、確実に誤り
位置としてのコードワードを選択することができる。ま
た、本実施例の不具合推定処理は、コードワード毎の処
理であり(S2000,S2070)、コードワード位
置情報等はデコードのための情報として予め記憶されて
いるため、比較的簡単に設計できる。
Therefore, it is highly probable that a code word composed of only white or black cells has a defect. In the present embodiment, it is determined whether or not the code word is composed of only white or black cells (S205 in FIG. 3).
0), if configured (S2050: YE
S), a flag is set as having a defect in the code word (S2060). As a result, a codeword as an error position can be reliably selected. Further, the failure estimation processing of the present embodiment is processing for each codeword (S2000, S2070), and the codeword position information and the like are stored in advance as information for decoding, so that the design can be made relatively easily.

【0083】さらにまた、本実施例の不具合推定処理で
は、データコードワードD1〜D46に含まれるある決
まった値又はある決まった範囲の値が記憶されるデータ
コードワードについては、データコードワードをデコー
ドし(図3中のS2010)、その値又はその範囲内の
値が記憶されているか否かを判断する(S2030)。
そして、デコード値が正常でない場合には(S203
0:NO)、そのデータコードワードに不具合があると
してフラグをセットする(S2040)。これによっ
て、特定のデータコードワードに対して確実にその不具
合が判断できる。
Further, in the defect estimation processing of the present embodiment, the data code word is decoded for a data code word in which a fixed value or a fixed range value included in the data code words D1 to D46 is stored. Then, it is determined whether the value or a value within the range is stored (S2030).
If the decoded value is not normal (S203
0: NO), and sets a flag assuming that the data code word has a defect (S2040). As a result, the defect can be reliably determined for a specific data code word.

【0084】なお、本実施例では、白又は黒のみのセル
で構成されたコードワードに不具合があるとしたが、白
又は黒のみのセルで構成されたコードワードに隣接する
コードワードにも不具合がある可能性が高い。QRコー
ドの汚れや破損は、図7に2点鎖線で示したように、コ
ードワードの周囲まで広がっている可能性が高いからで
ある。
In this embodiment, it is assumed that a code word composed of only white or black cells has a defect. However, a code word adjacent to a code word composed of only white or black cells has a defect. There is likely to be. This is because the dirt or damage of the QR code is likely to have spread to the periphery of the code word as indicated by the two-dot chain line in FIG.

【0085】そこで、本第1実施例の変形例として、図
3中のS2060では、選択されたコードワードに対応
するフラグをセットするだけでなく、隣接するコードワ
ードに対応するフラグもセットするようにしてもよい。
これによって、図7に示すような、コードワードD33
〜D37,E5〜E9に隣接するコードワードD19〜
D25,D32,D38,E4,E10,E21〜E2
7にもフラグがセットされることになる。このようにす
れば、不具合のある可能性の高いコードワードを確実に
推定できる可能性が高くなる。
Therefore, as a modification of the first embodiment, in S2060 in FIG. 3, not only the flag corresponding to the selected code word but also the flag corresponding to the adjacent code word is set. It may be.
Thereby, the code word D33 as shown in FIG.
~ D37, codewords D19 ~ adjacent to E5 ~ E9
D25, D32, D38, E4, E10, E21-E2
7, the flag is set. In this way, it is more likely that a code word that is likely to have a defect can be reliably estimated.

【0086】なお、本実施例における図3の不具合推定
処理が不具合領域推定処理に相当し、図2中のS101
0の処理が消失訂正処理に相当し、S1040の処理が
検出訂正処理に相当する。 [第2実施例]第2実施例は、上記第1実施例における
不具合推定処理を異にするものである。したがって、本
実施例の説明として、不具合推定処理のみを説明する。
ハードウェア構成については、上記第1実施例と同様で
あるため、同一の符号を用いて示す。
The failure estimation processing of FIG. 3 in this embodiment corresponds to the failure area estimation processing.
The processing of 0 corresponds to the erasure correction processing, and the processing of S1040 corresponds to the detection correction processing. [Second Embodiment] The second embodiment differs from the first embodiment in the defect estimation processing. Therefore, only the failure estimation processing will be described as the description of the present embodiment.
Since the hardware configuration is the same as in the first embodiment, the same reference numerals are used.

【0087】本実施例の不具合推定処理は、図8のフロ
ーチャートに示す如くである。まず最初のステップS3
000では、コード面積を算出する。この処理は、画像
中の2次元コード領域の面積を算出するものである。そ
して、続くS3010では、S3000にて算出した2
次元コード領域の面積から、コードワード1つ分の面積
を算出する。
The failure estimating process of this embodiment is as shown in the flowchart of FIG. First step S3
In 000, the code area is calculated. This process calculates the area of the two-dimensional code area in the image. Then, in subsequent S3010, 2 calculated in S3000 is used.
The area of one codeword is calculated from the area of the dimensional code area.

【0088】次のS3020では、S3010にて算出
したコードワード1つ分の面積以上の領域であって、白
又は黒のセルが偏った領域を検出する。本実施例では、
白のみで構成される領域又は黒のみで構成される領域を
検出する。例えば図5(a)に示したような、2次元コ
ードの汚れ等によって黒くなった領域や、図5(b)に
示したような、破損等によって白くなった領域を検出す
るという具合である。
In the next step S3020, an area larger than the area of one code word calculated in S3010 and in which white or black cells are biased is detected. In this embodiment,
An area consisting only of white or an area consisting only of black is detected. For example, an area blackened due to dirt or the like of the two-dimensional code as shown in FIG. 5A or an area whitened due to damage or the like as shown in FIG. 5B is detected. .

【0089】続くS3030では、検出した領域の1つ
を選択する。そして、S3040にてその領域に少なく
とも一部が含まれるコードワードを特定し、そのコード
ワードに対応するフラグをセットして、その後、S30
50へ移行する。例えば図7中の2点鎖線で示した領域
が選択された場合、この領域に少なくともその一部が含
まれるコードワードは、D19〜D25,D32〜D3
8,E4〜E10,E21〜E27のコードワードであ
るため、これらのコードワードに対してフラグがセット
される。
At S3030, one of the detected areas is selected. Then, in S3040, a code word at least partially included in the area is specified, a flag corresponding to the code word is set, and then, the process proceeds to S3040.
Move to 50. For example, when a region indicated by a two-dot chain line in FIG. 7 is selected, code words including at least a part of the region are D19 to D25 and D32 to D3.
8, E4 to E10 and E21 to E27, the flags are set for these codewords.

【0090】S3050では、検出された全ての領域を
選択したか否かを判断する。ここで検出された全ての領
域が選択されている場合(S3050:YES)、本不
具合推定処理を終了する。一方、選択されていない領域
がある場合には(S3050:NO)、S3030から
の処理を繰り返す。
In S3050, it is determined whether or not all the detected areas have been selected. If all the detected areas have been selected (S3050: YES), the failure estimation processing ends. On the other hand, if there is an area that has not been selected (S3050: NO), the processing from S3030 is repeated.

【0091】このような不具合推定処理によっても、上
記第1実施例と同様に不具合のあるコードワードを推定
することができる。したがって、訂正効率の向上という
面で上記第1実施例と同様の効果が得られる。なお、本
実施例では、1つ分のコードワード以上の面積を有し、
白又は黒のセルのみからなる領域を検出した。それは、
上述したように本実施例のQRコード500がランダム
化されており、コードワードが白又は黒のセルのみから
構成される可能性が極めて低いという事実に基づく。
With such a defect estimating process, a code word having a defect can be estimated as in the first embodiment. Therefore, an effect similar to that of the first embodiment can be obtained in terms of improvement in correction efficiency. In the present embodiment, the area is equal to or larger than one code word.
An area consisting of only white or black cells was detected. that is,
As described above, the QR code 500 of the present embodiment is randomized, which is based on the fact that it is extremely unlikely that a code word is composed of only white or black cells.

【0092】図8に示した不具合推定処理にて、どの位
の割合でセルが分布する、どの位の面積の領域を検出す
るかは、2次元コードの種類に基づいて例えば実験的に
決定すればよい。つまり、適正な状況下で生じるセルの
偏りと、2次元コードの汚れ等によって生じる不適切な
セルの偏りとを区別できる程度の面積・割合を設定し、
この条件に合う領域を検出するようにすればよく、上述
したS3010及びS3020の検出条件には限定され
ない。例えば、不具合がない時にコード領域全体の1/
4の領域を見ると白又は黒のセルの偏りが70%を越え
ることが稀な2次元コードであれば、図6中のS301
0においてコード面積の1/4の面積を算出し、S30
20にて、80%以上で白又は黒のセルが偏って分布し
ている、コード面積の1/4以上の領域を検出するとい
う具合である。
In the defect estimating process shown in FIG. 8, the proportion of cells to be distributed and the area of the area to be detected are determined, for example, experimentally based on the type of the two-dimensional code. I just need. In other words, an area and a ratio are set so as to be able to distinguish between the cell bias generated under an appropriate situation and the inappropriate cell bias generated due to contamination of the two-dimensional code, etc.
What is necessary is just to detect the area | region which meets this condition, and it is not limited to the detection conditions of S3010 and S3020 mentioned above. For example, when there is no defect, 1 /
In the area of No. 4, if the two-dimensional code is such that the deviation of the white or black cells rarely exceeds 70%, the processing proceeds to S301 in FIG.
0, the area of 1/4 of the code area is calculated, and S30
At 20, it is possible to detect a region of 80 or more of the code area where white or black cells are unevenly distributed at 80% or more.

【0093】本実施例のような不具合推定処理では、白
又は黒のセルが偏って分布する領域を検出する処理ステ
ップが必要となるが、検出する領域内のセルの偏り具合
や検出する領域の面積を変えることによって、種々の2
次元コードに適用できる点で有利である。
In the failure estimating process as in this embodiment, a processing step for detecting an area where white or black cells are unevenly distributed is required. By changing the area, various 2
It is advantageous in that it can be applied to dimensional codes.

【0094】なお、本実施例においては、図8に示した
不具合推定処理が不具合領域推定処理に相当する。 [その他]上記第1又は第2実施例に示した不具合推定
処理に加え、又は代え、次のようにしてコードワードの
不具合を推定するようにしてもよい。
In this embodiment, the failure estimation processing shown in FIG. 8 corresponds to the failure area estimation processing. [Others] In addition to or instead of the defect estimating process shown in the first or second embodiment, a code word defect may be estimated as follows.

【0095】(い)画像メモリ20に取り込まれた多値
データとしての2次元コード画像が適正に2値化ができ
ない状況も生じ得る。例えば2次元コードがグレーのイ
ンク等で汚れた場合等、白セルの部分が白とも黒とも判
定できなくなることが考えられる。これは、図9に示す
ように、汚れ部分に対応する多値データの振幅(レベル
変化)が小さくなってしまうからである。
(I) There may be a situation where a two-dimensional code image as multi-valued data taken into the image memory 20 cannot be properly binarized. For example, when the two-dimensional code is stained with gray ink or the like, it is conceivable that the white cell portion cannot be determined as white or black. This is because, as shown in FIG. 9, the amplitude (level change) of the multivalued data corresponding to the stained portion becomes small.

【0096】そこで、上記第2実施例の不具合推定処理
のS3020において、多値データの適正な2値化が不
可能な振幅部分に対応する領域を検出するようにしても
よい。例えば振幅が所定値以下であるか否かを判断する
ことによって、その領域を検出するという具合である。
このようにすれば、その後、S3040にて、この領域
に少なくともその一部が含まれるコードワードに不具合
があるとしてフラグがセットされる。これによって、適
正な2値化ができない可能性の高い領域を含むコードワ
ードが選択できる。
Therefore, in S3020 of the failure estimating process of the second embodiment, an area corresponding to an amplitude portion where multi-valued data cannot be properly binarized may be detected. For example, the area is detected by determining whether the amplitude is equal to or less than a predetermined value.
By doing so, a flag is set in S3040 assuming that there is a defect in the code word at least partially included in this area. As a result, a codeword including an area where it is highly likely that proper binarization cannot be performed can be selected.

【0097】なお、この場合も上記第2実施例と同様
に、図8に示した不具合推定処理が不具合領域推定処理
に相当する。 (ろ)2次元コード画像の不具合は、2次元コード自体
の汚れや破損だけでなく、2次元コードを画像として取
り込む過程でも発生する。例えば図12に示すように、
CCDエリアセンサ12の取り込み視野から読取対象の
QRコード500の一部がはみ出し、画像中にQRコー
ドの一部が取り込まれない状況が考えられる。
In this case, similarly to the second embodiment, the failure estimation processing shown in FIG. 8 corresponds to the failure area estimation processing. (R) The defect of the two-dimensional code image occurs not only in the case where the two-dimensional code itself is dirty or damaged, but also in the process of capturing the two-dimensional code as an image. For example, as shown in FIG.
It is conceivable that a part of the QR code 500 to be read protrudes from the field of view of the CCD area sensor 12 and part of the QR code is not captured in the image.

【0098】そこで、この場合には、図10に示すよう
なコード領域に基づく推定処理を実行することが考えら
れる。すなわち、2次元コード領域の4頂点を検出し
(S4000)、検出した4頂点が画像内にあるか否か
を判断する(S4010)。そして、画像内にあれば
(S4010:YES)、処理を終了する。一方、画像
内になければ(S4010:NO)、画像に写っていな
い領域を算出する(S4020)。画像に写っていない
領域は、画像に写っている領域を算出することによって
特定できる。そして、画像に写っていない領域に少なく
ともその一部が含まれるコードワードに不具合があると
してフラグをセットする(S4030、図12参照)。
Therefore, in this case, it is conceivable to execute an estimation process based on a code area as shown in FIG. That is, four vertices of the two-dimensional code area are detected (S4000), and it is determined whether the detected four vertices are in the image (S4010). If it is within the image (S4010: YES), the process ends. On the other hand, if it is not in the image (S4010: NO), an area not shown in the image is calculated (S4020). The area not shown in the image can be specified by calculating the area shown in the image. Then, a flag is set assuming that there is a defect in a code word at least partially included in an area not shown in the image (S4030, see FIG. 12).

【0099】なお、この場合は、図10に示したコード
領域に基づく推定処理が不具合領域推定処理に相当す
る。 (は)また、2次元コードには一般的に、画像中のコー
ド領域やセル位置を特定するための位置決め用シンボ
ル、タイミングセルといった機能パターンが含まれる。
例えばQRコードで言えば、図14に示した位置決め用
シンボル510a,510b,510c及びタイミング
セル520a,520bがここでいう機能パターンであ
る。
In this case, the estimation processing based on the code area shown in FIG. 10 corresponds to the defective area estimation processing. (I) In addition, a two-dimensional code generally includes a functional pattern such as a positioning symbol for specifying a code area or a cell position in an image, and a timing cell.
For example, in the case of a QR code, the positioning symbols 510a, 510b, and 510c and the timing cells 520a and 520b shown in FIG.

【0100】そこで、次のよう図11に示す機能パター
ンに基づく推定処理を実行してもよい。すなわち、図9
に示すように、特定パターンに不具合があるか否かを判
断し(S5000)、不具合がなければ(S5000:
NO)処理を終了し、不具合があれば(S5000:Y
ES)、特定パターンに隣接するコードワードに対応す
るフラグをセットする(S5010)。
Therefore, an estimation process based on the function pattern shown in FIG. 11 may be executed as follows. That is, FIG.
As shown in (5), it is determined whether or not there is a defect in the specific pattern (S5000), and if there is no defect (S5000:
NO) The process ends, and if there is a problem (S5000: Y
ES), a flag corresponding to a code word adjacent to the specific pattern is set (S5010).

【0101】機能パターンは、決まったセルで構成され
ている。例えばQRコードの有する位置決め用シンボル
510a,510b,510cは、例えば、一辺の長さ
が7セルに相当する黒い正方形512、一辺の長さが5
セルに相当する白い正方形514、一辺の長さが3セル
に相当する黒い正方形516を同心状に重ね合わせた時
にできる図形である(図14参照)。
The function pattern is composed of fixed cells. For example, the positioning symbols 510a, 510b, and 510c included in the QR code are, for example, black squares 512 each having a side length of 7 cells, and each side having a length of 5 cells.
This is a figure formed when a white square 514 corresponding to a cell and a black square 516 having a side length of 3 cells are superimposed concentrically (see FIG. 14).

【0102】したがって、この機能パターンが決まった
セルで構成されていない場合、例えば図12(b)に示
すように位置決め用シンボルやタイミングセルに汚れ等
がある場合には、機能パターンに不具合があるとしてよ
い。このときは、この機能パターンの周辺に位置するコ
ードワードにも不具合がある可能性が高い。そこで、機
能パターンの周辺に位置するコードワードに不具合があ
ると推定する。例えば図7中の左上の位置決め用シンボ
ルに不具合があれば、E63〜E68,E78,E8
3,E88のコードワードに不具合があるとするという
具合である。なお、「周辺」に位置するコードワード
は、このように機能パターンに隣接するものとしてもよ
いが、2次元コードの使用環境に応じて決めてよい。例
えば2次元コードの汚れ等が広い範囲で生じるような環
境であれば「周辺」を比較的大きな領域とする。逆に2
次元コードの汚れ等が狭い範囲で生じるような環境であ
れば「周辺」を比較的小さな領域とする。このようにす
れば、汚れ等が原因で生じる機能パターン周囲のコード
ワードの不具合を確実に検出することができる。
Therefore, when the function pattern is not composed of fixed cells, for example, when the positioning symbol and the timing cell are dirty as shown in FIG. 12B, the function pattern has a defect. It may be. At this time, there is a high possibility that a code word located around the function pattern has a defect. Therefore, it is presumed that a code word located around the function pattern has a defect. For example, if there is a defect in the upper left positioning symbol in FIG. 7, E63 to E68, E78, E8
It is assumed that there is a defect in the code word of 3, E88. The code word located in the “periphery” may be adjacent to the function pattern as described above, but may be determined according to the use environment of the two-dimensional code. For example, in an environment in which dirt or the like of a two-dimensional code occurs in a wide range, the “periphery” is a relatively large area. Conversely 2
In an environment in which dirt on a dimensional code or the like occurs in a narrow range, the "periphery" is a relatively small area. In this way, it is possible to reliably detect a defect in the code word around the function pattern caused by dirt or the like.

【0103】この場合は、図11に示した機能パターン
に基づく推定処理が不具合領域推定処理に相当する。
In this case, the estimation processing based on the function patterns shown in FIG. 11 corresponds to the defective area estimation processing.

【図面の簡単な説明】[Brief description of the drawings]

【図1】実施例の2次元コード読取装置の構成を示すブ
ロック図である。
FIG. 1 is a block diagram illustrating a configuration of a two-dimensional code reader according to an embodiment.

【図2】2次元コードの読取処理を示すフローチャート
である。
FIG. 2 is a flowchart showing a two-dimensional code reading process.

【図3】第1実施例の不具合領域推定処理を示すフロー
チャートである。
FIG. 3 is a flowchart illustrating a defective area estimation process according to the first embodiment.

【図4】コード情報を構成するコードワードと符号化さ
れたブロックとの関係を示す説明図である。
FIG. 4 is an explanatory diagram showing the relationship between codewords constituting code information and encoded blocks.

【図5】コードの汚れ及び破損による2次元コード画像
の不具合を示す説明図である。
FIG. 5 is an explanatory diagram showing a defect of a two-dimensional code image due to dirt and breakage of a code.

【図6】不具合のあるコードワードが特定された様子を
示す説明図である。
FIG. 6 is an explanatory diagram showing a state where a defective codeword is specified;

【図7】汚れによる不具合発生領域を示す説明図であ
る。
FIG. 7 is an explanatory diagram showing a defect occurrence area due to dirt.

【図8】第2実施例の不具合推定処理を示すフローチャ
ートである。
FIG. 8 is a flowchart illustrating a failure estimating process according to the second embodiment.

【図9】コードの汚れと多値データの振幅との関係を示
す説明図である。
FIG. 9 is an explanatory diagram showing the relationship between code contamination and the amplitude of multi-value data.

【図10】コード領域に基づく推定処理を示すフローチャ
ートである。
FIG. 10 is a flowchart illustrating an estimation process based on a code area.

【図11】機能パターンに基づく推定処理を示すフローチ
ャートである。
FIG. 11 is a flowchart illustrating an estimation process based on a function pattern.

【図12】(a)はコード領域の一部が画像として取り込
まれない状況を示す説明図であり、(b)は機能パター
ンに不具合がある状態を示す説明図である。
12A is an explanatory diagram illustrating a situation where a part of a code area is not captured as an image, and FIG. 12B is an explanatory diagram illustrating a state in which a function pattern has a defect.

【図13】(a)はバーコードを示す説明図であり、
(b)は2次元コードを示す説明図である。
FIG. 13A is an explanatory diagram illustrating a barcode,
(B) is an explanatory view showing a two-dimensional code.

【図14】QRコードの構成を示す説明図である。FIG. 14 is an explanatory diagram showing a configuration of a QR code.

【符号の説明】[Explanation of symbols]

1…2次元コード読取装置 10…読取制御回路 11…照明用発光ダイオード 12…CCDエリアセンサ13…増幅回路 14…A/D変換回路 16…同期パルス発生回路 17…アドレス発生回路 20…画像メモリ 31…スイッチ群 32…液晶表示器 33…通信I/F回路 DESCRIPTION OF SYMBOLS 1 ... Two-dimensional code reader 10 ... Reading control circuit 11 ... Light emitting diode 12 for illumination 12 ... CCD area sensor 13 ... Amplification circuit 14 ... A / D conversion circuit 16 ... Synchronous pulse generation circuit 17 ... Address generation circuit 20 ... Image memory 31 ... Switch group 32 ... Liquid crystal display 33 ... Communication I / F circuit

Claims (13)

【特許請求の範囲】[Claims] 【請求項1】セルの分布パターンによって情報を表現す
る2次元コードを画像として取り込み、当該2次元コー
ド画像に基づいて前記情報を読み取るにあたり、前記2
次元コード画像に不具合がある場合には、前記2次元コ
ードに含まれる誤り訂正データを用い、前記2次元コー
ド画像の不具合によって生じる誤りを訂正する誤り訂正
方法において、 前記情報を構成する単位となる領域であって、前記不具
合がある単位情報領域を、前記誤り訂正データを用いる
ことなく前記2次元コード画像の特徴に基づき、符号の
誤り位置に相当する不具合領域として推定する不具合領
域推定処理を実行し、 続いて、前記不具合領域推定処理にて推定された前記単
位情報領域に対し、前記誤り訂正データを用い、誤り量
を計算して誤りを訂正する消失訂正処理を実行すること
を特徴とする誤り訂正方法。
1. A two-dimensional code representing information by a cell distribution pattern is taken in as an image, and the information is read based on the two-dimensional code image.
In the case where there is a defect in the two-dimensional code image, in an error correction method for correcting an error caused by the defect of the two-dimensional code image using error correction data included in the two-dimensional code, the information is a unit constituting the information. Executing a defect area estimation process of estimating a unit information area having the defect as a defect area corresponding to a code error position based on characteristics of the two-dimensional code image without using the error correction data. Then, an erasure correction process of calculating an error amount and correcting an error is performed on the unit information area estimated in the defect area estimation process using the error correction data. Error correction method.
【請求項2】請求項1に記載の誤り訂正方法において、 前記消失訂正処理は、前記不具合領域推定処理にて推定
された前記単位情報領域以外の単位情報領域に対して
は、前記誤り訂正データを用い、不具合の有無を検出す
ると共に誤り量を計算して誤りを訂正する処理であるこ
とを特徴とする誤り訂正方法。
2. The error correction method according to claim 1, wherein the erasure correction processing is performed on the error correction data for a unit information area other than the unit information area estimated in the defect area estimation processing. An error correction method comprising: detecting whether there is a defect and calculating an error amount to correct the error.
【請求項3】請求項1又は2に記載の誤り訂正方法にお
いて、 前記不具合領域推定処理は、白又は黒のいずれか一方の
セルが所定割合以上で偏って分布している所定面積以上
の領域を検出し、当該領域に少なくともその一部が含ま
れる前記単位情報領域を前記不具合領域として推定する
処理であることを特徴とする誤り訂正方法。
3. The error correction method according to claim 1, wherein the defective area estimating process is performed on an area having a predetermined area or more in which one of white and black cells is unevenly distributed at a predetermined ratio or more. And correcting the unit information area including at least a part of the area as the defective area.
【請求項4】請求項1又は2に記載の誤り訂正方法にお
いて、 前記不具合領域推定処理は、白又は黒のいずれか一方の
セルだけで構成された前記単位情報領域を前記不具合領
域として推定する処理であることを特徴とする誤り訂正
方法。
4. The error correction method according to claim 1, wherein said defective area estimating process estimates said unit information area composed of only one of white and black cells as said defective area. An error correction method characterized by processing.
【請求項5】請求項4に記載の誤り訂正方法において、 前記不具合領域推定処理は、白又は黒のいずれか一方の
セルだけで構成された前記単位情報領域に加え、当該単
位情報領域に隣接する単位情報領域を前記不具合領域と
して推定する処理であることを特徴とする誤り訂正方
法。
5. The error correction method according to claim 4, wherein the defective area estimating process is performed in addition to the unit information area configured by only one of white and black cells and an adjacent area to the unit information area. An error correction method characterized by a process of estimating a unit information area to be performed as the defective area.
【請求項6】請求項1〜5のいずれかに記載の誤り訂正
方法において、 前記2次元コード画像は多値データであり、 前記不具合領域推定処理は、前記多値データの適正な2
値化が不可能な振幅部分に対応する領域を検出し、当該
領域に少なくとも一部が含まれる前記単位情報領域を前
記不具合領域として推定する処理であることを特徴とす
る誤り訂正方法。
6. The error correction method according to claim 1, wherein said two-dimensional code image is multi-valued data, and said defect area estimating process is performed by using an appropriate two-dimensional data of said multi-valued data.
An error correction method, comprising: detecting a region corresponding to an amplitude portion that cannot be converted into a value; and estimating the unit information region including at least a part of the region as the defective region.
【請求項7】請求項1〜6のいずれかに記載の誤り訂正
方法において、 前記不具合領域推定処理は、前記2次元コード画像に前
記2次元コードの一部の領域が写っていない場合、当該
領域に少なくともその一部が含まれる前記単位情報領域
を前記不具合領域として推定する処理であることを特徴
とする誤り訂正方法。
7. The error correction method according to claim 1, wherein the defective area estimation processing is performed when a partial area of the two-dimensional code is not shown in the two-dimensional code image. An error correction method, wherein the unit information area including at least a part of the area is estimated as the defective area.
【請求項8】請求項1〜7のいずれかに記載の誤り訂正
方法において、 前記不具合領域推定処理は、前記2次元コード画像中に
含まれる機能パターンに不具合があるか否かを判断し、
当該機能パターンに不具合があれば、当該機能パターン
の周辺に位置する前記単位情報領域を前記不具合領域と
して推定する処理であることを特徴とする誤り訂正方
法。
8. The error correction method according to claim 1, wherein the defect area estimating process determines whether there is a defect in a function pattern included in the two-dimensional code image,
If there is a defect in the function pattern, the error correction method is a process of estimating the unit information area located around the function pattern as the defect area.
【請求項9】請求項1〜8のいずれかに記載の誤り訂正
方法において、 前記不具合領域推定処理は、ある決まった値又はある決
まった範囲の値が記憶される単位情報領域に当該値又は
当該範囲内の値が記録されていない場合には、当該単位
情報領域を前記不具合領域として推定する処理であるこ
とを特徴とする誤り訂正方法。
9. The error correction method according to claim 1, wherein the defective area estimation processing includes the step of determining the value or a value in a unit information area in which a fixed value or a fixed range of values is stored. An error correction method characterized in that when a value within the range is not recorded, the unit information area is estimated as the defective area.
【請求項10】請求項1〜9のいずれかに記載の誤り訂
正方法において、 さらに、前記誤り訂正データを用いて、前記単位情報領
域の誤り検出を行うと共に当該誤り検出結果に基づく誤
り訂正を行う検出訂正処理を含み、以下の(イ)又は
(ロ)のいずれかの順序で処理を実行することを特徴と
する誤り訂正方法。 (イ)最初に前記不具合領域推定処理及び前記消失訂正
処理を実行し、誤りを訂正できない場合には、次に前記
検出訂正処理を実行する。 (ロ)最初に前記検出訂正処理を実行し、誤りを訂正で
きない場合には、次に前記不具合領域推定処理及び前記
消失訂正処理を実行する。
10. The error correction method according to claim 1, further comprising: performing error detection of said unit information area using said error correction data, and performing error correction based on said error detection result. An error correction method including a detection and correction process to be performed, and performing the process in any of the following order (a) or (b). (A) First, the defective area estimation processing and the erasure correction processing are executed. If the error cannot be corrected, the detection correction processing is executed next. (B) First, the detection and correction processing is executed, and if an error cannot be corrected, the defective area estimation processing and the erasure correction processing are next executed.
【請求項11】請求項1〜10のいずれかに記載の誤り
訂正方法を用いて誤りを訂正し、前記2次元コード画像
に基づいて前記情報を読み取ることを特徴とする2次元
コード読取方法。
11. A two-dimensional code reading method, comprising: correcting an error using the error correction method according to claim 1; and reading the information based on the two-dimensional code image.
【請求項12】請求項11に記載の2次元コード読取方
法を用いて2次元コードとして記録された情報を読み取
ることを特徴とする2次元コード読取装置。
12. A two-dimensional code reading apparatus for reading information recorded as a two-dimensional code by using the two-dimensional code reading method according to claim 11.
【請求項13】請求項1〜10のいずれかに記載の誤り
訂正方法又は請求項11に記載の2次元コード読取方法
が、コンピュータシステムにて実行されるプログラムと
して記録されたことを特徴とする記録媒体。
13. An error correction method according to claim 1 or a two-dimensional code reading method according to claim 11, recorded as a program to be executed by a computer system. recoding media.
JP2000220761A 1999-09-29 2000-07-21 Error correcting method, method and device for reading two-dimensional code and recording medium Pending JP2001167222A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000220761A JP2001167222A (en) 1999-09-29 2000-07-21 Error correcting method, method and device for reading two-dimensional code and recording medium

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11-276458 1999-09-29
JP27645899 1999-09-29
JP2000220761A JP2001167222A (en) 1999-09-29 2000-07-21 Error correcting method, method and device for reading two-dimensional code and recording medium

Publications (1)

Publication Number Publication Date
JP2001167222A true JP2001167222A (en) 2001-06-22

Family

ID=26551913

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000220761A Pending JP2001167222A (en) 1999-09-29 2000-07-21 Error correcting method, method and device for reading two-dimensional code and recording medium

Country Status (1)

Country Link
JP (1) JP2001167222A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008083843A (en) * 2006-09-26 2008-04-10 Casio Comput Co Ltd Code reader and program
KR100848614B1 (en) 2006-03-30 2008-07-28 후지쯔 가부시끼가이샤 Error correction apparatus
JP2011118722A (en) * 2009-12-04 2011-06-16 Denso Wave Inc Optical information reading apparatus
JP2011223093A (en) * 2010-04-05 2011-11-04 Canon Inc Image forming apparatus, image forming method, program therefor and storage medium
CN102568608A (en) * 2012-02-24 2012-07-11 南京大学 Improved method for strengthening QR (Quick Response) code error correcting capability
CN102819724A (en) * 2012-08-02 2012-12-12 广东正迪科技股份有限公司 Two-dimensional code label anti-counterfeiting identification system and method based on smart phone
JP2013148981A (en) * 2012-01-17 2013-08-01 Denso Wave Inc Two-dimensional code reading device
WO2014098130A1 (en) * 2012-12-19 2014-06-26 株式会社デンソーウェーブ Information code, information code generation method, information code reader device, and information code usage system
JP2015084199A (en) * 2013-01-23 2015-04-30 株式会社デンソーウェーブ Information code creation method, information code, information code reading device, and information code use system
CN104700064A (en) * 2015-04-02 2015-06-10 宁波聚思信息科技有限公司 Packaging bar code error correction integrated equipment
CN104796252A (en) * 2014-01-20 2015-07-22 北京大学 Variable data label anti-counterfeiting method, variable data label anti-counterfeiting device, variable data label authenticating method and variable data label authenticating system
US10147028B2 (en) 2014-10-07 2018-12-04 Denso Wave Incorporated Method and apparatus for producing information code having an image display region with a code figure
WO2019017433A1 (en) * 2017-07-20 2019-01-24 株式会社デンソーウェーブ Two-dimensional code and two-dimensional code reading device
CN111079463A (en) * 2019-10-22 2020-04-28 福建新大陆支付技术有限公司 Method for generating contaminated two-dimensional code for software test
JP2021119465A (en) * 2016-01-26 2021-08-12 ハンド ヘルド プロダクツ インコーポレーティッド Enhanced matrix symbol error correction method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06203489A (en) * 1992-12-30 1994-07-22 Sony Corp Error correction method
JPH09259546A (en) * 1996-03-25 1997-10-03 Toshiba Corp Error correction system using vanishing flag
JPH10111904A (en) * 1996-10-04 1998-04-28 Matsushita Electric Ind Co Ltd Bar code reader and recording medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06203489A (en) * 1992-12-30 1994-07-22 Sony Corp Error correction method
JPH09259546A (en) * 1996-03-25 1997-10-03 Toshiba Corp Error correction system using vanishing flag
JPH10111904A (en) * 1996-10-04 1998-04-28 Matsushita Electric Ind Co Ltd Bar code reader and recording medium

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100848614B1 (en) 2006-03-30 2008-07-28 후지쯔 가부시끼가이샤 Error correction apparatus
JP2008083843A (en) * 2006-09-26 2008-04-10 Casio Comput Co Ltd Code reader and program
JP2011118722A (en) * 2009-12-04 2011-06-16 Denso Wave Inc Optical information reading apparatus
JP2011223093A (en) * 2010-04-05 2011-11-04 Canon Inc Image forming apparatus, image forming method, program therefor and storage medium
JP2013148981A (en) * 2012-01-17 2013-08-01 Denso Wave Inc Two-dimensional code reading device
CN102568608B (en) * 2012-02-24 2014-08-27 南京大学 Improved method for strengthening QR (Quick Response) code error correcting capability
CN102568608A (en) * 2012-02-24 2012-07-11 南京大学 Improved method for strengthening QR (Quick Response) code error correcting capability
CN102819724A (en) * 2012-08-02 2012-12-12 广东正迪科技股份有限公司 Two-dimensional code label anti-counterfeiting identification system and method based on smart phone
US10062022B2 (en) 2012-12-19 2018-08-28 Denso Wave Incorporated Information code, information code producing method, information code reader, and system which uses information code
WO2014098130A1 (en) * 2012-12-19 2014-06-26 株式会社デンソーウェーブ Information code, information code generation method, information code reader device, and information code usage system
JP2015084199A (en) * 2013-01-23 2015-04-30 株式会社デンソーウェーブ Information code creation method, information code, information code reading device, and information code use system
CN104796252A (en) * 2014-01-20 2015-07-22 北京大学 Variable data label anti-counterfeiting method, variable data label anti-counterfeiting device, variable data label authenticating method and variable data label authenticating system
US10147028B2 (en) 2014-10-07 2018-12-04 Denso Wave Incorporated Method and apparatus for producing information code having an image display region with a code figure
CN104700064B (en) * 2015-04-02 2017-11-07 宁波聚思信息科技有限公司 One kind packaging bar code error correction integration apparatus
CN104700064A (en) * 2015-04-02 2015-06-10 宁波聚思信息科技有限公司 Packaging bar code error correction integrated equipment
JP2021119465A (en) * 2016-01-26 2021-08-12 ハンド ヘルド プロダクツ インコーポレーティッド Enhanced matrix symbol error correction method
US11449700B2 (en) 2016-01-26 2022-09-20 Hand Held Products, Inc. Enhanced matrix symbol error correction method
JP7263423B2 (en) 2016-01-26 2023-04-24 ハンド ヘルド プロダクツ インコーポレーティッド Improved matrix symbol error fix
US11727232B2 (en) 2016-01-26 2023-08-15 Hand Held Products, Inc. Enhanced matrix symbol error correction method
WO2019017433A1 (en) * 2017-07-20 2019-01-24 株式会社デンソーウェーブ Two-dimensional code and two-dimensional code reading device
JP2019021165A (en) * 2017-07-20 2019-02-07 株式会社デンソーウェーブ Two-dimensional code and two-dimensional code reading device
CN110945530A (en) * 2017-07-20 2020-03-31 电装波动株式会社 Two-dimensional code and two-dimensional code reading device
CN110945530B (en) * 2017-07-20 2024-01-16 电装波动株式会社 Two-dimensional code and two-dimensional code reading device
CN111079463A (en) * 2019-10-22 2020-04-28 福建新大陆支付技术有限公司 Method for generating contaminated two-dimensional code for software test

Similar Documents

Publication Publication Date Title
JP2001167222A (en) Error correcting method, method and device for reading two-dimensional code and recording medium
US5454054A (en) Method and apparatus for recording/reproducing mesh pattern data
US7694889B2 (en) Printed material having location identification function, two-dimensional coordinate identification apparatus, image-forming apparatus and the method thereof
JP3896827B2 (en) Information code decoding method and decoding system
JP4564813B2 (en) Two-dimensional barcode and code decoding method thereof
US6685095B2 (en) Apparatus and method for decoding damaged optical codes
US7555699B2 (en) Storage control circuit, and method for address error check in the storage control circuit
US5553084A (en) Error correction enhancement for code one and other machine-readable symbologies
JP2004234318A (en) Two-dimension information code, and display method, generation method and reading method thereof
JP2005267598A5 (en)
JP6216229B2 (en) Imaging device and imaging system
JP2004536392A5 (en)
US6641051B1 (en) System for embedded digital data that allows embedding of data around known obstructions
KR20030085511A (en) 2d barcode card and its decoding method
US8353461B2 (en) Image processing apparatus, identification apparatus, electronic writing instrument, method for determining bit sequence and computer readable medium
JP2500859B2 (en) Bar code reader
US5778011A (en) Method and apparatus for writing and protecting against random and cluster errors in image blocks
JP5379626B2 (en) Stack bar code information reading method and stack bar code information reading device
JP5359858B2 (en) Information code and information code generation method
JPH10111904A (en) Bar code reader and recording medium
US7308190B2 (en) Device for decoding disc read signal and method thereof
JP4241803B2 (en) Two-dimensional information code reading method and reading apparatus
JP4155156B2 (en) Bar code reader and bar code discrimination method
JPH0311481A (en) Method and device for recording data, recording medium, and method and device for reproducing data
JP2001256425A (en) Optical information reader

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040330

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040803