JP2021184141A - Code decoding device, code decoding method, and program - Google Patents

Code decoding device, code decoding method, and program Download PDF

Info

Publication number
JP2021184141A
JP2021184141A JP2020088825A JP2020088825A JP2021184141A JP 2021184141 A JP2021184141 A JP 2021184141A JP 2020088825 A JP2020088825 A JP 2020088825A JP 2020088825 A JP2020088825 A JP 2020088825A JP 2021184141 A JP2021184141 A JP 2021184141A
Authority
JP
Japan
Prior art keywords
contour line
code
dimensional code
cell
function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2020088825A
Other languages
Japanese (ja)
Inventor
智司 小野
Tomoji Ono
誠 神薗
Makoto Kamizono
一希 鞍津輪
Kazuki Kuratsuwa
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 JP2020088825A priority Critical patent/JP2021184141A/en
Publication of JP2021184141A publication Critical patent/JP2021184141A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

To provide a code decoding device and the like capable of accurately detecting code information even if a two-dimensional code image without auxiliary lines is distorted in a complex way, distorted locally, or distorted with a shielded area.SOLUTION: A code decoding device 1 comprises a contour line detection device 10, a contour line estimation part 11, and a decoding part 12. The contour line detection device 10 detects a contour line 6 of a cell 4 from an image Im1 of a two-dimensional code 2 in which code information is encoded by the combination of cells 4 composed of either a black area 4A or a white area 4B with different brightness each other. The contour line estimation part 11 estimates location information in the two-dimensional code 2 of the contour line 6 detected by the contour line detection device 10. The decoding part 12 estimates the location information in the two-dimensional code 2 of the cell 4 based on the location information of the contour line 6 detected by the contour line detection part 10 and of the contour line 6 estimated by the contour line estimation part 11, and decodes the code information based on the estimated result of the location information of the cell 4.SELECTED DRAWING: Figure 1

Description

本発明は、コード復号装置、コード復号方法及びプログラムに関する。 The present invention relates to a code decoding device, a code decoding method and a program.

交通機関の搭乗券、決済、認証などにおいて、シート上に印刷された2次元コードが用いられる場面が増えている。2次元コードの画像から、コード情報を復号化する際には、まず、その中に埋め込まれた位置検出用コードが検出される。続いて、検出された位置検出用コードに従って、サンプリンググリッドとも呼ばれる2次元格子が2次元コードの画像上に規定される。この場合、2次元格子の交点は2次元コードを構成する各セル(1ビットの情報を示す単位領域)の位置に合致する。したがって、サンプリング点の明暗情報から、コード情報を検出してコード情報を復号化することができる。 Two-dimensional codes printed on sheets are increasingly used in boarding passes, payments, authentication, etc. for transportation. When decoding the code information from the image of the two-dimensional code, first, the position detection code embedded in the code information is detected. Subsequently, according to the detected position detection code, a two-dimensional grid, also called a sampling grid, is defined on the image of the two-dimensional code. In this case, the intersection of the two-dimensional lattice matches the position of each cell (unit area indicating one-bit information) constituting the two-dimensional code. Therefore, the code information can be detected from the light / dark information of the sampling point and the code information can be decoded.

2次元コードが紙などのシート上に印刷されている場合、シートが折れたり皺が寄ったりすると、印刷された2次元コードも複雑に歪む。この場合、サンプリング点と実際のセルの位置とにずれが生じ、明暗情報が間違って検出され、コード情報を正確に復号化できない場合がある。 When the two-dimensional code is printed on a sheet such as paper, if the sheet is folded or wrinkled, the printed two-dimensional code is also complicatedly distorted. In this case, the sampling point and the actual cell position may be misaligned, the light / dark information may be detected incorrectly, and the code information may not be accurately decoded.

このような状況に対応すべく、2次元コードの様々な検出方法が提案されている。例えば、2次元コードの包絡線、すなわち2次元コード全体の外形から形成した補助線に基づいてコード情報を検出する技術が開示されている(例えば、特許文献1参照)。この他、2次元コードに予め補助線を埋め込んで、復号化の際に補助線を検出し、検出した補助線に沿ってコード情報を検出して、復号を行う技術が開示されている(例えば、非特許文献1、2参照)。 Various methods for detecting a two-dimensional code have been proposed in order to deal with such a situation. For example, a technique for detecting code information based on an envelope of a two-dimensional code, that is, an auxiliary line formed from the outer shape of the entire two-dimensional code is disclosed (see, for example, Patent Document 1). In addition, a technique is disclosed in which an auxiliary line is embedded in a two-dimensional code in advance, an auxiliary line is detected at the time of decoding, code information is detected along the detected auxiliary line, and decoding is performed (for example). , See Non-Patent Documents 1 and 2).

特開2004−362053号公報Japanese Unexamined Patent Publication No. 2004-362053

K.Kamizuru, Y.Kawakami, H.Kawasaki, S.Ono, “Belief-propagation-based robust decoding for two-dimensional barcodes to overcome distortion and occlusion and its extension to multi-view decoding”, ICIP, pp.2359〜2363,2015.K.Kamizuru, Y.Kawakami, H.Kawasaki, S.Ono, “Belief-propagation-based robust decoding for two-dimensional barcodes to overcome distortion and occlusion and its extension to multi-view decoding”, ICIP, pp.2359 ~ 2363,2015. K.Kamizuru, K.Nakamura, H.Kawasaki, S.Ono, “A belief-propagation-based decoding method for two-dimensional barcodes with monochrome auxiliary lines robust against non-uniform geometric distortion”, QCAV, 2017.K.Kamizuru, K.Nakamura, H.Kawasaki, S.Ono, “A belief-propagation-based decoding method for two-dimensional barcodes with monochrome auxiliary lines robust against non-uniform geometric distortion”, QCAV, 2017.

上記特許文献1に開示された装置によれば、2次元コードの緩やかな歪みに対して高速かつ正確なコード情報の検出が可能となる。しかしながら、この装置では、2次元コードに、図14(A)の点線で囲まれた部分に示すような不均一な凸状又は凹状な歪み(複雑、局所的な歪み)があったり、図14(B)の点線で囲まれた部分に示すような遮蔽領域のある歪みがあったりする場合には、コード情報を正確に検出するのが困難になる。 According to the apparatus disclosed in Patent Document 1, it is possible to detect code information at high speed and accurately with respect to a gentle distortion of a two-dimensional code. However, in this device, the two-dimensional code may have non-uniform convex or concave distortion (complex, local distortion) as shown in the portion surrounded by the dotted line in FIG. 14 (A), or FIG. 14 When there is a distortion with a shielding area as shown in the portion surrounded by the dotted line (B), it becomes difficult to accurately detect the code information.

上記非特許文献1、2に開示された装置によれば、2次元コードに複雑な歪み、局所的な歪みおよび遮蔽領域のある歪みにも対応することが可能である。2次元コードの補助線の位置から、明暗が同じ、すなわち同色のセル同士の間の境界線の正確な位置を把握することができるので、複雑な局所的な歪み、遮蔽領域のある歪みをある程度把握し易くすることができるためである。しかしながら、これらの装置では、2次元コード内に補助線を予め設けておく必要があり、補助線のない一般的な2次元コードには対応することができない。 According to the apparatus disclosed in Non-Patent Documents 1 and 2, it is possible to deal with a complicated distortion, a local distortion, and a distortion having a shielding region in a two-dimensional code. From the position of the auxiliary line of the two-dimensional code, it is possible to grasp the exact position of the boundary line between cells of the same brightness, that is, cells of the same color, so that complicated local distortion and distortion with a shielded area can be to some extent. This is because it can be easily grasped. However, in these devices, it is necessary to provide an auxiliary line in the two-dimensional code in advance, and it is not possible to deal with a general two-dimensional code without an auxiliary line.

本発明は、上記実情の下になされたものであり、補助線が設けられていない2次元コードの画像に複雑な歪み、局所的な歪みおよび遮蔽領域のある歪みがあっても、コード情報を正確に検出することができるコード復号装置、コード復号方法及びプログラムを提供することを目的とする。 The present invention has been made under the above circumstances, and even if the image of the two-dimensional code without auxiliary lines has complicated distortion, local distortion, and distortion with a shielding region, the code information can be obtained. It is an object of the present invention to provide a code decoding device, a code decoding method and a program that can be accurately detected.

上記目的を達成するために、本発明の第1の観点に係るコード復号装置は、
互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出部と、
前記輪郭線検出部で検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定部と、
前記輪郭線検出部で検出された前記輪郭線と、前記輪郭線推定部で推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号部と、
を備える。
In order to achieve the above object, the code decryption device according to the first aspect of the present invention is
A contour line detection unit that detects the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region or a second region having different brightness from each other. When,
A contour line estimation unit that estimates the position information of the contour line detected by the contour line detection unit in the two-dimensional code, and a contour line estimation unit.
Based on the contour line detected by the contour line detection unit and the position information of the contour line estimated by the contour line estimation unit, the position information in the two-dimensional code of the cell is estimated. A decoding unit that decodes the code information based on the estimation result of the cell position information, and
To prepare for.

この場合、前記輪郭線推定部は、
前記輪郭線検出部で検出された前記輪郭線に対して、前記2次元コード内の位置を表す識別番号を付与し、
付与した前記識別番号に基づいて、前記輪郭線の前記2次元コード内の位置情報を推定する、
こととしてもよい。
これにより、輝度が等しい両隣の前記セル同士の間の前記輪郭線を抽出することが可能となる。
In this case, the contour line estimation unit is
An identification number indicating a position in the two-dimensional code is assigned to the contour line detected by the contour line detection unit.
Based on the assigned identification number, the position information of the contour line in the two-dimensional code is estimated.
It may be that.
This makes it possible to extract the contour line between the adjacent cells having the same brightness.

また、前記輪郭線推定部は、
同じ前記識別番号を有する前記輪郭線の端部同士を接続線で接続した場合において、前記接続線と前記輪郭線とのなす角度が大きくなるにつれて大きくなる第1の関数と、前記接続線同士の交叉回数が増えるにつれて大きくなる第2の関数と、隣接する前記輪郭線の間隔が大きくなるにつれて大きくなる第3の関数とのいずれか、又は、前記第1の関数、前記第2の関数及び前記第3の関数のうちの少なくとも2つの和のいずれかを含む目的関数を用いて、前記輪郭線に付与される前記識別番号の組み合わせの中から、前記目的関数の値が最も小さくなる前記識別番号の組み合わせを探索する、
こととしてもよい。
前記目的関数を用いて前記輪郭線に付与される最適な前記識別番号の組み合わせを探索することにより、全ての前記セルの輪郭線を見つけ出すことができるとともに、全ての前記セルの位置を特定することができ、前記2次元コードを復元できるようになる。
Further, the contour line estimation unit is
When the ends of the contour lines having the same identification number are connected by a connecting line, the first function that increases as the angle between the connecting line and the contour line increases, and the connecting lines Either a second function that increases as the number of crossings increases and a third function that increases as the distance between adjacent contour lines increases, or the first function, the second function, and the above. The identification number having the smallest value of the objective function among the combinations of the identification numbers given to the contour line by using the objective function including any one of at least two sums of the third function. Search for combinations of
It may be that.
By searching for the optimum combination of the identification numbers given to the contour line using the objective function, the contour lines of all the cells can be found and the positions of all the cells can be specified. And the two-dimensional code can be restored.

前記目的関数において、前記第1の関数と、前記第2の関数と、前記第3の関数とには、それぞれ異なる重みが付与されている、
こととしてもよい。
In the objective function, the first function, the second function, and the third function are given different weights.
It may be that.

前記輪郭線検出部は、
機械学習を行って、前記2次元コードの画像から、両隣の前記セルの輝度が等しいために不可視の前記セルの輪郭線を検出する機械学習部を備える、
こととしてもよい。
The contour line detection unit is
It is provided with a machine learning unit that performs machine learning and detects the contour line of the cell that is invisible because the brightness of the cells on both sides is equal from the image of the two-dimensional code.
It may be that.

前記機械学習部は、
多層パーセプトロン、畳み込みニューラルネットワーク、又は前記2次元コードの画像の各画素をノードとするグラフ構造で表現したマルコフ確率場として最適化を行う最適化器である、
こととしてもよい。前記多層パーセプトロンや前記畳み込みニューラルネットワークは、前記2次元コードの画像の各画素に対して前記輪郭線であるか否かを識別するモデルであり、移動窓方式により画像の全画素について識別を行う。また、前記マルコフ確率場は、画像の領域分割に利用される一般的なモデルと同一である。
The machine learning unit
It is an optimizer that optimizes as a Markov random field expressed by a multi-layer perceptron, a convolutional neural network, or a graph structure with each pixel of the image of the two-dimensional code as a node.
It may be that. The multi-layer perceptron and the convolutional neural network are models for discriminating whether or not each pixel of the image of the two-dimensional code is the contour line, and all the pixels of the image are discriminated by the moving window method. Further, the Markov random field is the same as a general model used for region division of an image.

前記畳み込みニューラルネットワークは、全結合層を持たず全ての層が畳み込み層である全層畳み込みネットワークである、
こととしてもよい。
The convolutional neural network is a full-layer convolutional network that does not have a fully connected layer and all layers are convolutional layers.
It may be that.

本発明の第2の観点に係るコード復号方法は、
情報処理装置によって実行されるコード復号方法であって、
互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出ステップと、
前記輪郭線検出ステップで検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定ステップと、
前記輪郭線検出ステップで検出された前記輪郭線と、前記輪郭線推定ステップで推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号ステップと、
を含む。
The code decoding method according to the second aspect of the present invention is
A code decryption method executed by an information processing device.
A contour line detection step for detecting the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region and a second region having different luminances from each other. When,
A contour line estimation step for estimating the position information of the contour line detected in the contour line detection step in the two-dimensional code, and a contour line estimation step.
Based on the contour line detected in the contour line detection step and the position information of the contour line estimated in the contour line estimation step, the position information in the two-dimensional code of the cell is estimated. A decoding step for decoding the code information based on the estimation result of the cell position information, and
including.

本発明の第3の観点に係るプログラムは、
コンピュータを、
互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出部、
前記輪郭線検出部で検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定部、
前記輪郭線検出部で検出された前記輪郭線と、前記輪郭線推定部で推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号部、
として機能させる。
The program according to the third aspect of the present invention is
Computer,
A contour line detection unit that detects the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region or a second region having different brightness from each other. ,
A contour line estimation unit that estimates the position information of the contour line detected by the contour line detection unit in the two-dimensional code.
Based on the contour line detected by the contour line detection unit and the position information of the contour line estimated by the contour line estimation unit, the position information in the two-dimensional code of the cell is estimated. A decoding unit that decodes the code information based on the estimation result of the cell position information.
To function as.

本発明によれば、互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、セルの輪郭線を検出するだけでなく、輪郭線の2次元コード内の位置情報を推定する。これにより、検出された輪郭線と推定された輪郭線の2次元コード内の位置情報とに基づいて、セルの2次元コード内の位置情報を正確に推定することができる。このため、補助線が設けられていない2次元コードの画像に複雑な歪み、局所的な歪みおよび遮蔽領域のある歪みがあっても、コード情報を正確に検出することができる。 According to the present invention, the contour line of a cell is detected from an image of a two-dimensional code in which code information is encoded by a combination of cells composed of either a first region or a second region having different brightness. Not only does it, but it also estimates the position information of the contour line in the two-dimensional code. Thereby, the position information in the two-dimensional code of the cell can be accurately estimated based on the detected contour line and the position information in the two-dimensional code of the estimated contour line. Therefore, even if the image of the two-dimensional code without the auxiliary line has complicated distortion, local distortion, and distortion with a shielding region, the code information can be accurately detected.

本発明の実施の形態に係るコード復号装置の構成を示すブロック図である。It is a block diagram which shows the structure of the code decoding apparatus which concerns on embodiment of this invention. 2次元コードの画像に推定された輪郭線を重ねた模式図である。It is a schematic diagram which superposed the estimated contour line on the image of a 2D code. (A)は、2次元コードの一部を示す図である。(B)は、(A)の2次元コードの一部に対応する輪郭線を示す図である。(A) is a figure which shows a part of a two-dimensional code. (B) is a diagram showing a contour line corresponding to a part of the two-dimensional code of (A). 機械学習部における畳み込みニューラルネットワークの構造を示す模式図である。It is a schematic diagram which shows the structure of the convolutional neural network in the machine learning part. (A)は、訓練データとして用いられる2次元コードの画像の一例を示す図である。(B)は、(A)の画像から正確に作成された輪郭線の画像を示す図である。(A) is a figure which shows an example of the image of the 2D code used as training data. (B) is a diagram showing an image of a contour line accurately created from the image of (A). (A)は、エッジ検出により検出された縦の輪郭線の一例を示す図である。(B)は、輪郭線検出部で検出された縦の輪郭線の一例を示す図である。(C)は、輪郭線推定部で推定された縦の輪郭線の全体の一例を示す図である。(A) is a figure which shows an example of the vertical contour line detected by edge detection. (B) is a figure which shows an example of the vertical contour line detected by the contour line detection part. (C) is a figure which shows an example of the whole of the vertical contour line estimated by the contour line estimation part. (A)、(B)及び(C)は、目的関数を構成する各関数の意味を示す図である。(A), (B) and (C) are diagrams showing the meaning of each function constituting the objective function. セルを判定する様子を示す模式図である。It is a schematic diagram which shows the state of determining a cell. 図1のコード復号装置のハードウエア構成を示すブロック図である。It is a block diagram which shows the hardware structure of the code decoding apparatus of FIG. 本発明の実施の形態に係るコード復号装置の動作を示すフローチャートである。It is a flowchart which shows the operation of the code decoding apparatus which concerns on embodiment of this invention. 輪郭線推定部の処理を示すフローチャートである。It is a flowchart which shows the processing of the contour line estimation part. (A)は、縦の輪郭線の一例を示す図である。(B)は、横の輪郭線の一例を示す図である。(A) is a figure which shows an example of a vertical contour line. (B) is a diagram showing an example of a horizontal contour line. 最終的に形成される輪郭線の一例を示す図である。It is a figure which shows an example of the contour line finally formed. (A)及び(B)は、2次元コードの歪みの一例を示す図である。(A) and (B) are diagrams showing an example of distortion of a two-dimensional code.

以下、本発明の実施の形態について図面を参照して詳細に説明する。全図において、同一又は相当する構成要素には、同一の符号が付されている。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In all figures, the same or corresponding components are designated by the same reference numerals.

実施の形態1
まず、本発明の実施の形態1について説明する。図1に示すように、2次元コード2は、紙等のシート3に印刷されたものであり、シート3の歪みに応じて歪んでいる。カメラ5は、この2次元コード2を撮像する。本実施の形態に係るコード復号装置1は、カメラ5で撮像された2次元コード2の画像Im1に基づいて、コード情報を検出し、そのコード情報を復号化する。
Embodiment 1
First, Embodiment 1 of the present invention will be described. As shown in FIG. 1, the two-dimensional code 2 is printed on a sheet 3 such as paper, and is distorted according to the distortion of the sheet 3. The camera 5 captures the two-dimensional code 2. The code decoding device 1 according to the present embodiment detects the code information based on the image Im1 of the two-dimensional code 2 captured by the camera 5, and decodes the code information.

図2に示すように、2次元コード2は、矩形状のセル4がマトリクス状に配列されることにより構成されている。セル4は、第1の領域としての黒領域4Aと、第2の領域としての白領域4Bのいずれかで構成される、1ビットの情報を示す単位領域である。セル4は、モジュールとも呼ばれる。黒領域4Aと白領域4Bは、互いに輝度が異なる。黒領域4Aがコード情報の「1」を示し、白領域4Bがコード情報の「0」を示しているが、この逆であってもよい。2次元コード2は、セル4毎に「1」か「0」かを示す明暗情報で符号化されている。 As shown in FIG. 2, the two-dimensional code 2 is configured by arranging rectangular cells 4 in a matrix. The cell 4 is a unit area indicating 1-bit information composed of either a black area 4A as a first area and a white area 4B as a second area. Cell 4 is also called a module. The brightness of the black region 4A and the white region 4B are different from each other. The black area 4A indicates the code information "1" and the white area 4B indicates the code information "0", but the reverse may be performed. The two-dimensional code 2 is encoded by light / dark information indicating "1" or "0" for each cell 4.

図1に戻り、セル4は矩形状であるため、その外形に4辺の輪郭線6が形成されている。隣接するセル4同士では、その境界線が輪郭線6となる。この輪郭線6は、モジュールエッジともいう。 Returning to FIG. 1, since the cell 4 has a rectangular shape, contour lines 6 on four sides are formed on the outer shape thereof. In the adjacent cells 4, the boundary line becomes the contour line 6. This contour line 6 is also referred to as a module edge.

セル4は、マトリクス状に配列されているため、シート3に印刷された2次元コード2に歪みがない場合には、セル4の輪郭線6は、図2に示すように、縦方向に延びる直線と横方向に延びる直線とになる。縦方向に延びる輪郭線6を輪郭線6Vとし、横方向に延びる輪郭線6を輪郭線6Hとする。なお、輪郭線6は、2次元コード2の上に実際に形成されてはいない。図2では、説明のために、2次元コード2の上に、輪郭線6を重ねて示しているだけである。2次元コード2の歪みにより、輪郭線6(6V,6H)も歪んでいる(図3(A)及び図3(B)参照)。 Since the cells 4 are arranged in a matrix, the contour line 6 of the cell 4 extends in the vertical direction as shown in FIG. 2 when the two-dimensional code 2 printed on the sheet 3 is not distorted. It becomes a straight line and a straight line extending in the horizontal direction. The contour line 6 extending in the vertical direction is referred to as the contour line 6V, and the contour line 6 extending in the horizontal direction is referred to as the contour line 6H. The contour line 6 is not actually formed on the two-dimensional code 2. In FIG. 2, for the sake of explanation, the contour line 6 is merely superimposed on the two-dimensional code 2. The contour line 6 (6V, 6H) is also distorted due to the distortion of the two-dimensional code 2 (see FIGS. 3A and 3B).

本実施の形態に係るコード復号装置1は、セル4の輪郭線6(6V,6H)を検出する。そして、コード復号装置1は、縦の輪郭線6Vと横の輪郭線6Hとで仕切られる領域を抽出し、その領域の輝度が黒領域4Aのものであるか白領域4Bのものであるかを判定する。さらに、コード復号装置1は、その領域が「1」を示すか「0」を示すかを判定することにより、コード情報を読み出して、復号化する。 The code decoding device 1 according to the present embodiment detects the contour line 6 (6V, 6H) of the cell 4. Then, the code decoding device 1 extracts a region partitioned by the vertical contour line 6V and the horizontal contour line 6H, and determines whether the brightness of the region is that of the black region 4A or that of the white region 4B. judge. Further, the code decoding device 1 reads out the code information and decodes it by determining whether the area indicates "1" or "0".

なお、セル4は、黒領域4Aか白領域4Bかのいずれかであるため、図3(A)に示すように、黒領域4A同士、白領域4B同士が隣接する場合もある。図3(B)に示すように、これら同輝度、同色のセル4の間では輪郭線6(6v,6h)が明示されず、不可視となる。このようなこともあって、検出される輪郭線6(6v,6h)は、途中で途切れるようになる。そこで、本実施の形態に係るコード復号装置1は、黒領域4A同士、白領域4B同士を仕切る輪郭線6をも推定する。なお、以下では、このようにして推定された輪郭線6を、輪郭線6(6v’,6h’)とする。また、輪郭線6(6v,6h)と、輪郭線6(6v’,6h’)とを組み合わせた輪郭線6を、輪郭線6(6v+6v’,6h+6h’)と表現する。 Since the cell 4 is either a black region 4A or a white region 4B, the black regions 4A and the white regions 4B may be adjacent to each other as shown in FIG. 3A. As shown in FIG. 3B, the contour line 6 (6v, 6h) is not clearly shown between the cells 4 having the same brightness and the same color, and is invisible. Due to such a situation, the detected contour line 6 (6v, 6h) is interrupted in the middle. Therefore, the code decoding device 1 according to the present embodiment also estimates the contour line 6 that partitions the black regions 4A and the white regions 4B. In the following, the contour line 6 estimated in this way will be referred to as a contour line 6 (6v', 6h'). Further, the contour line 6 in which the contour line 6 (6v, 6h) and the contour line 6 (6v', 6h') are combined is expressed as the contour line 6 (6v + 6v', 6h + 6h').

図1に戻り、本実施の形態に係るコード復号装置1は、輪郭線検出部10と、輪郭線推定部11と、復号部12と、を備える。輪郭線検出部10は、カメラ5で撮像された2次元コード2の画像Im1から、セル4の輪郭線6(6v+6v’,6h+6h’)を検出する。輪郭線推定部11は、輪郭線検出部10で検出された輪郭線6(6v+6v’,6h+6h’)の2次元コード2内の位置情報を推定する。輪郭線推定部11での位置情報の推定により追加生成される輪郭線6を、輪郭線6(6v”,6h”)とする。復号部12は、輪郭線検出部10で検出された輪郭線6(6v+6v’,6h+6h’)と、輪郭線推定部11で推定された輪郭線6の位置情報とに基づいて、セル4の2次元コード2内の位置情報を推定し、セル4の位置情報の推定結果に基づいてコード情報を復号化する。ここでは、全てのセル4の2次元コード2内での相対位置が認識され、各セル4の明暗を判定することで復号化が行われる。以下、コード復号装置1の各構成要素の詳細について説明する。 Returning to FIG. 1, the code decoding device 1 according to the present embodiment includes a contour line detecting unit 10, a contour line estimation unit 11, and a decoding unit 12. The contour line detecting unit 10 detects the contour line 6 (6v + 6v', 6h + 6h') of the cell 4 from the image Im1 of the two-dimensional code 2 captured by the camera 5. The contour line estimation unit 11 estimates the position information of the contour line 6 (6v + 6v', 6h + 6h') detected by the contour line detection unit 10 in the two-dimensional code 2. The contour line 6 additionally generated by the estimation of the position information by the contour line estimation unit 11 is referred to as a contour line 6 (6v ", 6h"). The decoding unit 12 2 of cell 4 is based on the contour line 6 (6v + 6v', 6h + 6h') detected by the contour line detecting unit 10 and the position information of the contour line 6 estimated by the contour line estimation unit 11. The position information in the dimension code 2 is estimated, and the code information is decoded based on the estimation result of the position information in the cell 4. Here, the relative positions of all cells 4 in the two-dimensional code 2 are recognized, and decoding is performed by determining the brightness of each cell 4. Hereinafter, details of each component of the code decoding device 1 will be described.

[輪郭線検出部]
輪郭線検出部10の詳細について説明する。輪郭線検出部10は、機械学習を行って、2次元コード2の画像Im1から、輪郭線6(6v,6h)の他、両隣のセル4の輝度が等しいために不可視のセル4の輪郭線6(6v’,6h’)を推定し、輪郭線6(6v+6v’,6h+6h’)を出力する機械学習部21を有している。
[Contour line detector]
The details of the contour line detecting unit 10 will be described. The contour line detection unit 10 performs machine learning, and from the image Im1 of the two-dimensional code 2, the contour line 6 (6v, 6h) and the contour line of the cell 4 which is invisible because the brightness of the cells 4 on both sides are the same. It has a machine learning unit 21 that estimates 6 (6v', 6h') and outputs contour lines 6 (6v + 6v', 6h + 6h').

機械学習部21は、例えば、多層パーセプトロン又は畳み込みニューラルネットワーク,全層畳み込みネットワークとすることができる。多層パーセプトロンや畳み込みニューラルネットワークは、画素の各画素に対して輪郭線であるか否かを識別するモデルであり、移動窓方式により画像の全画素について識別を行う。また、この機械学習部21を、2次元コード2の画像Im1の各画素をノードとするグラフ構造で表現したマルコフ確率場として最適化を行う最適化器とすることができる。マルコフ確率場は、画像の領域分割に利用される一般的なモデルと同一とすることができる。 The machine learning unit 21 may be, for example, a multi-layer perceptron, a convolutional neural network, or a full-layer convolutional network. A multi-layer perceptron or a convolutional neural network is a model that discriminates whether or not each pixel is a contour line, and discriminates all pixels of an image by a moving window method. Further, the machine learning unit 21 can be an optimizer that optimizes as a Markov random field represented by a graph structure in which each pixel of the image Im1 of the two-dimensional code 2 is a node. The Markov random field can be the same as the general model used for image segmentation.

スキップ結合を含み、全結合層を持たず全ての層が畳み込み層である全層畳み込みネットワークであるU−Netを用いた例を図4に示す。U−Netは、エンコーダ・デコーダ構造にスキップ構造を加えたネットワークである。図4に示すように、本実施の形態に係るU−Netでは、5層の畳み込み層と、同じく5層の逆畳み込み層とで構成される。しかしながら、畳み込み層及び逆畳み込み層は、5層には限られない。 FIG. 4 shows an example using U-Net, which is a full-layer convolutional network including a skip bond and having no fully connected layer and all layers are convolutional layers. U-Net is a network in which a skip structure is added to an encoder / decoder structure. As shown in FIG. 4, the U-Net according to the present embodiment is composed of five convolution layers and five reverse convolution layers. However, the convolutional layer and the deconvolutional layer are not limited to the five layers.

U−Netでは、エンコーダ時の特徴マップをデコーダ時にも利用するスキップ結合(スキップ接続)が導入されている。U−Netは、エンコーダとデコーダとが対となる構造となっている。U−Netでは、対応するエンコーダとデコーダの畳み込み層で得られる特徴マップは、同じサイズとなるため、そのまま連結し、スキップ結合を実現することができる。このスキップ結合の採用により、セグメンテーションの結果が粗くなるのを防止することが可能となる。 In U-Net, skip coupling (skip connection) is introduced, in which the feature map at the time of encoder is also used at the time of decoder. The U-Net has a structure in which an encoder and a decoder are paired. In U-Net, the feature maps obtained from the corresponding encoder and decoder convolution layers have the same size, so they can be connected as they are and skip coupling can be realized. By adopting this skip join, it is possible to prevent the result of segmentation from becoming rough.

言い換えれば、U−Netは、画素単位の領域分割を行う全層畳み込みニューラルネットワークであり、スキップ結合により詳細な領域分割が可能になる。図4では、各層のデータサイズと、特徴マップの数が示されている。例えば、入力画像のサイズは512×512ピクセルであり、その次の畳み込み層のサイズは256×256ピクセルとなり、枚数は64となる。 In other words, U-Net is a full-layer convolutional neural network that divides a region in pixel units, and skip coupling enables detailed region division. FIG. 4 shows the data size of each layer and the number of feature maps. For example, the size of the input image is 512 × 512 pixels, the size of the next convolution layer is 256 × 256 pixels, and the number of sheets is 64.

輪郭線検出部10は、深層学習が行われた畳み込みニューラルネットワークである機械学習部21を用いて、画像Im1から、輪郭線6(6v+6v’,6h+6h’)を推定する。この深層学習は、全セルの全輪郭線から構成される画像を教師データとして訓練が行われる。具体的には、2次元コード2の画像Im1(図5(A)参照)と、正確に得られた輪郭線6(6v+6v’,6h+6h’)の画像Im2(図5(B)参照)との組み合わせを複数作成し、作成された訓練データを用いて深層学習が行われる。なお、輪郭線6(6v+6v’,6h+6h’)の画像Im2には、遮蔽領域が輪郭線6とは異なる他の色に着色されている。このような画像を用いて学習を行えば、2次元コード2の遮蔽領域を検出し、遮蔽領域付近での不正確な輪郭線6’の抽出を回避することができる。 The contour line detection unit 10 estimates the contour line 6 (6v + 6v', 6h + 6h') from the image Im1 by using the machine learning unit 21 which is a convolutional neural network in which deep learning has been performed. This deep learning is trained using an image composed of all contour lines of all cells as teacher data. Specifically, the image Im1 of the two-dimensional code 2 (see FIG. 5 (A)) and the image Im2 of the accurately obtained contour line 6 (6v + 6v', 6h + 6h') (see FIG. 5B). Multiple combinations are created, and deep learning is performed using the created training data. In the image Im2 of the contour line 6 (6v + 6v', 6h + 6h'), the shielding region is colored in another color different from the contour line 6. If learning is performed using such an image, it is possible to detect the shielded area of the two-dimensional code 2 and avoid extracting an inaccurate contour line 6'near the shielded area.

深層学習には、例えば、誤差逆伝搬法等が用いられる。深層学習の結果得られたパラメータは、予め別のサーバコンピュータで行うことができ、サーバコンピュータから、後述する通信インターフェイス35を介して最適なパラメータを受信して、畳み込みニューラルネットワークに設定しておくことができる。 For deep learning, for example, an error back propagation method or the like is used. The parameters obtained as a result of deep learning can be performed in advance on another server computer, and the optimum parameters are received from the server computer via the communication interface 35 described later and set in the convolutional neural network. Can be done.

このように、深層学習された畳み込みニューラルネットワークの機械学習部21を用いることにより、従来は困難であった輝度差のない領域同士の輪郭線6(6v’,6h’)をも検出することが可能となる。なお、図6(A)には、機械学習部21を用いることなくエッジ検出された縦の輪郭線6(6v)の一例が示され、図6(B)には、機械学習部21で推定された縦の輪郭線6(6v+6v’)の一例が示されている。 In this way, by using the machine learning unit 21 of the deep-learned convolutional neural network, it is possible to detect contour lines 6 (6v', 6h') between regions having no luminance difference, which was difficult in the past. It will be possible. Note that FIG. 6A shows an example of the vertical contour line 6 (6v) whose edge is detected without using the machine learning unit 21, and FIG. 6B shows an estimation by the machine learning unit 21. An example of the vertical contour line 6 (6v + 6v') is shown.

[輪郭線推定部]
次に、輪郭線推定部11(図1参照)の詳細について説明する。輪郭線検出部10で検出された輪郭線6(6v+6v’,6h+6h’)は完全ではなく、一部つながっておらず、検出されていない輪郭線6(6v”,6h”)も存在する。輪郭線推定部11は、輪郭線検出部10で検出された輪郭線6(6v+6v’,6h+6h’)の番号を推定するとともに、輪郭線検出部10で検出されなかった輪郭線6(6v”,6h”)を推定する。これにより、輪郭線6全体の2次元コード2内の位置情報が推定される。図6(B)には、縦の輪郭線6(6v+6v’)が示され、図6(C)には、縦の輪郭線6(6v”)が示されている。
[Contour line estimation unit]
Next, the details of the contour line estimation unit 11 (see FIG. 1) will be described. The contour line 6 (6v + 6v', 6h + 6h') detected by the contour line detecting unit 10 is not perfect, is not partially connected, and there is also an undetected contour line 6 (6v ", 6h"). The contour line estimation unit 11 estimates the number of the contour line 6 (6v + 6v', 6h + 6h') detected by the contour line detection unit 10, and the contour line 6 (6v ", which is not detected by the contour line detection unit 10. 6h ") is estimated. As a result, the position information in the two-dimensional code 2 of the entire contour line 6 is estimated. FIG. 6B shows a vertical contour line 6 (6v + 6v'), and FIG. 6C shows a vertical contour line 6 (6v ″).

輪郭線6の推定は、以下のようにして行われる。輪郭線推定部11は、例えば、図6(B)に示すように、縦の輪郭線6(6v+6v’)に対して、輪郭線6(6v+6v’)が並ぶ方向に、順番に識別番号としてのラベルを付与する。ラベルは、輪郭線6(6v+6v’)毎の固有の情報であり、輪郭線6(6v+6v’)の2次元コード2内の位置を表す情報である。例えば、左から0、1、2、3、4、・・・というように輪郭線6が並ぶ順番に付与される。途切れた輪郭線6についても、左から順番に0,1,2,・・・というように順番にラベルが付与される。例えば、型番が3のQRコード(登録商標)であれば29×29セルを含むため、ラベルは0から29となる。なお、横の輪郭線6(6h+6h’)の場合には、上から輪郭線6が並ぶ順番に、0、1、2、・・・というようにラベルを付与することができる。これらのラベルは、輪郭線6(6v+6v’,6h+6h’)の2次元コード2内での位置を表し、各セル4の2次元コード2内での位置を推定することを可能にする。輪郭線推定部11は、付与したラベルに基づいて、輪郭線検出部10で検出されなかった輪郭線6(6v”,6h”)の2次元コード2内の位置情報を推定する。 The estimation of the contour line 6 is performed as follows. As shown in FIG. 6B, for example, the contour line estimation unit 11 serves as an identification number in order in the direction in which the contour lines 6 (6v + 6v') are arranged with respect to the vertical contour line 6 (6v + 6v'). Give a label. The label is unique information for each contour line 6 (6v + 6v'), and is information indicating the position of the contour line 6 (6v + 6v') in the two-dimensional code 2. For example, the contour lines 6 are assigned in the order of 0, 1, 2, 3, 4, ... From the left. Labels are also assigned to the interrupted contour lines 6 in order from the left, such as 0, 1, 2, .... For example, if the model number is 3 QR code (registered trademark), 29 × 29 cells are included, so the label is 0 to 29. In the case of the horizontal contour line 6 (6h + 6h'), labels such as 0, 1, 2, ... Can be added in the order in which the contour lines 6 are lined up from the top. These labels represent the position of the contour line 6 (6v + 6v', 6h + 6h') in the 2D code 2 and make it possible to estimate the position of each cell 4 in the 2D code 2. The contour line estimation unit 11 estimates the position information in the two-dimensional code 2 of the contour line 6 (6v ", 6h") that was not detected by the contour line detection unit 10 based on the given label.

輪郭線6は、理想的には2次元コード2の一辺と同じ長さを持つ線であるが、輪郭線検出部10で検出された輪郭線6は途切れ途切れとなっており、途切れた輪郭線6毎にラベルが付与される。本実施の形態に係る輪郭線推定部11は、同じラベルを有する途切れた輪郭線6(6v+6v’,6h+6h’)の端部同士を、輪郭線(接続線)6(6v”,6h”)で接続して途切れのない輪郭線6(6v+6v’+6v”,6h+6h’+6h”)を生成する。このとき、接続線6(6v”,6h”)を結び後述する目的関数F(C)を用いることで、途切れた輪郭線6の集合に対して付与されたラベルの組み合わせの適切さを評価することが可能となる。結果的に、輪郭線推定部11は、輪郭線6(6v+6v’,6h+6h’)に、輪郭線6(6v”,6h”)を加えた輪郭線6(6v+6v’+6v”,6h+6h’+6h”)を出力する。なお、図6(C)では、縦の輪郭線6(6v+6v’+6v”)しか示されていないが、横の輪郭線6(6h+6h’+6h”)についても、同様の推定処理が行われる。 The contour line 6 is ideally a line having the same length as one side of the two-dimensional code 2, but the contour line 6 detected by the contour line detection unit 10 is interrupted, and the contour line 6 is interrupted. A label is given every six. The contour line estimation unit 11 according to the present embodiment connects the ends of the interrupted contour lines 6 (6v + 6v', 6h + 6h') having the same label with the contour lines (connecting lines) 6 (6v ", 6h"). Connect to generate a continuous contour line 6 (6v + 6v'+ 6v ", 6h + 6h' + 6h"). At this time, by connecting the connection lines 6 (6v ", 6h") and using the objective function F (C) described later, the appropriateness of the combination of labels given to the set of the interrupted contour lines 6 is evaluated. It becomes possible. As a result, the contour line estimation unit 11 adds the contour line 6 (6v ", 6h") to the contour line 6 (6v + 6v', 6h + 6h') to form the contour line 6 (6v + 6v'+ 6v ", 6h + 6h' + 6h"). Is output. Although only the vertical contour line 6 (6v + 6v'+ 6v ") is shown in FIG. 6C, the same estimation processing is performed for the horizontal contour line 6 (6h + 6h'+ 6h").

輪郭線推定部11は、輪郭線6(6v+6v’,6h+6h’)に対して最適なラベルの組み合わせを割り当てるために、仮に割り当てたラベルにより得られる接続線6(6v”,6h”)において、3つの関数の値を算出することでその妥当性を評価する。第1の関数F(C)と、第2の関数F(C)と、第3の関数F(C)である。なお、これらの関数の説明では、輪郭線6(6v+6v’,6h+6h’)を輪郭線6’とし、輪郭線、すなわち接続線6(6v”,6h”)を輪郭線6”として説明する。 The contour line estimation unit 11 has 3 in the connection line 6 (6v ", 6h") obtained by the temporarily assigned label in order to assign the optimum label combination to the contour line 6 (6v + 6v', 6h + 6h'). The validity is evaluated by calculating the value of one function. The first function Fa (C), the second function F c (C), and the third function Fi (C). In the description of these functions, the contour line 6 (6v + 6v', 6h + 6h') will be referred to as the contour line 6', and the contour line, that is, the connecting line 6 (6v ", 6h") will be referred to as the contour line 6 ".

第1の関数F(C)は、輪郭線6’と接続線6”とのなす角度が大きくなるにつれて大きくなる評価関数である。図7(A)に示すように、ラベルが同じ上の輪郭線6’(モジュールエッジe)と、下の輪郭線6’(モジュールエッジe)とが、接続線6”で接続されるものとした場合、上の輪郭線6’と接続線6”とのなす角度をθi,topとし、下の輪郭線6’と接続線6”とのなす角度をθi,bottomとする。輪郭線6’について引かれた接続線6”の総数をnとすると、第1の関数F(C)は、以下の式(1)で示されている。

Figure 2021184141
The first function Fa (C) is an evaluation function that increases as the angle between the contour line 6'and the connecting line 6'increases. As shown in FIG. 7 (A), the labels are on the same. Assuming that the contour line 6'(module edge e 1 ) and the lower contour line 6'(module edge e 2 ) are connected by the connecting line 6', the upper contour line 6'and the connecting line 6' Let θ i and top be the angles formed by " , and let θ i and bottom be the angles formed by the lower contour line 6'and the connecting line 6". Assuming that the total number of connecting lines 6 "drawn for the contour line 6'is n, the first function Fa (C) is shown by the following equation (1).
Figure 2021184141

第2の関数F(C)は、図7(B)に示すように、接続線6”同士の交叉回数が増えるにつれて大きくなる評価関数である。第2の関数F(C)は、以下の式(2)で示されている。
(C)=Ccross ・・・(2)
ここで、Ccrossは、輪郭線6’について引かれた接続線6”の交叉回数である。
Second function F c (C), as shown in FIG. 7 (B), connecting lines 6 "is larger evaluation function as crossover frequency of each other increases. The second function F c (C) is, It is represented by the following equation (2).
F c (C) = C cross ... (2)
Here, C cross is the number of crossings of the connecting line 6 "drawn for the contour line 6'.

第3の関数F(C)は、図7(C)に示すように、隣接する輪郭線6’の間隔が大きくなるにつれて大きくなる評価関数である。第3の関数F(C)を以下の式(3)に示す。

Figure 2021184141
ここで、εは、輪郭線6’の組み合わせの集合であり、|ε|は組み合わせの総数である。e,ejは、輪郭線(モジュールエッジ)6’である。l(e),l(e)は、モジュールエッジ6’のラベルである。
Figure 2021184141
は、隣接する輪郭線6’の間隔の推定値であり、δ(e,e)は、eとeの間隔の実測値である。このように、上記式(3)は、隣接する2本の輪郭線e,eの間隔から推定されるラベルの差と、その輪郭線6’に付与されたラベルの差(l(e)−l(e))との違いに基づく値となる。 As shown in FIG. 7 (C), the third function Fi (C) is an evaluation function that increases as the distance between adjacent contour lines 6 ′ increases. The third function Fi (C) is shown in the following equation (3).
Figure 2021184141
Here, ε is a set of combinations of contour lines 6', and | ε | is the total number of combinations. e i and e j are contour lines (module edges) 6'. l (e i ) and l (e j ) are labels for the module edge 6'.
Figure 2021184141
Is an estimated value of the interval between adjacent contour lines 6', and δ (e i , e j ) is an actually measured value of the interval between e i and e j. As described above, in the above equation (3), the difference between the labels estimated from the distance between the two adjacent contour lines e i and e j and the difference between the labels given to the contour lines 6'(l (e). j) is a value based on the difference between -l (e i)).

目的関数F(C)としては、例えば次式を採用することができる。

Figure 2021184141
上述のように、第1の関数F(C)は、輪郭線6’と接続線6”とがなす角度による評価関数である。また、第2の関数F(C)は、接続線6”の交叉回数による評価関数である。また、第3の関数F(C)は、隣接する輪郭線6’の間隔による評価関数である。上述の式において、w,w,wは、第1の関数F(C)、第2の関数F(C)及び第3の関数F(C)の重みである。 As the objective function F (C), for example, the following equation can be adopted.
Figure 2021184141
As described above, the first function Fa (C) is an evaluation function based on the angle formed by the contour line 6'and the connecting line 6'. The second function F c (C) is the connecting line. It is an evaluation function based on the number of crossings of 6 ”. Further, the third function Fi (C) is an evaluation function based on the interval between adjacent contour lines 6'. In the above formula, w a, w c, w i is the weight of the first function F a (C), a second function F c (C) and the third function F i (C).

輪郭線推定部11は、目的関数F(C)を用いて、輪郭線6’に付与されるラベルの組み合わせの中から、目的関数F(C)の値が最も小さくなるラベルの組み合わせを探索する。目的関数F(C)の値が最も小さくなる接続線6”で接続された輪郭線6が、最終的な輪郭線6となる。なお、目的関数F(C)は、上記式のものに限らず、第1の関数Fa(C)、第2の関数Fc(C)及び第3の関数Fi(C)のいずれか、又は第1の関数Fa(C)、第2の関数Fc(C)及び第3の関数Fi(C)のうちの少なくとも2つの和のいずれかを含んでいればよい。 The contour line estimation unit 11 uses the objective function F (C) to search for the combination of labels having the smallest value of the objective function F (C) from the combinations of labels given to the contour line 6'. .. The contour line 6 connected by the connection line 6 ”that has the smallest value of the objective function F (C) becomes the final contour line 6. Note that the objective function F (C) is limited to that of the above equation. First, any of the first function Fa (C), the second function Fc (C), and the third function Fi (C), or the first function Fa (C), the second function Fc (C). And any of at least two sums of the third function Fi (C) may be included.

[復号部]
次に、復号部12の詳細について説明する。復号部12は、輪郭線検出部10で検出された輪郭線6と、輪郭線推定部11で推定された輪郭線6の位置情報とに基づいて、セル4の2次元コード内の位置情報を推定する。例えば、図8に示すように、ラベル14、15が付与された縦の輪郭線6及びその位置情報と、ラベル14、15が付与された横の輪郭線6及びその位置情報とによって、その間の領域が推定される。復号部12は、推定された輝度値を検出し、検出した輝度値を閾値と比較して、「1」を示しているか、「0」を示しているかを判定する。この判定は、例えば、領域内の平均輝度値が閾値以上であるか否かにより行われる。この判定結果により、セル4を示す値が決定される。このように、復号部12は、輪郭線6(6v+6v’+6v”,6h+6h’+6h”)及びその位置情報に基づいてセル4の領域を推定し、領域毎に輝度値を検出し、その輝度値と閾値とを比較して、「1」又は「0」を判定する処理をすべての領域について行う。そして、すべての領域での「1」、「0」の情報を組み合わせてコード情報が生成される。
[Decoding section]
Next, the details of the decoding unit 12 will be described. The decoding unit 12 obtains the position information in the two-dimensional code of the cell 4 based on the contour line 6 detected by the contour line detection unit 10 and the position information of the contour line 6 estimated by the contour line estimation unit 11. presume. For example, as shown in FIG. 8, the vertical contour line 6 and its position information to which the labels 14 and 15 are attached and the horizontal contour line 6 and its position information to which the labels 14 and 15 are attached are in between. The area is estimated. The decoding unit 12 detects the estimated luminance value, compares the detected luminance value with the threshold value, and determines whether it indicates “1” or “0”. This determination is made, for example, by whether or not the average luminance value in the region is equal to or greater than the threshold value. From this determination result, the value indicating the cell 4 is determined. In this way, the decoding unit 12 estimates the region of the cell 4 based on the contour line 6 (6v + 6v'+ 6v ", 6h + 6h' + 6h") and its position information, detects the luminance value for each region, and determines the luminance value. And the threshold value are compared, and the process of determining "1" or "0" is performed for all areas. Then, the code information is generated by combining the information of "1" and "0" in all the areas.

[ハードウエア構成]
図9には、コード復号装置1(情報処理装置)のコンピュータのハードウエア構成が示されている。図9に示すように、コード復号装置1は、CPU(Central Processing Unit)30と、メモリ31と、外部記憶部32と、入出力部33と、通信インターフェイス35とを備える。コード復号装置1の各構成要素は、内部バス40を介して接続されている。
[Hardware configuration]
FIG. 9 shows the hardware configuration of the computer of the code decoding device 1 (information processing device). As shown in FIG. 9, the code decoding device 1 includes a CPU (Central Processing Unit) 30, a memory 31, an external storage unit 32, an input / output unit 33, and a communication interface 35. Each component of the code decoding device 1 is connected via the internal bus 40.

CPU30は、ソフトウエアプログラム(以下、単に「プログラム」とする)を実行するプロセッサ(演算装置)である。メモリ31には、外部記憶部32からプログラム39が読み込まれ、CPU30は、メモリ31に格納されたプログラム39を実行することにより、輪郭線検出部10、輪郭線推定部11及び復号部12の動作を行う。 The CPU 30 is a processor (arithmetic unit) that executes a software program (hereinafter, simply referred to as a "program"). The program 39 is read into the memory 31 from the external storage unit 32, and the CPU 30 operates the contour line detection unit 10, the contour line estimation unit 11, and the decoding unit 12 by executing the program 39 stored in the memory 31. I do.

メモリ31は、例えばRAM(Random Access Memory)である。メモリ31には、CPU30によって実行されるプログラム39が格納される他、CPU30によるプログラム39の実行で必要なデータ、プログラム39の実行の結果生成されるデータが記憶される。 The memory 31 is, for example, a RAM (Random Access Memory). In addition to storing the program 39 executed by the CPU 30, the memory 31 stores data necessary for executing the program 39 by the CPU 30 and data generated as a result of executing the program 39.

外部記憶部32は、例えばハードディスク等である。外部記憶部32は、CPU30により実行されるプログラム39が記憶される。 The external storage unit 32 is, for example, a hard disk or the like. The external storage unit 32 stores the program 39 executed by the CPU 30.

入出力部33は、カメラ5とのデータ入出力を行うインターフェイスである。カメラ5で撮像された画像は、入出力部33を介してメモリ31等に記憶される。 The input / output unit 33 is an interface for inputting / outputting data to / from the camera 5. The image captured by the camera 5 is stored in the memory 31 or the like via the input / output unit 33.

通信インターフェイス35は、インターネット等の通信ネットワークに接続する通信インターフェイスである。深層学習によって得られた畳み込みニューラルネットワーク等の機械学習部21のパラメータは、この通信インターフェイス35を介してダウンロードされ、コード復号装置1に設定される。 The communication interface 35 is a communication interface connected to a communication network such as the Internet. The parameters of the machine learning unit 21 such as the convolutional neural network obtained by deep learning are downloaded via the communication interface 35 and set in the code decoding device 1.

なお、輪郭線検出部10、輪郭線推定部11及び復号部12の機能は、通信ネットワーク上に構築されるクラウドコンピュータによって実現されるようにしてもよい。この場合、CPU30は、クラウドコンピュータに画像等を送り、復号の指示を行うだけでよい。 The functions of the contour line detection unit 10, the contour line estimation unit 11, and the decoding unit 12 may be realized by a cloud computer constructed on a communication network. In this case, the CPU 30 only needs to send an image or the like to the cloud computer and give an instruction for decoding.

次に、本実施の形態に係るコード復号装置1(情報処理装置)の動作、すなわちコード復号装置1によって実行されるコード復号方法について説明する。 Next, the operation of the code decoding device 1 (information processing device) according to the present embodiment, that is, the code decoding method executed by the code decoding device 1 will be described.

カメラ5で2次元コード2の画像Im1が撮像されると、図10に示すように、まず、輪郭線検出部10は、画像Im1における2次元コード2の位置を検出する(ステップS1)。この検出は、例えば、Star検出器を用いて行われる。Star検出器は、Center Surround Extremas(CenSurE)から派生した特徴点検出器である。CenSurE検出器は、グレースケール画像に対して回転やスケール変化に不変であり、簡素化された2階層のCenter−surroundフィルタを用いることで差分処理を行い、極値を検出する。Star検出器では、大小の星形範囲の符号をそれぞれ変えて重ねたフィルタが使用されている。このフィルタは、格子状に符号化されている2次元コードの領域間で多くの特徴点を検出する。この検出結果により2次元コード2の画像Im1が規格化される。 When the image Im1 of the two-dimensional code 2 is captured by the camera 5, the contour line detecting unit 10 first detects the position of the two-dimensional code 2 in the image Im1 as shown in FIG. 10 (step S1). This detection is performed using, for example, a Star detector. The Star detector is a feature point detector derived from the Center Surround Extremas (CenSurE). The CenSurE detector is invariant to rotation and scale changes for grayscale images, and performs difference processing by using a simplified two-layer Center-surround filter to detect extreme values. In the Star detector, a filter in which the signs of the large and small star-shaped ranges are changed and superimposed is used. This filter detects many feature points between regions of a two-dimensional code that are coded in a grid pattern. Based on this detection result, the image Im1 of the two-dimensional code 2 is standardized.

続いて、輪郭線検出部10を構成する機械学習部21は、画像Im1(図5(A)参照)から、セル4(4A,4B)の輪郭線6(6v+6v’,6h+6h’)を推定する(ステップS2;輪郭線検出ステップ)。これにより、機械学習部21から輪郭線6(6v+6v’,6h+6h’)の画像Im2(図5(B))が得られる。 Subsequently, the machine learning unit 21 constituting the contour line detection unit 10 estimates the contour line 6 (6v + 6v', 6h + 6h') of the cells 4 (4A, 4B) from the image Im1 (see FIG. 5A). (Step S2; contour line detection step). As a result, the image Im2 (FIG. 5 (B)) of the contour line 6 (6v + 6v', 6h + 6h') is obtained from the machine learning unit 21.

続いて、輪郭線推定部11は、輪郭線6を縦の輪郭線6v+6v’と、横の輪郭線6h+6h’とに分離する(ステップS4)。これにより、図12(A)及び図12(B)に示すように、例えば、ステップS2,S3で検出された輪郭線6が、縦の輪郭線6(6v+6v’)と、横の輪郭線6(6h+6h’)とに分離される。 Subsequently, the contour line estimation unit 11 separates the contour line 6 into a vertical contour line 6v + 6v'and a horizontal contour line 6h + 6h' (step S4). As a result, as shown in FIGS. 12A and 12B, for example, the contour lines 6 detected in steps S2 and S3 are the vertical contour line 6 (6v + 6v') and the horizontal contour line 6 It is separated into (6h + 6h').

さらに、輪郭線推定部11は、図6(B)に示すように、縦の輪郭線6(6v+6v’)にラベルを付与するとともに、横の輪郭線6(6h+6h’)にラベルを付与する(ステップS5)。輪郭線6(6v+6v’,6h+6h’)の位置情報の推定は、このラベルに基づいて行われる。 Further, as shown in FIG. 6B, the contour line estimation unit 11 assigns a label to the vertical contour line 6 (6v + 6v') and a label to the horizontal contour line 6 (6h + 6h'). Step S5). The estimation of the position information of the contour line 6 (6v + 6v', 6h + 6h') is performed based on this label.

さらに、輪郭線推定部11は、ステップS2で検出された縦の輪郭線6(6v+6v’)同士をつなぎ合わせてセル4の輪郭線6(6v”)の位置情報を推定するとともに、ステップS2で検出された横の輪郭線6(6h+6h’)同士をつなぎ合わせてセル4の輪郭線6(6h”)の位置情報を推定する推定処理サブルーチンを行う(ステップS6;輪郭線推定ステップ)。 Further, the contour line estimation unit 11 connects the vertical contour lines 6 (6v + 6v') detected in step S2 to estimate the position information of the contour line 6 (6v ") of the cell 4, and in step S2. An estimation processing subroutine is performed to estimate the position information of the contour line 6 (6h ") of the cell 4 by connecting the detected horizontal contour lines 6 (6h + 6h') to each other (step S6; contour line estimation step).

この推定処理サブルーチンでは、山登り法を用いて、輪郭線6に付与されるラベルの組み合わせの最適化が行われる。具体的には、例えば、図11に示すように、まず、輪郭線推定部11が、初期解を生成する(ステップS10)。この推定処理サブルーチンにおいて、「解」とは、輪郭線6に付与されるラベルの組み合わせのことである。このような、輪郭線6に付与されるラベルの組み合わせは複数あり、その中の1つの組み合わせが初期解となる。 In this estimation processing subroutine, the combination of labels given to the contour line 6 is optimized by using the mountain climbing method. Specifically, for example, as shown in FIG. 11, first, the contour line estimation unit 11 generates an initial solution (step S10). In this estimation processing subroutine, the "solution" is a combination of labels given to the contour line 6. There are a plurality of combinations of labels given to the contour line 6, and one combination among them is the initial solution.

続いて、輪郭線推定部11は、生成された解の評価を行う(ステップS11)。具体的には、輪郭線推定部11は、設定された初期解について、上述の式を用いて、目的関数F(C)を算出する。 Subsequently, the contour line estimation unit 11 evaluates the generated solution (step S11). Specifically, the contour line estimation unit 11 calculates the objective function F (C) for the set initial solution using the above equation.

続いて、輪郭線推定部11は、終了判定を行う(ステップS12)。ここで、終了条件は、最適解の近傍にあるすべての解の評価が完了することであるとする。ここでは、初期解の評価が行われただけであるので、判定は否定される(ステップS12;No)。 Subsequently, the contour line estimation unit 11 makes an end determination (step S12). Here, it is assumed that the termination condition is that the evaluation of all the solutions in the vicinity of the optimum solution is completed. Here, since the initial solution has only been evaluated, the determination is denied (step S12; No).

続いて、輪郭線推定部11は、新たな解の候補を生成する(ステップS13)。まだ、評価が行われていない、ラベルの組み合わせが存在する場合には、その組み合わせが生成される。 Subsequently, the contour line estimation unit 11 generates a new solution candidate (step S13). If there is a label combination that has not yet been evaluated, that combination is generated.

続いて、輪郭線推定部11は、リペア処理を行う(ステップS14)。このリペア処理では、接続線6”でつないで形成される輪郭線6’について、接続線6”同士の交叉を解消したり、分割されている接続線6”を結合したり、結合されている接続線6”を解消したり、ラベルが付与されていない輪郭線6’を削除したりすることなどが行われる。 Subsequently, the contour line estimation unit 11 performs a repair process (step S14). In this repair process, for the contour line 6'formed by connecting the connecting lines 6", the crossing of the connecting lines 6 "is canceled, and the divided connecting lines 6" are joined or connected. The connection line 6 "is eliminated, the contour line 6'without a label is deleted, and the like.

リペア処理を行った後、輪郭線推定部11は、新たな解について評価を行う(ステップS11)。以降、ステップS12で終了である、すなわち、すべての解の組み合わせでの評価が完了し、終了条件を満たすまで(ステップS12;Yes)、ステップS11→S12→S13→S14が繰り返される。終了条件を満たすと(ステップS12;Yes)、推定処理のサブルーチンが終了する。 After performing the repair process, the contour line estimation unit 11 evaluates a new solution (step S11). After that, steps S11 → S12 → S13 → S14 are repeated until the end in step S12, that is, the evaluation of all combinations of solutions is completed and the end condition is satisfied (step S12; Yes). When the end condition is satisfied (step S12; Yes), the estimation processing subroutine ends.

上述の推定処理により、例えば、図13に示すように、2次元コード2全体に対応する輪郭線6(6v+6v’+6v”,6h+6h’+6h”)が形成される。 By the above estimation process, for example, as shown in FIG. 13, the contour line 6 (6v + 6v'+ 6v ", 6h + 6h' + 6h") corresponding to the entire two-dimensional code 2 is formed.

図10に戻り、続いて、復号部12は、輪郭線6(6v+6v’+6v”,6h+6h’+6h”)で2次元コード2の画像Im1を仕切って、領域分割を行う(ステップS7)。さらに、復号部12は、図8に示すように、仕切られた領域を各セル4として推定し、コード情報を検出して、その復号化を行う(ステップS8;復号ステップ)。これにより、2次元コード2の画像Im1の各セル4の輝度が判定され、「1」と「0」とのデータ列であるコード情報が生成される。このコードは、例えば、インターネットのサイトのアドレスなどを表している。 Returning to FIG. 10, the decoding unit 12 subsequently partitions the image Im1 of the two-dimensional code 2 by the contour line 6 (6v + 6v'+ 6v ", 6h + 6h' + 6h"), and divides the area (step S7). Further, as shown in FIG. 8, the decoding unit 12 estimates the partitioned area as each cell 4, detects the code information, and decodes the code information (step S8; decoding step). As a result, the brightness of each cell 4 of the image Im1 of the two-dimensional code 2 is determined, and the code information which is a data string of "1" and "0" is generated. This code represents, for example, the address of an internet site.

以上詳細に説明したように、本実施の形態に係るコード復号装置1によれば、互いに輝度が異なる黒領域4Aと白領域4Bのいずれかで構成されるセル4の組み合わせでコード情報が符号化された2次元コード2の画像Im1から、セル4の輪郭線6(6v+6v’,6h+6h’)が検出されるだけでなく、検出された輪郭線6(6v+6v’,6h+6h’)の2次元コード内での位置を表すラベルを推定するとともに、検出されなかった輪郭線6(6v”,6h”)を推定する。これにより、検出された輪郭線6(6v+6v’,6h+6h’)と推定された輪郭線6(6v”,6h”)とに基づいて、全てのセル4の輪郭線が得られ、セル4の位置を正確に特定することができる。このため、補助線が設けられていない2次元コード2の画像Im1に複雑な歪み、局所的な歪みおよび遮蔽領域のある歪みがあっても、コード情報を正確に検出することができる。 As described in detail above, according to the code decoding device 1 according to the present embodiment, the code information is encoded by the combination of the cell 4 composed of either the black region 4A or the white region 4B having different brightness. Not only the contour line 6 (6v + 6v', 6h + 6h') of the cell 4 is detected from the image Im1 of the two-dimensional code 2, but also the detected contour line 6 (6v + 6v', 6h + 6h') is included in the two-dimensional code. In addition to estimating the label indicating the position at, the contour line 6 (6v ", 6h") that was not detected is estimated. As a result, the contour lines of all the cells 4 are obtained based on the detected contour lines 6 (6v + 6v', 6h + 6h') and the estimated contour lines 6 (6v ", 6h"), and the positions of the cells 4 are obtained. Can be accurately identified. Therefore, even if the image Im1 of the two-dimensional code 2 having no auxiliary line has complicated distortion, local distortion, and distortion with a shielding region, the code information can be accurately detected.

また、上記実施の形態によれば、図6(B)に示すように、輪郭線推定部11は、輪郭線検出部10で検出された輪郭線6(6v+6v’,6h+6h’)に対して、輪郭線6(6v+6v’,6h+6h’)が並ぶ方向に、順番にラベルを付与する。さらに、輪郭線推定部11は、付与したラベルに基づいて、輪郭線検出部10で検出されなかった輪郭線6(6v”,6h”)を推定する。このように、輪郭線6(6v”,6h”)を推定することにより、断片化された輪郭線6(6v+6v’,6h+6h’)の総数を削減することができ、ラベルの推定を行う組み合わせ最適化の問題のサイズが抑えられるため、番号の推定を行い易くなるうえ、推定に要する時間を短縮することが可能となる。 Further, according to the above embodiment, as shown in FIG. 6B, the contour line estimation unit 11 has a reference to the contour line 6 (6v + 6v', 6h + 6h') detected by the contour line detection unit 10. Labels are given in order in the direction in which the contour lines 6 (6v + 6v', 6h + 6h') are lined up. Further, the contour line estimation unit 11 estimates the contour lines 6 (6v ", 6h") that were not detected by the contour line detection unit 10 based on the attached label. By estimating the contour line 6 (6v ", 6h") in this way, the total number of fragmented contour lines 6 (6v + 6v', 6h + 6h') can be reduced, and the combination of estimating the label is optimal. Since the size of the fragmentation problem is reduced, it becomes easier to estimate the number and the time required for estimation can be shortened.

また、上記実施の形態に係るコード復号装置1において、輪郭線推定部11においてラベルの割り当ての妥当性を評価するために、以下の関数を用いる。すなわち、仮に割り当てられたラベルに基づいて、同じラベルを有する輪郭線6’同士を接続線6”で接続した場合において、輪郭線6’と接続線6”とのなす角度が大きくなるにつれて大きくなる第1の関数F(C)と、接続線6”同士の交叉回数が増えるにつれて大きくなる第2の関数F(C)と、隣接する輪郭線6’の間隔が大きくなるにつれて大きくなる第3の関数F(C)とのいずれか、又は、第1の関数F(C)、第2の関数F(C)及び第3の関数F(C)のうちの少なくとも2つの和のいずれかを含む目的関数F(C)を用いて、輪郭線6に付与されるラベルの組み合わせの中から、目的関数F(C)の値が最も小さくなる組み合わせを探索する。このようにすれば、推定される輪郭線6を最適なものとすることができる。 Further, in the code decoding device 1 according to the above embodiment, the following function is used in the contour line estimation unit 11 to evaluate the validity of the label assignment. That is, when contour lines 6'having the same label are connected by a connecting line 6 "based on the assigned label, the angle between the contour line 6'and the connecting line 6" increases. The first function F a (C) and the second function F c (C) that increase as the number of crossovers between the connecting lines 6 "increases, and the second function F c (C) that increases as the distance between the adjacent contour lines 6'increases. 3 one of the functions F i (C), or, the first function F a (C), the second function F c (C) and the third function F i at least two of (C) Using the objective function F (C) including any of the sums, the combination of labels given to the contour line 6 is searched for the combination having the smallest value of the objective function F (C). Then, the estimated contour line 6 can be optimized.

また、目的関数では、第1の関数F(C)と、第2の関数F(C)と、第3の関数F(C)とは、それぞれ異なる重みw,w,wが付与されている。このようにすれば、輪郭線6との角度、交叉回数、間隔それぞれ重みw,w,wを異ならせるようにした最適化が可能となる。 Further, in the objective function, the first function Fa (C), the second function F c (C), and the third function Fi (C) have different weights w a , w c , w, respectively. i is given. In this way, the angle of the contour line 6, crossing number, spacing each weight w a, w c, it is possible optimizations to vary the w i.

また、上記実施の形態に係るコード復号装置1において、輪郭線検出部10は、2次元コード2の画像Im1を入力し、セル4の輪郭線6を出力する機械学習部21を有している。輪郭線検出部10は、2次元コード2の撮像画像Im1と、理想的な輪郭線6(6v’,6h’)の画像との組み合わせを訓練データとして学習させた機械学習部21を用いて、輪郭線6(6v’,6h’)を推定する。このようにすれば、同じ輝度のセル4間の輪郭線6を推定することが可能となる。これにより、輪郭線推定部11における輪郭線6に対する番号の推定時間を短縮することができる。 Further, in the code decoding device 1 according to the above embodiment, the contour line detecting unit 10 has a machine learning unit 21 that inputs the image Im1 of the two-dimensional code 2 and outputs the contour line 6 of the cell 4. .. The contour line detection unit 10 uses a machine learning unit 21 in which the combination of the captured image Im1 of the two-dimensional code 2 and the image of the ideal contour line 6 (6v', 6h') is learned as training data. The contour line 6 (6v', 6h') is estimated. By doing so, it is possible to estimate the contour line 6 between the cells 4 having the same brightness. As a result, the estimation time of the number for the contour line 6 in the contour line estimation unit 11 can be shortened.

また、上記実施の形態に係るコード復号装置1において、機械学習部21について、畳み込みニューラルネットワークを採用した場合には、その畳み込みニューラルネットワークを、U−Netとすることができる。このようにすれば、画像のボケの発生を防止することができる。しかしながら、本実施の形態に係るコード復号装置1で用いることができる畳み込みニューラルネットワークはU−Netには限られない。例えば、畳み込みニューラルネットワークとしてSegNet(画像セグメンテーションニューラルネットワーク)、GAN(敵対的生成ネットワーク)等を採用するようにしてもよい。 Further, when a convolutional neural network is adopted for the machine learning unit 21 in the code decoding device 1 according to the above embodiment, the convolutional neural network can be U-Net. By doing so, it is possible to prevent the occurrence of blurring of the image. However, the convolutional neural network that can be used in the code decoding device 1 according to the present embodiment is not limited to U-Net. For example, SegNet (image segmentation neural network), GAN (hostile generation network), or the like may be adopted as the convolutional neural network.

なお、輪郭線検出部10は、機械学習部21を用いなくてもよい。例えば、ソーベルフィルタを用いて、輪郭線6、すなわちモジュールエッジを検出するだけでもよい。また、ソーベルフィルタを用いて輪郭線6(6v+6h)を検出した後、輪郭線6(6v+6h)の画像を機械学習部21に入力して、輪郭線6(6v+6v’,6h+6h’)を推定するようにしてもよい。 The contour line detection unit 10 does not have to use the machine learning unit 21. For example, a Sobel filter may be used to simply detect contour line 6, i.e., module edges. Further, after detecting the contour line 6 (6v + 6h) using the sobel filter, the image of the contour line 6 (6v + 6h) is input to the machine learning unit 21 to estimate the contour line 6 (6v + 6v', 6h + 6h'). You may do so.

また、輪郭線検出部10により、全ての輪郭線6が抽出されている場合には、輪郭線推定部11は、処理を行う必要はない。 Further, when all the contour lines 6 are extracted by the contour line detecting unit 10, the contour line estimation unit 11 does not need to perform processing.

また、上記実施の形態に係るコード復号装置1は、QRコード(登録商標)の2次元コード2の画像Im1から、コード情報を復号化した。しかしながら、本発明はこれには限られない。いわゆるバーコードを復号化するのに用いるようにしてもよい。本発明は、QRコード(登録商標)以外のマトリクス型の2次元コードにも、スタック型の2次元コードにも適用することが可能である。 Further, the code decoding device 1 according to the above embodiment decodes the code information from the image Im1 of the two-dimensional code 2 of the QR code (registered trademark). However, the present invention is not limited to this. It may be used to decode a so-called barcode. The present invention can be applied to both a matrix type two-dimensional code other than the QR code (registered trademark) and a stack type two-dimensional code.

その他、コード復号装置1のハードウエア構成やソフトウエア構成は一例であり、任意に変更および修正が可能である。 In addition, the hardware configuration and software configuration of the code decryption device 1 are examples, and can be arbitrarily changed and modified.

輪郭線検出部10、輪郭線推定部11及び復号部12などから構成されるコード復号装置1の処理を行う中心となる部分は、専用のシステムによらず、通常のコンピュータシステムを用いて実現可能である。例えば、前記の動作を実行するためのコンピュータプログラムを、コンピュータが読み取り可能な記録媒体(フレキシブルディスク、CD−ROM、DVD−ROM等)に格納して配布し、当該コンピュータプログラムをコンピュータにインストールすることにより、前記の処理を実行するコード復号装置1を構成してもよい。また、インターネット等の通信ネットワーク上のサーバ装置が有する記憶装置に当該コンピュータプログラムを格納しておき、通常のコンピュータシステムがダウンロード等することでコード復号装置1を構成してもよい。 The central part for processing the code decoding device 1 including the contour line detecting unit 10, the contour line estimating unit 11, and the decoding unit 12 can be realized by using a normal computer system without using a dedicated system. Is. For example, a computer program for performing the above operation is stored and distributed in a computer-readable recording medium (flexible disk, CD-ROM, DVD-ROM, etc.), and the computer program is installed in the computer. May configure the code decoding device 1 to execute the above processing. Further, the code decoding device 1 may be configured by storing the computer program in a storage device of a server device on a communication network such as the Internet and downloading it by a normal computer system.

コード復号装置1の機能を、OS(オペレーティングシステム)とアプリケーションプログラムとの分担、またはOSとアプリケーションプログラムとの協働により実現する場合などには、アプリケーションプログラム部分のみを記録媒体や記憶装置に格納してもよい。 When the function of the code decryption device 1 is realized by the division of the OS (operating system) and the application program or the cooperation between the OS and the application program, only the application program portion is stored in the recording medium or the storage device. You may.

搬送波にコンピュータプログラムを重畳し、通信ネットワークを介して配信することも可能である。例えば、通信ネットワーク上の掲示板(BBS;Bulletin Board System)にコンピュータプログラムを掲示し、ネットワークを介してコンピュータプログラムを配信してもよい。そして、このコンピュータプログラムを起動し、OSの制御下で、他のアプリケーションプログラムと同様に実行することにより、前記の処理を実行できるように構成してもよい。 It is also possible to superimpose a computer program on a carrier wave and distribute it via a communication network. For example, a computer program may be posted on a bulletin board system (BBS) on a communication network, and the computer program may be distributed via the network. Then, the computer program may be started and executed in the same manner as other application programs under the control of the OS so that the above processing can be executed.

この発明は、この発明の広義の精神と範囲を逸脱することなく、様々な実施の形態及び変形が可能とされるものである。また、上述した実施の形態は、この発明を説明するためのものであり、この発明の範囲を限定するものではない。すなわち、この発明の範囲は、実施の形態ではなく、特許請求の範囲によって示される。そして、特許請求の範囲内及びそれと同等の発明の意義の範囲内で施される様々な変形が、この発明の範囲内とみなされる。 The present invention allows for various embodiments and variations without departing from the broad spirit and scope of the invention. Further, the above-described embodiments are for explaining the present invention, and do not limit the scope of the present invention. That is, the scope of the present invention is shown not by the embodiment but by the claims. Then, various modifications made within the scope of the claims and within the scope of the equivalent invention are considered to be within the scope of the present invention.

本発明は、撮像画像からコードを検出するのに適用することができる。 The present invention can be applied to detect a code from a captured image.

1 コード復号装置、2 2次元コード、3 シート、4 セル、4A 黒領域(第1の領域)、4B 白領域(第2の領域)、5 カメラ、6,6’,6V,6H,6v,6v’,6h,6h’ 輪郭線(モジュールエッジ)、6”,6v”,6h” 輪郭線(接続線)、10 輪郭線検出部、11 輪郭線推定部、12 復号部、21 機械学習部、30 CPU、31 メモリ、32 外部記憶部、33 入出力部、35 通信インターフェイス、39 プログラム、40 内部バス、Im1,1m2 画像 1 code decoder, 2 2D code, 3 sheets, 4 cells, 4A black area (first area), 4B white area (second area), 5 cameras, 6,6', 6V, 6H, 6v, 6v', 6h, 6h'contour line (module edge), 6 ", 6v", 6h "contour line (connection line), 10 contour line detection unit, 11 contour line estimation unit, 12 decoding unit, 21 machine learning unit, 30 CPU, 31 memory, 32 external storage, 33 input / output, 35 communication interface, 39 program, 40 internal bus, Im1,1m2 image

Claims (9)

互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出部と、
前記輪郭線検出部で検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定部と、
前記輪郭線検出部で検出された前記輪郭線と、前記輪郭線推定部で推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号部と、
を備えるコード復号装置。
A contour line detection unit that detects the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region or a second region having different brightness from each other. When,
A contour line estimation unit that estimates the position information of the contour line detected by the contour line detection unit in the two-dimensional code, and a contour line estimation unit.
Based on the contour line detected by the contour line detection unit and the position information of the contour line estimated by the contour line estimation unit, the position information in the two-dimensional code of the cell is estimated. A decoding unit that decodes the code information based on the estimation result of the cell position information, and
A code decryption device.
前記輪郭線推定部は、
前記輪郭線検出部で検出された前記輪郭線に対して、前記2次元コード内の位置を表す識別番号を付与し、
付与した前記識別番号に基づいて、前記輪郭線の前記2次元コード内の位置情報を推定する、
請求項1に記載のコード復号装置。
The contour line estimation unit is
An identification number indicating a position in the two-dimensional code is assigned to the contour line detected by the contour line detection unit.
Based on the assigned identification number, the position information of the contour line in the two-dimensional code is estimated.
The code decryption device according to claim 1.
前記輪郭線推定部は、
同じ前記識別番号を有する前記輪郭線の端部同士を接続線で接続した場合において、前記接続線と前記輪郭線とのなす角度が大きくなるにつれて大きくなる第1の関数と、前記接続線同士の交叉回数が増えるにつれて大きくなる第2の関数と、隣接する前記輪郭線の間隔が大きくなるにつれて大きくなる第3の関数とのいずれか、又は、前記第1の関数、前記第2の関数及び前記第3の関数のうちの少なくとも2つの和のいずれかを含む目的関数を用いて、前記輪郭線に付与される前記識別番号の組み合わせの中から、前記目的関数の値が最も小さくなる前記識別番号の組み合わせを探索する、
請求項2に記載のコード復号装置。
The contour line estimation unit is
When the ends of the contour lines having the same identification number are connected by a connecting line, the first function that increases as the angle between the connecting line and the contour line increases, and the connecting lines Either a second function that increases as the number of crossings increases and a third function that increases as the distance between adjacent contour lines increases, or the first function, the second function, and the above. The identification number having the smallest value of the objective function among the combinations of the identification numbers given to the contour line by using the objective function including any one of at least two sums of the third function. Search for combinations of
The code decryption device according to claim 2.
前記目的関数において、前記第1の関数と、前記第2の関数と、前記第3の関数とには、それぞれ異なる重みが付与されている、
請求項3に記載のコード復号装置。
In the objective function, the first function, the second function, and the third function are given different weights.
The code decryption device according to claim 3.
前記輪郭線検出部は、
機械学習を行って、前記2次元コードの画像から、両隣の前記セルの輝度が等しいために不可視の前記セルの前記輪郭線を検出する機械学習部を備える、
請求項1から4のいずれか一項に記載のコード復号装置。
The contour line detection unit is
A machine learning unit is provided that performs machine learning and detects the contour line of the cell that is invisible because the brightness of the cells on both sides is equal from the image of the two-dimensional code.
The code decryption device according to any one of claims 1 to 4.
前記機械学習部は、
多層パーセプトロン、畳み込みニューラルネットワーク、又は前記2次元コードの画像の各画素をノードとするグラフ構造で表現したマルコフ確率場として最適化を行う最適化器である、
請求項5に記載のコード復号装置。
The machine learning unit
It is an optimizer that optimizes as a Markov random field expressed by a multi-layer perceptron, a convolutional neural network, or a graph structure with each pixel of the image of the two-dimensional code as a node.
The code decryption device according to claim 5.
前記畳み込みニューラルネットワークは、全結合層を持たず全ての層が畳み込み層である全層畳み込みネットワークである、
請求項6に記載のコード復号装置。
The convolutional neural network is a full-layer convolutional network that does not have a fully connected layer and all layers are convolutional layers.
The code decryption device according to claim 6.
情報処理装置によって実行されるコード復号方法であって、
互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出ステップと、
前記輪郭線検出ステップで検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定ステップと、
前記輪郭線検出ステップで検出された前記輪郭線と、前記輪郭線推定ステップで推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号ステップと、
を含むコード復号方法。
A code decryption method executed by an information processing device.
A contour line detection step for detecting the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region and a second region having different luminances from each other. When,
A contour line estimation step for estimating the position information of the contour line detected in the contour line detection step in the two-dimensional code, and a contour line estimation step.
Based on the contour line detected in the contour line detection step and the position information of the contour line estimated in the contour line estimation step, the position information in the two-dimensional code of the cell is estimated. A decoding step for decoding the code information based on the estimation result of the cell position information, and
Code decryption method including.
コンピュータを、
互いに輝度が異なる第1の領域と第2の領域のいずれかで構成されるセルの組み合わせでコード情報が符号化された2次元コードの画像から、前記セルの輪郭線を検出する輪郭線検出部、
前記輪郭線検出部で検出された前記輪郭線の前記2次元コード内の位置情報を推定する輪郭線推定部、
前記輪郭線検出部で検出された前記輪郭線と、前記輪郭線推定部で推定された前記輪郭線の前記位置情報とに基づいて、前記セルの前記2次元コード内の位置情報を推定し、前記セルの位置情報の推定結果に基づいて前記コード情報を復号化する復号部、
として機能させるプログラム。
Computer,
A contour line detection unit that detects the contour line of the cell from a two-dimensional code image in which code information is encoded by a combination of cells composed of either a first region or a second region having different brightness from each other. ,
A contour line estimation unit that estimates the position information of the contour line detected by the contour line detection unit in the two-dimensional code.
Based on the contour line detected by the contour line detection unit and the position information of the contour line estimated by the contour line estimation unit, the position information in the two-dimensional code of the cell is estimated. A decoding unit that decodes the code information based on the estimation result of the cell position information.
A program that functions as.
JP2020088825A 2020-05-21 2020-05-21 Code decoding device, code decoding method, and program Pending JP2021184141A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020088825A JP2021184141A (en) 2020-05-21 2020-05-21 Code decoding device, code decoding method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020088825A JP2021184141A (en) 2020-05-21 2020-05-21 Code decoding device, code decoding method, and program

Publications (1)

Publication Number Publication Date
JP2021184141A true JP2021184141A (en) 2021-12-02

Family

ID=78767414

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020088825A Pending JP2021184141A (en) 2020-05-21 2020-05-21 Code decoding device, code decoding method, and program

Country Status (1)

Country Link
JP (1) JP2021184141A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023166672A1 (en) * 2022-03-03 2023-09-07 三菱電機株式会社 Diagnosis system, control device, diagnosis method, and diagnosis program
CN117197422A (en) * 2023-11-07 2023-12-08 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023166672A1 (en) * 2022-03-03 2023-09-07 三菱電機株式会社 Diagnosis system, control device, diagnosis method, and diagnosis program
JP7461510B2 (en) 2022-03-03 2024-04-03 三菱電機株式会社 Diagnostic system, control device, diagnostic method and diagnostic program
CN117197422A (en) * 2023-11-07 2023-12-08 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium
CN117197422B (en) * 2023-11-07 2024-03-26 深圳优艾智合机器人科技有限公司 Identification code positioning method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106548127B (en) Image recognition method
RU2621601C1 (en) Document image curvature eliminating
US20230021661A1 (en) Forgery detection of face image
JP7246104B2 (en) License plate identification method based on text line identification
CN113435240B (en) End-to-end form detection and structure identification method and system
CN105574524B (en) Based on dialogue and divide the mirror cartoon image template recognition method and system that joint identifies
JP4901676B2 (en) License plate information processing apparatus and license plate information processing method
WO2013112738A1 (en) Identifying regions of text to merge in a natural image or video frame
Dal Poz et al. Automated extraction of road network from medium-and high-resolution images
KR102111667B1 (en) Apparatus of generating 2d image data set for deep learning through 3d design drawing data processing and system for searching simillar design drawing data based on deep learning using the same
JP2021184141A (en) Code decoding device, code decoding method, and program
WO2014129018A1 (en) Character recognition device, character recognition method, and recording medium
CN111104941B (en) Image direction correction method and device and electronic equipment
Cohen et al. Symmetry-aware facade parsing with occlusions
JP2019220014A (en) Image analyzing apparatus, image analyzing method and program
CN111507119B (en) Identification code recognition method, identification code recognition device, electronic equipment and computer readable storage medium
Xue et al. Indoor obstacle discovery on reflective ground via monocular camera
CN117115824A (en) Visual text detection method based on stroke region segmentation strategy
US9111142B2 (en) Method and apparatus for providing sign information
CN115223173A (en) Object identification method and device, electronic equipment and storage medium
EP3702958B1 (en) Method for verifying the identity of a user by identifying an object within an image that has a biometric characteristic of the user and separating a portion of the image comprising the biometric characteristic from other portions of the image
CN111680691A (en) Character detection method and device, electronic equipment and computer readable storage medium
US20230146018A1 (en) Polygonal building extraction from satellite images
CN116071835B (en) Face recognition attack post screening method and device and electronic equipment
CN116958981B (en) Character recognition method and device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20230516

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20240213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240214

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20240412

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20240605

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240618