JP5592234B2 - Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program - Google Patents

Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program Download PDF

Info

Publication number
JP5592234B2
JP5592234B2 JP2010240939A JP2010240939A JP5592234B2 JP 5592234 B2 JP5592234 B2 JP 5592234B2 JP 2010240939 A JP2010240939 A JP 2010240939A JP 2010240939 A JP2010240939 A JP 2010240939A JP 5592234 B2 JP5592234 B2 JP 5592234B2
Authority
JP
Japan
Prior art keywords
dimensional code
data
bit
bits
encoded data
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.)
Active
Application number
JP2010240939A
Other languages
Japanese (ja)
Other versions
JP2012093971A (en
Inventor
和宏 笹尾
英隆 山下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Steel Corp
NS Solutions Corp
Original Assignee
Nippon Steel Corp
NS Solutions 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 Nippon Steel Corp, NS Solutions Corp filed Critical Nippon Steel Corp
Priority to JP2010240939A priority Critical patent/JP5592234B2/en
Publication of JP2012093971A publication Critical patent/JP2012093971A/en
Application granted granted Critical
Publication of JP5592234B2 publication Critical patent/JP5592234B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、データを符号化して、二次元のマトリックス上にパターンとして配置した二次元コードを生成、読み取るための技術に関するものである。   The present invention relates to a technique for encoding and generating a two-dimensional code arranged as a pattern on a two-dimensional matrix.

近年、固体識別等のためにバーコードが多く利用されてきている。例えば特許文献1には、文字や数字情報を略正方形に構成された二次元コード化する技術が開示されている。また、特許文献2には、縦横比の異なる長方形で構成された二次元コードの技術が開示されている。   In recent years, many barcodes have been used for solid identification and the like. For example, Patent Document 1 discloses a technique for converting two-dimensional coding of character and number information into a substantially square shape. Patent Document 2 discloses a technique of a two-dimensional code composed of rectangles having different aspect ratios.

ところで、特許文献1に開示された二次元コードは略正方形に構成されることから、情報量を増やすと縦横ともにコードサイズが大きくなる。従って、細長い形状の対象物に付するには不都合が生じる。例えば従来から用いられている1次元バーコードは、比較的細長い形状への表示は可能であるが、直線状の汚れに弱かったり、インクジェット式の印字では細線を表示することが困難であったりする。また、同じ面積を占有することで比較すると、二次元コードと比べて情報量が少ないという欠点がある。また、特許文献2に開示される二次元コードは長方形で構成されるため、特許文献1に開示される略正方形の二次元コードに比べると細長い形状に付するに都合がよい。   By the way, since the two-dimensional code disclosed in Patent Document 1 is configured in a substantially square shape, the code size increases both vertically and horizontally when the amount of information is increased. Therefore, inconvenience arises when attached to an elongated object. For example, a conventionally used one-dimensional bar code can be displayed in a relatively long and narrow shape, but is weak against linear stains, and it is difficult to display a thin line in ink jet printing. . Further, when compared by occupying the same area, there is a disadvantage that the amount of information is smaller than that of the two-dimensional code. In addition, since the two-dimensional code disclosed in Patent Document 2 is formed in a rectangular shape, it is convenient to attach an elongated shape compared to the substantially square two-dimensional code disclosed in Patent Document 1.

特許第2938338号公報Japanese Patent No. 2938338 特許第4247190号公報Japanese Patent No. 4247190

しかしながら、特許文献2に開示される技術では、カードに表示された二次元コードをカメラでカード1枚毎に撮影することが想定されている。対象物に付された細長い形状の二次元コードの場合、1画面として捉えるより、場合によっては二次元コードをスキャンして読み取ることの方が好都合であることも多い。   However, in the technique disclosed in Patent Document 2, it is assumed that a two-dimensional code displayed on a card is photographed for each card with a camera. In the case of an elongated two-dimensional code attached to an object, it is often more convenient to scan and read the two-dimensional code in some cases than to capture it as one screen.

一般的に細長く構成された二次元コードをスキャンして認識する場合、スキャン速度によっては誤認識が発生しやすく、その対処が必要であるが特許文献2ではそのような考慮について開示されていない。   In general, when a long and thin two-dimensional code is recognized by scanning, erroneous recognition is likely to occur depending on the scanning speed, and it is necessary to deal with it, but Patent Document 2 does not disclose such consideration.

以上のことに鑑みて、この発明の目的とするところは、細長く構成された二次元コードをスキャンして認識する場合でも、二次元コードのデータビットの誤認識を回避し安定的にコード認識処理を行えるような二次元コード生成装置とプログラムを提供することである。   In view of the above, an object of the present invention is to stably perform code recognition processing by avoiding erroneous recognition of data bits of a two-dimensional code, even when scanning and recognizing a two-dimensional code formed in an elongated shape. It is to provide a two-dimensional code generation device and a program that can perform the above.

本発明の二次元コード生成装置は、符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを生成する二次元コード生成装置であって、前記符号化されたデータに対し、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを、符号化されたデータ毎に区分する間隔で周期的に挿入し、スタートビット及びエンドビットを付加した前記二次元コードを生成する二次元コード生成手段を有することを特徴とする。
本発明の二次元コード読取装置は、符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを読み取る二次元コード読取装置であって、スタートビット及びエンドビットを検出することにより前記二次元コードを読み取る読取手段と、前記二次元コードにおいて前記符号化されたデータに対して符号化されたデータ毎に区分する間隔で周期的に挿入された隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを基準にして、前記二次元コードから前記冗長化データにより区分された前記符号化されたデータを検出する検出手段と、前記検出手段により検出された前記符号化されたデータを復号化する復号化手段とを有することを特徴とする。
本発明の二次元コードは、符号化されたデータが二次元のマトリックス上にパターンとして配置された二次元コードであって、前記符号化されたデータに対して、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データが周期的に挿入され、スタートビット及びエンドビットが付加されたことを特徴とする
Two-dimensional code generating apparatus of the present invention is a two-dimensional code generating device for generating a two-dimensional code arranged as a pattern marks Goka data on a two-dimensional matrix, the encoded data In contrast, the two-dimensional data in which redundant data including at least two pieces of data that are adjacent and whose values are inverted are periodically inserted at intervals for each encoded data , and a start bit and an end bit are added. characterized by having a two-dimensional code generation means to generate code.
The two-dimensional code reader of the present invention is a two-dimensional code reader that reads a two-dimensional code in which encoded data is arranged as a pattern on a two- dimensional matrix, and detects a start bit and an end bit. reading means for reading the two-dimensional code, at least the periodically inserted adjacent by the encoded encoding intervals for dividing each data to the data in the two-dimensional code, and the value is inverted the redundant data includes two data based on a detection means for detecting the encoded data divided by said redundancy data from said two-dimensional code, is the encoded detected by said detecting means And decrypting means for decrypting the received data.
The two-dimensional code of the present invention is a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix , and is adjacent to the encoded data and inverted in value. Redundant data including at least two data is periodically inserted, and a start bit and an end bit are added .

以上説明したように本発明によれば、所定のデータ構造の冗長化データを周期的に挿入して二次元コードを生成する装置と復号化する装置を提供することにより、二次元コードのデータビットの誤認識を回避し安定的にコード認識処理を行うことができる。特に鋼板の製造ラインのようなスキャンして認識する場合に好適な二次元コード認識装置とプログラムを提供することができる。   As described above, according to the present invention, data bits of a two-dimensional code are provided by providing a device for generating a two-dimensional code by periodically inserting redundant data having a predetermined data structure and a device for decoding. Therefore, the code recognition process can be performed stably. In particular, it is possible to provide a two-dimensional code recognition device and program suitable for scanning and recognizing a steel sheet production line.

本発明の実施形態に係る二次元コード生成装置及び二次元コード読取装置の機能的な構成を示す図である。It is a figure which shows the functional structure of the two-dimensional code production | generation apparatus and two-dimensional code reader which concern on embodiment of this invention. 本発明の実施形態に係る二次元コード生成装置、二次元コード読取装置のハードウェア構成を示す図である。It is a figure which shows the hardware constitutions of the two-dimensional code production | generation apparatus which concerns on embodiment of this invention, and a two-dimensional code reader. 本発明の実施形態に係る二次元コード生成装置の処理を示すフローチャートである。It is a flowchart which shows the process of the two-dimensional code production | generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係る二次元コード読取装置の処理を示すフローチャートである。It is a flowchart which shows the process of the two-dimensional code reader which concerns on embodiment of this invention. 変換テーブルの構成例を示す図である。It is a figure which shows the structural example of a conversion table. 定義テーブルの構成例を示す図である。It is a figure which shows the structural example of a definition table. 図6の定義ルール1に従って“GH”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。FIG. 7 is a diagram for explaining an example in which input data “GH” is converted into data bits according to the definition rule 1 in FIG. 6 to generate a two-dimensional code. 図6の定義ルール1に従って、図7で説明した処理により生成された二次元コードのデータビットを出力データに変換する例を説明するための図である。FIG. 8 is a diagram for explaining an example of converting data bits of a two-dimensional code generated by the process described in FIG. 7 into output data according to the definition rule 1 in FIG. 6. 図6の定義ルール2に従って“441”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。It is a figure for demonstrating the example which converts the input data "441" into a data bit according to the definition rule 2 of FIG. 6, and produces | generates a two-dimensional code. 図6の定義テーブル2に従って、図9で説明した処理により生成された二次元コードのデータビットを出力データに変換する例を説明するための図である。FIG. 10 is a diagram for explaining an example of converting data bits of a two-dimensional code generated by the process described in FIG. 9 into output data according to the definition table 2 in FIG. 6. 図6の定義ルール2に従って“441”という入力データをデータビットに変換し、冗長化ビット挿入部が定義ルール2を参照することなく、一定の周期で冗長化ビットをデータビットに対して挿入する例を説明するための図である。The input data “441” is converted into data bits according to the definition rule 2 in FIG. 6, and the redundant bit insertion unit inserts the redundant bits into the data bits at a constant cycle without referring to the definition rule 2. It is a figure for demonstrating an example. 図6の定義ルール2に従って、図11で説明した処理により生成された二次元コードのデータビットを出力データに変換する例を説明するための図である。FIG. 12 is a diagram for explaining an example of converting data bits of a two-dimensional code generated by the process described in FIG. 11 into output data according to the definition rule 2 in FIG. 6. 定義テーブルの他の例を示す図である。It is a figure which shows the other example of a definition table. 図13の定義ルール1に従って“GH”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。It is a figure for demonstrating the example which converts the input data "GH" into a data bit according to the definition rule 1 of FIG. 13, and produces | generates a two-dimensional code. 図13の定義ルール1に従って、図14で説明した処理により生成された二次元コードのデータビットを出力データに変換する例を説明するための図である。FIG. 15 is a diagram for explaining an example in which data bits of a two-dimensional code generated by the process described in FIG. 14 are converted into output data according to the definition rule 1 in FIG. 13. 定義テーブルの更に他の例と、当該定義テーブルに従って“AB012”という入力データから二次元コードを生成し、当該二次元コードを読み取る処理例とを示す図である。It is a figure which shows the further another example of a definition table, and the process example which produces | generates a two-dimensional code from the input data "AB012" according to the said definition table, and reads the said two-dimensional code. 冗長化ビットの他の態様を示す図である。It is a figure which shows the other aspect of a redundancy bit. 本発明の実施形態の一例を示すシステム構成図である。It is a system configuration figure showing an example of an embodiment of the present invention.

以下、本発明を適用した好適な実施形態を、添付図面を参照しながら詳細に説明する。   DESCRIPTION OF EXEMPLARY EMBODIMENTS Hereinafter, preferred embodiments to which the invention is applied will be described in detail with reference to the accompanying drawings.

図1は、本実施形態に係る二次元コード生成装置1及び二次元コード読取装置2の機能的な構成を示す図である。なお、二次元コード生成装置1と二次元コード読取装置2とは一体化された装置であってもよいし、夫々が個別の装置であってもよい。   FIG. 1 is a diagram illustrating a functional configuration of a two-dimensional code generation device 1 and a two-dimensional code reading device 2 according to the present embodiment. The two-dimensional code generation device 1 and the two-dimensional code reading device 2 may be an integrated device, or may be individual devices.

<二次元コード生成装置1>
図1に示すように、二次元コード生成装置1は、データ入力部11、二値化処理部12、冗長化ビット挿入部13、二次元コード出力部14、変換テーブル121、定義テーブル122を備える。データ入力部11は、二次元コードに変換される文字、数字や画像等のデータ(以下、入力データと称す)を入力する。二値化処理部12は、入力データを二値化(符号化)する。その際に、二値化処理部12は、変換テーブル121と定義テーブル122とを参照する。ここで変換テーブル121とは、図5に示すように、入力データ及び後述する出力データと二値化データとの対応関係を設定・管理するためのテーブルである。以下、二値化処理部12が入力データを変換した二値化データをデータビットと称す。また、定義テーブル122とは、入力データ及び出力データのデータ構造を定義するためのデータ(以下、定義ルールと称す)を設定・管理するためのテーブルである。より具体的には、定義ルールにおいては、入力データ及び出力データを構成する各データが「文字」であるか「数字」であるか或いは「画像」であるかが定義されている。なお、以下では説明を簡単にするために入力データが「文字」及び「数字」である場合を中心に説明する。
<Two-dimensional code generator 1>
As shown in FIG. 1, the two-dimensional code generation device 1 includes a data input unit 11, a binarization processing unit 12, a redundant bit insertion unit 13, a two-dimensional code output unit 14, a conversion table 121, and a definition table 122. . The data input unit 11 inputs data such as characters, numbers and images (hereinafter referred to as input data) to be converted into a two-dimensional code. The binarization processing unit 12 binarizes (encodes) the input data. At that time, the binarization processing unit 12 refers to the conversion table 121 and the definition table 122. Here, the conversion table 121 is a table for setting and managing the correspondence between input data and output data (to be described later) and binarized data, as shown in FIG. Hereinafter, the binarized data obtained by converting the input data by the binarization processing unit 12 is referred to as data bits. The definition table 122 is a table for setting and managing data for defining the data structures of input data and output data (hereinafter referred to as definition rules). More specifically, in the definition rule, it is defined whether each data constituting the input data and the output data is “character”, “number”, or “image”. In the following, in order to simplify the description, the case where the input data is “character” and “number” will be mainly described.

図6は、定義テーブル122の構成例を示す図である。図6の例では、定義テーブル122は、入力データ及び出力データのデータ構造として「文字」、「文字」を定義している定義ルール1と、入力データ及び出力データのデータ構造として「数字」、「数字」、「数字」を定義している定義テーブル2とを管理している。即ち、定義ルール1においては、例えば“AB”や“BD”等の2つの「文字」が並んだデータ構造を定義している。また、定義ルール2においては、例えば“123”や“578”等の3つの「数字」が並んだデータ構造を定義している。   FIG. 6 is a diagram illustrating a configuration example of the definition table 122. In the example of FIG. 6, the definition table 122 includes a definition rule 1 that defines “characters” and “characters” as data structures of input data and output data, and “numbers” as data structures of input data and output data. It manages a definition table 2 defining “numbers” and “numbers”. That is, the definition rule 1 defines a data structure in which two “characters” such as “AB” and “BD” are arranged. In the definition rule 2, for example, a data structure in which three “numbers” such as “123” and “578” are arranged is defined.

ここで、図5の変換テーブル121に示すように、「0」〜「9」の「数字」は上位2ビットの0を省略し4ビットで表現することが可能である。従って、二値化処理部12は、定義テーブル122から定義ルール2を参照すると、「数字」、「数字」、「数字」と定義されているため、入力データの各データを4ビットのデータビットに変換する。また、図5の変換テーブル121に示すように、「A」〜「Z」までの「文字」は6ビットのデータビットで表現することが可能である。従って、二値化処理部12は、定義テーブル122から定義ルール1を参照すると「文字」、「文字」と定義されているため、入力データの各データを6ビットのデータビットに変換する。   Here, as shown in the conversion table 121 of FIG. 5, “numbers” of “0” to “9” can be expressed by 4 bits by omitting the upper 2 bits of 0. Therefore, when the binarization processing unit 12 refers to the definition rule 2 from the definition table 122, it is defined as “number”, “number”, and “number”. Convert to Further, as shown in the conversion table 121 in FIG. 5, “characters” from “A” to “Z” can be represented by 6 data bits. Therefore, since the binarization processing unit 12 refers to the definition rule 1 from the definition table 122 and is defined as “character” and “character”, each data of the input data is converted into 6-bit data bits.

冗長化ビット挿入部13は、二値化処理部12によって得られたデータビットに対して冗長化ビットを挿入する。その際に冗長化ビット挿入部13は、定義テーブル122を参照し、データビットに対して冗長化ビットを挿入する位置を決定する。本実施形態において、冗長化ビットは、二次元コード読取部2が二次元コードからデータビットを検出する際の基準位置を示すビットとして扱われる。従って、各データビットの区切りとなる位置に冗長化ビットを配置することが好ましい。よって、本実施形態では、定義ルール2のように「数字」、「数字」、「数字」と定義されている場合、冗長化ビット挿入部13は、データビットに対して4ビット間隔で冗長化ビットを挿入することを決定する。また、定義ルール1のように「文字」、「文字」と定義されている場合、冗長化ビット挿入部13は、データビットに対して6ビット間隔で冗長化ビットを挿入することを決定する。このように周期的に存在する冗長化ビットの位置を検出することにより、その間に存在するデータビットを正確に検出することが可能となる。なお、入力データが画像データの場合、例えば1スキャンラインのデータ毎に冗長化ビットを挿入したり、所定画素数のデータ毎に冗長化ビットを挿入したりすれば良い。   The redundancy bit insertion unit 13 inserts redundancy bits into the data bits obtained by the binarization processing unit 12. At that time, the redundant bit insertion unit 13 refers to the definition table 122 and determines a position where the redundant bit is inserted into the data bit. In the present embodiment, the redundant bit is handled as a bit indicating a reference position when the two-dimensional code reading unit 2 detects a data bit from the two-dimensional code. Therefore, it is preferable to arrange the redundant bits at the positions where the data bits are separated. Therefore, in the present embodiment, when “number”, “number”, and “number” are defined as in the definition rule 2, the redundancy bit insertion unit 13 makes the data bits redundant at intervals of 4 bits. Decide to insert a bit. Further, when “character” and “character” are defined as in the definition rule 1, the redundant bit insertion unit 13 determines to insert redundant bits at 6-bit intervals with respect to the data bits. By detecting the positions of the redundant bits that periodically exist in this way, it is possible to accurately detect the data bits that exist between them. When the input data is image data, for example, a redundancy bit may be inserted for each data of one scan line, or a redundancy bit may be inserted for each data of a predetermined number of pixels.

さらに、冗長化ビット挿入部13は、データビットに冗長化ビットを挿入した後、その先頭部及び最後部に夫々、スタートビット及びエンドビットを付加する。このようにしておくとコードの読取時に、二次元コード読取装置2は、スタートビット及びエンドビットを二次元コードから検出することにより、どこからどこまでが二次元コードであるかを識別することが可能となる。以上のデータ処理により、二次元コードが生成される。二次元コード出力部14は、上記の二次元コードを対象物に対して印字する。なお、二次元コードとは、数値の配列である入力データを二値化(ビット化)してデータビットとし、各データビットの値(二値)を二次元のマトリックス上に、それぞれ例えば白・黒のパターンとして配置したものである。以下では、幅方向が2ビット、長さ方向がNビット(Nは自然数)の二次元のマトリックス上にデータビットを配置した二次元コードを例に挙げて説明を行う。   Further, the redundancy bit insertion unit 13 inserts the redundancy bit into the data bit, and then adds a start bit and an end bit to the head part and the last part, respectively. In this way, at the time of reading the code, the two-dimensional code reader 2 can identify from where to where the two-dimensional code is by detecting the start bit and the end bit from the two-dimensional code. Become. A two-dimensional code is generated by the above data processing. The two-dimensional code output unit 14 prints the above two-dimensional code on the object. The two-dimensional code is a binary (bit) of input data, which is an array of numerical values, to form data bits. Each data bit value (binary) is displayed on a two-dimensional matrix, for example, white It is arranged as a black pattern. In the following description, a two-dimensional code in which data bits are arranged on a two-dimensional matrix having a width direction of 2 bits and a length direction of N bits (N is a natural number) will be described as an example.

<二次元コード読取装置2>
二次元コード読取装置2について説明する。図1に示すように、二次元コード読取装置2は、二次元コード読取部21、データビット検出部22、データ変換部23、データ出力部24を備えている。二次元コード読取部21は、対象物に印字された二次元コードを読み取る。データビット検出部22は、二次元コードから冗長化ビットの位置を検出し、冗長化ビットの位置を基準にしてデータビットを検出する。即ち、データビット検出部22は、周期的に現れる冗長化ビットを検出し、その間に存在するデータビットを検出する。その際、データビット検出部22は、定義テーブル122から定義ルールを参照する。定義ルール2のようにデータ構造として「数字」、「数字」、「数字」と定義されている場合、データビット検出部22は、二次元コードから検出するデータビットが4ビット毎であることを認識する。一方、定義ルール1のようにデータ構造として「文字」、「文字」と定義されている場合、データビット検出部22は、二次元コードから検出するデータビットが6ビット毎であることを認識する。即ち、データビット検出部22は、検出するデータビットのビット数を認識した上で、冗長化ビットの位置を基準にしてデータビットの検出を行う。データ変換部23は、データビット検出部22により検出されたデータビットを、変換テーブル121を参照して「数字」や「文字」のデータ(以下、出力データと称す)に変換(復号化)する。データ出力部24は、データ変換部23によって得られた出力データを例えばディスプレイ等に出力する。
<Two-dimensional code reader 2>
The two-dimensional code reader 2 will be described. As shown in FIG. 1, the two-dimensional code reader 2 includes a two-dimensional code reader 21, a data bit detector 22, a data converter 23, and a data output unit 24. The two-dimensional code reading unit 21 reads a two-dimensional code printed on the object. The data bit detection unit 22 detects the position of the redundant bit from the two-dimensional code, and detects the data bit with reference to the position of the redundant bit. That is, the data bit detection unit 22 detects redundant bits that appear periodically, and detects data bits existing between them. At that time, the data bit detection unit 22 refers to the definition rule from the definition table 122. When “numeric”, “numeric”, and “numeric” are defined as the data structure as in the definition rule 2, the data bit detection unit 22 determines that the data bit detected from the two-dimensional code is every 4 bits. recognize. On the other hand, when “character” and “character” are defined as the data structure as in the definition rule 1, the data bit detection unit 22 recognizes that the data bit detected from the two-dimensional code is every 6 bits. . That is, the data bit detection unit 22 recognizes the number of data bits to be detected, and detects the data bits based on the position of the redundant bit. The data converter 23 converts (decodes) the data bits detected by the data bit detector 22 into “number” or “character” data (hereinafter referred to as output data) with reference to the conversion table 121. . The data output unit 24 outputs the output data obtained by the data conversion unit 23 to, for example, a display.

図2は、本実施形態に係る二次元コード生成装置1、二次元コード読取装置2のハードウェア構成を示す図である。なお、図2は、二次元コード生成装置1と二次元コード読取装置2とが一体化された場合のハードウェア構成を示している。   FIG. 2 is a diagram illustrating a hardware configuration of the two-dimensional code generation device 1 and the two-dimensional code reading device 2 according to the present embodiment. FIG. 2 shows a hardware configuration when the two-dimensional code generation device 1 and the two-dimensional code reading device 2 are integrated.

CPU201は、システムバスに接続される各デバイスやコントローラを統括的に制御する。ROM203には、CPU201の制御プログラムであるBIOS(Basic Input / Output System)やオペレーティングシステムプログラム、二次元コード生成装置1、二次元コード読取装置2が実行する例えば図3、図4に示す処理フローのプログラム等が記憶されている。   The CPU 201 comprehensively controls each device and controller connected to the system bus. The ROM 203 has a processing flow shown in FIG. 3 and FIG. 4 executed by the basic input / output system (BIOS) and operating system program which are control programs of the CPU 201, the two-dimensional code generation device 1, and the two-dimensional code reading device 2, for example. Programs and so on are stored.

また、本実施形態に係る例えば図3、図4に示す処理を行うためのプログラムは、CD−ROM等のコンピュータ読み取り可能な記録媒体に記録され、それらの記録媒体から供給される構成としてもよいし、インターネット等の通信媒体を介して供給される構成としてもよい。   Further, for example, the program for performing the processing shown in FIGS. 3 and 4 according to the present embodiment may be recorded on a computer-readable recording medium such as a CD-ROM and supplied from the recording medium. However, it may be configured to be supplied via a communication medium such as the Internet.

RAM202は、CPU201の主メモリ、ワークエリア等として機能する。CPU201は、処理の実行に際して必要なプログラム等をRAM202にロードして、プログラムを実行することで各種動作を実現するものである。   The RAM 202 functions as a main memory, work area, and the like for the CPU 201. The CPU 201 implements various operations by loading a program necessary for execution of processing into the RAM 202 and executing the program.

CPU201は、処理の実行に際して必要なプログラム等をRAM202にロードして、プログラムを実行することで各種動作を実現するものである。   The CPU 201 implements various operations by loading a program necessary for execution of processing into the RAM 202 and executing the program.

ディスプレイコントローラ208は、ディスプレイ209における画像表示を制御する。KBコントローラ204は、KB(キーボード)205からの操作入力を受け付け、CPU201に対して送信する。なお、図示していないが、KB205の他に、マウス等のポインティングデバイスもユーザの操作手段として本実施形態に係る二次元コード生成装置1、二次元コード読取装置2に適用可能である。   The display controller 208 controls image display on the display 209. The KB controller 204 receives an operation input from the KB (keyboard) 205 and transmits it to the CPU 201. Although not shown, in addition to the KB 205, a pointing device such as a mouse can also be applied to the two-dimensional code generation apparatus 1 and the two-dimensional code reading apparatus 2 according to the present embodiment as user operation means.

プリント部207は、対象物に二次元コードを印字するための装置である。スキャナ部206は、対象物に印字された二次元コードを読み取るための装置である。   The print unit 207 is a device for printing a two-dimensional code on an object. The scanner unit 206 is a device for reading a two-dimensional code printed on an object.

図18に実施形態の一例を示す。鋼板の製造ラインである通板中の鋼板1802、鋼板に印字された二次元コード1801、スキャナ部に相当するカメラ1803、前工程で二次元コードを印字するプリント部に相当するマーキング装置1804、二次元コード生成装置、読取装置である1.2で構成される。   FIG. 18 shows an example of the embodiment. A steel plate 1802 in a through-plate that is a production line of a steel plate, a two-dimensional code 1801 printed on the steel plate, a camera 1803 corresponding to a scanner unit, a marking device 1804 corresponding to a print unit that prints a two-dimensional code in a previous process, two It is composed of 1.2 which is a dimension code generator and reader.

なお、図1に示す二値化処理部12、冗長化ビット挿入部13、データビット検出部22、データ変換部23は、例えばROM203内に記憶され、必要に応じてRAM202にロードされるプログラム及びそれを実行するCPU201によって実現される構成である。また、データ入力部11は、KB205及びKBコントローラ204に相当する構成である。二次元コード出力部14は、プリント部207に相当する構成である。二次元コード読取部21は、スキャナ部206に相当する構成である。   The binarization processing unit 12, the redundant bit insertion unit 13, the data bit detection unit 22, and the data conversion unit 23 illustrated in FIG. 1 are stored in, for example, the ROM 203 and loaded into the RAM 202 as necessary. This is a configuration realized by the CPU 201 that executes it. The data input unit 11 has a configuration corresponding to the KB 205 and the KB controller 204. The two-dimensional code output unit 14 has a configuration corresponding to the print unit 207. The two-dimensional code reading unit 21 has a configuration corresponding to the scanner unit 206.

図3は、本実施形態に係る二次元コード生成装置1の処理を示すフローチャートである。先ずステップS301において、データ入力部11は、二次元コードに変換する文字や数字等の入力データを入力する。ステップS302において、二値化処理部12は変換テーブル121と定義テーブル122とを参照する。ここで、二値化処理部12は、定義テーブル122から定義ルールを参照し、入力データの構造に応じたビット数を認識する。即ち、定義ルール2において「数字」、「数字」、「数字」が定義されている入力データについては、二値化処理部12は、当該入力データの各データを4ビットのデータビットに変換することを認識する。一方、定義ルール1において「文字」、「文字」が定義されている入力データについては、二値化処理部12は、当該入力データの各データを6ビットのデータビットに変換することを認識する。ステップS303において、二値化処理部12は、ステップS302で参照した変換テーブル121を用いて、認識したビット数で入力データをデータビットに変換する。即ち、二値化処理部12は、4ビットのデータビットに変換すると認識した場合には、例えば入力データ“2”については変換テーブル121において“000010”が対応付けられているが、上2桁の“00”を除いた“0010”に変換する。そもそも「数字」は4ビットで表現可能であるため、上2桁の“00”はなくても問題はない。一方、6ビットのデータビットに変換すると認識された場合、例えば入力データ“2”は“000010”に変換される。   FIG. 3 is a flowchart showing processing of the two-dimensional code generation device 1 according to the present embodiment. First, in step S301, the data input unit 11 inputs input data such as characters and numbers to be converted into a two-dimensional code. In step S <b> 302, the binarization processing unit 12 refers to the conversion table 121 and the definition table 122. Here, the binarization processing unit 12 refers to the definition rule from the definition table 122 and recognizes the number of bits corresponding to the structure of the input data. That is, for input data in which “number”, “number”, and “number” are defined in the definition rule 2, the binarization processing unit 12 converts each data of the input data into 4-bit data bits. Recognize that. On the other hand, for input data in which “character” and “character” are defined in the definition rule 1, the binarization processing unit 12 recognizes that each data of the input data is converted into 6-bit data bits. . In step S303, the binarization processing unit 12 converts the input data into data bits with the recognized number of bits using the conversion table 121 referred to in step S302. That is, when the binarization processing unit 12 recognizes that the data is to be converted into 4-bit data bits, for example, the input data “2” is associated with “000010” in the conversion table 121, but the first two digits. To “0010” except “00”. In the first place, “number” can be expressed by 4 bits, so there is no problem even if the first two digits “00” are not present. On the other hand, when it is recognized that the data is converted into 6-bit data bits, for example, the input data “2” is converted into “000010”.

ステップS304において、冗長化ビット挿入部13は、定義テーブル122から定義ルールを参照し、データビットに対して冗長化ビットを挿入する。例えば、定義ルール2が参照された場合、冗長化ビット挿入部13は、データビットに対して4ビット間隔の周期で冗長化ビットを挿入する。一方、定義ルール1が参照された場合、冗長化ビット挿入部13は、データビットに対して6ビット間隔の周期で冗長化ビットを挿入する。   In step S304, the redundant bit insertion unit 13 refers to the definition rule from the definition table 122 and inserts the redundant bit into the data bit. For example, when the definition rule 2 is referred to, the redundant bit insertion unit 13 inserts redundant bits at intervals of 4 bits with respect to the data bits. On the other hand, when the definition rule 1 is referred to, the redundant bit insertion unit 13 inserts redundant bits at a cycle of 6 bits with respect to the data bits.

ステップS305において、冗長化ビット挿入部13は、冗長化ビットが挿入されたデータビットの先頭部にスタートビットを付加するとともに、最後部にエンドビットを付加する。これにより、二次元コードが生成される。ステップS306において、二次元コード出力部14は、生成された二次元コードを対象物に印字する。   In step S305, the redundancy bit insertion unit 13 adds a start bit to the beginning of the data bit in which the redundancy bit is inserted, and adds an end bit to the end. Thereby, a two-dimensional code is generated. In step S306, the two-dimensional code output unit 14 prints the generated two-dimensional code on the object.

図7は、図6の定義ルール1に従って“GH”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。   FIG. 7 is a diagram for explaining an example in which input data “GH” is converted into data bits according to the definition rule 1 in FIG. 6 to generate a two-dimensional code.

データ入力部11が“GH”701という入力データを入力すると、二値化処理部12は定義テーブル122から「文字」、「文字」という定義ルール1を参照し、入力データの各データ“G”、“H”を夫々6ビットのビットデータに変換することを認識する。従って、二値化処理部12は、変換テーブル121を参照して、“G”を“010000”、“H”を“010001”に変換する(図7の702)。二値化処理部12は、これらのビットデータを結合することにより、“GH”に対応するビットデータ“010000010001”を生成する。なお、入力データと参照する定義ルールとの紐づけは、入力データが入力される前に、参照すべき定義ルールがユーザによって指定される方法でもよいし、入力データと定義ルールとを対応付けたテーブルを別途用意してもよい。   When the data input unit 11 inputs the input data “GH” 701, the binarization processing unit 12 refers to the definition rule 1 “character” and “character” from the definition table 122, and each data “G” of the input data. , “H” is converted into 6-bit bit data. Therefore, the binarization processing unit 12 refers to the conversion table 121 and converts “G” to “010000” and “H” to “010001” (702 in FIG. 7). The binarization processing unit 12 generates bit data “010000010001” corresponding to “GH” by combining these bit data. The input data and the definition rule to be referenced may be linked by a method in which the definition rule to be referred to is specified by the user before the input data is input, or the input data and the definition rule are associated with each other. A table may be prepared separately.

次に冗長化ビット挿入部13は、同じ定義ルール1を参照することにより、6ビット間隔で周期的にビットデータに対して冗長化ビットを挿入することを認識する。従って、冗長化ビット挿入部13は、ビットデータ“010000010001”の、先頭部と、“010000”と“010001”との間との夫々に冗長化ビットを挿入する。次に冗長化ビット挿入部13は、冗長化ビットを挿入した後のビットデータの先頭部にスタートビットを付加するとともに、最後部にエンドビットを付加する。これにより、二次元コードが生成される(図7の703)。なお、図7の703に示す二次元コード内の(0)〜(5)は、データビットの配置位置又は配置順序を示している。図9、図11、図14、図17についても同様である。   Next, the redundant bit insertion unit 13 recognizes that redundant bits are periodically inserted into the bit data at intervals of 6 bits by referring to the same definition rule 1. Therefore, the redundant bit insertion unit 13 inserts redundant bits between the head portion of the bit data “010000010001” and between “010000” and “010001”. Next, the redundant bit insertion unit 13 adds a start bit to the head part of the bit data after inserting the redundant bit and adds an end bit to the last part. Thereby, a two-dimensional code is generated (703 in FIG. 7). Note that (0) to (5) in the two-dimensional code indicated by reference numeral 703 in FIG. 7 indicate the arrangement position or arrangement order of the data bits. The same applies to FIG. 9, FIG. 11, FIG. 14, and FIG.

図4は、本実施形態に係る二次元コード読取装置2の処理を示すフローチャートである。先ずステップS401において、二次元コード読取部21は、対象物に印字された二次元コードを読み取る。ステップS402において、読み取られた二次元コード全体の画像データはRAM202上に展開される。ステップS403において、データビット検出部22は、定義テーブル122から定義ルールを参照し、二次元コードから検出するデータビットのビット数を検出する。即ち、定義ルール2において「数字」、「数字」、「数字」が定義されている出力データについては、データビット検出部22は、二次元コードから4ビット毎にデータビットを検出することを認識する。一方、定義ルール1において「文字」、「文字」が定義されている出力データについては、データビット検出部22は、二次元コードから6ビット毎にデータビットを検出することを認識する。   FIG. 4 is a flowchart showing processing of the two-dimensional code reading device 2 according to the present embodiment. First, in step S401, the two-dimensional code reading unit 21 reads the two-dimensional code printed on the object. In step S <b> 402, the read image data of the entire two-dimensional code is developed on the RAM 202. In step S403, the data bit detection unit 22 refers to the definition rule from the definition table 122, and detects the number of data bits detected from the two-dimensional code. That is, for output data in which “number”, “number”, and “number” are defined in the definition rule 2, the data bit detection unit 22 recognizes that a data bit is detected every four bits from the two-dimensional code. To do. On the other hand, for output data in which “character” and “character” are defined in the definition rule 1, the data bit detection unit 22 recognizes that a data bit is detected every 6 bits from the two-dimensional code.

ステップS404において、データビット検出部22は、RAM202上に展開された二次元コード全体の画像データからスタートビット、冗長化ビット及びエンドビットを検出する。ステップS405において、データビット検出部22は、スタートビット、冗長化ビット及びエンドビットを用いて、二次元コードからデータビットを検出する。即ち、データビット検出部22は、スタートビット及びエンドビットから二次元コードの先頭部と最後部とを検出することにより、どこからどこまでが二次元コードであるかを把握する。そしてデータビット検出部22は、二次元コードに存在する冗長化ビットの位置を検出し、その位置を基準にして冗長化ビット間に存在するデータビットを検出する。その際、データビット検出部22は、冗長化ビット間に存在するデータビットが定義ルールから認識したビット数のデータビットであるものとして、データビットの検出を行う。   In step S <b> 404, the data bit detection unit 22 detects start bits, redundancy bits, and end bits from the image data of the entire two-dimensional code developed on the RAM 202. In step S405, the data bit detection unit 22 detects a data bit from the two-dimensional code using the start bit, the redundancy bit, and the end bit. That is, the data bit detection unit 22 detects the beginning and end of the two-dimensional code from the start bit and the end bit, thereby grasping from where to where the two-dimensional code is. The data bit detection unit 22 detects the position of the redundant bit existing in the two-dimensional code, and detects the data bit existing between the redundant bits on the basis of the position. At that time, the data bit detection unit 22 detects the data bits on the assumption that the data bits existing between the redundant bits are the number of bits recognized from the definition rule.

本実施形態においては、仮に二次元コードが印字された対象物の移動速度が変化し、又は、二次元コード読取装置2の移動速度が変化することによって、二次元コードの読み取り速度が変化した場合でも、冗長化ビットの位置から二次元コードのデータビットを正確に読み取ることができる。即ち、読み取った二次元コードの画像データはRAM202上に一度展開されるが、読み取り速度が速い場合、実際のデータビットよりも小さなサイズでRAM202上に展開されたり、逆に読み取り速度が遅い場合、実際のデータビットより大きなサイズでRAM202上に展開されたりする。これにより従来方法では大きなサイズで展開されたデータビットは実際よりも大きなビット数のデータビットで検出される可能性があり、反対に小さなサイズで展開されたデータビットは実際よりも小さいビット数のデータビットで検出される可能性がある。このように、実際の二次元コードのデータビットとは異なるサイズで読み取られると、データビットの誤認識が生じることがある。   In the present embodiment, when the moving speed of the object on which the two-dimensional code is printed changes, or the reading speed of the two-dimensional code changes due to the changing moving speed of the two-dimensional code reader 2. However, the data bits of the two-dimensional code can be accurately read from the redundant bit positions. That is, the read image data of the two-dimensional code is developed once on the RAM 202, but when the reading speed is high, when it is developed on the RAM 202 with a size smaller than the actual data bits, or conversely, the reading speed is low, It is expanded on the RAM 202 with a size larger than the actual data bits. As a result, in the conventional method, a data bit expanded in a large size may be detected by a data bit having a larger number of bits than the actual number, and conversely, a data bit expanded in a small size has a smaller number of bits. May be detected by data bits. As described above, when data bits are read in a size different from the actual data bits of the two-dimensional code, erroneous recognition of the data bits may occur.

これに対し、本実施形態では、RAM202上に展開された二次元コードから冗長化ビットの位置を検出し、二次元コードのどこからどこまでが所定のビット数(ここでは、4又は6ビット)のビットデータであるのかを把握した上でデータビットを検出するため、データビットの誤認識を回避することが可能となる。   On the other hand, in this embodiment, the position of the redundant bit is detected from the two-dimensional code developed on the RAM 202, and the bit of the predetermined number of bits (here, 4 or 6 bits) from where to where in the two-dimensional code. Since the data bit is detected after grasping whether it is data, erroneous recognition of the data bit can be avoided.

冗長化ビットのなかには、隣接するデータビットとの関係により、それ自体だけでは検出が困難なものが存在し得る。これに対し、本実施形態では、読み取った二次元コードを一旦RAM202上に展開した上で冗長化ビットの検出を行うようにしている。従って、他の冗長化ビットの検出がある程度の割合で成功していれば、それらの冗長化ビットの配置パターンの周期性を利用して、検出しづらい冗長化ビットの位置を推定することができる。   Some redundant bits may be difficult to detect by themselves because of the relationship with adjacent data bits. On the other hand, in the present embodiment, the read two-dimensional code is once developed on the RAM 202, and then the redundant bit is detected. Therefore, if the detection of other redundant bits is successful to some extent, the position of redundant bits that are difficult to detect can be estimated using the periodicity of the arrangement pattern of the redundant bits. .

ステップS406において、データ変換部23は、変換テーブル121を参照し、ステップS405で検出されたデータビットを出力データに変換する。ステップS407において、データ出力部24は、出力データをディスプレイ等に表示する。   In step S406, the data conversion unit 23 refers to the conversion table 121 and converts the data bits detected in step S405 into output data. In step S407, the data output unit 24 displays the output data on a display or the like.

図8は、図6の定義ルール1に従って、図7で説明した処理により生成された二次元コード703のデータビットを出力データに変換する例を説明するための図である。   FIG. 8 is a diagram for explaining an example in which the data bits of the two-dimensional code 703 generated by the process described in FIG. 7 are converted into output data according to the definition rule 1 in FIG.

二次元コード読取部21が二次元コード801(図7の703)を読み取ると、二次元コードの全ての画像データがRAM202上に展開される。データビット検出部22は、定義テーブル122から「文字」、「文字」という定義ルール1を参照し、二次元コードから6ビット毎にデータビットを検出することを認識する。なお、二次元コードと参照する定義ルールとの紐づけは、二次元コードが読み取られる前に、参照すべき定義ルールがユーザによって指定される方法でもよいし、二次元コードと定義ルールとを対応付けたテーブルを別途用意してもよい。   When the two-dimensional code reading unit 21 reads the two-dimensional code 801 (703 in FIG. 7), all image data of the two-dimensional code is developed on the RAM 202. The data bit detection unit 22 refers to the definition rule 1 “character” and “character” from the definition table 122 and recognizes that a data bit is detected every 6 bits from the two-dimensional code. Note that the two-dimensional code and the definition rule to be referenced may be linked by a method in which the definition rule to be referenced is specified by the user before the two-dimensional code is read, or the two-dimensional code and the definition rule are associated. You may prepare the attached table separately.

次にデータビット検出部22は、RAM202上に展開された画像データから、スタートビット、冗長化ビット及びエンドビットを検出する。スタートビット及びエンドビットにより、どこからどこまでが二次元コードであるかを検出することができる。またデータビット検出部22は、二次元コードから冗長化ビットの位置を検出し、冗長化ビット間に存在するデータビットを検出する。図8の802は、RAM202上に展開された二次元コード801の画像データから検出される、全二次元コードのビットパターンを示している。スタートビットとエンドビットとは夫々独自のビットパターンとなっており、このビット配置が検出されることにより、どこからどこまでが二次元コードであるかが把握される。そして、スタートビットとエンドビットとの間には周期的に冗長化ビット(「1」、「0」)が配置されており、これらの冗長化ビットを検出することにより、冗長化ビット間に存在する“010000”、“010001”のデータビットが検出される(図8の803)。データ変換部23は、図5の変換テーブル121を参照して、“010000”、“010001”のデータビットを出力データ“G”、“H”に変換する。データ出力部24は、データ変換部23により生成された出力データを結合した“GH”を出力する(図8の804)。   Next, the data bit detection unit 22 detects a start bit, a redundancy bit, and an end bit from the image data developed on the RAM 202. From the start bit and the end bit, it is possible to detect from where to where the two-dimensional code is. Further, the data bit detection unit 22 detects the position of the redundant bit from the two-dimensional code, and detects the data bit existing between the redundant bits. Reference numeral 802 in FIG. 8 denotes a bit pattern of all two-dimensional codes detected from the image data of the two-dimensional code 801 developed on the RAM 202. The start bit and the end bit each have a unique bit pattern. By detecting this bit arrangement, it is possible to grasp from where to where it is a two-dimensional code. In addition, redundant bits ("1", "0") are periodically arranged between the start bit and the end bit, and exist between the redundant bits by detecting these redundant bits. The data bits “010000” and “010001” are detected (803 in FIG. 8). The data conversion unit 23 refers to the conversion table 121 of FIG. 5 and converts the data bits “010000” and “010001” into output data “G” and “H”. The data output unit 24 outputs “GH” obtained by combining the output data generated by the data conversion unit 23 (804 in FIG. 8).

図9は、図6の定義ルール2に従って“441”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。   FIG. 9 is a diagram for explaining an example in which input data “441” is converted into data bits according to the definition rule 2 in FIG. 6 to generate a two-dimensional code.

データ入力部11が“441”901という入力データを入力すると、二値化処理部12は定義テーブル122から「数字」、「数字」、「数字」という定義ルール2を参照し、入力データ“4”、“4”、“1”を夫々4ビットのビットデータに変換することを認識する。従って、二値化処理部12は、変換テーブル121を参照して、“4”を“0100”、“1”を“0001”に変換する(図9の902)。二値化処理部12は、これらのビットデータを結合することにより、“441”に対応するビットデータ“010001000001”を生成する。   When the data input unit 11 inputs input data “441” 901, the binarization processing unit 12 refers to the definition rule 2 of “number”, “number”, “number” from the definition table 122, and inputs data “4” It is recognized that “4” and “1” are converted into 4-bit bit data, respectively. Therefore, the binarization processing unit 12 refers to the conversion table 121 and converts “4” into “0100” and “1” into “0001” (902 in FIG. 9). The binarization processing unit 12 generates bit data “010001000001” corresponding to “441” by combining these bit data.

次に冗長化ビット挿入部13は、同じ定義ルール2を参照することにより、4ビット間隔で周期的にビットデータに対して冗長化ビットを挿入することを認識する。従って、冗長化ビット挿入部13は、ビットデータ“010001000001”の、先頭部と、“0100”と“0100”との間と、“0100”と“0001”との間との夫々に冗長化ビットを挿入する。次に冗長化ビット挿入部13は、冗長化ビットを挿入した後のビットデータの先頭部にスタートビットを付加することともに、最後部にエンドビットを付加する。これにより、二次元コードが生成される(図9の903)。   Next, the redundant bit insertion unit 13 recognizes that redundant bits are periodically inserted into the bit data at intervals of 4 bits by referring to the same definition rule 2. Therefore, the redundant bit insertion unit 13 sets the redundant bit at the beginning of the bit data “010001000001”, between “0100” and “0100”, and between “0100” and “0001”. Insert. Next, the redundant bit insertion unit 13 adds a start bit to the head part of the bit data after inserting the redundant bit, and adds an end bit to the last part. As a result, a two-dimensional code is generated (903 in FIG. 9).

図10は、図6の定義テーブル2に従って、図9で説明した処理により生成された二次元コード903のデータビットを出力データに変換する例を説明するための図である。   FIG. 10 is a diagram for explaining an example in which the data bits of the two-dimensional code 903 generated by the processing described in FIG. 9 are converted into output data according to the definition table 2 in FIG.

二次元コード読取部21が二次元コード1001(図9の903)を読み取ると、二次元コードの全ての画像データがRAM202上に展開される。データビット検出部22は、定義テーブル122から「数字」、「数字」、「数字」という定義ルール2を参照し、二次元コードから4ビット毎にデータビットを検出することを認識する。次にデータビット検出部22は、RAM22上に展開された画像データから、スタートビット、冗長化ビット及びエンドビットを検出する。スタートビット及びエンドビットにより、どこからどこまでが二次元コードであるかを検出することができる。またデータビット検出部22は、二次元コードから冗長化ビットの位置を検出し、冗長化ビット間に存在するデータビットを検出する。図10の1002は、RAM202上に展開された二次元コード1001の画像データから検出される、全二次元コードのビット配置を示している。図8の例と同様に、スタートビットとエンドビットとのビット配置が検出されることにより、どこからどこまでが二次元コードであるかが把握される。そして、二次元コードに周期的に存在する冗長化ビット(「1」、「0」)が検出されることにより、冗長化ビット間に存在する“0100”、“0100”、“0001”のデータビットが検出される(図10の1003)。データ変換部23は、図5の変換テーブル121を参照して、“0100”、“0100”、“0001”のデータビットを出力データ“4”、“4”、“1”に変換する。データ出力部24は、データ変換部23により生成された出力データを結合した“441”を出力する(図10の1004)。   When the two-dimensional code reading unit 21 reads the two-dimensional code 1001 (903 in FIG. 9), all image data of the two-dimensional code is developed on the RAM 202. The data bit detection unit 22 refers to the definition rule 2 of “number”, “number”, and “number” from the definition table 122 and recognizes that a data bit is detected every 4 bits from the two-dimensional code. Next, the data bit detection unit 22 detects a start bit, a redundancy bit, and an end bit from the image data developed on the RAM 22. From the start bit and the end bit, it is possible to detect from where to where the two-dimensional code is. Further, the data bit detection unit 22 detects the position of the redundant bit from the two-dimensional code, and detects the data bit existing between the redundant bits. Reference numeral 1002 in FIG. 10 indicates a bit arrangement of all two-dimensional codes detected from the image data of the two-dimensional code 1001 developed on the RAM 202. As in the example of FIG. 8, by detecting the bit arrangement of the start bit and the end bit, it is possible to grasp from where to where is the two-dimensional code. Then, by detecting redundant bits (“1”, “0”) that periodically exist in the two-dimensional code, data of “0100”, “0100”, “0001” existing between the redundant bits is detected. A bit is detected (1003 in FIG. 10). The data conversion unit 23 refers to the conversion table 121 in FIG. 5 and converts the data bits “0100”, “0100”, and “0001” into output data “4”, “4”, and “1”. The data output unit 24 outputs “441” obtained by combining the output data generated by the data conversion unit 23 (1004 in FIG. 10).

以上のように、本実施形態では、入力データの構造が「数字」、「数字」、「数字」である場合、入力データを、「0」〜「9」を表現可能な最小限のビット数(4ビット)のデータビットに変換するようにしている。これにより、不要なデータビットを使用せずに二次元コードを生成することが可能となり、二次元コードのサイズを縮小することができる。   As described above, in this embodiment, when the structure of input data is “number”, “number”, “number”, the minimum number of bits that can represent “0” to “9” as input data. The data is converted into (4 bits) data bits. Thereby, it becomes possible to generate a two-dimensional code without using unnecessary data bits, and the size of the two-dimensional code can be reduced.

上述した実施形態では、データビットに対して、定義ルールに従って各データビットを区分する間隔で冗長化ビットを挿入しているが、他の実施形態として、常に一定のビット数の周期で冗長化ビットを挿入するようにしてもよい。その具体例を図11及び図12を参照しながら説明する。   In the above-described embodiment, the redundant bits are inserted into the data bits at intervals that divide each data bit according to the definition rule. However, as another embodiment, the redundant bits are always in a fixed number of bits. May be inserted. A specific example will be described with reference to FIGS.

図11は、図6の定義ルール2に従って“441”という入力データをデータビットに変換し、冗長化ビット挿入部13が定義ルール2を参照することなく、一定の周期(ここでは、6ビットの周期)で冗長化ビットをデータビットに対して挿入する例を説明するための図である。   11 converts the input data “441” into data bits in accordance with the definition rule 2 in FIG. 6, and the redundant bit insertion unit 13 does not refer to the definition rule 2, and does not refer to the definition rule 2. It is a figure for demonstrating the example which inserts a redundant bit with respect to a data bit by a period.

データ入力部11が“441”1101というデータを入力すると、二値化処理部12は定義テーブル122から「数字」、「数字」、「数字」という定義ルール2を参照し、入力データ“4”、“4”、“1”を夫々4ビットのビットデータに変換することを認識する。従って、二値化処理部12は、変換テーブル121を参照して、“4”を“0100”、“1”を“0001”に変換する(図11の1102)。二値化処理部12は、これらのビットデータを結合することにより、“441”に対応するビットデータ“010001000001”を生成する。   When the data input unit 11 inputs data “441” 1101, the binarization processing unit 12 refers to the definition rule 2 of “number”, “number”, “number” from the definition table 122, and inputs data “4”. , “4” and “1” are converted into 4-bit bit data, respectively. Therefore, the binarization processing unit 12 refers to the conversion table 121 and converts “4” into “0100” and “1” into “0001” (1102 in FIG. 11). The binarization processing unit 12 generates bit data “010001000001” corresponding to “441” by combining these bit data.

次に冗長化ビット挿入部13は、6ビットの周期で冗長化ビットをビットデータに対して挿入する。即ち、冗長化ビット挿入部13は、ビットデータ“010001000001”の、先頭部と、“010001”と“000001”との間との夫々に冗長化ビットを挿入する。次に冗長化ビット挿入部13は、冗長化ビットを挿入した後のビットデータの先頭部にスタートビットを付加するとともに、最後部にエンドビットを付加する。これにより、二次元コードが生成される(図11の1103)。   Next, the redundant bit insertion unit 13 inserts redundant bits into the bit data at a cycle of 6 bits. That is, the redundant bit insertion unit 13 inserts redundant bits at the beginning of the bit data “010001000001” and between “010001” and “000001”. Next, the redundant bit insertion unit 13 adds a start bit to the head part of the bit data after inserting the redundant bit and adds an end bit to the last part. Thereby, a two-dimensional code is generated (1103 in FIG. 11).

図12は、図6の定義ルール2に従って、図11で説明した処理により生成された二次元コード1103のデータビットを出力データに変換する例を説明するための図である。   FIG. 12 is a diagram for explaining an example of converting data bits of the two-dimensional code 1103 generated by the processing described in FIG. 11 into output data according to the definition rule 2 in FIG.

二次元コード読取部21が二次元コード1201(図11の1103)を読み取ると、二次元コードの全ての画像データがRAM202上に展開される。データビット検出部22は、定義テーブル122から「数字」、「数字」、「数字」という定義ルール2を参照し、二次元コードから4ビット毎にデータビットを検出することを認識する。次にデータビット検出部22は、RAM22上に展開された画像データから、スタートビット、冗長化ビット及びエンドビットを検出する。スタートビット及びエンドビットにより、どこからどこまでが二次元コードであるかを検出するところまでは図8及び図10で説明した処理と同様である。本実施形態において、データビット検出部22は、データビットに対して冗長化ビットが6ビット間隔で挿入されていることを予め把握しているものとする。また、データビット検出部22は、定義ルール2から、4ビット毎にデータビットを検出することを認識している。従って、データビット検出部22は、冗長化ビット間に存在する6ビットのデータビットを2回検出すると、2回検出した計12ビットのデータビットから4ビットのデータビットを3つ検出する。即ち、データビット検出部22は、冗長間ビット間に存在する6ビットのデータビットとして“010001”、“000001”を検出すると(図12の1202)、これらを結合したデータビット“010001000001”を3つに分割し、“0100”、“0100”、“0001”を検出する(図12の1203)。データ変換部23は、図5の変換テーブル121を参照して、“0100”、“0100”、“0001”のデータビットを出力データ“4”、“4”、“1”に変換する。データ出力部24は、データ変換部23により生成された出力データを結合した“441”を出力する(図12の1204)。   When the two-dimensional code reading unit 21 reads the two-dimensional code 1201 (1103 in FIG. 11), all image data of the two-dimensional code is developed on the RAM 202. The data bit detection unit 22 refers to the definition rule 2 of “number”, “number”, and “number” from the definition table 122 and recognizes that a data bit is detected every 4 bits from the two-dimensional code. Next, the data bit detection unit 22 detects a start bit, a redundancy bit, and an end bit from the image data developed on the RAM 22. The process up to detecting where the two-dimensional code is from the start bit and the end bit is the same as the processing described with reference to FIGS. In the present embodiment, it is assumed that the data bit detection unit 22 knows in advance that redundant bits are inserted at 6-bit intervals with respect to data bits. Further, the data bit detection unit 22 recognizes that the data bit is detected every 4 bits from the definition rule 2. Therefore, when the 6-bit data bit existing between the redundant bits is detected twice, the data bit detecting unit 22 detects three 4-bit data bits from the total 12-bit data bits detected twice. That is, when the data bit detection unit 22 detects “010001” and “000001” as 6-bit data bits existing between the redundant bits (1202 in FIG. 12), the data bit “010001000001” obtained by combining these is represented by 3 Then, “0100”, “0100”, and “0001” are detected (1203 in FIG. 12). The data conversion unit 23 refers to the conversion table 121 in FIG. 5 and converts the data bits “0100”, “0100”, and “0001” into output data “4”, “4”, and “1”. The data output unit 24 outputs “441” obtained by combining the output data generated by the data conversion unit 23 (1204 in FIG. 12).

次に、本発明の実施形態に適用可能な他の定義ルールの例について説明する。上述した定義ルールでは、入力データ及び出力データについて常に同一の構造を定義していたが、本実施形態では、定義ルールにおいて、入力データと出力データとで異なる構造を定義している。即ち、本実施形態の定義ルールでは、入力データの構造から出力データへの構造の変換方法を定義している。   Next, examples of other definition rules applicable to the embodiment of the present invention will be described. In the definition rule described above, the same structure is always defined for input data and output data. However, in this embodiment, different structures are defined for input data and output data in the definition rule. That is, the definition rule of this embodiment defines a method for converting the structure of input data to output data.

図13は、定義テーブル122の他の例を示す図である。本定義テーブル122では、定義ルール1において、「文字」、「文字」という構造の入力データを、「数字」、「数字」、「数字」という構造の出力データに変換することを定義しており、定義ルール2において、「数字」、「数字」、「数字」という構造の入力データを、「文字」、「文字」という構造の出力データに変換することを定義している。以下、図13の定義ルール1を適用した場合の動作について説明する。   FIG. 13 is a diagram illustrating another example of the definition table 122. In this definition table 122, the definition rule 1 defines that input data having a structure of “characters” and “characters” is converted into output data having a structure of “numbers”, “numbers”, and “numbers”. Definition rule 2 defines that input data having a structure of “number”, “number”, and “number” is converted to output data having a structure of “character” and “character”. Hereinafter, an operation when the definition rule 1 of FIG. 13 is applied will be described.

図14は、図13の定義ルール1に従って“GH”という入力データをデータビットに変換し、二次元コードを生成する例を説明するための図である。   FIG. 14 is a diagram for explaining an example in which input data “GH” is converted into data bits according to the definition rule 1 in FIG. 13 to generate a two-dimensional code.

データ入力部11が“GH”1401という入力データを入力すると、二値化処理部12は定義テーブル122から「文字」、「文字」という定義ルール1を参照し、入力データ“G”、“H”を夫々6ビットのビットデータに変換することを認識する。従って、二値化処理部12は、変換テーブル121を参照して、“G”を“010000”、“H”を“010001”に変換する(図14の1402)。二値化処理部12は、これらのビットデータを結合することにより、“GH”に対応するビットデータ“010000010001”を生成する。   When the data input unit 11 inputs input data “GH” 1401, the binarization processing unit 12 refers to the definition rule 1 “character” and “character” from the definition table 122 and inputs the input data “G”, “H”. It recognizes that “is converted into 6-bit bit data. Accordingly, the binarization processing unit 12 refers to the conversion table 121 and converts “G” into “010000” and “H” into “010001” (1402 in FIG. 14). The binarization processing unit 12 generates bit data “010000010001” corresponding to “GH” by combining these bit data.

次に冗長化ビット挿入部13は、同じ定義ルール1を参照することにより、6ビット間隔で周期的にビットデータに対して冗長化ビットを挿入することを認識する。従って、冗長化ビット挿入部13は、ビットデータ“010000010001”の、先頭部と、“010000”と“010001”との間との夫々に冗長化ビットを挿入する。次に冗長化ビット挿入部13は、冗長化ビットを挿入した後のビットデータの先頭部にスタートビットを付加するととともに、最後部にエンドビットを付加する。これにより、二次元コードが生成される(図14の1403)。   Next, the redundant bit insertion unit 13 recognizes that redundant bits are periodically inserted into the bit data at intervals of 6 bits by referring to the same definition rule 1. Therefore, the redundant bit insertion unit 13 inserts redundant bits between the head portion of the bit data “010000010001” and between “010000” and “010001”. Next, the redundancy bit insertion unit 13 adds a start bit to the beginning of the bit data after inserting the redundancy bit, and adds an end bit to the end. As a result, a two-dimensional code is generated (1403 in FIG. 14).

図15は、図13の定義ルール1に従って、図14で説明した処理により生成された二次元コード1403のデータビットを出力データに変換する例を説明するための図である。   FIG. 15 is a diagram for explaining an example of converting the data bits of the two-dimensional code 1403 generated by the processing described in FIG. 14 into output data according to the definition rule 1 in FIG.

二次元コード読取部21が二次元コード1501(図14の1403)を読み取ると、二次元コードの全ての画像データがRAM202上に展開される。データビット検出部22は、定義テーブル122の定義ルール1において出力データとして「数字」、「数字」、「数字」が定義されていることから、二次元コードから4ビット毎にデータビットを検出することを認識する。それとともに、データビット検出部22は、同じく定義テーブル122の定義ルール1において入力データとして「文字」、「文字」が定義されていることから、二次元コード生成装置1の冗長化ビット挿入部13ではデータビットに対して6ビット間隔で冗長化ビットが挿入されていることを認識する。次にデータビット検出部22は、RAM22上に展開された画像データから、スタートビット、冗長化ビット及びエンドビットを検出する。データビット検出部22は、スタートビット及びエンドビットにより、どこからどこまでが二次元コードであるかを検出する。   When the two-dimensional code reading unit 21 reads the two-dimensional code 1501 (1403 in FIG. 14), all image data of the two-dimensional code is developed on the RAM 202. The data bit detection unit 22 detects data bits every 4 bits from the two-dimensional code because “number”, “number”, and “number” are defined as output data in the definition rule 1 of the definition table 122. Recognize that. At the same time, the data bit detection unit 22 also defines “character” and “character” as input data in the definition rule 1 of the definition table 122, so the redundant bit insertion unit 13 of the two-dimensional code generation device 1. Recognizes that redundant bits are inserted at 6-bit intervals with respect to data bits. Next, the data bit detection unit 22 detects a start bit, a redundancy bit, and an end bit from the image data developed on the RAM 22. The data bit detection unit 22 detects from where to where the two-dimensional code is based on the start bit and the end bit.

データビット検出部22は、冗長化ビット間に存在する6ビットのデータビットを2回検出すると、2回検出した計12ビットのデータビットから4ビットのデータビットを3つ検出する。即ち、データビット検出部22は、冗長化ビット間に存在する6ビットのデータビットとして“010000”、“010001”を検出すると(図15の1502)、これらを結合したデータビット“010000010001”を3つに分割し、“0100”、“0100”、“0001”を検出する(図15の1503)。データ変換部23は、図5の変換テーブル121を参照して、“0100”、“0100”、“0001”のデータビットを出力データ“4”、“4”、“1”に変換する。データ出力部24は、データ変換部23により生成された出力データを結合した“441”を出力する(図15の1504)。   When the 6-bit data bit existing between the redundant bits is detected twice, the data bit detection unit 22 detects three 4-bit data bits from the total 12-bit data bits detected twice. That is, when the data bit detection unit 22 detects “010000” and “010001” as the 6-bit data bits existing between the redundant bits (1502 in FIG. 15), the data bit “010000010001” obtained by combining these is represented by 3 Then, “0100”, “0100”, and “0001” are detected (1503 in FIG. 15). The data conversion unit 23 refers to the conversion table 121 in FIG. 5 and converts the data bits “0100”, “0100”, and “0001” into output data “4”, “4”, and “1”. The data output unit 24 outputs “441” obtained by combining the output data generated by the data conversion unit 23 (1504 in FIG. 15).

図16は、定義テーブル122の更に他の例と、当該定義テーブル122に従って“AB012”という入力データから二次元コードを生成し、当該二次元コードを読み取る処理例とを示す図である。これまでは、二次元コードから読み取られるデータビットと同じデータ構造の出力データを生成する処理について説明したが、以下では、二次元コードから読み取られるデータビットとは異なるデータ構造の出力データを生成する処理について説明する。   FIG. 16 is a diagram showing still another example of the definition table 122 and a processing example of generating a two-dimensional code from input data “AB012” according to the definition table 122 and reading the two-dimensional code. So far, the process of generating output data having the same data structure as the data bits read from the two-dimensional code has been described, but in the following, output data having a data structure different from the data bits read from the two-dimensional code is generated. Processing will be described.

図16(a)に示すように、本例における定義テーブル122では、定義ルール1において、「文字(1)」、「文字(2)」、「数字(1)」、「数字(2)」、「数字(3)」という構造の入力データを、「文字(1)」、「数字(1)」、「数字(2)」、「数字(3)」、「文字(2)」という構造の出力データに変換することを定義している。   As shown in FIG. 16A, in the definition table 122 in this example, in the definition rule 1, “character (1)”, “character (2)”, “number (1)”, “number (2)” , The input data having the structure of “number (3)” is converted into the structure of “character (1)”, “number (1)”, “number (2)”, “number (3)”, “character (2)”. Is defined to be converted to output data.

データ入力部11が“AB012”1601というデータを入力すると、二値化処理部12は定義テーブル122から「文字(1)」、「文字(2)」、「数字(1)」、「数字(2)」、「数字(3)」という定義ルール1を参照し、入力データ“A”、“B”、“0”、“1”、“2”を夫々6ビットのビットデータに変換することを認識する。従って、二値化処理部12は、変換テーブル121を参照して、“A”を“001010”、“B”を“001011”、“0”を“000000”、“1”を“000001”、“2”を“000010”に変換する(図16の1602)。以降、同様の方法により、冗長化ビット挿入13が冗長化ビット、スタートビット及びエンドビットをデータビットに挿入し、二次元コードが生成される。   When the data input unit 11 inputs data “AB012” 1601, the binarization processing unit 12 reads “character (1)”, “character (2)”, “number (1)”, “number ( 2) ”and“ Numeric (3) ”with reference to definition rule 1 and converting input data“ A ”,“ B ”,“ 0 ”,“ 1 ”,“ 2 ”into 6-bit bit data, respectively. Recognize Therefore, the binarization processing unit 12 refers to the conversion table 121, “A” is “001010”, “B” is “001011”, “0” is “000000”, “1” is “000001”, “2” is converted to “000010” (1602 in FIG. 16). Thereafter, the redundancy bit insertion 13 inserts the redundancy bit, the start bit, and the end bit into the data bits by the same method, and a two-dimensional code is generated.

生成された二次元コードを二次元コード読取部21が読み取ると、データビット検出部22は、定義ルール1において入力データとして「文字(1)」、「文字(2)」、「数字(1)」、「数字(2)」、「数字(3)」と定義され、出力データとして「文字(1)」、「数字(1)」、「数字(2)」、「数字(3)」、「文字(2)」と定義されていることから、二次元コードから6ビット毎にデータビットを検出した後、先頭から2番目に配置されている「文字(2)」を最後に配置するようにデータビットの入れ替えを行う。データ変換部23は、図5の変換テーブル121を参照し、このように入れ替えられた後のデータビット“001010”、“000000”、“000001”、“000010”、“001011”を出力データ“A012B”に変換する。データ出力部24は、データ変換部23により生成された出力データ“A012B”を出力する(図16の1603)。このように、二次元コードから読み取られるデータビット“AB012”とは異なるデータ構造の出力データ“A012B”を生成することが可能となる。   When the two-dimensional code reading unit 21 reads the generated two-dimensional code, the data bit detection unit 22 uses “character (1)”, “character (2)”, “number (1)” as input data in the definition rule 1. ”,“ Number (2) ”,“ number (3) ”, and output data is“ character (1) ”,“ number (1) ”,“ number (2) ”,“ number (3) ”, Since it is defined as “character (2)”, after detecting data bits every 6 bits from the two-dimensional code, “character (2)” arranged second from the beginning is arranged last. The data bit is replaced with The data conversion unit 23 refers to the conversion table 121 of FIG. 5 and outputs the data bits “001010”, “000000”, “000001”, “000010”, “001011” after the replacement in this way to the output data “A012B”. To "". The data output unit 24 outputs the output data “A012B” generated by the data conversion unit 23 (1603 in FIG. 16). As described above, it is possible to generate output data “A012B” having a data structure different from that of the data bit “AB012” read from the two-dimensional code.

なお、上述した処理例では、二値化処理部12は、図16(a)の定義テーブル122の定義ルール1に基づいて、入力データ“A”、“B”、“0”、“1”、“2”を夫々6ビットのビットデータに変換し、冗長化ビット挿入部13は、そのビットデータに対して6ビット間隔で冗長化ビットを挿入するようにしているが、これに限られない。例えば、二値化処理部12は、図16(a)の定義テーブル122の定義ルール1を参照することにより、入力データ“A”、“B”、“0”、“1”、“2”を夫々6ビット、6ビット、4ビット、4ビット、4ビットのデータビットに変換し、冗長化ビット挿入部13は、二値化処理部12が生成したデータビットに対して、6ビット、6ビット、4ビット、4ビット、4ビット間隔で冗長化ビットを挿入してもよい。この場合、データビット検出部22は、定義ルール1を参照して、冗長化ビット間には、6ビット、6ビット、4ビット、4ビット、4ビットのデータビットが存在することに認識した上で、データビットの検出を行う。このような手法によっても、二次元コードの読み取り速度が変化しても、データビットの誤認識を回避することができる。   In the processing example described above, the binarization processing unit 12 inputs the input data “A”, “B”, “0”, “1” based on the definition rule 1 of the definition table 122 in FIG. , “2” is converted into 6-bit bit data, and the redundant bit insertion unit 13 inserts redundant bits into the bit data at intervals of 6 bits, but is not limited thereto. . For example, the binarization processing unit 12 refers to the definition rule 1 of the definition table 122 in FIG. 16A to input data “A”, “B”, “0”, “1”, “2”. Are converted into 6-bit, 6-bit, 4-bit, 4-bit, and 4-bit data bits, respectively, and the redundancy bit insertion unit 13 applies 6-bit, 6-bit to the data bits generated by the binarization processing unit 12. Redundant bits may be inserted at 4-bit, 4-bit, 4-bit intervals. In this case, the data bit detector 22 refers to the definition rule 1 and recognizes that there are 6 bits, 6 bits, 4 bits, 4 bits, and 4 bits of data bits between the redundant bits. Then, the data bit is detected. Even with such a technique, erroneous recognition of data bits can be avoided even if the reading speed of the two-dimensional code changes.

以上説明した実施形態においては、例えば図7に示すように、幅方向(図の縦方向)に2ビット、長さ方向(図の横方向)にN(Nは任意の自然数)ビットの二次元コードを例に挙げているが、本発明に適用可能な二次元コードはこの形態に限定されない。即ち、幅方向も任意のビット数(Mビット(Mは任意の自然数))で構成することができる。   In the embodiment described above, for example, as shown in FIG. 7, two-dimensional with 2 bits in the width direction (vertical direction in the figure) and N (N is an arbitrary natural number) bits in the length direction (horizontal direction in the figure). A code is taken as an example, but a two-dimensional code applicable to the present invention is not limited to this form. That is, the width direction can also be configured with an arbitrary number of bits (M bits (M is an arbitrary natural number)).

また、冗長化ビットも上記実施形態で示した態様に限定されない。上記実施形態において冗長化ビットは、幅方向が2ビット、長さ方向がNビットの二次元コードにおいて、長さ方向に“1”、“0”の2ビットを隣接させたデータビットが幅方向の両端部に交互に現れるように配置しているが、これ以外の冗長化ビットの態様として次のようなものが挙げられる。図17は、冗長化ビットの他の態様を示す図である。図17(a)は、二次元コードの幅方向に“1”、“0”の2ビットを隣接させたデータビットが長さ方向に3ビットの周期で現れるように配置した冗長化ビットの例を示している。また、図17(b)は、二次元コードの幅方向の一方の端部で長さ方向に“1”、“0”の2ビットを隣接させたデータビットが、同じく長さ方向に3ビットの周期で現れるように配置した冗長化ビットの例を示している。   Further, the redundancy bit is not limited to the mode shown in the above embodiment. In the above embodiment, the redundant bit is a data bit in which two bits of “1” and “0” are adjacent in the length direction in a two-dimensional code having a width direction of 2 bits and a length direction of N bits. Are arranged so as to appear alternately at both ends, but other modes of redundant bits include the following. FIG. 17 is a diagram illustrating another mode of redundant bits. FIG. 17A shows an example of redundant bits arranged such that data bits in which two bits of “1” and “0” are adjacent in the width direction of the two-dimensional code appear in a period of 3 bits in the length direction. Is shown. FIG. 17 (b) shows that a data bit in which two bits of “1” and “0” are adjacent to each other at one end in the width direction of the two-dimensional code is also 3 bits in the length direction. The example of the redundancy bit arrange | positioned so that it may appear with the period of is shown.

図7に示す冗長化ビットの場合、二次元コードの幅方向の両端部において交互に冗長化ビットが現れるため、両端部に存在する冗長化ビットから二次元コードの幅が何ビットであるかを把握することができる。また、図17(a)に示す冗長化ビットの場合、二次元コードの幅方向の全ビットにわたって配置させている。従って、一つの冗長化ビットを検出すれば、二次元コードの幅が何ビットであるかを把握することができる。このように図7、図17(a)に示す冗長化ビットを採用した場合、二次元コードの幅が何ビットであるかを把握することができるため、実際には幅方向に更にデータビットが存在するのに存在しないものとして看做される等のデータビットの誤認識を回避することができる。一方、図17(b)に示す冗長化ビットの場合、図7、図17(a)に示す冗長化ビットのように幅方向のデータビットの誤認識を防ぐには不向きであるが、長さ方向ではデータビットの誤認識を防ぐことができる。このように本発明に適用可能な冗長化ビットは様々な態様のものが挙げられ、以上例示したものに限定されない。   In the case of the redundant bits shown in FIG. 7, since redundant bits appear alternately at both ends in the width direction of the two-dimensional code, how many bits the width of the two-dimensional code is from the redundant bits existing at both ends. I can grasp it. In the case of the redundant bits shown in FIG. 17A, the bits are arranged over all the bits in the width direction of the two-dimensional code. Therefore, if one redundant bit is detected, it is possible to grasp how many bits the width of the two-dimensional code is. In this way, when the redundant bits shown in FIGS. 7 and 17A are employed, it is possible to know how many bits the width of the two-dimensional code is, so in practice, there are more data bits in the width direction. It is possible to avoid misrecognition of data bits, such as being present as being present but not present. On the other hand, the redundant bits shown in FIG. 17B are not suitable for preventing erroneous recognition of data bits in the width direction as in the redundant bits shown in FIGS. 7 and 17A. In the direction, erroneous recognition of data bits can be prevented. As described above, the redundancy bits applicable to the present invention include various forms, and are not limited to those exemplified above.

また、上述した実施形態では、データビット、冗長化ビットを“0”、“1”の2値のビットで表現しているが、本発明はこれに限定されない。即ち、データビットや冗長化ビットを3値以上のグレースケールやカラーで表現してもよい。この場合、二次元コードを読み取って画像データをRAM202上に展開し、当該画像データを画像処理してマルチレベルの値の認識を行った後、変換テーブルを用いてデータビットから出力データに変換する処理を行うことになる。さらに、冗長化ビットは、上述した実施形態のように2ビットに限定されず、それ以上のビット数で表現してもよい。   In the above-described embodiment, the data bit and the redundancy bit are expressed by binary bits of “0” and “1”, but the present invention is not limited to this. That is, the data bits and the redundant bits may be expressed in grayscale or color having three or more values. In this case, the two-dimensional code is read, the image data is developed on the RAM 202, the image data is subjected to image processing, multilevel values are recognized, and then converted from data bits to output data using a conversion table. Processing will be performed. Further, the redundant bits are not limited to 2 bits as in the above-described embodiment, and may be expressed by a number of bits larger than that.

また、二次元コードのエンドビットの直前部分にチェックデジットを追加し、全データビットの値とチェックデジットの値とを加算し、0×Fで剰余をとったときに0×Fとなるか否かに応じて、正確にデータビットの読み取りができているか否かを判定(エラー検出)するようにしてもよい。もし正確にデータビットの読み取りができていないと判定された場合、もう一度読み取り処理を行うようにする。さらに、入力データをデータビットに変換する際に、公知のReed-Solomon符号化技術を用いてエラー訂正するようにしてもよい。   Also, a check digit is added immediately before the end bit of the two-dimensional code, the value of all data bits and the value of the check digit are added, and 0 × F is obtained when the remainder is taken as 0 × F. Accordingly, it may be determined (error detection) whether or not the data bits can be read accurately. If it is determined that the data bit cannot be read correctly, the reading process is performed again. Further, when converting input data into data bits, error correction may be performed using a known Reed-Solomon encoding technique.

なお、上述した実施形態では、矩形の冗長化ビット及びデータビットを二次元コードに配置しているが、冗長化ビット及びデータビットの形状はこれに限定されず、例えば円形の冗長化ビット及びデータビットであってもよく、全てのビットに通じて共通な形状であればよい。これにより、1次元バーコードのように細線でデータを表現する場合のように、直線状の汚れに弱かったり、インクジェット式の印字では表示することが困難であるという問題点を解消することができる。   In the above-described embodiment, rectangular redundancy bits and data bits are arranged in a two-dimensional code. However, the shape of the redundancy bits and data bits is not limited to this, and for example, circular redundancy bits and data bits. Bits may be used as long as they are common to all bits. As a result, it is possible to solve the problem that the data is expressed by thin lines like a one-dimensional bar code and is not easily displayed by ink-jet printing as it is vulnerable to linear stains. .

1:二次元コード生成装置、2:二次元コード読取装置、11:データ入力部、12:二値化処理部、13:冗長化ビット挿入部、14:二次元コード出力部、21:二次元コード読取部、22:データビット検出部、23:データ変換部、24:データ出力部、121:変換テーブル、122:定義テーブル   1: two-dimensional code generator, 2: two-dimensional code reader, 11: data input unit, 12: binarization processing unit, 13: redundant bit insertion unit, 14: two-dimensional code output unit, 21: two-dimensional Code reading unit, 22: data bit detection unit, 23: data conversion unit, 24: data output unit, 121: conversion table, 122: definition table

Claims (14)

号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを生成する二次元コード生成装置であって
前記符号化されたデータに対し、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを、符号化されたデータ毎に区分する間隔で周期的に挿入し、スタートビット及びエンドビットを付加した前記二次元コードを生成する二次元コード生成手段を有することを特徴とする二次元コード生成装置。
The marks Goka data a two-dimensional code generating device for generating a two-dimensional code arranged as a pattern on a two-dimensional matrix,
With respect to the encoded data, adjacent and redundant data including at least two data values are inverted periodically inserted at intervals classified in each encoded data, a start bit and two-dimensional code generating apparatus characterized by having a two-dimensional code generation means to generate the two-dimensional code added to the end bit.
前記二次元コード生成手段は、前記二次元コードの長さ方向において、前記二次元コードの幅方向の両端部に交互に現れるように前記冗長化データを配置することを特徴とする請求項1に記載の二次元コード生成装置。 The said two-dimensional code production | generation means arrange | positions the said redundant data so that it may appear alternately at the both ends of the width direction of the said two-dimensional code in the length direction of the said two-dimensional code. The two-dimensional code generation device described. 前記二次元コード生成手段は、細線を除く、全てに通じて共通な形状で前記データを配置した二次元コードを生成することを特徴とする請求項1又は2に記載の二次元コード生成装置。 3. The two-dimensional code generation device according to claim 1, wherein the two-dimensional code generation unit generates a two-dimensional code in which the data is arranged in a shape common to all but a thin line . 符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを読み取る二次元コード読取装置であって、
スタートビット及びエンドビットを検出することにより前記二次元コードを読み取る読取手段と、
前記二次元コードにおいて前記符号化されたデータに対して符号化されたデータ毎に区分する間隔で周期的に挿入された隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを基準にして、前記二次元コードから前記冗長化データにより区分された前記符号化されたデータを検出する検出手段と、
前記検出手段により検出された前記符号化されたデータを復号化する復号化手段とを有することを特徴とする二次元コード読取装置。
A two-dimensional code reader for reading a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix,
Reading means for reading the two-dimensional code by detecting a start bit and an end bit;
In the two-dimensional code, the redundant data including at least two adjacent data that are periodically inserted at intervals divided for each encoded data with respect to the encoded data and whose values are inverted is used as a reference. Detecting means for detecting the encoded data divided by the redundant data from the two-dimensional code;
It said detection means by said detected encoded two-dimensional code reader you characterized by chromatic and decoding means for decoding data.
前記読取手段により読み取られた前記二次元コードをメモリ上に展開する展開手段を更に有し、
前記検出手段は、前記メモリ上に展開された前記二次元コードから前記冗長化データを検出することを特徴とする請求項に記載の二次元コード読取装置。
Further comprising expansion means for expanding the two-dimensional code read by the reading means on a memory;
5. The two-dimensional code reader according to claim 4 , wherein the detection unit detects the redundant data from the two-dimensional code developed on the memory .
符号化されたデータが二次元のマトリックス上にパターンとして配置された二次元コードであって、
前記符号化されたデータに対して、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データが周期的に挿入され、スタートビット及びエンドビットが付加されたことを特徴とする二次元コード。
The encoded data is a two-dimensional code arranged as a pattern on a two-dimensional matrix,
With respect to the encoded data, adjacent and redundant data including at least two data values are inverted are periodically inserted, characterized in that the start bit and end bit are added two dimension code.
前記冗長化データは、前記符号化されたデータ毎に区分する間隔で挿入されたことを特徴とする請求項6に記載の二次元コード。 It said redundancy data, two-dimensional code according to claim 6, characterized in that it is inserted at intervals classified for each of the encoded data. 前記冗長化データは、前記二次元コードの長さ方向において、前記二次元コードの幅方向の両端部に交互に現れるように配置されたことを特徴とする請求項6又は7に記載の二次元コード。 The two-dimensional data according to claim 6 or 7, wherein the redundant data is arranged so as to alternately appear at both ends in the width direction of the two-dimensional code in the length direction of the two-dimensional code. code. 前記符号化されたデータは、細線を除く、全てに通じて共通な形状で配置されたことを特徴とする請求項6乃至8の何れか1項に記載の二次元コード。 The two-dimensional code according to any one of claims 6 to 8, wherein the encoded data is arranged in a shape common to all except a thin line . 前記符号化されたデータは、2値のデータ又は3値以上のデータであることを特徴とする請求項6乃至9の何れか1項に記載の二次元コード。 The two-dimensional code according to claim 6, wherein the encoded data is binary data or ternary or higher data . 符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを生成する二次元コード生成方法であって、
前記符号化されたデータに対し、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを、符号化されたデータ毎に区分する間隔で周期的に挿入し、スタートビット及びエンドビットを付加した前記二次元コードを生成する二次元コード生成ステップを含むことを特徴とする二次元コード生成方法
A two-dimensional code generation method for generating a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix,
Redundant data including at least two pieces of data that are adjacent to each other and whose values are inverted is periodically inserted into the encoded data at intervals that are divided for each encoded data, and a start bit and an end bit two-dimensional code generation how to comprising a two-dimensional code generating step of generating the two-dimensional code added.
符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを読み取る二次元コード読取方法であって、
スタートビット及びエンドビットを検出することにより前記二次元コードを読み取る読取ステップと、
前記二次元コードにおいて前記符号化されたデータに対して符号化されたデータ毎に区分する間隔で周期的に挿入された隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを基準にして、前記二次元コードから前記冗長化データにより区分された前記符号化されたデータを検出する検出ステップと、
前記検出ステップにより検出された前記符号化されたデータを復号化する復号化ステップとを含むことを特徴とする二次元コード読取方法
A two-dimensional code reading method for reading a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix,
A reading step of reading the two-dimensional code by detecting a start bit and an end bit;
In the two-dimensional code, the redundant data including at least two adjacent data that are periodically inserted at intervals divided for each encoded data with respect to the encoded data and whose values are inverted is used as a reference. And detecting the encoded data segmented by the redundant data from the two-dimensional code,
Two-dimensional code reading how to; and a decoding step of decoding the encoded data detected by the detecting step.
符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを生成する二次元コード生成方法をコンピュータに実行させるためのプログラムであって、
前記符号化されたデータに対し、隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを、符号化されたデータ毎に区分する間隔で周期的に挿入し、スタートビット及びエンドビットを付加した前記二次元コードを生成する二次元コード生成ステップをコンピュータに実行させるためのプログラム
A program for causing a computer to execute a two-dimensional code generation method for generating a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix,
Redundant data including at least two pieces of data that are adjacent to each other and whose values are inverted is periodically inserted into the encoded data at intervals that are divided for each encoded data, and a start bit and an end bit A program for causing a computer to execute a two-dimensional code generation step for generating the two-dimensional code to which is added .
符号化されたデータを二次元のマトリックス上にパターンとして配置した二次元コードを読み取る二次元コード読取方法をコンピュータに実行させるためのプログラムであって、
スタートビット及びエンドビットを検出することにより前記二次元コードを読み取る読取ステップと、
前記二次元コードにおいて前記符号化されたデータに対して符号化されたデータ毎に区分する間隔で周期的に挿入された隣接し、且つ値が反転した少なくとも2つのデータを含む冗長化データを基準にして、前記二次元コードから前記冗長化データにより区分された前記符号化されたデータを検出する検出ステップと、
前記検出ステップにより検出された前記符号化されたデータを復号化する復号化ステップとをコンピュータに実行させるためのプログラム
A program for causing a computer to execute a two-dimensional code reading method for reading a two-dimensional code in which encoded data is arranged as a pattern on a two-dimensional matrix,
A reading step of reading the two-dimensional code by detecting a start bit and an end bit;
In the two-dimensional code, the redundant data including at least two adjacent data that are periodically inserted at intervals divided for each encoded data with respect to the encoded data and whose values are inverted is used as a reference. And detecting the encoded data segmented by the redundant data from the two-dimensional code,
A program for causing a computer to execute a decoding step of decoding the encoded data detected by the detection step .
JP2010240939A 2010-10-27 2010-10-27 Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program Active JP5592234B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010240939A JP5592234B2 (en) 2010-10-27 2010-10-27 Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010240939A JP5592234B2 (en) 2010-10-27 2010-10-27 Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program

Publications (2)

Publication Number Publication Date
JP2012093971A JP2012093971A (en) 2012-05-17
JP5592234B2 true JP5592234B2 (en) 2014-09-17

Family

ID=46387226

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010240939A Active JP5592234B2 (en) 2010-10-27 2010-10-27 Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program

Country Status (1)

Country Link
JP (1) JP5592234B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103909741B (en) * 2012-12-30 2016-04-06 航天信息股份有限公司 9 needle printers in embedded system are utilized to print the method and apparatus of Quick Response Code
JP6785546B2 (en) * 2015-12-04 2020-11-18 共同印刷株式会社 Two-dimensional code analysis method, two-dimensional code analysis device, and two-dimensional code analysis program

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07134758A (en) * 1993-11-09 1995-05-23 Toppan Printing Co Ltd Display body provided with two-dimensional code and two-dimensional code reader
JP3012374U (en) * 1994-12-13 1995-06-13 東京アルテック有限会社 Playground card
JP2003331235A (en) * 2002-05-09 2003-11-21 Denso Wave Inc Two-dimensional code, two-dimensional code recording device, two-dimensional code reader and two-dimensional code reading system
JP5120155B2 (en) * 2008-09-02 2013-01-16 株式会社デンソーウェーブ Information code

Also Published As

Publication number Publication date
JP2012093971A (en) 2012-05-17

Similar Documents

Publication Publication Date Title
US8456486B2 (en) Image processing apparatus and image processing program
CN1560824A (en) Printing method for two-dimensional code symbol, and printer
WO2006117869A1 (en) Information input/output method using dot pattern
CN1964422A (en) Watermarked information embedding apparatus and method, and computer program
JP4188388B2 (en) Form processing system, form processing method, program, and optical reading form
JP2008305137A (en) Bar-code generation system, bar-code generation program and printer
CN101849243B (en) Code pattern
JP4893643B2 (en) Detection method and detection apparatus
JP5592234B2 (en) Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program
US20080174824A1 (en) Print data processing device and print data processing program
JPWO2013061468A1 (en) Image generation method, information processing method, program, and information processing apparatus
US8649055B2 (en) Image processing apparatus and computer readable medium
JP6127899B2 (en) Image processing apparatus and image processing program
JP6164018B2 (en) Information processing apparatus and information processing program
JP4397866B2 (en) Two-dimensional pattern reading device, two-dimensional pattern reading method
US8125691B2 (en) Information processing apparatus and method, computer program and computer-readable recording medium for embedding watermark information
JP7109398B2 (en) Image display medium, image processing device, image processing method, and program
WO2021095457A1 (en) Two-dimensional code generation method, two-dimensional code evaluation method, two-dimensional code system, two-dimensional code generation device, two-dimensional code evaluation device, and two-dimensional code
JP5434273B2 (en) Image processing apparatus and image processing program
JP2007096503A (en) Image processing apparatus, image processing method, and image processing program
JP5173690B2 (en) Information processing apparatus, information processing method, computer program, and computer-readable recording medium
JP5434272B2 (en) Information processing apparatus and information processing program
JP2007133907A (en) Document identification method and recording medium
JP2008301115A (en) Image processing apparatus, identifying method, and program
JP2008020947A (en) Bar code area determination device, method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130605

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140114

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140311

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140708

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140731

R150 Certificate of patent or registration of utility model

Ref document number: 5592234

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250