JP2017054560A - Two-dimensional code, two-dimensional code generation method, two-dimensional code generation device, program, and recording medium - Google Patents

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

Info

Publication number
JP2017054560A
JP2017054560A JP2016249272A JP2016249272A JP2017054560A JP 2017054560 A JP2017054560 A JP 2017054560A JP 2016249272 A JP2016249272 A JP 2016249272A JP 2016249272 A JP2016249272 A JP 2016249272A JP 2017054560 A JP2017054560 A JP 2017054560A
Authority
JP
Japan
Prior art keywords
solution candidate
dimensional code
data
generation
generated
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.)
Granted
Application number
JP2016249272A
Other languages
Japanese (ja)
Other versions
JP6270178B2 (en
Inventor
智司 小野
Tomoji Ono
智司 小野
孝康 渕田
Takayasu Fuchida
孝康 渕田
大介 谷山
Daisuke Taniyama
大介 谷山
昌之 田尻
Masayuki Tajiri
昌之 田尻
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.)
Kagoshima University NUC
Original Assignee
Kagoshima University NUC
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 Kagoshima University NUC filed Critical Kagoshima University NUC
Priority to JP2016249272A priority Critical patent/JP6270178B2/en
Publication of JP2017054560A publication Critical patent/JP2017054560A/en
Application granted granted Critical
Publication of JP6270178B2 publication Critical patent/JP6270178B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Editing Of Facsimile Originals (AREA)
  • Image Processing (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a two-dimensional code having a redundant structure in an area where data is embedded, a two-dimensional code generation method for generating the two-dimensional code, a two-dimensional code generation device, a program, and a recording medium.SOLUTION: In a two-dimensional code constituted by a model number, a mask pattern, error correction level, embedded data (a data code word) and a filler code word (and further an error correction word), secret information is embedded as metadata into a plurality of segments constituting the data code word, and by constitution positions of the segments, several module patterns can be generated.SELECTED DRAWING: Figure 5

Description

本発明は、特に、秘匿情報を格納するために用いて好適な2次元コード、2次元コード生成方法、2次元コード生成装置、プログラム及び記憶媒体に関する。   In particular, the present invention relates to a two-dimensional code, a two-dimensional code generation method, a two-dimensional code generation device, a program, and a storage medium that are suitable for storing confidential information.

近年、QRコード(登録商標)に代表される2次元コードは、電子チケットに用いられるなど、用途が多角化し、金銭的な価値を持つ認証に使われ始めている。これに対し、悪意のあるURLを含んだ2次元コードを偽造し、他の2次元コード上に貼りつけるなどして、フィッシングサイトに誘導するなど、2次元コードを利用した事件が起きている。   In recent years, a two-dimensional code represented by a QR code (registered trademark) is used for authentication having a monetary value due to diversified uses such as an electronic ticket. On the other hand, there are cases where two-dimensional codes are used, such as forging a two-dimensional code including a malicious URL and pasting it on another two-dimensional code to lead to a phishing site.

しかしながら、一般の2次元コードは偽造や複製への対策が取られておらず、偽造や複製を防止する手法の開発が要求されている。2次元コードの偽造を防止する手段として、格納データを暗号化する方法がある。しかし、それらの2次元コードを一般のデコーダで読み取った場合、提示される情報は意味不明な文字の羅列となる。そのため、ユーザに不信感を与えるという問題がある。   However, general two-dimensional codes do not take countermeasures against forgery and duplication, and development of a technique for preventing forgery and duplication is required. As a means for preventing forgery of the two-dimensional code, there is a method of encrypting stored data. However, when these two-dimensional codes are read by a general decoder, the presented information is an enumeration of characters whose meaning is unknown. Therefore, there is a problem of giving distrust to the user.

また、2次元コードの埋め草コードに秘匿情報を埋め込む手法も提案されている(例えば、特許文献1参照)。2次元コードは型番によってデータ長が定められており、埋め込むデータのサイズがデータ長よりも小さい場合、足りない部分には埋め草コードが埋められる。この埋め草コードを秘匿したいデータと置き換えることにより、一般のデコーダでは読み取ることのできない秘匿情報を2次元コードに埋め込むことを可能としている。しかしながらこの手法では、埋め草コードが秘匿情報となっているため、そのことを知っている場合には秘匿情報を容易に抽出することができてしまう。   A method of embedding confidential information in a two-dimensional code padding code has also been proposed (see, for example, Patent Document 1). The data length of the two-dimensional code is determined by the model number. When the size of the data to be embedded is smaller than the data length, the padding code is embedded in the missing part. By replacing the padding code with data to be concealed, it is possible to embed concealment information that cannot be read by a general decoder in a two-dimensional code. However, in this method, since the padding code is the secret information, the secret information can be easily extracted when it is known.

一方、2次元コードの普及は急速に進み、広告媒体として視覚的誘因生が低下している傾向にある。このため、近年、視覚的誘因性を向上させるために、2次元コードの内部に写真やイラストを組み込んだ装飾性の高い2次元コードが提案されている。このように2次元コードの装飾性を高めることにより、読み取る前から2次元コードに格納された情報を識別しやすくしたり、視認性を向上させてオリジナリティを演出したりすることができる。   On the other hand, the spread of two-dimensional codes is rapidly progressing, and there is a tendency for visual incentives to decrease as advertising media. For this reason, in recent years, in order to improve the visual incentive, a highly decorative two-dimensional code in which a photograph or an illustration is incorporated inside the two-dimensional code has been proposed. As described above, by enhancing the decorativeness of the two-dimensional code, it is possible to easily identify the information stored in the two-dimensional code before reading, or to improve the visibility and produce the originality.

ところが、写真やイラストを組み込むと、組み込んだ箇所の情報が隠蔽されるため、2次元コードを読み取る際に誤り訂正機能を用いて復号を行う必要がある。このように写真やイラストの大きさや配置位置に制限があるため、2次元コード上での写真やイラストを配置する位置を最適化して、装飾性と可読性とを両立させる必要がある。そのため、埋め草コード語の領域を制御したり、誤り訂正語の領域を変形対象としたりするなど、モジュールパターンを変更する方法が制限されており、データが埋め込まれた領域のモジュールパターンを変更することが難しかった。   However, when a photograph or illustration is incorporated, the information of the incorporated part is concealed, and therefore it is necessary to perform decoding using an error correction function when reading a two-dimensional code. As described above, since the size and arrangement position of photographs and illustrations are limited, it is necessary to optimize the position where the photographs and illustrations are arranged on the two-dimensional code so as to achieve both decoration and readability. For this reason, the method of changing the module pattern is restricted, such as controlling the padding codeword area or changing the error correction word area, and the module pattern in the area where data is embedded is changed. It was difficult.

特開2012−89177号公報JP 2012-89177 A 特開2013−25475号公報JP 2013-25475 A

本発明は前述の問題点に鑑み、データが埋め込まれる領域において冗長な構造の2次元コード、その2次元コードを生成するための2次元コード生成方法、2次元コード生成装置、プログラム及び記憶媒体を提供することを目的としている。   In view of the above-described problems, the present invention provides a two-dimensional code having a redundant structure in an area where data is embedded, a two-dimensional code generation method for generating the two-dimensional code, a two-dimensional code generation device, a program, and a storage medium. It is intended to provide.

本発明の2次元コードは、複数のセグメントに分割してデータが埋め込まれたコード語を有する2次元コードであって、特定の形状を表現したモジュールパターンを構成するためのセグメントの構造を含むことを特徴とする。   The two-dimensional code of the present invention is a two-dimensional code having a code word in which data is embedded by being divided into a plurality of segments, and includes a segment structure for constituting a module pattern expressing a specific shape It is characterized by.

本発明の2次元コード生成方法は、公開情報としてのデータ、秘匿情報及び画像を入力する入力工程と、セルの配置パターンの生成に関連し、前記データを格納する前記秘匿情報に応じたセグメントの構成要素を含む複数の構成要素を変数として、解候補として前記データを符号化した2次元コードを生成する解候補生成工程と、前記解候補生成工程において生成された解候補が前記画像と類似しているか否かを、少なくとも1つの目的関数に基づいて評価する解候補評価工程とを有し、前記解候補生成工程においては、前記解候補評価工程における評価に応じて、前記複数の構成要素に基づいた新たな解候補を生成し、前記解候補評価工程においては、前記解候補生成工程において生成された新たな解候補について評価することを特徴とする。   The two-dimensional code generation method of the present invention relates to an input process for inputting data, confidential information and an image as public information, and generation of a cell arrangement pattern, and a segment corresponding to the confidential information storing the data is generated. A solution candidate generation step of generating a two-dimensional code in which the data is encoded as a solution candidate using a plurality of components including the component as variables, and the solution candidate generated in the solution candidate generation step is similar to the image A solution candidate evaluation step for evaluating whether or not the plurality of components are included in the solution candidate generation step according to the evaluation in the solution candidate evaluation step. A new solution candidate based on the solution candidate is generated, and in the solution candidate evaluation step, the new solution candidate generated in the solution candidate generation step is evaluated. .

本発明の2次元コード生成装置は、公開情報としてのデータ、秘匿情報及び画像を入力する入力手段と、セルの配置パターンの生成に関連し、前記データを格納する前記秘匿情報に応じたセグメントの構成要素を含む複数の構成要素を変数として、解候補として前記データを符号化した2次元コードを生成する解候補生成手段と、前記解候補生成手段によって生成された解候補が前記画像と類似しているか否かを、少なくとも1つの目的関数に基づいて評価する解候補評価手段とを有し、前記解候補生成手段は、前記解候補評価手段による評価に応じて、前記複数の構成要素に基づいた新たな解候補を生成し、前記解候補評価手段は、前記解候補生成手段によって生成された新たな解候補について評価することを特徴とする。   The two-dimensional code generation device of the present invention relates to generation of a cell arrangement pattern, an input unit for inputting data as public information, confidential information and an image, and a segment corresponding to the confidential information for storing the data. A solution candidate generation unit that generates a two-dimensional code obtained by encoding the data as a solution candidate using a plurality of components including the component as variables, and a solution candidate generated by the solution candidate generation unit is similar to the image A solution candidate evaluation unit that evaluates whether or not the solution candidate is evaluated based on at least one objective function, wherein the solution candidate generation unit is based on the plurality of components according to the evaluation by the solution candidate evaluation unit A new solution candidate is generated, and the solution candidate evaluation unit evaluates the new solution candidate generated by the solution candidate generation unit.

本発明のプログラムは、前記2次元コード生成方法の各工程をコンピュータに実行させることを特徴とする。   The program of the present invention causes a computer to execute each step of the two-dimensional code generation method.

本発明の記憶媒体は、前記プログラムを記憶したことを特徴とする。   The storage medium of the present invention stores the program.

本発明によれば、データが埋め込まれる領域において冗長な構造を有することにより、秘匿情報を簡単に読み取れないようにしたり、装飾性を向上させたりすることができる。   According to the present invention, by having a redundant structure in an area where data is embedded, confidential information cannot be easily read, and decorativeness can be improved.

本発明の実施形態に係る2次元コード生成装置のハードウェア構成例を示すブロック図である。It is a block diagram which shows the hardware structural example of the two-dimensional code production | generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係る2次元コード生成装置の機能構成例を示すブロック図である。It is a block diagram which shows the function structural example of the two-dimensional code production | generation apparatus which concerns on embodiment of this invention. 一般的な2次元コードのデータ構造例を示す図である。It is a figure which shows the example of a data structure of a general two-dimensional code. 一般的なセグメントの構造例を示す図である。It is a figure which shows the structural example of a general segment. 本発明の実施形態における冗長性を持たせたセグメントの構造例を示す図である。It is a figure which shows the structural example of the segment which gave the redundancy in embodiment of this invention. 本発明の実施形態において、秘匿情報をセグメントに埋め込んだ場合のセグメントの構造例を示す図である。In embodiment of this invention, it is a figure which shows the example of a structure of a segment at the time of embedding confidential information in a segment. 本発明の実施形態において、秘匿情報をセグメントに埋め込んだ場合のセグメントの他の構造例を示す図である。In embodiment of this invention, it is a figure which shows the other structural example of a segment at the time of embedding confidential information in a segment. 本発明の実施形態において、初期集団として複数パターンの2次元コードを生成する処理手順の一例を示すフローチャートである。5 is a flowchart illustrating an example of a processing procedure for generating a plurality of patterns of two-dimensional codes as an initial group in the embodiment of the present invention. 誤り訂正レベルの一覧を示す図である。It is a figure which shows the list of error correction levels. 本発明の実施形態において、遺伝的アルゴリズムにより出力する2次元コードを生成する処理手順の一例を示すフローチャートである。6 is a flowchart illustrating an example of a processing procedure for generating a two-dimensional code output by a genetic algorithm in the embodiment of the present invention. 入力される画像の目標領域、境界領域及び背景領域を説明する図である。It is a figure explaining the target area | region, boundary area | region, and background area | region of the image input. Genotype及びPhenotypeを説明する図である。It is a figure explaining Genotype and Phenotype. イラストを貼り付けた2次元コード及びイラストに類似したパターンの2次元コードの一例を示す図である。It is a figure which shows an example of the two-dimensional code of the pattern similar to the two-dimensional code and illustration which affixed the illustration.

以下、本発明の実施形態について、図面を参照しながら説明する。本実施形態では、2次元コードの1種であるQRコードを参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the present embodiment, description will be made with reference to a QR code which is a kind of two-dimensional code.

図1は、本実施形態に係る2次元コード生成装置100のハードウェア構成例を示すブロック図である。
図1において、CPU101は、2次元コード生成装置100全体を制御するものであり、必要な時にROM103に記憶されたプログラムを読み出してRAM102に展開し、本実施形態に係る処理を実行する。入力装置104は、着脱可能なメモリカードなどの記録媒体を装着することができ、2次元コードに埋め込むデータ及び秘匿情報を入力したり、セルパターンとして形成させたい写真やイラストを入力したりする。
FIG. 1 is a block diagram illustrating a hardware configuration example of a two-dimensional code generation device 100 according to the present embodiment.
In FIG. 1, a CPU 101 controls the entire two-dimensional code generation apparatus 100, reads a program stored in a ROM 103 when necessary, expands it in a RAM 102, and executes processing according to the present embodiment. The input device 104 can be loaded with a removable recording medium such as a memory card, and inputs data to be embedded in a two-dimensional code and confidential information, or inputs a photograph or illustration to be formed as a cell pattern.

操作部105は、ユーザの操作に応じてコマンドを入力する操作部材である。記憶装置106は例えばハードディスクであり、データを記憶するためのものである。画像表示装置107は例えば液晶ディスプレイであり、2次元コードを生成できない旨のエラーなどを警告表示したり、2次元コードの条件等を設定するためのメニュー画面を表示したりする。ネットワークインタフェースカード(NIC)108は、LAN110を介して他の情報機器とデータをやり取りするためのインターフェースである。メインバス109は前述した各構成を接続するためのバスである。   The operation unit 105 is an operation member that inputs a command in accordance with a user operation. The storage device 106 is a hard disk, for example, for storing data. The image display device 107 is, for example, a liquid crystal display, and displays a warning message indicating that a two-dimensional code cannot be generated, or displays a menu screen for setting a two-dimensional code condition or the like. A network interface card (NIC) 108 is an interface for exchanging data with other information devices via the LAN 110. The main bus 109 is a bus for connecting the above-described components.

図2は、本実施形態に係る2次元コード生成装置100の機能構成例を示すブロック図である。
図2において、データ入力部201は、入力装置104、または外部装置からLAN110を介して2次元コードに埋め込むデータ(文字列)を入力する。2次元コードに秘匿情報を埋め込む場合には、秘匿情報も入力する。
FIG. 2 is a block diagram illustrating a functional configuration example of the two-dimensional code generation device 100 according to the present embodiment.
In FIG. 2, a data input unit 201 inputs data (character string) to be embedded in a two-dimensional code from the input device 104 or an external device via the LAN 110. When the confidential information is embedded in the two-dimensional code, the confidential information is also input.

解候補生成部202は、入力された文字列及び秘匿情報からコード語及びメタデータを生成し、データコード語、型番、誤り訂正レベル、マスクパターン、埋め草コード語などを変数として、2次元コードを複数パターン生成し、解候補記憶部206に記憶する。本実施形態では、データコード語において、冗長なセグメント構造とすることにより、秘匿情報をメタデータとして埋め込むことができるようにしている。なお、この冗長なセグメント構造については後述する。また、本実施形態では、詳細な説明は後述するが、このような複数の2次元コードから遺伝的アルゴリズムにより、秘匿情報を格納するとともに所望の写真やイラストを反映させた2次元コードを生成するようにする。   The solution candidate generation unit 202 generates a code word and metadata from the input character string and confidential information, and uses a data code word, a model number, an error correction level, a mask pattern, a padding code word, and the like as a variable as a two-dimensional code. Are generated and stored in the solution candidate storage unit 206. In the present embodiment, confidential information can be embedded as metadata by adopting a redundant segment structure in the data code word. This redundant segment structure will be described later. In the present embodiment, the detailed description will be given later, but secret information is stored from a plurality of such two-dimensional codes by a genetic algorithm and a two-dimensional code reflecting a desired photograph or illustration is generated. Like that.

画像入力部203は、入力装置104、または外部装置からLAN110を介して写真やイラストなどの画像データを入力する。解候補評価部204は、解候補記憶部206に記憶された2次元コードと、画像入力部203により入力された画像データとを比較することにより、遺伝的アルゴリズムを用いて2次元コードを評価する。出力部205は、生成された2次元コードを出力する。   The image input unit 203 inputs image data such as photographs and illustrations from the input device 104 or an external device via the LAN 110. The solution candidate evaluation unit 204 evaluates the two-dimensional code using a genetic algorithm by comparing the two-dimensional code stored in the solution candidate storage unit 206 with the image data input by the image input unit 203. . The output unit 205 outputs the generated two-dimensional code.

図3は、一般的な2次元コードのデータ構造例を示す図である。
図3に示すように、2次元コードのデータは、型番、マスクパターン、誤り訂正レベル、埋め込むデータ(データコード語)、埋め草コード語(さらには誤り訂正語を含む)で構成されている。埋め込むデータはさらに複数のセグメントから構成されており、数字モード、漢字モードなどモードによって分割されている。
FIG. 3 is a diagram illustrating a data structure example of a general two-dimensional code.
As shown in FIG. 3, the data of the two-dimensional code is composed of a model number, a mask pattern, an error correction level, data to be embedded (data code word), and a padding code word (further including an error correction word). The data to be embedded is further composed of a plurality of segments, which are divided according to modes such as a numeric mode and a kanji mode.

例えば図4に示すように、「エンコードテストdummyURL-kadai.jp」という情報を2次元コードに埋め込む場合には、セグメント1には、カタカナ表記の8文字の「エンコードテスト」の情報が埋め込まれ、セグメント2には、アルファベット表記の17文字の「dummyURL-kadai.jp」の情報が埋め込まれる。これらのセグメントに秘匿情報を埋め込むと、一般のデコーダでも各セグメントの情報を読み取ることができるため、秘匿情報が簡単に入手されてしまう。   For example, as shown in FIG. 4, when the information “encoding test dummyURL-kadai.jp” is embedded in the two-dimensional code, the 8-character “encoding test” information in katakana is embedded in segment 1, In segment 2, information of 17 characters “dummyURL-kadai.jp” in alphabetical notation is embedded. When the confidential information is embedded in these segments, the information of each segment can be read even by a general decoder, so that the confidential information is easily obtained.

図5は、本実施形態において、冗長性を持たせたセグメントの構造例を示す図である。
本実施形態では、セグメントのメタデータ(モード指示子やECIモード指示子、ECI割当て番号など)として秘匿情報を埋め込む。この場合、一般のデコーダでは、セグメントのメタデータは復号の犀利に利用されるだけであり、最終的な復号結果には表れない。基本的に、公開情報を一般的な手順で符号化するだけでは、セグメントのメタデータで所望の秘匿情報を表現することはできない。本実施形態では、所望の秘匿情報とメタデータとが一致するように、本来は不要な冗長なセグメントの構造を生成する。そのために、例えば、通常は1つのセグメントで表現すべき文字列を故意に2つのセグメントに分けたり、図5に示すように、実際には何も情報を含まない文字数が0の空のセグメントを含ませたりすることにより実現する。
FIG. 5 is a diagram showing an example of a segment structure with redundancy in the present embodiment.
In this embodiment, confidential information is embedded as segment metadata (mode indicator, ECI mode indicator, ECI allocation number, etc.). In this case, in a general decoder, the segment metadata is only used for the advantage of decoding, and does not appear in the final decoding result. Basically, the desired confidential information cannot be expressed by the segment metadata simply by encoding the public information by a general procedure. In the present embodiment, a redundant segment structure that is originally unnecessary is generated so that desired confidential information matches metadata. For this purpose, for example, a character string that should normally be represented by one segment is intentionally divided into two segments, or an empty segment with zero characters that does not actually contain any information as shown in FIG. It is realized by including.

図6は、秘匿情報をセグメントに埋め込んだ場合のセグメントの構造例を示す図である。
図6に示す構造において、上段はセグメントの要素を示し、中段はビットを示し、さらに下段は秘匿情報を示している。図6に示す文字数0のセグメント1には、「8ビットバイト」のモードと「漢字」のモードとが存在し、これらのモードを示すモード指示子が秘匿情報を表している。一方、公開情報として埋め込まれているデータ部には、秘匿情報が埋め込まれていない。
FIG. 6 is a diagram illustrating an example of the structure of a segment when confidential information is embedded in the segment.
In the structure shown in FIG. 6, the upper part shows segment elements, the middle part shows bits, and the lower part shows confidential information. The segment 1 with 0 characters shown in FIG. 6 has an “8-bit byte” mode and a “Kanji” mode, and a mode indicator indicating these modes represents confidential information. On the other hand, confidential information is not embedded in the data portion embedded as public information.

図7は、秘匿情報をセグメントに埋め込んだ場合のセグメントの他の構造例を示す図である。
図7に示す例では、文字数指示子が秘匿情報を表しており、セグメント1の文字数指示子「101」、セグメント2の文字数指示子「010」、それ以降の文字数指示子を接続することにより、秘匿情報「1010100...」を表している。なお、文字数指示子のビット数は、文字数指示子の下位2〜3ビット程度を用いる。
FIG. 7 is a diagram illustrating another example of the structure of the segment when the confidential information is embedded in the segment.
In the example shown in FIG. 7, the character number indicator represents the confidential information, and by connecting the segment number character number indicator “101”, the segment 2 character number indicator “010”, and the subsequent character number indicator, The confidential information “1010100...” Is represented. The number of bits of the character number indicator uses about the lower 2 to 3 bits of the character number indicator.

以上のように本実施形態では、本来は不要なセグメントの切り替えや文字数0のセグメントを設けることにより、冗長性を持たせたデータ構造としている。一方、セグメントに冗長性を持たせることによって埋め込むデータ(データコード語)を変数として、所望の写真やイラストに類似したモジュールパターンを含む2次元コードを生成することもできる。   As described above, in the present embodiment, a data structure having redundancy is provided by switching an originally unnecessary segment or providing a segment with 0 characters. On the other hand, it is also possible to generate a two-dimensional code including a module pattern similar to a desired photograph or illustration by using data (data code word) embedded by giving redundancy to a segment as a variable.

写真やイラストを組み込むと、組み込んだ箇所の情報が隠蔽されるため、2次元コードを読み取る際に誤り訂正機能を用いて復号を行う必要がある。このように写真やイラストの大きさや配置位置に制限があるため、2次元コード上での写真やイラストを配置する位置を最適化して、装飾性及び可読性を両立させる必要がある。そこで本実施形態では、特許文献2で設計変数とされている2次元コードの埋め草コード語、誤り訂正語などのモジュールパターンに加えて、データコード語のセグメントの構造を設計変数として加える。これらの値の組み合わせを調整し、写真やイラスト等に類似するモジュールパターンを形成することにより装飾性及び可読性を確保する。   When a photograph or illustration is incorporated, the information of the incorporated part is concealed, and therefore it is necessary to perform decoding using an error correction function when reading a two-dimensional code. As described above, since the size and arrangement position of photographs and illustrations are limited, it is necessary to optimize the position where the photographs and illustrations are arranged on the two-dimensional code so as to achieve both decoration and readability. Therefore, in this embodiment, in addition to module patterns such as two-dimensional code padding code words and error correction words, which are the design variables in Patent Document 2, the structure of the data code word segment is added as a design variable. A combination of these values is adjusted to form a module pattern similar to a photograph or illustration, thereby ensuring decoration and readability.

図8は、解候補生成部202により、初期集団として複数パターンの2次元コードを生成する処理手順の一例を示すフローチャートである。
まず、ステップS801において、2次元コードを生成する指示とともに、データ入力部201から公開情報である文字列のデータを入力するまで待機する。そして、文字列のデータを入力すると、ステップS802において、入力された文字列をもとに、コード語を生成する。このとき、データコード語については、秘匿情報が入力された場合に以下のような手順により生成する。
FIG. 8 is a flowchart illustrating an example of a processing procedure in which the solution candidate generation unit 202 generates a plurality of patterns of two-dimensional codes as an initial group.
First, in step S801, the process waits until an instruction for generating a two-dimensional code and character string data as public information are input from the data input unit 201. When character string data is input, a code word is generated in step S802 based on the input character string. At this time, the data code word is generated by the following procedure when confidential information is input.

本実施形態では、図6に示したようなモード指示子が秘匿情報を表すパターンと、図7に示したような文字数指示子が秘匿情報を表すパターンとの2通りのデータコード語を生成することができる。また、これ以外に、文字数が0のセグメントを利用し、例えば、空でないセグメントを1とし、空のセグメントを0として、セグメントの順列により秘匿情報を表すことも可能である。そして、後述するステップS805において組み合わせを決定する際に、これらの数パターンの中から1つを選択する。   In the present embodiment, two types of data code words are generated: a pattern in which the mode indicator as shown in FIG. 6 represents confidential information and a pattern in which the character number indicator as shown in FIG. 7 represents confidential information. be able to. In addition to this, it is also possible to use the segment with 0 characters, for example, to set the non-empty segment to 1, and set the empty segment to 0, and represent the confidential information by the permutation of the segments. Then, when determining a combination in step S805 described later, one of these number patterns is selected.

まず、モード指示子が秘匿情報を表すパターンの生成方法について説明する。モード指示子には、「8ビットバイト」のモード、「漢字」のモードの、「数字」のモード、及び「英数字」のモードが存在し、これらのモードの出現順序によって秘匿情報と対応付ける。このとき、データ部に埋め込む公開情報の字種の並びによっては、所望の秘匿情報を埋め込むことができない場合があるが、その際は文字数が0であるセグメント(空セグメント)を挿入する。   First, a method for generating a pattern in which the mode indicator represents confidential information will be described. The mode indicator includes an “8-bit byte” mode, a “kanji” mode, a “numeric” mode, and an “alphanumeric” mode, which are associated with confidential information according to the appearance order of these modes. At this time, depending on the arrangement of the character types of the public information embedded in the data part, the desired confidential information may not be embedded. In this case, a segment (empty segment) having 0 characters is inserted.

まず、長さがnの秘匿情報のビット列を2ビットごとに区切り、2ビット組の順列B1、B2、・・・、B[n/2]を得る。そして、公開情報を一般的な方法により符号化し、セグメント列S1、S2、・・・、SNを得る。次に、i=1から順にBiとSiとを比較し、モード指示子が一致しているか否かを判定して、一致していない場合にのみ、Siに空のセグメントを追加し、そのSiのモード指示子をBiのモード指示子に対応させる。以上のような手順によりi=[n/2]まで達した場合には、秘匿情報の終端を表すビット列を埋め込む。 First, a bit string of secret information having a length of n is divided every two bits to obtain 2-bit pairs of permutations B 1 , B 2 ,..., B [n / 2] . Then, encoded by a general method public information, obtain segment sequence S 1, S 2, · · ·, a S N. Next, B i and S i are compared in order from i = 1, and it is determined whether or not the mode indicators match. Only when they do not match, an empty segment is added to S i. to correspond the mode indicator of its S i to a mode indicator for the B i. When i = [n / 2] is reached by the above procedure, a bit string representing the end of the confidential information is embedded.

次に、文字数指示子が秘匿情報を表すパターンの生成方法について説明する。以下の説明では、文字数指示子の下位2ビットを用いる例について説明する。まず、同一の文字モードでエンコードする最大文字数2pを決定し、埋め込む秘匿情報のビット列をpビットごとに区切り、pビット組の順列B1、B2、・・・、B[n/p]に変換する。そして、注目する秘匿情報のビット組を示すi、及び注目するセグメントを示すlを1に初期化する。 Next, a method for generating a pattern in which the character number indicator represents confidential information will be described. In the following description, an example using the lower 2 bits of the character number indicator will be described. First, the maximum number of characters 2 p to be encoded in the same character mode is determined, and the bit sequence of the confidential information to be embedded is divided into p bits and converted into permutations B1, B2,..., B [n / p] of p bit sets. To do. Then, i indicating the bit set of the confidential information of interest and l indicating the segment of interest are initialized to 1.

次に、セグメントlの公開情報の注目する文字xからモード指示子を決定する。そして、Biを10進数に変換した値にlを加算した値dを計算する。次に、公開情報がx文字からx+d文字まで、同一のモードで符号化できる場合は、d文字からなるセグメントlを生成する。そして、iおよびlに1を加算し、xにdを加算する。そして、i が[n/p]に達した場合は、秘匿情報の終端を表すビット列を埋め込む。一方、i<[n/p]の場合は、上記手順を繰り返す。 Next, the mode indicator is determined from the noticed character x in the public information of the segment l. Then, a value d obtained by adding l to a value obtained by converting B i into a decimal number is calculated. Next, if the public information can be encoded in the same mode from the x character to the x + d character, a segment l composed of the d character is generated. Then, 1 is added to i and l, and d is added to x. When i reaches [n / p], a bit string representing the end of the confidential information is embedded. On the other hand, if i <[n / p], the above procedure is repeated.

一方、公開情報がx文字からx+d文字まで、同一のモードで符号化できない場合は、連続してエンコード可能な文字(d′文字とする)を用いてセグメントlを生成する。この場合、秘匿情報は埋め込まず、xにd′を加算して前述した手順に戻る。また、全ての公開情報を既に符号化済みの場合は、残りの秘匿情報について、モード指示子が秘匿情報を表すパターンの生成方法を用いて符号化する。   On the other hand, if the public information cannot be encoded in the same mode from the x character to the x + d character, the segment l is generated using characters that can be continuously encoded (referred to as d ′ character). In this case, the confidential information is not embedded, and d ′ is added to x, and the procedure returns to the above-described procedure. When all the public information has already been encoded, the remaining confidential information is encoded using a method for generating a pattern in which the mode indicator represents the confidential information.

次に、ステップS803において、生成したコード語の先頭にモード指示子及び文字数指示子を付与する。そして、ステップS804において、生成したコード語の終端に終端ビットを付与する。   Next, in step S803, a mode indicator and a character number indicator are added to the head of the generated code word. In step S804, a termination bit is added to the end of the generated code word.

次に、ステップS805において、データコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語の組合せをランダムに設定する。このとき、一度適用した組合せについては再度選択しないようにする。また、誤り訂正レベルについては、図9に示すように、L、M、Q、Hの4段階に設定することが可能である。また、2次元コードの用途として、印刷物や物品などに用いられるような場合には、誤り訂正機能を大きくするために、初期設定として例えば、Q、Hの2段階のみに設定するようにしてもよい。   Next, in step S805, a combination of a data code word, an error correction level, a mask pattern, a model number, and a padding code word is set at random. At this time, the combination once applied is not selected again. Further, as shown in FIG. 9, the error correction level can be set in four stages of L, M, Q, and H. Further, when the two-dimensional code is used for a printed matter or an article, the initial setting may be set to only two stages of Q and H in order to increase the error correction function. Good.

次に、ステップS806において、ステップS805において設定された埋め草コード語を生成し、ステップS804で付与した終端ビットの後方に追加する。なお、埋め草コード語の長さは、2次元コードの型番及び誤り訂正レベルに基づいて決定される。また、型番によって残余コード語や残余ビットが必要な場合は、残余コード語や残余ビットを付加する。そして、設定された誤り訂正レベルの誤り訂正コード語を追加する。ここで、誤り訂正コード語は、データコード語、誤り訂正レベル、型番、入力された文字列のコード語、及び埋め草コード語により決定されるものである。したがって、誤り訂正コード語を変更することによって、これらの5つの要素の情報を変更することができる。本実施形態では、このように誤り訂正レベル、型番などを設計変数として取り扱うため、誤り訂正コード語の領域におけるセルの配置パターンも変更することができる。次に、ステップS807において、ステップS806までに生成されたビット列をブロック分割し、各ブロックにおいてRS符号を生成する。   Next, in step S806, the padding code word set in step S805 is generated and added behind the end bit assigned in step S804. Note that the length of the padding code word is determined based on the model number and error correction level of the two-dimensional code. In addition, when a residual code word or a residual bit is necessary depending on the model number, a residual code word or a residual bit is added. Then, an error correction code word having the set error correction level is added. Here, the error correction code word is determined by the data code word, the error correction level, the model number, the code word of the input character string, and the padding code word. Therefore, the information of these five elements can be changed by changing the error correction code word. In this embodiment, since the error correction level, the model number, and the like are handled as design variables in this way, the cell arrangement pattern in the error correction codeword area can also be changed. Next, in step S807, the bit string generated up to step S806 is divided into blocks, and an RS code is generated in each block.

次に、ステップS808において、生成されたコード語を、ステップS805で設定された型番のシンボル上に配置する。本実施形態では、2値化を容易にして可読性を確保するためセルの色は白及び黒の2色を用いるものとする。そして、ステップS809において、ステップS805で設定されたマスクパターンに従ってマスク処理を行う。そして、ステップS810において、形式情報及び型番情報を2次元コードのシンボル上の所定の位置に配置し、初期集団としての2次元コードを生成する。   Next, in step S808, the generated code word is arranged on the symbol of the model number set in step S805. In the present embodiment, it is assumed that two colors of white and black are used as the cell color in order to facilitate binarization and ensure readability. In step S809, mask processing is performed according to the mask pattern set in step S805. In step S810, the format information and the model number information are arranged at predetermined positions on the symbol of the two-dimensional code, and a two-dimensional code as an initial group is generated.

次に、ステップS811において、所定数の2次元コードが得られたか否かを判定する。この判定の結果、所定数の2次元コードが得られていない場合は、ステップS805に戻り、異なる組合せによりデータコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語を設定する。一方、所定数の2次元コードが得られた場合は、初期集団生成部202による処理を終了する。なお、初期集団として必要な2次元コードの数は、後述する遺伝的アルゴリズムで用いるパラメータによって決定される。   Next, in step S811, it is determined whether a predetermined number of two-dimensional codes have been obtained. If the predetermined number of two-dimensional codes are not obtained as a result of the determination, the process returns to step S805, and data code words, error correction levels, mask patterns, model numbers, and padding code words are set by different combinations. On the other hand, when a predetermined number of two-dimensional codes are obtained, the processing by the initial group generation unit 202 is terminated. Note that the number of two-dimensional codes necessary for the initial population is determined by parameters used in a genetic algorithm described later.

次に、解候補評価部204の評価により、遺伝的アルゴリズムを用いて写真またはイラストの形状が反映された2次元コードを生成する方法について説明する。写真やイラストの形状を反映させるようにセルの配置パターンを変更すると、2次元コードの内部のデータが変更されるため、可読性が低下する。そこで、可読性を維持しつつ、セルの配置パターンを変更させるためには、2次元コードの内部の構成データを変更することが必要である。   Next, a method for generating a two-dimensional code reflecting the shape of a photograph or an illustration using a genetic algorithm based on the evaluation of the solution candidate evaluation unit 204 will be described. When the cell arrangement pattern is changed so as to reflect the shape of the photograph or illustration, the data inside the two-dimensional code is changed, so that the readability is lowered. Therefore, in order to change the cell arrangement pattern while maintaining readability, it is necessary to change the internal configuration data of the two-dimensional code.

そこで本実施形態では、構成要素として、セルの配置パターンに影響する誤り訂正レベル、マスクパターン、型番、埋め草コード語、及びデータコード語における空セグメントの位置や個数、空でないセグメントの分割の有無等を遺伝的アルゴリズムの設計変数とし、遺伝的アルゴリズムにより、入力された写真やイラストが反映された2次元コードを生成する。   Therefore, in the present embodiment, the error correction level, mask pattern, model number, padding code word, and position and number of empty segments in the data code word, and presence / absence of non-empty segment division, which affect the cell arrangement pattern, as constituent elements Are used as design variables of the genetic algorithm, and a two-dimensional code reflecting the input photograph or illustration is generated by the genetic algorithm.

図10は、解候補評価部204において遺伝的アルゴリズムにより2次元コードの解候補を評価する処理手順の一例を示すフローチャートである。
まず、ステップS1001において、画像入力部203から写真やイラストなどの画像データを入力する。
FIG. 10 is a flowchart illustrating an example of a processing procedure in which the solution candidate evaluation unit 204 evaluates a solution candidate of a two-dimensional code using a genetic algorithm.
First, in step S1001, image data such as a photograph or an illustration is input from the image input unit 203.

次に、ステップS1002において、解候補評価部204は、解候補記憶部206に記憶されている2次元コードと、ステップS1001で入力された画像データとを比較し、以下の式(1)及び式(2)により類似度を示す適応度Q(C)を算出する。   Next, in step S1002, the solution candidate evaluation unit 204 compares the two-dimensional code stored in the solution candidate storage unit 206 with the image data input in step S1001, and the following equation (1) and equation: The fitness Q (C) indicating the similarity is calculated by (2).

Figure 2017054560
Figure 2017054560

Figure 2017054560
Figure 2017054560

ここで、O(x,y)は、2次元コードにおける実際の階調値であり、T(x,y)は、出力する2次元コードとして理想的な階調値である。また、H,Wはそれぞれ、縦及び横のピクセル数を示す。本実施形態では、閾値εは、入力された画像と類似するまで解候補の生成と評価とを繰り返し、類似しているとみなせる程度に小さい値に設定する。   Here, O (x, y) is an actual gradation value in the two-dimensional code, and T (x, y) is an ideal gradation value as an output two-dimensional code. H and W represent the numbers of vertical and horizontal pixels, respectively. In the present embodiment, the threshold ε is set to a value that is small enough to repeat generation and evaluation of solution candidates until they are similar to the input image, and to be regarded as similar.

また、ωは重み画像における階調値を示し、入力された画像から算出される値である。図11に示すように、入力された画像においては、目標領域1101、境界領域1102及び背景領域1103に分かれる。階調値ωの算出方法は、これらの領域によって異なり、目標領域1101での階調値ωtarget、境界領域1102での階調値ωborder、及び背景領域1103での階調値ωbackは、以下の式(3)により算出される。 Further, ω represents a gradation value in the weighted image and is a value calculated from the input image. As shown in FIG. 11, the input image is divided into a target area 1101, a boundary area 1102, and a background area 1103. The method of calculating the gradation value omega differs by these regions, the gradation value omega target at the target region 1101, the tone value omega back of a gray level value of omega border and background region 1103, in the boundary region 1102, It is calculated by the following equation (3).

Figure 2017054560
Figure 2017054560

ここで、Sallは、2次元コードの面積であり、Stargetは、画像内の主に表現したい目標領域601の面積である。また、Sbackは、その他の背景領域1103の面積である。 Here, S all is the area of the two-dimensional code, and S target is the area of the target region 601 to be mainly expressed in the image. S back is the area of the other background region 1103.

次に、ステップS1003において、解候補評価部204は、解候補記憶部206に記憶されている2次元コードの中から、ランダムに2つの2次元コードを読み出す。そして、後述するステップS1004での交叉及び突然変異により直前に生成された子の2次元コードを解候補記憶部206から読み出す。そして、子の2次元コード、及び読み出した2つの2次元コードを合わせた4つの中から最も適応度の高い2次元コードを選択し、さらに、ルーレットにより1つの2次元コードを選択する。ここで、ルーレットにより1つの2次元コードを選択する際に、適応度の高い順に比重を高く設定し、適応度の高い2次元コードほど高い確率で選択されるようにする。   Next, in step S1003, the solution candidate evaluation unit 204 reads two two-dimensional codes at random from the two-dimensional codes stored in the solution candidate storage unit 206. Then, the child two-dimensional code generated immediately before by crossover and mutation in step S1004 to be described later is read from the solution candidate storage unit 206. Then, the two-dimensional code having the highest fitness is selected from the four of the two-dimensional codes of the child and the read two-dimensional codes, and one two-dimensional code is selected by roulette. Here, when one two-dimensional code is selected by the roulette, the specific gravity is set higher in the order of higher fitness, and the two-dimensional code with higher fitness is selected with higher probability.

次に、ステップS1004において、解候補生成部202は、ステップS1003で選択された2つの2次元コードを親とし、交叉により子個体を生成する。そして、生成した子個体の全ての遺伝子(データコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語)に3%の突然変異を起こす。   Next, in step S1004, the solution candidate generation unit 202 uses the two two-dimensional codes selected in step S1003 as parents, and generates a child individual by crossover. Then, 3% mutation is caused in all genes (data code word, error correction level, mask pattern, model number and padding code word) of the generated child individual.

図12は、Genotype及びPhenotypeを説明する図である。
ステップS1004における交叉及び突然変異では、図12に示すように、Genotypeで表現してデータコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語を操作する。この場合、誤り訂正レベル、マスクパターン及び型番は固定長であり、それぞれ2ビット、3ビット、6ビットである。一方、埋め草コード語は、型番、誤り訂正レベル及び埋め込まれたデータの文字数に依存するため、可変長である。交叉の方法としては、一様交叉を用いて子個体を生成する。また、突然変異では、設計変数となる各ビットにおいて3%の確率でビットの反転を行う。そして、ステップS1005において、解候補生成部202は、生成した子個体をPhenotypeである2次元コードにエンコードし、解候補記憶部206に記憶する。
FIG. 12 is a diagram for explaining Genotype and Phenotype.
In the crossover and mutation in step S1004, as shown in FIG. 12, the data code word, error correction level, mask pattern, model number, and padding code word are manipulated expressed in Genotype. In this case, the error correction level, the mask pattern, and the model number are fixed lengths, which are 2 bits, 3 bits, and 6 bits, respectively. On the other hand, the padding code word has a variable length because it depends on the model number, the error correction level, and the number of characters of the embedded data. As a method of crossover, a child individual is generated using uniform crossover. In the mutation, the bit is inverted with a probability of 3% for each bit as a design variable. In step S <b> 1005, the solution candidate generation unit 202 encodes the generated child individual into a two-dimensional code that is a Phenotype and stores it in the solution candidate storage unit 206.

次に、ステップS1006において、解候補評価部204は、遺伝子操作を繰り返した結果、適応度が所定値を上回る2次元コードが得られているか否かを判定する。この判定の結果、適応度が所定値を上回る2次元コードが得られている場合は入力画像と類似しているとみなし、ステップS1007において、その2次元コードを出力部205から出力し、処理を終了する。出力方法としては、画像表示装置107に解候補である2次元コードを表示してもよく、LAN110を介して外部装置に送信してもよい。   Next, in step S1006, the solution candidate evaluation unit 204 determines whether or not a two-dimensional code having a fitness exceeding a predetermined value is obtained as a result of repeating the genetic manipulation. As a result of this determination, if a two-dimensional code having a fitness level exceeding a predetermined value is obtained, it is regarded as being similar to the input image. In step S1007, the two-dimensional code is output from the output unit 205, and the process is performed. finish. As an output method, a two-dimensional code that is a solution candidate may be displayed on the image display device 107 or may be transmitted to an external device via the LAN 110.

一方、ステップS1006の判定の結果、適応度が所定値を上回る2次元コードが得られていない場合は類似していないとみなし、ステップS1002に戻り、所望の2次元コードが得られるまで処理を繰り返す。以降、ステップS1002では、子の2次元コードなど、適応度が算出されていない2次元コードのみ適応値を算出すればよい。   On the other hand, as a result of the determination in step S1006, if a two-dimensional code having a fitness level exceeding a predetermined value is not obtained, it is regarded that they are not similar, and the process returns to step S1002 and the process is repeated until a desired two-dimensional code is obtained. . Thereafter, in step S1002, an adaptive value may be calculated only for a two-dimensional code whose fitness is not calculated, such as a child two-dimensional code.

図13(a)は、文字を貼り付けた2次元コードの一例を示す図であり、図13(b)は、本実施形態に係る方法により生成した2次元コードの一例を示す図である。図13に示すように、本実施形態に係る方法により、「2」に類似するパターンにより2次元コードを生成することができる。   FIG. 13A is a diagram illustrating an example of a two-dimensional code pasted with characters, and FIG. 13B is a diagram illustrating an example of a two-dimensional code generated by the method according to the present embodiment. As shown in FIG. 13, a two-dimensional code can be generated with a pattern similar to “2” by the method according to the present embodiment.

以上のように本実施形態によれば、データコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語を変数として、遺伝的アルゴリズムにより写真やイラストを最も反映させた2次元コードを生成することもできる。   As described above, according to this embodiment, a data code word, an error correction level, a mask pattern, a model number, and a padding code word are used as variables to generate a two-dimensional code that most reflects a photograph or illustration by a genetic algorithm. You can also.

なお、本実施形態では、遺伝的アルゴリズムにより写真やイラストを反映させた2次元コードを生成したが、解候補の生成と評価とを繰り返すアルゴリズムであれば、他のアルゴリズムを用いてもよい。このように試行錯誤的に解候補の生成及び評価を行うことにより最適化するアルゴリズムとしては、他に、ランダム法、シンプレックス法、山登り法、焼き鈍し法、タブー探索などの単点探索アルゴリズム、または、遺伝的アルゴリズム、粒子群最適化、蟻コロニー最適化などの多点探索アルゴリズムなどが挙げられる。   In the present embodiment, a two-dimensional code reflecting a photograph or an illustration is generated by a genetic algorithm, but other algorithms may be used as long as the algorithm repeats generation and evaluation of solution candidates. As an algorithm to optimize by generating and evaluating candidate solutions by trial and error in this way, in addition, a single point search algorithm such as a random method, a simplex method, a hill climbing method, an annealing method, a tabu search, or the like, Examples include multi-point search algorithms such as genetic algorithms, particle swarm optimization, and ant colony optimization.

また、本実施形態では、初期集団の2次元コードを複数生成したが、アルゴリズムの種類によっては、初期集団の2次元コードの生成が不要である場合もある。このようなアルゴリズムを用いて解候補の生成と評価とを繰り返す場合には、図8に示す処理により初期集団として複数の2次元コードを生成しなくてもよい。   In the present embodiment, a plurality of two-dimensional codes of the initial group are generated. However, depending on the type of algorithm, it may not be necessary to generate a two-dimensional code of the initial group. When the generation and evaluation of solution candidates are repeated using such an algorithm, it is not necessary to generate a plurality of two-dimensional codes as an initial group by the processing shown in FIG.

また、本実施形態では、目的となるイラスト等との類似性を目的関数としたが、目的となるイラスト等との類似性を第1目的関数、モジュールパターンの評価(同色の行・列の隣接モジュール、同色のモジュールブロック、行・列における1:1:3:1:1の比率の明暗パターン、全体に対する暗モジュールの占める割合)を第2目的関数とするなどして、多目的最適化を行っても良い(JIS X 0510:2004 P.45)。   In this embodiment, the similarity to the target illustration or the like is used as the objective function. However, the similarity to the target illustration or the like is used as the first objective function and the module pattern evaluation (adjacent rows / columns of the same color). Multi-objective optimization is performed by setting the module, the same color module block, the light / dark pattern of 1: 1: 3: 1: 1 in the rows and columns, the ratio of the dark module to the whole) as the second objective function, etc. Yes (JIS X 0510: 2004 P.45).

さらに、本実施形態では、QRコードの構造を例に説明したが、他の2次元コードについても同様に、シンボルを形成するパターンの生成に関連する構成要素を可変し、解候補の生成と評価とを繰り返すことにより同様の効果が得られる。   Furthermore, in the present embodiment, the structure of the QR code has been described as an example. Similarly, for other two-dimensional codes, the constituent elements related to the generation of a pattern forming a symbol can be changed to generate and evaluate solution candidates. By repeating the above, the same effect can be obtained.

また、本実施形態では、データコード語、誤り訂正レベル、マスクパターン、型番及び埋め草コード語を設計変数として設定したが、設計変数としてはこれらの5つ以外に、残余コード語、残余ビットなどを含めて設計変数としてもよい。   In this embodiment, the data code word, error correction level, mask pattern, model number, and padding code word are set as design variables. However, in addition to these five design variables, the remaining code word, the remaining bit, etc. It is good also as a design variable including.

さらに本実施形態では、空セグメントの位置や個数、空でないセグメントの分割の有無等によりデータコード語を設計変数として設定したが、秘匿情報を含まないような場合であっても前述した手順で最終的な2次元コードを決定することができる。   Furthermore, in this embodiment, the data code word is set as a design variable depending on the position and number of empty segments, the presence / absence of non-empty segment division, etc., but even in the case where confidential information is not included, the final procedure is as described above. A typical two-dimensional code can be determined.

(その他の実施形態)
前述した本発明の実施形態における2次元コード生成装置を構成する各手段、並びに2次元コード生成方法の各工程は、コンピュータのRAMやROMなどに記憶されたプログラムが動作することによって実現できる。このプログラム及び前記プログラムを記憶したコンピュータ読み取り可能な記憶媒体は本発明に含まれる。
(Other embodiments)
Each means constituting the two-dimensional code generation device and each step of the two-dimensional code generation method in the embodiment of the present invention described above can be realized by operating a program stored in a RAM or ROM of a computer. This program and a computer-readable storage medium storing the program are included in the present invention.

また、本発明は、例えば、システム、装置、方法、プログラムもしくは記憶媒体等としての実施形態も可能であり、具体的には、複数の機器から構成されるシステムに適用してもよいし、また、一つの機器からなる装置に適用してもよい。   In addition, the present invention can be implemented as, for example, a system, apparatus, method, program, storage medium, or the like. Specifically, the present invention may be applied to a system including a plurality of devices. The present invention may be applied to an apparatus composed of a single device.

なお、本発明は、前述した実施形態の機能を実現するソフトウェアのプログラム(実施形態では図8及び図10に示すフローチャートに対応したプログラム)を、システムまたは装置に直接、または遠隔から供給する場合も含む。そして、そのシステムまたは装置のコンピュータが前記供給されたプログラムコードを読み出して実行することによっても達成される場合を含む。   In the present invention, a software program for realizing the functions of the above-described embodiment (in the embodiment, a program corresponding to the flowcharts shown in FIGS. 8 and 10) may be supplied directly or remotely to the system or apparatus. Including. This includes the case where the system or the computer of the apparatus is also achieved by reading and executing the supplied program code.

したがって、本発明の機能処理をコンピュータで実現するために、前記コンピュータにインストールされるプログラムコード自体も本発明を実現するものである。つまり、本発明は、本発明の機能処理を実現するためのコンピュータプログラム自体も含まれる。   Accordingly, since the functions of the present invention are implemented by computer, the program code installed in the computer also implements the present invention. That is, the present invention also includes a computer program for realizing the functional processing of the present invention.

その場合、プログラムの機能を有していれば、オブジェクトコード、インタプリタにより実行されるプログラム、OSに供給するスクリプトデータ等の形態であってもよい。   In that case, as long as it has the function of a program, it may be in the form of object code, a program executed by an interpreter, script data supplied to the OS, and the like.

プログラムを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスクなどがある。さらに、MO、CD−ROM、CD−R、CD−RW、磁気テープ、不揮発性のメモリカード、ROM、DVD(DVD−ROM、DVD−R)などもある。   Examples of the storage medium for supplying the program include a flexible disk, a hard disk, an optical disk, and a magneto-optical disk. Further, there are MO, CD-ROM, CD-R, CD-RW, magnetic tape, nonvolatile memory card, ROM, DVD (DVD-ROM, DVD-R) and the like.

その他、プログラムの供給方法としては、クライアントコンピュータのブラウザを用いてインターネットのホームページに接続する方法がある。そして、前記ホームページから本発明のコンピュータプログラムそのもの、もしくは圧縮され自動インストール機能を含むファイルをハードディスク等の記憶媒体にダウンロードすることによっても供給できる。   As another program supply method, there is a method of connecting to an Internet home page using a browser of a client computer. It can also be supplied by downloading the computer program itself of the present invention or a compressed file including an automatic installation function from a homepage to a storage medium such as a hard disk.

また、本発明のプログラムを構成するプログラムコードを複数のファイルに分割し、それぞれのファイルを異なるホームページからダウンロードすることによっても実現可能である。つまり、本発明の機能処理をコンピュータで実現するためのプログラムファイルを複数のユーザに対してダウンロードさせるWWWサーバも、本発明に含まれるものである。   It can also be realized by dividing the program code constituting the program of the present invention into a plurality of files and downloading each file from a different homepage. That is, a WWW server that allows a plurality of users to download a program file for realizing the functional processing of the present invention on a computer is also included in the present invention.

また、その他の方法として、本発明のプログラムを暗号化してCD−ROM等の記憶媒体に格納してユーザに配布し、所定の条件をクリアしたユーザに対し、インターネットを介してホームページから暗号化を解く鍵情報をダウンロードさせ、その鍵情報を使用することにより暗号化されたプログラムを実行してコンピュータにインストールさせて実現することも可能である。   As another method, the program of the present invention is encrypted, stored in a storage medium such as a CD-ROM, distributed to users, and encrypted from a homepage via the Internet to users who have cleared predetermined conditions. It is also possible to download the key information to be solved and use the key information to execute the encrypted program and install it in the computer.

また、コンピュータが、読み出したプログラムを実行することによって、前述した実施形態の機能が実現される。さらに、そのプログラムの指示に基づき、コンピュータ上で稼動しているOSなどが、実際の処理の一部または全部を行い、その処理によっても前述した実施形態の機能が実現され得る。   Further, the functions of the above-described embodiments are realized by the computer executing the read program. Furthermore, based on the instructions of the program, an OS or the like running on the computer performs part or all of the actual processing, and the functions of the above-described embodiments can be realized by the processing.

さらに、その他の方法として、記憶媒体から読み出されたプログラムが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれ、そのプログラムの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によっても前述した実施形態の機能が実現される。   Further, as another method, a program read from a storage medium is written into a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, and the function is based on the instructions of the program. A CPU or the like provided in the expansion board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are also realized by the processing.

201 データ入力部
202 解候補生成部
203 画像入力部
204 解候補評価部
205 出力部
206 解候補記憶部
201 Data Input Unit 202 Solution Candidate Generation Unit 203 Image Input Unit 204 Solution Candidate Evaluation Unit 205 Output Unit 206 Solution Candidate Storage Unit

Claims (7)

複数のセグメントに分割してデータが埋め込まれたコード語を有する2次元コードであって、
特定の形状を表現したモジュールパターンを構成するためのセグメントの構造を含むことを特徴とする2次元コード。
A two-dimensional code having a code word in which data is embedded by being divided into a plurality of segments,
A two-dimensional code comprising a segment structure for constituting a module pattern expressing a specific shape.
公開情報としてのデータ、秘匿情報及び画像を入力する入力工程と、
セルの配置パターンの生成に関連し、前記データを格納する前記秘匿情報に応じたセグメントの構成要素を含む複数の構成要素を変数として、解候補として前記データを符号化した2次元コードを生成する解候補生成工程と、
前記解候補生成工程において生成された解候補が前記画像と類似しているか否かを、少なくとも1つの目的関数に基づいて評価する解候補評価工程とを有し、
前記解候補生成工程においては、前記解候補評価工程における評価に応じて、前記複数の構成要素に基づいた新たな解候補を生成し、
前記解候補評価工程においては、前記解候補生成工程において生成された新たな解候補について評価することを特徴とする2次元コード生成方法。
An input process for inputting data as public information, confidential information and an image;
A two-dimensional code in which the data is encoded as a solution candidate is generated using a plurality of constituent elements including the constituent elements of the segment corresponding to the confidential information storing the data as a variable in relation to generation of the cell arrangement pattern Solution candidate generation process;
A solution candidate evaluation step of evaluating whether the solution candidate generated in the solution candidate generation step is similar to the image based on at least one objective function;
In the solution candidate generation step, according to the evaluation in the solution candidate evaluation step, generate a new solution candidate based on the plurality of components,
In the solution candidate evaluation step, a new solution candidate generated in the solution candidate generation step is evaluated.
前記解候補評価工程においては、前記画像との類似度を算出して類似しているか否か、を評価することを特徴とする請求項2に記載の2次元コード生成方法。   3. The two-dimensional code generation method according to claim 2, wherein, in the solution candidate evaluation step, the similarity with the image is calculated to evaluate whether or not they are similar. 前記解候補生成工程においては、前記解候補評価工程における評価に応じて、前記複数の構成要素と、前記算出した類似度とに基づいた新たな解候補を生成することを特徴とする請求項2に記載の2次元コード生成方法。   3. The solution candidate generation step generates a new solution candidate based on the plurality of components and the calculated similarity according to the evaluation in the solution candidate evaluation step. The two-dimensional code generation method described in 1. 公開情報としてのデータ、秘匿情報及び画像を入力する入力手段と、
セルの配置パターンの生成に関連し、前記データを格納する前記秘匿情報に応じたセグメントの構成要素を含む複数の構成要素を変数として、解候補として前記データを符号化した2次元コードを生成する解候補生成手段と、
前記解候補生成手段によって生成された解候補が前記画像と類似しているか否かを、少なくとも1つの目的関数に基づいて評価する解候補評価手段とを有し、
前記解候補生成手段は、前記解候補評価手段による評価に応じて、前記複数の構成要素に基づいた新たな解候補を生成し、
前記解候補評価手段は、前記解候補生成手段によって生成された新たな解候補について評価することを特徴とする2次元コード生成装置。
Input means for inputting data, confidential information and images as public information;
A two-dimensional code in which the data is encoded as a solution candidate is generated using a plurality of constituent elements including the constituent elements of the segment corresponding to the confidential information storing the data as a variable in relation to generation of the cell arrangement pattern Solution candidate generation means;
Solution candidate evaluation means for evaluating whether or not the solution candidate generated by the solution candidate generation means is similar to the image based on at least one objective function;
The solution candidate generation unit generates a new solution candidate based on the plurality of components according to the evaluation by the solution candidate evaluation unit,
The solution candidate evaluation means evaluates a new solution candidate generated by the solution candidate generation means.
請求項2〜4の何れか1項に記載の2次元コード生成方法の各工程をコンピュータに実行させることを特徴とするプログラム。   A program for causing a computer to execute each step of the two-dimensional code generation method according to any one of claims 2 to 4. 請求項6に記載のプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 6.
JP2016249272A 2016-12-22 2016-12-22 Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium Active JP6270178B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016249272A JP6270178B2 (en) 2016-12-22 2016-12-22 Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016249272A JP6270178B2 (en) 2016-12-22 2016-12-22 Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2013081180A Division JP6078878B2 (en) 2013-04-09 2013-04-09 2D code

Publications (2)

Publication Number Publication Date
JP2017054560A true JP2017054560A (en) 2017-03-16
JP6270178B2 JP6270178B2 (en) 2018-01-31

Family

ID=58316926

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016249272A Active JP6270178B2 (en) 2016-12-22 2016-12-22 Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium

Country Status (1)

Country Link
JP (1) JP6270178B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069904A (en) * 2019-03-22 2019-07-30 平安普惠企业管理有限公司 H5 resource wraps transmission method, H5 resource packet method for down loading and relevant device
CN111209579A (en) * 2020-01-03 2020-05-29 玉溪市电子政务内网信息技术中心 Electronic analysis equipment and method for encrypting confidential files by utilizing two-dimensional code in multiple ways

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08249408A (en) * 1995-03-15 1996-09-27 Sharp Corp Digital information recording method, decoding method and decoder
JP2007034998A (en) * 2005-07-25 2007-02-08 Shinsekai:Kk Two-dimensional code generation system having optional specified image as pattern
JP2007043456A (en) * 2005-08-03 2007-02-15 Zento:Kk Qr-code preparation program, computer readable-recording medium with the program stored, qr-code preparation apparatus, and qr-code preparation method
JP2009151700A (en) * 2007-12-21 2009-07-09 Kagoshima Univ Image processor, image processing method, program, and recording medium
JP2013025475A (en) * 2011-07-19 2013-02-04 Kagoshima Univ Two-dimensional code generation method, two-dimensional code generation device, program and recording medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08249408A (en) * 1995-03-15 1996-09-27 Sharp Corp Digital information recording method, decoding method and decoder
JP2007034998A (en) * 2005-07-25 2007-02-08 Shinsekai:Kk Two-dimensional code generation system having optional specified image as pattern
JP2007043456A (en) * 2005-08-03 2007-02-15 Zento:Kk Qr-code preparation program, computer readable-recording medium with the program stored, qr-code preparation apparatus, and qr-code preparation method
JP2009151700A (en) * 2007-12-21 2009-07-09 Kagoshima Univ Image processor, image processing method, program, and recording medium
JP2013025475A (en) * 2011-07-19 2013-02-04 Kagoshima Univ Two-dimensional code generation method, two-dimensional code generation device, program and recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069904A (en) * 2019-03-22 2019-07-30 平安普惠企业管理有限公司 H5 resource wraps transmission method, H5 resource packet method for down loading and relevant device
CN111209579A (en) * 2020-01-03 2020-05-29 玉溪市电子政务内网信息技术中心 Electronic analysis equipment and method for encrypting confidential files by utilizing two-dimensional code in multiple ways

Also Published As

Publication number Publication date
JP6270178B2 (en) 2018-01-31

Similar Documents

Publication Publication Date Title
EP1585009B1 (en) High performance content alteration architecture and techniques
Li et al. An aesthetic QR code solution based on error correction mechanism
US20110205569A1 (en) Glyph-looking alphabet for vipp / specialty imaging fonts
US6775394B2 (en) Digital watermarking of binary document using halftoning
CN104428778B (en) Method for being labelled to digital book
KR20040007552A (en) Method Of Invisibly Embedding and Hiding Data Into Soft-Copy Text Documents
JP2009151700A (en) Image processor, image processing method, program, and recording medium
CN112088378A (en) Image hidden information detector
JP6078878B2 (en) 2D code
Hung et al. Micrography QR codes
JP6270178B2 (en) Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium
CN110322386A (en) A kind of insertion of digital text watermarking and detection method and device
JP5686346B2 (en) Two-dimensional code generation method, two-dimensional code generation device, program, and storage medium
CN110942322A (en) Anti-counterfeiting method, system, electronic equipment and medium for coupon getting interface screenshot
Alkhafaji et al. Payload capacity scheme for quran text watermarking based on vowels with kashida
CN108770370A (en) Method for being authenticated and verifying to file and server
US20220156873A1 (en) Image synthesis device and method for embedding watermark
CN109495275A (en) Generate the setting method of random verification code
Rafat et al. Secure digital steganography for ASCII text documents
CN110097159B (en) QR code security authentication method and system based on Hamming code
CN113160028B (en) Information hiding and recovering method and equipment based on colorful character picture and storage medium
CN109840574B (en) Two-dimensional code information hiding method and device, electronic equipment and storage medium
CN113159255A (en) Digital watermark anti-counterfeiting method based on QR (quick response) code and security shading
KR20100067316A (en) Inserting method of document identifier and decoding method thereof
Juan et al. Graphic qr code with the second hidden qr code by codeword rearrangement

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170112

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170925

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171003

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171122

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

R150 Certificate of patent or registration of utility model

Ref document number: 6270178

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250