JP4364186B2 - card - Google Patents

card Download PDF

Info

Publication number
JP4364186B2
JP4364186B2 JP2005269295A JP2005269295A JP4364186B2 JP 4364186 B2 JP4364186 B2 JP 4364186B2 JP 2005269295 A JP2005269295 A JP 2005269295A JP 2005269295 A JP2005269295 A JP 2005269295A JP 4364186 B2 JP4364186 B2 JP 4364186B2
Authority
JP
Japan
Prior art keywords
cell
corner
cells
code
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2005269295A
Other languages
Japanese (ja)
Other versions
JP2007080108A (en
Inventor
寛史 岡本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Interactive Entertainment Inc
Original Assignee
Sony Computer Entertainment Inc
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
Priority to JP2005269295A priority Critical patent/JP4364186B2/en
Application filed by Sony Computer Entertainment Inc filed Critical Sony Computer Entertainment Inc
Priority to KR1020067018844A priority patent/KR100858399B1/en
Priority to PCT/JP2005/018926 priority patent/WO2006041149A1/en
Priority to AT05793212T priority patent/ATE497219T1/en
Priority to EP05793212A priority patent/EP1801735B1/en
Priority to EP10195115A priority patent/EP2330536B1/en
Priority to DE602005026145T priority patent/DE602005026145D1/en
Priority to US10/590,759 priority patent/US7661601B2/en
Publication of JP2007080108A publication Critical patent/JP2007080108A/en
Priority to US12/534,979 priority patent/US8066195B2/en
Application granted granted Critical
Publication of JP4364186B2 publication Critical patent/JP4364186B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、複数のセルを2次元配置することでコードデータを表現する技術に関する。   The present invention relates to a technique for expressing code data by two-dimensionally arranging a plurality of cells.

近年、2次元コードをカメラで撮像してコードデータを認識し、そのコードデータに対応付けられた所定の処理を実行させる技術が普及している。1次元バーコードと比較すると、2次元コードの方がコード化できる情報量が多く、現在では様々な種類の2次元コードが登場するようになっている。2次元コードのコードデータは、画像データから効率よく且つ正確に読み取られる必要がある。このような状況をふまえて、従来、2次元コードの画像認識に関する技術を提案するものがある(例えば、特許文献1参照)。
特開2000−82108号公報
In recent years, a technique for recognizing code data by capturing a two-dimensional code with a camera and executing a predetermined process associated with the code data has become widespread. Compared to one-dimensional barcodes, two-dimensional codes have more information that can be encoded, and various types of two-dimensional codes are now available. The code data of the two-dimensional code needs to be read efficiently and accurately from the image data. In view of such a situation, there has been proposed a technique related to image recognition of a two-dimensional code (see, for example, Patent Document 1).
JP 2000-82108 A

画像データの解像度が高ければ、2次元コードの情報量を多く取得でき、コードデータの高い認識率を実現することができる。しかしながら、カメラによっては解像度の低いものもあり、そのような場合であっても、コードデータの認識率を高めることが好ましい。また、撮像して取得された画像データには、外部の環境光などの影響が含まれているため、取得した画像データを2値化する際にその影響を考慮して、2値化する画素値の範囲を好適に設定することが好ましい。
本発明は、精度よく認識することのできるカードなどの物体を提供することを目的とする。また本発明は、画像データを2値化する際の画素値の範囲を好適に設定する技術を提供することを目的とする。
If the resolution of the image data is high, a large amount of information of the two-dimensional code can be acquired, and a high recognition rate of the code data can be realized. However, some cameras have low resolution, and even in such a case, it is preferable to increase the recognition rate of code data. Further, since the image data acquired by imaging includes the influence of external environmental light or the like, the binarized pixels are taken into account when the acquired image data is binarized. It is preferable to set the range of values suitably.
An object of the present invention is to provide an object such as a card that can be recognized with high accuracy. It is another object of the present invention to provide a technique for suitably setting a pixel value range when binarizing image data.

上記課題を解決するために、本発明のある態様の物体は、 所定の形状を有する基準セルと、 それぞれを2次元配置することでコードデータを構成する複数の多辺形セルと、 同一形状を有する複数のコーナーセルと、を備える。コーナーセルは、基準セルおよび多辺形セルとは異なる色を付けられる。この物体はカードなどの2次元的なオブジェクトであってもよく、また3次元オブジェクトであってもよい。   In order to solve the above-described problem, an object according to an aspect of the present invention includes a reference cell having a predetermined shape, a plurality of polygonal cells that form code data by two-dimensionally arranging each, and the same shape. A plurality of corner cells. The corner cell is colored differently than the reference cell and the polygonal cell. This object may be a two-dimensional object such as a card or a three-dimensional object.

なお、以上の構成要素の任意の組合せ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   It should be noted that any combination of the above-described constituent elements and a conversion of the expression of the present invention between a method, an apparatus, a system, a recording medium, a computer program, etc. are also effective as an aspect of the present invention.

本発明によると、精度よく認識することのできる2次元コードを提供することができる。   According to the present invention, a two-dimensional code that can be recognized with high accuracy can be provided.

図1は、本発明の実施例にかかるゲームシステム1の構成を示す。ゲームシステム1は、撮像装置2、画像処理装置10および出力装置6を備える。画像処理装置10は、画像解析装置20およびゲーム装置30を備える。画像解析装置20およびゲーム装置30は別装置として構成されてもよいが、一体として構成されてもよい。撮像装置2は、CCD撮像素子またはMOS撮像素子などから構成されるビデオカメラであり、例えば320画素×240画素の解像度を有する。撮像装置2は実空間を所定の周期で撮像して、周期ごとのフレーム画像を生成する。撮像領域5は撮像装置2により撮像される範囲であり、撮像装置2の高さや向きを調整することで、撮像領域5の位置や大きさが調整される。ゲームプレイヤは、撮像領域5において、実オブジェクトであるゲームカード4を指で動かす。ゲームカード4は、自身を一意に識別するための2次元コードを有して構成される。   FIG. 1 shows a configuration of a game system 1 according to an embodiment of the present invention. The game system 1 includes an imaging device 2, an image processing device 10, and an output device 6. The image processing device 10 includes an image analysis device 20 and a game device 30. The image analysis device 20 and the game device 30 may be configured as separate devices, but may be configured as a single unit. The imaging device 2 is a video camera configured by a CCD imaging device or a MOS imaging device, and has a resolution of 320 pixels × 240 pixels, for example. The imaging device 2 images the real space at a predetermined cycle and generates a frame image for each cycle. The imaging region 5 is a range where the imaging device 2 captures an image, and the position and size of the imaging region 5 are adjusted by adjusting the height and direction of the imaging device 2. The game player moves the game card 4 that is a real object with a finger in the imaging area 5. The game card 4 has a two-dimensional code for uniquely identifying itself.

出力装置6は、表示装置であるディスプレイ7を有する。出力装置6は、さらにスピーカ(図示せず)を有して構成されてもよい。基本的に画像処理装置10は、撮像装置2により撮像されたフレーム画像をディスプレイ7に表示させ、その際に、ゲームカード4上に仮想オブジェクトであるキャラクタを重畳するように表示制御する。プレイヤは、ディスプレイ7を見ることで、ゲームカード4が撮像領域5に入っているか容易に確認でき、入っていない場合には、ゲームカード4の位置をずらしたり、また撮像装置2の向きを調整して、撮像装置2にゲームカード4を撮像させるようにする。   The output device 6 includes a display 7 that is a display device. The output device 6 may further include a speaker (not shown). Basically, the image processing apparatus 10 displays the frame image captured by the imaging apparatus 2 on the display 7, and controls display so that a character that is a virtual object is superimposed on the game card 4. The player can easily check whether or not the game card 4 is in the imaging area 5 by looking at the display 7. If not, the player can shift the position of the game card 4 or adjust the orientation of the imaging device 2. Then, the imaging device 2 is caused to image the game card 4.

実施例のゲームアプリケーションでは、プレイヤがゲームカード4に対して所定の操作を施すことにより、キャラクタを動作させる。このゲームアプリケーションの性質上、プレイヤにゲームカード4とキャラクタとの一体性を認識させることが好ましく、そのため、キャラクタの画像を、ゲームカード4に重ね合わせて表示させている。撮像領域5内でゲームカード4をゆっくりと移動させると、キャラクタは、ゲームカード4の上に乗った状態を維持しながら、ゲームカード4の動きに追従して一緒に移動する。   In the game application of the embodiment, the player operates the character by performing a predetermined operation on the game card 4. Due to the nature of the game application, it is preferable that the player recognize the unity between the game card 4 and the character, and therefore, the character image is displayed superimposed on the game card 4. When the game card 4 is slowly moved within the imaging area 5, the character moves together following the movement of the game card 4 while maintaining the state of riding on the game card 4.

以上のキャラクタの動きは、画像処理装置10により制御される。まず、画像解析装置20は、撮像装置2において取得されたフレーム画像から、ゲームカード4の画像情報を抽出する。さらに、画像解析装置20は、ゲームカード4の画像情報から、ゲームカード4に印刷された2次元コードを抽出する。このとき、画像解析装置20は、ゲームカード4の2次元コードから、ゲームカード4の空間における位置情報、方向情報、距離情報などを決定する。   The movement of the above characters is controlled by the image processing apparatus 10. First, the image analysis device 20 extracts image information of the game card 4 from the frame image acquired by the imaging device 2. Further, the image analysis device 20 extracts a two-dimensional code printed on the game card 4 from the image information of the game card 4. At this time, the image analysis device 20 determines position information, direction information, distance information, and the like in the space of the game card 4 from the two-dimensional code of the game card 4.

後述するが、画像解析装置20は、フレーム画像中のゲームカード4の画像における基準セルおよび4隅のコーナーセルを用いて、撮像装置2とゲームカード4との距離やゲームカード4の向きなどを計算して求める。これにより、キャラクタは、ゲームカード4上にて前方を向くように表示制御される。また、2次元コードにおける複数の方形セルの配列から、ゲームカード4のコードデータを取得する。   As will be described later, the image analysis device 20 uses the reference cells and the four corner cells in the image of the game card 4 in the frame image to determine the distance between the imaging device 2 and the game card 4, the orientation of the game card 4, and the like. Calculate to find. As a result, the character is controlled to face forward on the game card 4. Further, the code data of the game card 4 is acquired from the array of a plurality of rectangular cells in the two-dimensional code.

図1では、ゲームカード4が台3に単に置かれている状態を示しているが、ゲームカード4は、例えば台3に対して斜めに傾けられたり、また台3よりも上に持ち上げられたりしてもよい。画像解析装置20は、ゲームカード4が傾斜された状態、または、台3からの高さを変化された状態を画像解析により認識する機能をもつ。画像解析装置20において画像解析された結果は、ゲーム装置30に送られる。なお、撮像装置2において撮像されたフレーム画像が、ゲーム装置30に送られて、ゲーム装置30側で画像解析を行ってもよい。この場合、画像処理装置10は、ゲーム装置30のみで構成されることになる。   FIG. 1 shows a state in which the game card 4 is simply placed on the table 3, but the game card 4 is tilted with respect to the table 3, for example, or lifted above the table 3. May be. The image analysis device 20 has a function of recognizing a state where the game card 4 is tilted or a state where the height from the table 3 is changed by image analysis. The result of the image analysis performed by the image analysis device 20 is sent to the game device 30. Note that the frame image captured by the imaging device 2 may be sent to the game device 30 and image analysis performed on the game device 30 side. In this case, the image processing apparatus 10 is configured by only the game apparatus 30.

ゲーム装置30は、画像解析装置20における画像解析結果をもとに、ディスプレイ7の表示画面上で、キャラクタをゲームカード4の上に位置するように表示制御する。キャラクタは、ゲームカード4から抽出したコードデータに対応付けられて、ゲームシーンごとに適宜割り当てられてもよい。この場合、ゲームシーンが切り替わると、表示されるキャラクタも切り替わることになる。   The game apparatus 30 performs display control so that the character is positioned on the game card 4 on the display screen of the display 7 based on the image analysis result in the image analysis apparatus 20. The character may be associated with the code data extracted from the game card 4 and appropriately assigned for each game scene. In this case, when the game scene is switched, the displayed character is also switched.

図2は、ゲームカードの表面に印刷した2次元コードを示す。ゲームカード4の表面には、複数の所定形状をもつ多角形セルが所定の配列規則にしたがって2次元的に配置されている。具体的に、ゲームカード4の2次元コードは、撮像装置2により撮像された画像データからゲームカード4の認識処理を行うための基準となる基準セル100、複数の方形セル106を2次元配置することでコードデータを構成するコードデータ部分102、コードデータ部分102を取り囲むように配置される複数のコーナーセル104a、104b、104c、104d(以下、総称する場合は、「コーナーセル104」と呼ぶ)を備えている。コードデータ部分102およびコーナーセル104は、2次元コードにおけるコード部110に存在している。   FIG. 2 shows a two-dimensional code printed on the surface of the game card. A plurality of polygonal cells having a predetermined shape are two-dimensionally arranged on the surface of the game card 4 according to a predetermined arrangement rule. Specifically, the two-dimensional code of the game card 4 is a two-dimensional arrangement of a reference cell 100 and a plurality of rectangular cells 106 serving as a reference for performing recognition processing of the game card 4 from image data captured by the imaging device 2. The code data portion 102 constituting the code data, and a plurality of corner cells 104a, 104b, 104c, 104d arranged so as to surround the code data portion 102 (hereinafter collectively referred to as “corner cell 104”) It has. The code data portion 102 and the corner cell 104 exist in the code portion 110 in the two-dimensional code.

基準セル100、方形セル106およびコーナーセル104は、それぞれ所定の形状を有して構成される。図2に示す2次元コードでは、各セルが黒色に塗りつぶされて存在している。図2において、領域108は、複数の方形セル106が連結して構成されたものであり、他の方形セル106とともにコードデータを構成している。方形セル106は、同一の形状、ここでは正方形の形状をもつ。実施例のゲームカード4が複数存在する場合に、基準セル100およびコーナーセル104の配置および大きさは共通とされ、コードデータ部分102における方形セル106の配列により、ゲームカード4を一意に特定することができる。   The reference cell 100, the square cell 106, and the corner cell 104 are each configured to have a predetermined shape. In the two-dimensional code shown in FIG. 2, each cell is painted black. In FIG. 2, a region 108 is configured by connecting a plurality of rectangular cells 106, and constitutes code data together with other rectangular cells 106. The rectangular cells 106 have the same shape, here a square shape. When there are a plurality of game cards 4 in the embodiment, the arrangement and size of the reference cell 100 and the corner cell 104 are common, and the game card 4 is uniquely specified by the arrangement of the rectangular cells 106 in the code data portion 102. be able to.

以下に、本実施例における2次元コードの詳細を説明する。正方形状の方形セル106の1辺を1ブロックとすると、基準セル100は、7ブロック分の横方向の長辺と1.5ブロック分の縦方向の短辺で形成される長方形状のセル(エレメント)として構成される。実施例において、縦1ブロックと横1ブロックで形成される正方形状の領域をブロック領域と呼ぶ。   Details of the two-dimensional code in this embodiment will be described below. Assuming that one side of the square-shaped square cell 106 is one block, the reference cell 100 is a rectangular cell (with a long side in the horizontal direction of 7 blocks and a short side in the vertical direction of 1.5 blocks ( Element). In the embodiment, a square area formed by one vertical block and one horizontal block is called a block area.

コードデータ部分102は、7ブロック×7ブロックで囲まれる領域に形成される。この領域の一辺は、基準セル100の長辺に平行であり且つ長辺から1ブロック離れた位置に配置される。図示のように、コード部110は、8ブロック×8ブロックで囲まれる領域であり、コードデータ部分102は、コード部110が形成される領域に含まれる。実際に方形セル106が配置される領域は、7ブロック×7ブロックで囲まれる領域の4隅における2ブロック×2ブロックの領域を除いた部分とする。すなわち、4隅の2ブロック×2ブロックの領域には方形セル106を配置させないこととし、したがって、(7×7−2×2×4)=33のブロック領域に方形セル106が配置されて、コードデータを構成する。   The code data portion 102 is formed in an area surrounded by 7 blocks × 7 blocks. One side of this region is parallel to the long side of the reference cell 100 and is arranged at a position one block away from the long side. As shown in the figure, the code part 110 is an area surrounded by 8 blocks × 8 blocks, and the code data part 102 is included in the area where the code part 110 is formed. The area where the square cells 106 are actually arranged is a portion excluding the area of 2 blocks × 2 blocks at the four corners of the area surrounded by 7 blocks × 7 blocks. That is, the rectangular cell 106 is not arranged in the area of 2 blocks × 2 blocks at the four corners. Therefore, the rectangular cell 106 is arranged in the block area of (7 × 7−2 × 2 × 4) = 33, Configure code data.

コーナーセル104aは、コード部110の左上隅の領域に配置される。この左上隅の領域は、コードデータ部分102として7ブロック×7ブロックで囲まれる領域の左上隅の2ブロック×2ブロックの領域の範囲内であってよく、またその範囲内からはみ出してもよい。図示の例では、コーナーセル104aが、コードデータ部分102における左上隅の2ブロック×2ブロックの領域から縦に0.5ブロック分、横に0.5ブロック分だけはみ出して配置されている。すなわち、コーナーセル104aは、コード部110において2.5ブロック×2.5ブロックで囲まれる左上隅の領域に存在している。同様に、コーナーセル104bはコード部110の右上隅の領域に配置され、コーナーセル104cはコード部110の右下隅の領域に配置され、コーナーセル104dはコード部110の左下隅の領域に配置される。図示の例では、各コーナーセル104は方形に形成され、具体的には1辺を1.5ブロック分の長さとする正方形のセルとして形成されている。   The corner cell 104 a is disposed in the upper left corner area of the code portion 110. This upper left corner area may be within the range of the area of 2 blocks × 2 blocks at the upper left corner of the area surrounded by 7 blocks × 7 blocks as the code data portion 102, or may extend beyond the range. In the example shown in the figure, the corner cell 104a is arranged to protrude 0.5 blocks vertically and 0.5 blocks horizontally from the 2 block × 2 block region in the upper left corner of the code data portion 102. That is, the corner cell 104a exists in the upper left corner region surrounded by 2.5 blocks × 2.5 blocks in the code portion 110. Similarly, the corner cell 104b is disposed in the upper right corner region of the code portion 110, the corner cell 104c is disposed in the lower right corner region of the code portion 110, and the corner cell 104d is disposed in the lower left corner region of the code portion 110. The In the example shown in the drawing, each corner cell 104 is formed in a square shape, specifically, a square cell with one side having a length of 1.5 blocks.

コードデータ部分102は、1ブロック領域を1ビットとすると、合計で33ビット分の情報をコード化することができる。この33ビット中、9ビット分は、コードデータが、正しいコードデータであることを確かめるためのチェックデータを構成する。従って、コードデータ部分102には、24ビット分の情報がコード化されている。   In the code data portion 102, if one block area is 1 bit, information of 33 bits in total can be encoded. Of these 33 bits, 9 bits constitute check data for confirming that the code data is correct code data. Therefore, information for 24 bits is encoded in the code data portion 102.

方形セル106は、コードデータを表現する重要なエレメントであり、画像解析装置20において正確に画像認識される必要がある。そのためには、全ての方形セル106を大きく形成することが理想的であるが、当然のことながらゲームカード4の大きさには制約があり、方形セル106を大きくすることは、それだけコードデータ部分102を構成する方形セル106の数を減じる結果となる。これは情報のビット数を減らすことに相当し、好ましくない。   The rectangular cell 106 is an important element that expresses code data, and needs to be accurately recognized by the image analysis apparatus 20. For that purpose, it is ideal to make all the square cells 106 large, but naturally the size of the game card 4 is limited, and the enlargement of the square cells 106 is equivalent to the code data portion. As a result, the number of rectangular cells 106 constituting the number 102 is reduced. This corresponds to reducing the number of bits of information and is not preferable.

以上のことから、本実施例において、コーナーセル104は、方形セル106よりも大きな面積を有して構成される。後述するが、本実施例の画像解析装置20において、4隅のコーナーセル104は、コードデータ部分102を検出するために利用される。逆に言えば、4隅のコーナーセル104を検出できなければ、方形セル106を検出することもできないため、この2次元コードでは、方形セル106よりもコーナーセル104をまず確実に認識する必要がある。4隅のコーナーセル104を方形セル106よりも大きく形成することで、4隅のコーナーセル104の認識率を高めることができる。   From the above, in this embodiment, the corner cell 104 is configured to have a larger area than the square cell 106. As will be described later, in the image analysis apparatus 20 of this embodiment, the corner cells 104 at the four corners are used to detect the code data portion 102. In other words, if the corner cells 104 at the four corners cannot be detected, the square cell 106 cannot be detected. Therefore, in this two-dimensional code, it is necessary to first reliably recognize the corner cells 104 rather than the square cells 106. is there. By forming the four corner cells 104 larger than the square cells 106, the recognition rate of the four corner cells 104 can be increased.

画像解析装置20は、フレーム画像中の基準セル100の候補を抽出して所定の基準を満たすものを基準セル100として仮定し、その仮定した基準セル100の近傍に4つのコーナーセル104が存在しているか否かを判定する。4つのコーナーセル104を認識すると、画像解析装置20は、4つのコーナーセル104により囲まれた領域、すなわちコードデータ部分102における方形セル106の配置を読み取り、コードデータを取得する。これにより、仮定した基準セル100が真の基準セル100であったことが判断され、ゲームカード4を認識することができる。画像解析装置20は、撮像装置2を基準(原点)とするゲームカード4の仮想3次元座標系における位置と方向を計算して求める。   The image analysis apparatus 20 extracts candidates for the reference cell 100 in the frame image and assumes a reference cell 100 that satisfies a predetermined reference, and there are four corner cells 104 in the vicinity of the assumed reference cell 100. It is determined whether or not. When the four corner cells 104 are recognized, the image analysis apparatus 20 reads the area surrounded by the four corner cells 104, that is, the arrangement of the rectangular cells 106 in the code data portion 102, and acquires code data. Thereby, it is determined that the assumed reference cell 100 is the true reference cell 100, and the game card 4 can be recognized. The image analysis device 20 calculates and obtains the position and direction of the game card 4 in the virtual three-dimensional coordinate system with the imaging device 2 as a reference (origin).

図3は、画像解析装置の構成を示す。画像解析装置20は、フレーム画像取得部40、実オブジェクト抽出部42および状態決定部44を備える。実オブジェクト抽出部42は、2値化処理部50、基準セル検出部52、コード部検出部54、検証処理部56を備える。本実施例における画像解析装置20の処理機能は、CPU、メモリ、メモリにロードされたプログラムなどによって実現され、ここではそれらの連携によって実現される構成を描いている。プログラムは、画像解析装置20に内蔵されていてもよく、また記録媒体に格納された形態で外部から供給されるものであってもよい。したがってこれらの機能ブロックがハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できることは、当業者に理解されるところである。図示の例では、画像解析装置20のCPUが、フレーム画像取得部40、実オブジェクト抽出部42、状態決定部44としての機能をもつ。   FIG. 3 shows the configuration of the image analysis apparatus. The image analysis device 20 includes a frame image acquisition unit 40, a real object extraction unit 42, and a state determination unit 44. The real object extraction unit 42 includes a binarization processing unit 50, a reference cell detection unit 52, a code unit detection unit 54, and a verification processing unit 56. The processing function of the image analysis apparatus 20 in the present embodiment is realized by a CPU, a memory, a program loaded in the memory, and the like, and here, a configuration realized by cooperation thereof is illustrated. The program may be built in the image analysis apparatus 20 or may be supplied from the outside in a form stored in a recording medium. Accordingly, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof. In the illustrated example, the CPU of the image analysis device 20 has functions as a frame image acquisition unit 40, a real object extraction unit 42, and a state determination unit 44.

フレーム画像取得部40が、撮像装置2にて撮像された実空間のフレーム画像を取得する。撮像装置2は、周期的にフレーム画像を取得し、好適には1/60秒間隔でフレーム画像を生成する。   The frame image acquisition unit 40 acquires a real space frame image captured by the imaging device 2. The imaging device 2 periodically acquires frame images, and preferably generates frame images at 1/60 second intervals.

実オブジェクト抽出部42は、フレーム画像から実オブジェクト画像、すなわちゲームカード4の画像を抽出する。具体的に、2値化処理部50がフレーム画像を2進数のビット表現に変換して、フレーム画像の情報をビットのオンとオフで表現する。基準セル検出部52は、フレーム画像の2値化データから、基準セル100を検出する。基準セル100を検出すると、コード部検出部54が、基準セル100の位置をもとにコード部110を検出し、検証処理部56が、コード部110に含まれるコードデータの検証処理を行う。   The real object extraction unit 42 extracts a real object image, that is, an image of the game card 4 from the frame image. Specifically, the binarization processing unit 50 converts the frame image into binary bit representation, and expresses the frame image information by turning the bit on and off. The reference cell detection unit 52 detects the reference cell 100 from the binarized data of the frame image. When the reference cell 100 is detected, the code part detection unit 54 detects the code part 110 based on the position of the reference cell 100, and the verification processing unit 56 performs verification processing of the code data included in the code part 110.

状態決定部44は、設定した座標系における実オブジェクトの状態を決定し、具体的には、ゲームカード4の位置、方向および撮像装置2からの距離を決定する。状態決定部44において決定された位置情報、方向情報、距離情報は、2次元コードから取得されたコードデータにそれぞれ関連付けされて、ゲーム装置30に送られる。なお、複数のゲームカード4が撮像領域5に存在する場合には、それぞれのゲームカード4ごとに、位置情報、方向情報、距離情報、コードデータが関連付けされてゲーム装置30に送られる。また、ゲームシステム1では、撮像装置2により撮像されたフレーム画像をディスプレイ7に表示させるため、フレーム画像自体もゲーム装置30に送られる。ゲーム装置30は、コードデータに対応付けられたキャラクタを読み出し、3次元の仮想空間においてゲームカード4とキャラクタとを重畳させて表示させる。   The state determination unit 44 determines the state of the real object in the set coordinate system, and specifically determines the position and direction of the game card 4 and the distance from the imaging device 2. The position information, direction information, and distance information determined by the state determination unit 44 are respectively associated with code data acquired from the two-dimensional code and sent to the game apparatus 30. When a plurality of game cards 4 are present in the imaging area 5, position information, direction information, distance information, and code data are associated with each game card 4 and sent to the game apparatus 30. In the game system 1, the frame image itself is also sent to the game device 30 in order to display the frame image captured by the imaging device 2 on the display 7. The game apparatus 30 reads the character associated with the code data and displays the game card 4 and the character superimposed on each other in a three-dimensional virtual space.

図4は、2次元コードの認識処理の処理手順を示すフローチャートである。2次元コードが撮像装置2により撮像され、その結果得られた1フレーム分の画像データが、フレーム画像取得部40により取得される。2値化処理部50は、画像データに対して2値化処理を行う(S10)。2値化処理では、所定の閾値より大きい輝度を保持する画素の画素値が"0"に符号化され、表示上、その画素は白色とされる。以下においては、このように、画素値が"0"に符号化された画素を、白色画素と称する。一方、閾値以下の輝度値を保持する画素の画素値は、"1"に符号化され、表示上、その画素は黒色とされる。以下においては、このように、画素値が"1"に符号化された画素を、黒色画素と称する。2値化処理部50は、黒色画素が連続して存在する領域を1つの連結領域としてまとめ、抽出された複数の黒色画素連結領域に対して、番号を1から順に昇順で設定(ラベリング)する(S12)。例えば、ラベリングの番号は、連結領域として抽出した順すなわち特定した順に設定されてもよい。番号は、その座標データとともにRAM(図示せず)に記憶させる。図2に示す2次元コードを利用すると、コーナーセル104が方形セル106よりも大きく表示されているため、コーナーセル104を黒色画素連結領域として検出できる確率および座標位置の精度を高くすることができる。   FIG. 4 is a flowchart showing the processing procedure of the recognition process of the two-dimensional code. The two-dimensional code is imaged by the imaging device 2, and image data for one frame obtained as a result is acquired by the frame image acquisition unit 40. The binarization processing unit 50 performs binarization processing on the image data (S10). In the binarization process, the pixel value of a pixel holding a luminance greater than a predetermined threshold is encoded to “0”, and the pixel is white on display. Hereinafter, a pixel whose pixel value is encoded as “0” in this way is referred to as a white pixel. On the other hand, the pixel value of the pixel holding the luminance value below the threshold is encoded as “1”, and the pixel is black on display. Hereinafter, a pixel whose pixel value is encoded as “1” in this way is referred to as a black pixel. The binarization processing unit 50 collects areas in which black pixels are continuously present as one connected area, and sets (labels) the extracted black pixel connected areas in ascending order from 1 in order. (S12). For example, the labeling numbers may be set in the order in which they are extracted as connected regions, that is, in the specified order. The number is stored in a RAM (not shown) together with the coordinate data. When the two-dimensional code shown in FIG. 2 is used, since the corner cell 104 is displayed larger than the square cell 106, the probability that the corner cell 104 can be detected as a black pixel connection region and the accuracy of the coordinate position can be increased. .

基準セル検出部52は、今回対象とする画像データより前に実行された2次元コード認識処理において、認識された2次元コードの表示上の位置、例えば、基準セル100の中央点が、RAMに記憶されているか否かを判定する(S14)。前フレームにおける基準セル100の中央点がRAMに記憶されている場合(S14のY)、記憶されている位置を基準セル検出処理の開始点として設定する(S16)。前の画像フレームにおいて基準セル100が検出されている場合、今回の画像フレームにおいてもゲームカード4の位置は大きく変化していないことが多いため、前フレームの基準セル100の中央点を利用することで、今回のフレームにおいて効率的に基準セル100を検出することが可能となる。一方、2次元コードの位置がRAMに記憶されていない場合(S14のN)、基準セル検出部52は、ディスプレイ7の表示上の中心点を基準セル検出処理の開始点に設定する(S18)。開始点を設定した後、基準セル検出部52は、基準セル100の検出処理を実行する(S20)。   In the two-dimensional code recognition process executed before the current target image data, the reference cell detection unit 52 displays the recognized position on the display of the two-dimensional code, for example, the center point of the reference cell 100 in the RAM. It is determined whether it is stored (S14). When the center point of the reference cell 100 in the previous frame is stored in the RAM (Y in S14), the stored position is set as the start point of the reference cell detection process (S16). When the reference cell 100 is detected in the previous image frame, the position of the game card 4 is often not changed greatly in the current image frame, so the center point of the reference cell 100 in the previous frame is used. Thus, the reference cell 100 can be efficiently detected in the current frame. On the other hand, when the position of the two-dimensional code is not stored in the RAM (N in S14), the reference cell detection unit 52 sets the center point on the display 7 as the start point of the reference cell detection process (S18). . After setting the starting point, the reference cell detection unit 52 executes the detection process of the reference cell 100 (S20).

図5は、基準セルの検出処理を示すフローチャートである。なお、本フローにて示す画素数は撮像装置2の解像度などに依存し、ここでは理解を容易にするため、一例としての画素数を示すこととする。まず、基準セル検出部52は、図4のS12においてラベリングした黒色画素連結領域の総数Mを読み出し、カウンタの値jを1に初期設定する(S100)。次に、図4のS16またはS18において設定した開始点から、ディスプレイ7の画面上を左回りの渦巻の軌跡に沿って、黒色画素連結領域を探索し、始めに検出した黒色画素連結領域を基準セル候補領域として選択する(S102)。基準セル検出部52は、選択した基準セル候補領域の縁部分を抽出して、短辺および長辺を決定する(S104)。   FIG. 5 is a flowchart showing reference cell detection processing. Note that the number of pixels shown in this flow depends on the resolution of the imaging device 2, and the number of pixels is shown as an example here for easy understanding. First, the reference cell detection unit 52 reads the total number M of black pixel connected regions labeled in S12 of FIG. 4 and initializes the counter value j to 1 (S100). Next, from the start point set in S16 or S18 of FIG. 4, the black pixel connection area is searched along the trace of the counterclockwise spiral on the screen of the display 7, and the black pixel connection area detected first is used as a reference. A cell candidate area is selected (S102). The reference cell detection unit 52 extracts the edge portion of the selected reference cell candidate region, and determines the short side and the long side (S104).

基準セル検出部52は、短辺が所定画素数、例えば20画素以上の画素で構成されているか否かを判定する(S106)。短辺は1.5ブロック分の長さで構成されているが、短辺が20画素より少ない画素で構成されている基準セル100である場合、1ブロックの長さは、さらに少ない数の画素から構成されることとなる。そのため、2次元コードにおける最小の構成要素である方形セル106の一辺は約13画素以下となり、撮像装置2で適切に撮像することはできない。このことより、短辺が20画素より少ない画素で構成されていると判定された場合(S106のN)、S102で選択された黒色画素連結領域は、基準セル100ではないと判断することとし、S116に進む。   The reference cell detection unit 52 determines whether or not the short side includes a predetermined number of pixels, for example, 20 pixels or more (S106). The short side is configured with a length corresponding to 1.5 blocks, but when the short side is the reference cell 100 configured with less than 20 pixels, the length of one block is a smaller number of pixels. It will be composed of. Therefore, one side of the rectangular cell 106, which is the smallest component in the two-dimensional code, is about 13 pixels or less, and the image pickup apparatus 2 cannot capture images appropriately. From this, when it is determined that the short side is configured by fewer than 20 pixels (N in S106), it is determined that the black pixel connection region selected in S102 is not the reference cell 100. The process proceeds to S116.

短辺が20画素以上の画素で構成されていると判定された場合(S106のY)、基準セル検出部52は、基準セル候補領域の長辺が所定画素数、例えば300画素以下の画素で構成されているか否かを判定する(S108)。例えば、長辺が300画素より多い画素で構成されている基準セル100であるとすると、長辺の長さが7に対して1の割合で求められる1ブロックの長さが大きくなり、基準セル100から、8.5ブロック分離れて位置する右下コーナーセル104cおよび左下コーナーセル104dが、撮像装置2にて撮像されなくなる。このことより、長辺が300画素より多い画素で構成されていると判定された場合(S108のN)、S102で選択された黒色画素連結領域は、基準セル100ではないと判断することとし、S116に進む。   When it is determined that the short side is composed of 20 or more pixels (Y in S106), the reference cell detection unit 52 uses a pixel whose long side of the reference cell candidate region is a predetermined number of pixels, for example, 300 pixels or less. It is determined whether or not it is configured (S108). For example, if the reference cell 100 is composed of more than 300 pixels on the long side, the length of one block obtained at a ratio of 1 to 7 on the long side becomes large. The lower right corner cell 104c and the lower left corner cell 104d located 8.5 blocks apart from 100 are no longer imaged by the imaging device 2. From this, when it is determined that the long side is composed of more than 300 pixels (N in S108), it is determined that the black pixel connection region selected in S102 is not the reference cell 100. The process proceeds to S116.

長辺が300画素以下の画素で構成されていると判定された場合(S108のY)、基準セル検出部52は、基準セル候補領域の黒色画素の総数が、20画素以上かつ1500画素未満であるか否かを判定する(S110)。黒色画素の総数が20画素未満の場合(S110のN)、短辺が20画素より少ない画素で構成された場合と同様の問題が発生し、また、1500画素以上である場合(S110のN)、長辺が300画素より多い画素で構成された場合と同様の問題が発生する。したがって、これらの場合には、基準セル候補領域が基準セル100である可能性が小さいと判断することとし、S116に進む。   When it is determined that the long side is composed of pixels of 300 pixels or less (Y in S108), the reference cell detection unit 52 determines that the total number of black pixels in the reference cell candidate region is 20 pixels or more and less than 1500 pixels. It is determined whether or not there is (S110). When the total number of black pixels is less than 20 pixels (N in S110), the same problem occurs when the short side is composed of less than 20 pixels, and when the total number is 1500 pixels or more (N in S110). The same problem occurs when the long side is composed of more than 300 pixels. Therefore, in these cases, it is determined that the possibility that the reference cell candidate region is the reference cell 100 is small, and the process proceeds to S116.

基準セル候補領域の黒色画素の総数が20画素以上かつ1500画素未満である場合(S110のY)、基準セル検出部52が、基準セル候補領域の方形らしさを判定する(S112)。方形らしさは、既述した特許文献1に記載されるように、基準セル候補領域のモーメントをもとに求められる。方形でないと判定する場合(S112のN)、基準セル候補領域が基準セル100でないと判断することとし、S116に進む。方形であると判定される場合(S112のY)、基準セル検出部52は、基準セル候補領域を基準セル100として設定し(S114)、基準セル候補領域とされた黒色画素連結領域のラベリング番号を、RAMに記憶させる。このようにして、基準セル100を検出することができる。画像データ中に1枚のゲームカード4しか含まれていない場合、基準セル100を検出した時点で、基準セルの検出処理を終了する。一方、ゲームカード4が複数含まれている可能性がある場合には、S116に進む。   When the total number of black pixels in the reference cell candidate region is 20 pixels or more and less than 1500 pixels (Y in S110), the reference cell detection unit 52 determines the squareness of the reference cell candidate region (S112). The squareness is obtained based on the moment of the reference cell candidate region as described in Patent Document 1 described above. When it is determined that it is not a square (N in S112), it is determined that the reference cell candidate region is not the reference cell 100, and the process proceeds to S116. When it is determined that the pixel is a square (Y in S112), the reference cell detection unit 52 sets the reference cell candidate region as the reference cell 100 (S114), and the labeling number of the black pixel connection region that is set as the reference cell candidate region Is stored in the RAM. In this way, the reference cell 100 can be detected. When only one game card 4 is included in the image data, the reference cell detection process ends when the reference cell 100 is detected. On the other hand, if there is a possibility that a plurality of game cards 4 are included, the process proceeds to S116.

基準セル検出部52は、カウント値jが基準セル候補領域の総数Mに等しいか否かを判定する(S116)。カウント値jが総数Mに達していない場合(S116のN)、カウント値jを1インクリメントして(S118)、S102のステップに戻る。一方、カウント値jが総数Mに達すると(S116のY)、この基準セル検出処理を終了する。   The reference cell detection unit 52 determines whether or not the count value j is equal to the total number M of reference cell candidate areas (S116). If the count value j has not reached the total number M (N in S116), the count value j is incremented by 1 (S118), and the process returns to the step of S102. On the other hand, when the count value j reaches the total number M (Y in S116), the reference cell detection process is terminated.

図4に戻って、S20の基準セル検出処理において基準セル100が検出されない場合(S22のN)、ゲームカード4の存在を確認できないため、2次元コードの認識処理を終了する。一方、基準セル100が検出されると(S22のY)、コード部検出処理が実行される(S24)。   Returning to FIG. 4, when the reference cell 100 is not detected in the reference cell detection process of S20 (N of S22), since the presence of the game card 4 cannot be confirmed, the two-dimensional code recognition process is terminated. On the other hand, when the reference cell 100 is detected (Y in S22), a code part detection process is executed (S24).

図6は、コード部の検出処理を示すフローチャートである。まず、コード部検出部54は、図5のS114において設定された基準セル100の総数Nを読み出し、カウンタの値kを1に初期設定する(S200)。なお、S114において設定した基準セル100には、設定した順に番号をふっているものとする。続いて、図4のS12においてラベリングした黒色画素連結領域の総数Mを読み出し、カウンタの値jを1に初期設定する(S202)。コード部検出部54は、カウント値jに対応する番号の黒色画素連結領域を検出し、それを左下隅のコーナーセル候補領域として選択する(S204)。   FIG. 6 is a flowchart showing the code portion detection process. First, the code part detection unit 54 reads the total number N of the reference cells 100 set in S114 of FIG. 5, and initializes the counter value k to 1 (S200). Note that the reference cells 100 set in S114 are numbered in the order set. Subsequently, the total number M of the black pixel connected regions labeled in S12 of FIG. 4 is read, and the counter value j is initialized to 1 (S202). The code part detection part 54 detects the black pixel connection area of the number corresponding to the count value j, and selects it as a corner cell candidate area in the lower left corner (S204).

次に、コード部検出部54は、選択した左下隅コーナーセル候補領域が、図4のS20において検出してカウント値kに対応する番号の基準セル100に対して予め設定された探索範囲内に存在するか否かを判定する(S206)。基準セル100と左下隅のコーナーセル104dとの位置関係は図2に示すように予め定められているため、基準セル100の座標データから、左下隅コーナーセルを探索する範囲を絞ることが可能である。なお、基準セル100は横長の矩形状を有するため、長辺側を挟んで対向する2つの位置に探索範囲を設定することが可能となる。探索範囲内に存在しない場合(S206のN)、その黒色画素連結領域は左下コーナーセル104dではないと判断され、S232に進む。探索範囲内に存在する場合(S206のY)、その黒色画素連結領域を左下コーナーセル104dとして設定する(S208)。   Next, the code portion detection unit 54 detects that the selected lower left corner cell candidate region is within the search range set in advance for the reference cell 100 of the number corresponding to the count value k detected in S20 of FIG. It is determined whether or not it exists (S206). Since the positional relationship between the reference cell 100 and the corner cell 104d at the lower left corner is predetermined as shown in FIG. 2, the search range for the lower left corner cell can be narrowed down from the coordinate data of the reference cell 100. is there. Since the reference cell 100 has a horizontally long rectangular shape, it is possible to set a search range at two positions facing each other across the long side. When it does not exist within the search range (N in S206), it is determined that the black pixel connected region is not the lower left corner cell 104d, and the process proceeds to S232. If it exists within the search range (Y in S206), the black pixel connection region is set as the lower left corner cell 104d (S208).

左下コーナーセル104を設定した後、コード部検出部54は、黒色画素連結領域の番号をカウントする他のカウンタの値lを1に初期設定する(S210)。コード部検出部54は、カウント値lに対応する番号の黒色画素連結領域を検出し、それを右下隅のコーナーセル候補領域として選択する(S212)。   After setting the lower left corner cell 104, the code portion detection unit 54 initializes the value l of another counter for counting the number of the black pixel connection region to 1 (S210). The code part detection part 54 detects the black pixel connection area of the number corresponding to the count value l and selects it as a corner cell candidate area in the lower right corner (S212).

次に、コード部検出部54は、S208で設定した左下コーナーセル104dの画素数(面積)と、S212で選択した右下コーナーセル候補領域の画素数(面積)の比を算出し、その比(面積比)が例えば1/6以上または6倍以下であるか否かを判定する(S214)。コーナーセル104は撮像装置2からの距離に応じて取得される画素数が変化する。具体的に、撮像装置2に近ければ大きい面積を有し、離れれば面積は小さくなる。そのため、コーナーセル同士であっても画像データ中の面積は異なるケースが想定される。しかしながら、例えば左下コーナーセルと右下コーナーセルの比が1/6より小さく、または6倍よりも大きくなるようなケース(S214のN)は通常想定しえないため、これらは一つの2次元コードにおけるコーナーセルであるとみなすことはできず、S226に進む。   Next, the code part detection unit 54 calculates the ratio between the number of pixels (area) of the lower left corner cell 104d set in S208 and the number of pixels (area) of the lower right corner cell candidate region selected in S212, and the ratio It is determined whether (area ratio) is, for example, 1/6 or more or 6 times or less (S214). In the corner cell 104, the number of pixels acquired changes according to the distance from the imaging device 2. Specifically, it has a large area if it is close to the imaging device 2, and the area is small if it is far away. Therefore, it is assumed that the areas in the image data are different even in the corner cells. However, for example, a case where the ratio of the lower left corner cell to the lower right corner cell is smaller than 1/6 or larger than 6 times (N in S214) cannot normally be assumed. Cannot be regarded as a corner cell in step S226, and the process proceeds to step S226.

面積比が例えば1/6以上、6倍以下である場合(S214のY)、コード部検出部54は、左下コーナーセル104dの中心点と、S212で選択した右下コーナーセル候補領域の中心点の距離が所定の条件を満たすか否かを判定する(S216)。ここで所定の条件とは、中心点同士の距離が例えば基準セル100の長辺の長さに近似していることであってもよい。所定の条件が成立しなければ(S216のN)、S226にすすみ、所定の条件が成立すると(S216のY)、コード部検出部54は、その黒色画素連結領域を右下コーナーセル104cとして設定する(S218)。   When the area ratio is, for example, 1/6 or more and 6 times or less (Y in S214), the code part detection unit 54 determines the center point of the lower left corner cell 104d and the center point of the lower right corner cell candidate region selected in S212. It is determined whether or not the distance of (2) satisfies a predetermined condition (S216). Here, the predetermined condition may be that the distance between the center points approximates the length of the long side of the reference cell 100, for example. If the predetermined condition is not satisfied (N in S216), the process proceeds to S226, and if the predetermined condition is satisfied (Y in S216), the code portion detection unit 54 sets the black pixel connection region as the lower right corner cell 104c. (S218).

以上のように左下コーナーセル104d、右下コーナーセル104cを設定すると、コード部検出部54が、設定した基準セル100、左下コーナーセル104d、右下コーナーセル104cを、ディスプレイ7の画面上のX軸方向およびY軸方向にアフィン変換する(S220)。なお、1ブロックの長さは、S20で設定した基準セル100の長辺または短辺の長さに基づいて算出される。コード部検出部54は、アフィン変換して得られた画像から、コード部110の領域に含まれる黒色画素連結領域をセルとしてマッピングし、コードマップを生成する(S222)。   When the lower left corner cell 104d and the lower right corner cell 104c are set as described above, the code part detection unit 54 changes the set reference cell 100, lower left corner cell 104d, and lower right corner cell 104c to X on the screen of the display 7. Affine transformation is performed in the axial direction and the Y-axis direction (S220). The length of one block is calculated based on the length of the long side or short side of the reference cell 100 set in S20. The code part detection part 54 maps the black pixel connection area included in the area of the code part 110 as a cell from the image obtained by the affine transformation, and generates a code map (S222).

コード部検出部54は、生成したコードマップのセルのうち、4隅のコーナーセル104を検出し、その周りの3ブロック領域が、白色画素とされているか否かを判定する(S224)。コーナーセル104の周囲の3ブロック領域が白色画素で構成されている場合(S224のY)、そのコードマップを2次元コードのコード部110と設定して(S230)、S236に進む。コーナーセル104の周囲の3ブロック領域が白色画素でない場合、S226に進む。   The code part detection unit 54 detects the corner cells 104 at the four corners from the generated code map cells, and determines whether or not the surrounding three block areas are white pixels (S224). If the three block areas around the corner cell 104 are composed of white pixels (Y in S224), the code map is set as the code part 110 of the two-dimensional code (S230), and the process proceeds to S236. When the three block areas around the corner cell 104 are not white pixels, the process proceeds to S226.

S226では、カウント値lが黒色画素連結領域の総数Mに等しいか否かを判定し、カウント値lがMに等しければ(S226のY)、S232に進み、等しくなければ(S226のN)、カウント値lを1インクリメントして(S228)、S212に戻る。   In S226, it is determined whether or not the count value l is equal to the total number M of black pixel connected regions. If the count value l is equal to M (Y in S226), the process proceeds to S232, and if not equal (N in S226), The count value l is incremented by 1 (S228), and the process returns to S212.

S232では、カウント値jが黒色画素連結領域の総数Mに等しいか否かを判定し、カウント値jがMに等しければ(S232のY)、S236に進み、等しくなければ(S232のN)、カウント値jを1インクリメントして(S234)、S204に戻る。   In S232, it is determined whether or not the count value j is equal to the total number M of the black pixel connected regions. If the count value j is equal to M (Y in S232), the process proceeds to S236, and if not equal (N in S232), The count value j is incremented by 1 (S234), and the process returns to S204.

S236では、カウント値kが設定した基準セル100の総数Nに等しいか否かを判定し、カウント値kがNに等しくなければ(S236のN)、カウント値kを1インクリメントして(S238)、S202に戻る。これにより、画像データにおいて複数の2次元コードを探索することが可能となる。カウント値kがNに等しくなると(S236のY)、以上により、コード部110の検出処理が終了する。   In S236, it is determined whether or not the count value k is equal to the set total number N of reference cells 100. If the count value k is not equal to N (N in S236), the count value k is incremented by 1 (S238). , Return to S202. This makes it possible to search for a plurality of two-dimensional codes in the image data. When the count value k is equal to N (Y in S236), the detection process of the code unit 110 is finished as described above.

図4に戻って、S24のコード部検出処理においてコード部110が検出されない場合(S26のN)、2次元コードの存在を確認できないため、2次元コードの認識処理を終了する。一方、コード部110が検出されると(S26のY)、コードデータの検証処理が実行される(S28)。   Returning to FIG. 4, when the code part 110 is not detected in the code part detection process of S24 (N of S26), since the presence of the two-dimensional code cannot be confirmed, the two-dimensional code recognition process is terminated. On the other hand, when the code part 110 is detected (Y in S26), a code data verification process is executed (S28).

図7は、コードデータの検証処理を示すフローチャートである。既述したように、33ビットのコードデータ中、所定のアルゴリズムで生成された9ビットのチェックデータと、24ビットの情報データとが存在し、この処理ではチェックデータを用いて、コードデータを検証する。以下では、所定のアルゴリズムで生成したチェックデータを、そのアルゴリズムに基づいてコードデータからチェックデータを生成して照合することで、コードデータを検証する処理を行う。   FIG. 7 is a flowchart showing a code data verification process. As described above, 9-bit check data generated by a predetermined algorithm and 24-bit information data exist in 33-bit code data. In this process, the check data is used to verify the code data. To do. In the following, a process for verifying code data is performed by generating check data from code data based on the check data generated by a predetermined algorithm and collating the check data.

まず、検証処理部56は、後のステップであるS304、S308で算出される基準値を、1ビット右方向にシフトする回数をカウントするカウンタの値pを1に初期設定する(S300)。次に、検証処理部56は、コード部110のコードマップから、コードデータおよびチェックデータの値を算出する(S302)。   First, the verification processing unit 56 initially sets a value p of a counter that counts the number of times the reference value calculated in subsequent steps S304 and S308 is shifted to the right by 1 bit to 1 (S300). Next, the verification processing unit 56 calculates code data and check data values from the code map of the code unit 110 (S302).

検証処理部56は、算出したコードデータの値(ビットストリーム)と、0xFFFFFFとの排他的論理和演算を行い(S304)、その結果得られた値(ビットストリーム)を基準値(基準ビットストリーム)とする。基準ビットストリームのLSB(Least Significant Bit)に"1"が立っているか否かを判定し(S306)、"1"が立っていないと判定した場合(S306のN)、検証処理部56は、基準値(基準ビットストリーム)と、0x8408との排他的論理和演算を行い(S308)、その結果得られた値(ビットストリーム)を新たな基準値(基準ビットストリーム)とし、S310に進む。LSBに"1"がたっている場合(S306のY)、同様にS310に進む。   The verification processing unit 56 performs an exclusive OR operation between the calculated code data value (bit stream) and 0xFFFFFF (S304), and uses the obtained value (bit stream) as a reference value (reference bit stream). And It is determined whether or not “1” is set in the LSB (Least Significant Bit) of the reference bitstream (S306). If it is determined that “1” is not set (N in S306), the verification processing unit 56 An exclusive OR operation of the reference value (reference bit stream) and 0x8408 is performed (S308), and the value (bit stream) obtained as a result is set as a new reference value (reference bit stream), and the process proceeds to S310. If “1” is in the LSB (Y in S306), the process proceeds to S310 in the same manner.

検証処理部56は、S304またはS308において算出した基準値(基準ビットストリーム)を1ビットだけ右にシフトさせ(S310)、カウント値pが、予め定めたシフト回数である24に等しいか否かを判定する(S312)。p=24ではないと判定した場合(S312のN)、カウント値pを1だけインクリメントした後(S314)、S306に戻る。   The verification processing unit 56 shifts the reference value (reference bit stream) calculated in S304 or S308 to the right by 1 bit (S310), and determines whether or not the count value p is equal to 24 which is a predetermined number of shifts. Determination is made (S312). If it is determined that p is not 24 (N in S312), the count value p is incremented by 1 (S314), and the process returns to S306.

p=24であると判定した場合(S312のY)、算出されたビットストリームと、0x1FFとの論理積演算を行う(S316)。検証処理部56は、論理積演算より得られ値が、算出したチェックデータの値と等しいか否かを判定し(S318)、等しいと判定した場合(S318のY)、図4のS24で検出されたコード部110が、2次元コードとして適正なパターンであるとし、2次元コードのコード部110を確定する(S320)。チェックコードと等しくなければ(S318のN)、コード部110の読み取りに誤りがあったことを判定して、コードデータの検証処理を終了する。なお、図7では1つのコード部110の検証処理のみを示しているが、複数のコード部110が検出されている場合は、それぞれについてこの検証処理を実行する。   When it is determined that p = 24 (Y in S312), a logical product operation of the calculated bit stream and 0x1FF is performed (S316). The verification processing unit 56 determines whether or not the value obtained by the logical product operation is equal to the calculated check data value (S318). If it is determined that the value is equal (Y in S318), it is detected in S24 of FIG. The code part 110 thus determined is an appropriate pattern as a two-dimensional code, and the code part 110 of the two-dimensional code is determined (S320). If it is not equal to the check code (N in S318), it is determined that there is an error in reading the code part 110, and the code data verification process is terminated. In FIG. 7, only the verification process for one code unit 110 is shown, but when a plurality of code units 110 are detected, this verification process is executed for each.

図4に戻って、S28のコードデータ検出処理においてコード部110が確定されない場合(S30のN)、2次元コードの存在を確認できないため、2次元コードの認識処理を終了する。一方、コード部110が確定されると(S30のY)、コードデータの値、すなわち、2次元コードの値を、例えばRAMに記憶させ、保持し(S32)、2次元コードの認識処理を終了する。   Returning to FIG. 4, when the code part 110 is not fixed in the code data detection process of S28 (N of S30), since the presence of the two-dimensional code cannot be confirmed, the two-dimensional code recognition process is terminated. On the other hand, when the code part 110 is confirmed (Y in S30), the value of the code data, that is, the value of the two-dimensional code is stored in, for example, the RAM and held (S32), and the two-dimensional code recognition process is finished. To do.

以下に、3次元座標系におけるゲームカード4の位置および方向の求め方について説明する。ゲームカード4の仮想3次元座標系の位置および方向を求めるために、本実施例では、撮像装置2の画角、スクリーン解像度、4つのコーナーセル104のスクリーン座標位置、実際のコーナーセル104間の距離を利用する。なお、スクリーンとは、撮像装置2により撮像された画像を表示するディスプレイ7の画面である。   Hereinafter, a method for obtaining the position and direction of the game card 4 in the three-dimensional coordinate system will be described. In order to determine the position and direction of the virtual three-dimensional coordinate system of the game card 4, in this embodiment, the angle of view of the imaging device 2, the screen resolution, the screen coordinate positions of the four corner cells 104, and the actual corner cells 104 Use distance. The screen is a screen of the display 7 that displays an image captured by the imaging device 2.

(ステップ1)
まず、視点からスクリーン投影面までの距離を求める。ここでは、カメラの画角とスクリーン解像度により、視点からスクリーン投影面までの距離を求める。
カメラの水平方向の画角:θ
スクリーンの水平方向の解像度:W
視点からスクリーン投影面までの距離:P
とすると、以下の計算式が成り立つ。
P=(W×0.5)/tan(θ×0.5)
(Step 1)
First, the distance from the viewpoint to the screen projection plane is obtained. Here, the distance from the viewpoint to the screen projection plane is obtained from the angle of view of the camera and the screen resolution.
Camera horizontal angle of view: θ
Screen horizontal resolution: W
Distance from viewpoint to screen projection plane: P
Then, the following calculation formula holds.
P = (W × 0.5) / tan (θ × 0.5)

(ステップ2)
次に、視点から各コーナーセル104に伸びる3次元ベクトルを求める。
コーナーセルのスクリーン座標位置:SX、SY
視点からスクリーン投影面までの距離:P
コーナーセルへ伸びる3次元ベクトル:V
とすると、以下の計算式が成り立つ。
V=(SX,SY,P)
なお、スクリーン座標位置は、スクリーンの中央を原点としている。
(Step 2)
Next, a three-dimensional vector extending from the viewpoint to each corner cell 104 is obtained.
Corner cell screen coordinate position: SX, SY
Distance from viewpoint to screen projection plane: P
3D vector extending to the corner cell: V
Then, the following calculation formula holds.
V = (SX, SY, P)
Note that the screen coordinate position has the origin at the center of the screen.

(ステップ3)
視点と、隣り合う2つのコーナーセルの3点が形成する平面の法線ベクトルを求める。この法線ベクトルは、合計で4つ生成される。
視点からコーナーセル104aへ伸びる3次元ベクトル:V1
視点からコーナーセル104bへ伸びる3次元ベクトル:V2
視点からコーナーセル104cへ伸びる3次元ベクトル:V3
視点からコーナーセル104dへ伸びる3次元ベクトル:V4
視点とコーナーセル104a、104bが形成する平面の法線ベクトル:S12
視点とコーナーセル104b、104cが形成する平面の法線ベクトル:S23
視点とコーナーセル104c、104dが形成する平面の法線ベクトル:S34
視点とコーナーセル104d、104aが形成する平面の法線ベクトル:S41
とすると、以下の計算式が成り立つ。
S12=V1×V2
S23=V2×V3
S34=V3×V4
S41=V4×V1
なお、「×」は、外積を指す。
(Step 3)
A normal vector of a plane formed by the viewpoint and three points of two adjacent corner cells is obtained. A total of four normal vectors are generated.
A three-dimensional vector extending from the viewpoint to the corner cell 104a: V1
A three-dimensional vector extending from the viewpoint to the corner cell 104b: V2
A three-dimensional vector extending from the viewpoint to the corner cell 104c: V3
A three-dimensional vector extending from the viewpoint to the corner cell 104d: V4
Normal vector of the plane formed by the viewpoint and the corner cells 104a and 104b: S12
Normal vector of the plane formed by the viewpoint and the corner cells 104b and 104c: S23
Normal vector of the plane formed by the viewpoint and the corner cells 104c and 104d: S34
Normal vector of the plane formed by the viewpoint and the corner cells 104d and 104a: S41
Then, the following calculation formula holds.
S12 = V1 × V2
S23 = V2 × V3
S34 = V3 × V4
S41 = V4 × V1
“X” indicates an outer product.

(ステップ4)
続いて、ゲームカード4の3次元上での方向(座標軸)を求める。ステップ3で求めた4つの法線ベクトルをもとに、カードの座標軸が求まる。
カードのローカル座標X軸(カード表面に対して左右方向):VX
カードのローカル座標Y軸(カード表面に対して貫く方向):VY
カードのローカル座標Z軸(カード表面に対して上下方向):VZ
とすると、以下の計算式が成り立つ。
VX=S12×S34
VZ=S23×S41
VY=VZ×VX
(Step 4)
Subsequently, the direction (coordinate axis) of the game card 4 in three dimensions is obtained. Based on the four normal vectors obtained in step 3, the coordinate axes of the card are obtained.
Card local coordinate X-axis (horizontal direction with respect to the card surface): VX
Card local coordinate Y-axis (direction penetrating the card surface): VY
Card local coordinate Z-axis (vertical direction with respect to the card surface): VZ
Then, the following calculation formula holds.
VX = S12 × S34
VZ = S23 × S41
VY = VZ × VX

(ステップ5)
最後に、ゲームカード4の3次元上での位置を求める。ステップ4では、ゲームカード4のローカル座標変換マトリクスを求めたが、現実のコーナーセル間の距離が分かれば、カードの位置は容易に求められる。コーナーセル104aの3次元座標位置を変数として表現すると、その変数を使ってコーナーセル104b、104c、104dの3次元座標位置を表すことができる。4つのコーナーセルのスクリーン座標位置は判明しているため、これらの計算式の連立方程式を解くことで、ゲームカード4の3次元座標位置を特定できる。
(Step 5)
Finally, the three-dimensional position of the game card 4 is obtained. In step 4, the local coordinate transformation matrix of the game card 4 is obtained. If the actual distance between corner cells is known, the position of the card can be easily obtained. If the three-dimensional coordinate position of the corner cell 104a is expressed as a variable, the three-dimensional coordinate positions of the corner cells 104b, 104c, and 104d can be expressed using the variable. Since the screen coordinate positions of the four corner cells are known, the three-dimensional coordinate position of the game card 4 can be specified by solving the simultaneous equations of these calculation formulas.

以上の実施例に示したように、図2に示す2次元コードを利用することで、コード部110におけるコーナーセル104の認識率を高めることができるとともに、2次元座標系におけるコーナーセル104の座標位置を正確に求めることが可能となる。具体的には、コーナーセル104を大きく形成することで、コーナーセル104の中心位置を正確に求めることができるため、ゲームカード4の位置を正確に特定できる。また、複数のコーナーセル104の中心位置を正確に求めることで、基準セル100とコーナーセル104との位置関係を正確に把握して、アフィン変換の精度を高めることができ、ゲームカード4の位置やゲームカード4が向いている方向などを正確に特定できる。   As shown in the above embodiment, by using the two-dimensional code shown in FIG. 2, the recognition rate of the corner cell 104 in the code unit 110 can be increased, and the coordinates of the corner cell 104 in the two-dimensional coordinate system are used. The position can be obtained accurately. Specifically, since the center position of the corner cell 104 can be accurately obtained by forming the corner cell 104 large, the position of the game card 4 can be accurately identified. In addition, by accurately determining the center positions of the plurality of corner cells 104, the positional relationship between the reference cell 100 and the corner cells 104 can be accurately grasped, and the accuracy of affine transformation can be improved. And the direction in which the game card 4 is facing can be accurately specified.

図8は、ゲームカードの表面に印刷した2次元コードの別の例を示す。ゲームカード4の表面には、所定の形状を有する基準セル100およびコード部110が配置されている。図2の2次元コードと比較すると、図8に示す2次元コードでは、コードデータ部分102を取り囲む複数のコーナーセル104a、104b、104c、104dが円形に形成されている。既述したように、コーナーセル104の2次元座標位置は、コーナーセル104の中心点により特定される。コーナーセル104が丸い形状を有することで、撮像装置2に対するゲームカード4の向きによらず、撮像装置2により撮像されるコーナーセル104の形状は変化しない。そのため、撮像装置2に対する向きによって、コーナーセル104の中心点が変わらず、したがって安定して中心点を取得することが可能となる。これにより、既述したように、ゲームカード4の位置情報、方向情報、距離情報を正確に求めることが可能となる。なお、方形セル106を丸く形成してもよい。また、コーナーセル104を円形にするだけでなく、図2に関して説明したように、方形セル106に対して大きく形成することで、コーナーセル104の座標位置をさらに高精度に求めることが可能となる。   FIG. 8 shows another example of the two-dimensional code printed on the surface of the game card. A reference cell 100 and a code portion 110 having a predetermined shape are arranged on the surface of the game card 4. Compared with the two-dimensional code of FIG. 2, in the two-dimensional code shown in FIG. 8, a plurality of corner cells 104a, 104b, 104c, 104d surrounding the code data portion 102 are formed in a circle. As described above, the two-dimensional coordinate position of the corner cell 104 is specified by the center point of the corner cell 104. Since the corner cell 104 has a round shape, the shape of the corner cell 104 imaged by the imaging device 2 does not change regardless of the orientation of the game card 4 with respect to the imaging device 2. For this reason, the center point of the corner cell 104 does not change depending on the orientation with respect to the imaging device 2, and thus the center point can be acquired stably. Thereby, as described above, the position information, direction information, and distance information of the game card 4 can be accurately obtained. Note that the square cell 106 may be formed in a round shape. In addition to making the corner cell 104 circular, as described with reference to FIG. 2, it is possible to obtain the coordinate position of the corner cell 104 with higher accuracy by forming it larger than the rectangular cell 106. .

図9は、ゲームカードの表面に印刷した2次元コードのさらに別の例を示す。ゲームカード4の表面には、基準セル100およびコード部110が配置されている。図2の2次元コードと比較すると、図9に示す2次元コードでは、所定の形状を有する基準セル100、それぞれ2次元配置することでコードデータを構成する複数の方形セル106、コードデータ部分102の領域を取り囲むように配置される複数のコーナーセル104の少なくとも1つのセルが、他のセルと異なる色を付けられる。例えば、基準セル100に赤色、方形セル106に緑色、コーナーセル104に青色とそれぞれのセルに異なる色を割り当ててもよい。なお、ここで割り当てる色は、撮像装置2において取り込んで、所定の輝度閾値を基準として2値化できる色であればよく、必ずしも人間の目に可視であることは要求されない。使用する撮像装置2の撮像特性が予め分かっている場合は、その特性に合わせてセルを色づけしてもよい。   FIG. 9 shows still another example of the two-dimensional code printed on the surface of the game card. A reference cell 100 and a code portion 110 are arranged on the surface of the game card 4. Compared with the two-dimensional code of FIG. 2, in the two-dimensional code shown in FIG. 9, a reference cell 100 having a predetermined shape, a plurality of rectangular cells 106 constituting code data by being arranged two-dimensionally, and a code data portion 102 At least one cell of the plurality of corner cells 104 arranged so as to surround the region is colored differently from the other cells. For example, red may be assigned to the reference cell 100, green may be assigned to the square cell 106, blue may be assigned to the corner cell 104, and different colors may be assigned to the respective cells. The color assigned here may be any color that can be captured by the imaging apparatus 2 and binarized with a predetermined luminance threshold as a reference, and is not necessarily required to be visible to the human eye. When the imaging characteristics of the imaging apparatus 2 to be used are known in advance, the cells may be colored according to the characteristics.

本実施例の2次元コードの認識処理では、図4のS20に示すように、まず基準セル100を検出することが条件となる。2次元コードの認識処理全体のなかでも、この基準セル検出処理の負荷は高く、したがって、画像データ中から基準セル100を効率的に抽出できることが好ましい。そこで、複数種類のセルのうち、少なくとも基準セル100には、方形セル106およびコーナーセル104とは異なる色をつけることが好ましい。   In the recognition process of the two-dimensional code of the present embodiment, as shown in S20 of FIG. Among the entire two-dimensional code recognition processes, the load of the reference cell detection process is high. Therefore, it is preferable that the reference cell 100 can be efficiently extracted from the image data. Therefore, it is preferable that at least the reference cell 100 among the plurality of types of cells is colored differently from the rectangular cell 106 and the corner cell 104.

撮像装置2の受光面の前面にはRGBのカラーフィルタが配置されており、フレーム画像ごとに、RGBのそれぞれの画素値が256階調で表現されたデータとして記録される。この例において、2値化処理部50が、2値化処理するためのRGBの画素値の範囲を設定する機能をもつ。基準セル100が赤色で塗りつぶされている場合、図4のS10の2値化処理において、2値化処理部50が、基準セル用のRGBの画素値の範囲を設定する。例えば、2値化処理部50は、赤色(R)の画素値の範囲を200〜255、緑色(G)の画素値の範囲を0〜100、青色(B)の画素値の範囲を0〜100と設定する。この設定に基づいて、2値化処理部50は、この範囲内にあるRGBの複合画素を抽出して、その画素値を"1"に符号化する。例えば、R画素値が225、G画素値が30、B画素値が50となる複合画素の画素値は"1"に符号化され、2値画像としての色が黒色に設定される。一方、RGBの画素値がこれらの範囲内にない複合画素の画素値は"0"に符号化され、2値画像としての色が白色に設定される。このように、赤色の画素を画像データから抽出することで、図4のS12において、2値画像において黒色画素となる連結領域をラベリングすることができる。黒色画素として抽出する画素を画像データにおいて特定の色、ここでは赤色のものに限定することで、抽出するノイズの数を少なくでき、基準セル検出部52は、フレーム画像の2値化データから基準セル100を検出する時間を短縮できる。   An RGB color filter is arranged in front of the light receiving surface of the imaging device 2, and each pixel value of RGB is recorded as data expressed in 256 gradations for each frame image. In this example, the binarization processing unit 50 has a function of setting a range of RGB pixel values for binarization processing. When the reference cell 100 is painted red, the binarization processing unit 50 sets a range of RGB pixel values for the reference cell in the binarization process of S10 of FIG. For example, the binarization processing unit 50 has a red (R) pixel value range of 200 to 255, a green (G) pixel value range of 0 to 100, and a blue (B) pixel value range of 0 to 0. Set to 100. Based on this setting, the binarization processing unit 50 extracts RGB composite pixels within this range, and encodes the pixel values to “1”. For example, the pixel value of the composite pixel in which the R pixel value is 225, the G pixel value is 30, and the B pixel value is 50 is encoded as “1”, and the color as the binary image is set to black. On the other hand, the pixel value of the composite pixel whose RGB pixel value is not within these ranges is encoded to “0”, and the color as the binary image is set to white. As described above, by extracting the red pixels from the image data, it is possible to label connected regions that are black pixels in the binary image in S12 of FIG. The number of noises to be extracted can be reduced by limiting the pixels to be extracted as black pixels to a specific color in the image data, in this case, red, and the reference cell detection unit 52 can extract the reference data from the binarized data of the frame image. The time for detecting the cell 100 can be shortened.

なお、画素値はカラーフィルタ特性の影響を受けるため、カラーフィルタの特性も加味した画素値の範囲設定を行うために、ゲームカード4を台3に配置した状態で、基準セル100の赤色の画素値を調査してもよい。これにより、撮像装置2において取得される基準セル100のRGBの画素値を特定することができ、特定した画素値に若干のマージンを与えた範囲で2値化処理を行うことで、検出する黒色画素連結領域の数を飛躍的に少なくすることが可能となる。特に、ゲームシステム1においては、リアルタイムで処理することが好ましいため、基準セル100を効率的に抽出できることには、大きなメリットがある。   Since the pixel value is affected by the color filter characteristics, the red pixel of the reference cell 100 is placed with the game card 4 placed on the table 3 in order to set a range of pixel values that also consider the color filter characteristics. The value may be investigated. As a result, the RGB pixel value of the reference cell 100 acquired in the imaging device 2 can be specified, and the black value to be detected by performing binarization processing in a range in which a slight margin is given to the specified pixel value. It is possible to dramatically reduce the number of pixel connection regions. In particular, in the game system 1, since it is preferable to perform processing in real time, there is a great merit that the reference cell 100 can be efficiently extracted.

なお、他の種類のセル、例えばコーナーセル104、方形セル106に色づけを施した場合も同様である。コーナーセル104を青色とする場合、図4のS10において、2値化処理部50が、コーナーセル用のRGBの画素値の範囲を設定する。例えば、2値化処理部50は、赤色(R)の画素値の範囲を0〜100、緑色(G)の画素値の範囲を0〜100、青色(B)の画素値の範囲を200〜255と設定する。この設定に基づいて、2値化処理部50は、この範囲内にあるRGBの複合画素を抽出して、その画素値を"1"に符号化する。例えば、R画素値が20、G画素値が30、B画素値が240となる複合画素の画素値は"1"に符号化され、2値画像としての色が黒色に設定される。一方、RGBの画素値がこれらの範囲内にない複合画素の画素値は"0"に符号化され、2値画像としての色が白色に設定される。このように、青色の画素を画像データから抽出することで、図4のS12において、2値画像において黒色画素となる連結領域をラベリングすることができる。   The same applies to the case where other types of cells, for example, the corner cell 104 and the rectangular cell 106 are colored. When the corner cell 104 is blue, in S10 of FIG. 4, the binarization processing unit 50 sets a range of RGB pixel values for the corner cell. For example, the binarization processing unit 50 has a red (R) pixel value range of 0 to 100, a green (G) pixel value range of 0 to 100, and a blue (B) pixel value range of 200 to 200. Set to 255. Based on this setting, the binarization processing unit 50 extracts RGB composite pixels within this range, and encodes the pixel values to “1”. For example, the pixel value of the composite pixel in which the R pixel value is 20, the G pixel value is 30, and the B pixel value is 240 is encoded as “1”, and the color as the binary image is set to black. On the other hand, the pixel value of the composite pixel whose RGB pixel value is not within these ranges is encoded to “0”, and the color as the binary image is set to white. In this way, by extracting blue pixels from the image data, it is possible to label connected regions that are black pixels in the binary image in S12 of FIG.

このように、青色の強い画像を黒色画像に変換する2値化処理を行ってから、S12において黒色画素連結領域としてラベリングされたものを、コード部検出部54が、図6のフローに示すコーナーセル候補領域として選択するために利用する。黒色画素として抽出する画素を画像データにおいて特定の色、ここでは青色のものに限定することで、抽出するノイズの数を少なくでき、コード部検出部54は、フレーム画像の2値化データからコーナーセル104を検出する時間を短縮できる。方形セル106を緑色とした場合は、図4のS10において緑色の強い画像を黒色画像に変換する2値化処理を行ってから、S12において黒色画素連結領域としてラベリングされたものを、図6のS222のコードマップ生成処理に利用する。3種類のセルに異なる色づけをした場合、2値化処理をする回数が増えることになるが、2値化処理した後の連結領域を探索する処理量が大幅に低減されるため、全体的な効率化を実現できる。   In this way, after performing the binarization processing for converting a strong blue image into a black image, the code portion detection unit 54 performs the corner shown in the flow of FIG. Used to select as a cell candidate area. The number of noises to be extracted can be reduced by limiting the pixels to be extracted as black pixels to a specific color in the image data, in this case, blue, and the code portion detection unit 54 can calculate the corner from the binarized data of the frame image. The time for detecting the cell 104 can be shortened. When the square cell 106 is green, the binarization process for converting a strong green image into a black image in S10 in FIG. 4 is performed, and then the black pixel connected region in S12 is labeled as shown in FIG. This is used for the code map generation process of S222. When three types of cells are colored differently, the number of times of binarization processing increases. However, since the processing amount for searching for a connected region after binarization processing is greatly reduced, Efficiency can be realized.

図9に示した2次元コードは、色づけしたセルを有しており、色づけしたセルは、大きく形成されてもよく、また図8に示すように、丸く形成されてもよい。   The two-dimensional code shown in FIG. 9 has colored cells, and the colored cells may be formed large, or may be formed round as shown in FIG.

図10は、ゲームカードの表面に印刷した2次元コードのさらに別の例を示す。ゲームカード4の表面には、基準セル100およびコード部110が配置されている。図10に示す2次元コードは、図9に示した2次元コードの一つの実施態様である。図10に示す2次元コードは、所定の形状を有する基準セル100、それぞれ2次元配置することでコードデータを構成する複数の方形セル106、コードデータ部分102の領域を取り囲むように配置される複数のコーナーセル104を備える。4つのコーナーセル104a、104b、104c、104dには全て同一の配色がなされるが、基準セル100および方形セル106とは異なる色を付けられる。   FIG. 10 shows still another example of the two-dimensional code printed on the surface of the game card. A reference cell 100 and a code portion 110 are arranged on the surface of the game card 4. The two-dimensional code shown in FIG. 10 is one embodiment of the two-dimensional code shown in FIG. The two-dimensional code shown in FIG. 10 includes a reference cell 100 having a predetermined shape, a plurality of rectangular cells 106 constituting code data by being arranged two-dimensionally, and a plurality of codes arranged so as to surround the area of the code data portion 102. The corner cell 104 is provided. The four corner cells 104a, 104b, 104c, and 104d have the same color scheme, but are colored differently from the reference cell 100 and the rectangular cell 106.

ゲームカード4の美観性を向上するために、コーナーセル104は、ゲームカード4の側縁まで設けられる。コーナーセル104はゲームカード4の4隅の近くに配置され、また方形セル106よりも大きく形成されるため、ゲームカード4の中で、4つのコーナーセル104は目立つ存在となる。本来、コーナーセル104は、方形セル106の存在位置を特定するために設けられるが、ゲームカード4として使用される以上は、美観性も重要である。そのためゲームカード4を縁取る枠縁107を、コーナーセル104の位置でコーナーセル104を取り囲むように内側に折れ曲げてデザイン的に変化をもたせることで、コーナーセル104に意匠性をもたせることとしている。   In order to improve the aesthetics of the game card 4, the corner cell 104 is provided up to the side edge of the game card 4. Since the corner cells 104 are arranged near the four corners of the game card 4 and are formed larger than the square cells 106, the four corner cells 104 are conspicuous in the game card 4. Originally, the corner cell 104 is provided in order to specify the location of the square cell 106, but aesthetics are also important as long as it is used as the game card 4. Therefore, the corner cell 104 is designed to have a design by folding the frame edge 107 that borders the game card 4 inward so as to surround the corner cell 104 at the position of the corner cell 104. .

このようにコーナーセル104をゲームカード4の側縁に設ける場合、コーナーセル104は、黒色以外の色をつけられることが好ましい。仮に黒色を割り当てた場合、ゲームカード4を撮像装置2で撮像して2値化処理を施すと、ゲームカード4の縁部に生じる影も黒色画素として変換されることがあり、黒色画素に変換された2つのコーナーセル104が、ゲームカード4の縁部の影で連結される状況が想定される。2値化処理により2つのコーナーセル104が連結されると、連結した黒色画素から2つのコーナーセル104を分離することは難しくなる。そのため、コーナーセル104に黒色以外の色を割り当て、2値化する際のRGBの閾値、すなわちRGBの範囲を適切に設定して2値化処理することで、ゲームカード4の縁部の影によりコーナーセル104が連結される事態を回避することが可能となる。このように、コーナーセル104をゲームカード4の側縁まで設けた場合には、影の色以外の色、すなわち黒色以外の色を割り当てることで、コーナーセル104を適切に抽出することが可能となる。   Thus, when providing the corner cell 104 in the side edge of the game card 4, it is preferable that the corner cell 104 is given colors other than black. If black is assigned, when the game card 4 is imaged by the imaging device 2 and binarized, the shadow generated at the edge of the game card 4 may be converted as a black pixel. It is assumed that the two corner cells 104 are connected by the shadow of the edge of the game card 4. When the two corner cells 104 are connected by the binarization process, it is difficult to separate the two corner cells 104 from the connected black pixels. Therefore, by assigning a color other than black to the corner cell 104 and performing binarization processing by appropriately setting the RGB threshold when binarizing, that is, the RGB range, the shadow of the edge of the game card 4 It is possible to avoid a situation where the corner cells 104 are connected. Thus, when the corner cell 104 is provided up to the side edge of the game card 4, it is possible to appropriately extract the corner cell 104 by assigning a color other than the shadow color, that is, a color other than black. Become.

また、図10に示すゲームカード4においては、コーナーセル104が三角形状に構成される。この形状は、正三角形であってもよい。コーナーセル104を正三角形とすることで、コーナーセル104の認識精度を高めることができる。   In the game card 4 shown in FIG. 10, the corner cell 104 is formed in a triangular shape. This shape may be an equilateral triangle. By making the corner cell 104 an equilateral triangle, the recognition accuracy of the corner cell 104 can be increased.

図11(a)〜図11(c)は、取得した黒色画素がコーナーセル104であるか否かを判別する方法を説明するための説明図である。既述したように、コーナーセル104は、フレーム画像を2値化したあと、黒色画素の連結領域をもとに判別される。2値化されたフレーム画像は、2次元のXY座標上に表現されるため、この連結領域の座標値を利用して、連結領域がコーナーセル104であるか否かを判別することができる。   FIG. 11A to FIG. 11C are explanatory diagrams for explaining a method of determining whether or not the acquired black pixel is the corner cell 104. As described above, the corner cell 104 is discriminated based on the connected area of black pixels after binarizing the frame image. Since the binarized frame image is expressed on the two-dimensional XY coordinates, it is possible to determine whether or not the connected area is the corner cell 104 by using the coordinate value of the connected area.

図11(a)は、フレーム画像から抽出された連結領域の一例を示す。この連結領域109aは、X軸方向の幅をH、Y軸方向の幅をVとする。なお、この幅は、2次元座標上の画素数でカウントする。この連結領域109aの画素数をCとした場合、この連結領域109aがコーナーセル104の候補であるか否かは、以下の式で判別される。
α×H×V≦ C ≦β×H×V(α<β<1)
例えばαは0.3、βは0.7である。
連結領域109aの画素数Cが、上式を満たす場合、この連結領域109aをコーナーセル104の候補であると判別してもよい。当然のことながら、定数α、βの値は、他の値に設定してもよい。
Fig.11 (a) shows an example of the connection area | region extracted from the frame image. The connecting region 109a has a width in the X-axis direction as H 1 and a width in the Y-axis direction as V 1 . This width is counted by the number of pixels on the two-dimensional coordinate. If the number of pixels the coupling region 109a and the C 1, the connection region 109a is whether a candidate for corner cell 104, is determined by the following equation.
α × H 1 × V 1 ≦ C 1 ≦ β × H 1 × V 1 (α <β <1)
For example, α is 0.3 and β is 0.7.
Pixel number C 1 of the connecting region 109a is, if satisfying the above equation, the coupling region 109a may be determined to be a candidate of the corner cells 104. Naturally, the values of the constants α and β may be set to other values.

図11(b)は、フレーム画像から抽出された連結領域の別の例を示す。この連結領域109bがコーナーセル104の候補であるか否かは、同様に以下の式で判別される。この連結領域109bの画素数をC、X軸方向の幅をH、Y軸方向の幅をVとする。
α×H×V≦ C ≦β×H×V(α<β<1)
図11(a)および図11(b)に示す連結領域は、それぞれ判別式を満たしており、コーナーセル104の候補であると判別された例である。図11(a)および図11(b)に示されるように、フレーム画像において、ゲームカード4は様々な角度で撮像領域5中に配置されている可能性があるが、上記した判別式を利用することで、三角形状のコーナーセル104を適切に認識することが可能となる。
FIG. 11B shows another example of the connected area extracted from the frame image. Whether or not this connected area 109b is a candidate for the corner cell 104 is similarly determined by the following equation. The number of pixels the connecting region 109b C 2, the width of the X-axis direction to the width of the H 2, Y-axis and V 2.
α × H 2 × V 2 ≦ C 2 ≦ β × H 2 × V 2 (α <β <1)
The connected regions shown in FIGS. 11A and 11B each satisfy the discriminant, and are examples in which it is determined that the corner cell 104 is a candidate. As shown in FIG. 11A and FIG. 11B, in the frame image, the game card 4 may be arranged in the imaging region 5 at various angles, but the above discriminant is used. By doing so, it becomes possible to appropriately recognize the triangular corner cell 104.

図11(c)は、フレーム画像から抽出された連結領域のさらに別の例を示す。この場合、連結領域109cの画素数Cは、α×H(X軸方向の幅)×V(Y軸方向の幅)よりも小さい。すなわち、
< α×H×V
の関係が成立する。これは、判別式(α×H×V≦ C ≦β×H×V)を満足するものではないため、図11(c)に示す連結領域109cは、コーナーセル104ではないことが判別される。
FIG. 11C shows still another example of the connected area extracted from the frame image. In this case, the number of pixels C 3 in the connection region 109c is smaller than α × H 3 (width in the X-axis direction) × V 3 (width in the Y-axis direction). That is,
C 3 <α × H 3 × V 3
The relationship is established. Since this does not satisfy the discriminant (α × H 3 × V 3 ≦ C 3 ≦ β × H 3 × V 3 ), the connection region 109 c shown in FIG. 11C is not the corner cell 104. Is determined.

以上のように、コーナーセル104の形状を三角形とすることで、2次元座標上の座標値を利用して、簡単にコーナーセル104の候補を抽出することができる。またコーナーセル104の形状を正三角形とすると、他の三角形状と比較して、上記判別式で判定する際の方向依存性を低減できるため、コーナーセル104の認識精度をより高めることができる。
なお、図10に示すゲームカード4においては、方形セル106で構成されるコードデータ部分102を、カード下方のコーナーセル104c、104dの間に配置する。これにより、ゲームカード4の中央部分にスペースを作ることができ、そこにキャラクタの絵などを印刷することが可能となる。
As described above, by setting the shape of the corner cell 104 to a triangle, a candidate for the corner cell 104 can be easily extracted using the coordinate values on the two-dimensional coordinates. In addition, when the shape of the corner cell 104 is an equilateral triangle, the direction dependency at the time of determination by the discriminant can be reduced as compared with other triangular shapes, so that the recognition accuracy of the corner cell 104 can be further increased.
In the game card 4 shown in FIG. 10, the code data portion 102 composed of the square cells 106 is arranged between the corner cells 104c and 104d below the card. As a result, a space can be created in the central portion of the game card 4, and a character picture or the like can be printed there.

図12は、ゲームカードの表面に印刷した2次元コードのさらに別の例を示す。図12に示すゲームカード4では、図10に示すゲームカード4と同様に、コーナーセル104がゲームカード4の側縁から設けられている。このコーナーセル104は三角形状に形成され、基準セル100およびコードデータ部分102a、102bとは異なる色を付けられる。   FIG. 12 shows still another example of the two-dimensional code printed on the surface of the game card. In the game card 4 shown in FIG. 12, the corner cell 104 is provided from the side edge of the game card 4 similarly to the game card 4 shown in FIG. The corner cell 104 is formed in a triangular shape, and is colored differently from the reference cell 100 and the code data portions 102a and 102b.

図12に示すゲームカード4では、方形セル106を設ける領域が2つに分離される。ここでは、2つのコードデータ部分102a、102bが、4つのコーナーセル104a、104b、104c、104dより取り囲まれる領域以外の部分に配置される。コードデータ部分102aは、基準セル100とゲームカード4の上縁との間に形成され、コードデータ部分102bは、コーナーセル104cおよび104dを結んだラインとゲームカード4の下縁との間に形成される。なお、コーナーセル104cおよび104dを結ぶラインとは、カード内向きの三角形頂点同士を結んだラインである。コードデータ部分102aおよびコードデータ部分102bを、4つのコーナーセル104で囲まれる領域の外に配置することで、ゲームカード4の中央領域のスペースを広くとることができ、そこにキャラクタの絵などを印刷することが可能となる。コードデータ部分102aおよび102bは、それぞれ12ビットの情報を記録することができ、したがって合計24ビットの情報量を保持できる。なお、ゲームカード4の下方に配置されたコードデータ部分102bは、基準セル100と誤認識されることを防ぐために、所定のビット長、例えば3ビット以上連続して着色されないようにすることが望ましい。   In the game card 4 shown in FIG. 12, the area in which the square cell 106 is provided is separated into two. Here, the two code data portions 102a and 102b are arranged in a portion other than the region surrounded by the four corner cells 104a, 104b, 104c, and 104d. The code data portion 102a is formed between the reference cell 100 and the upper edge of the game card 4, and the code data portion 102b is formed between the line connecting the corner cells 104c and 104d and the lower edge of the game card 4. Is done. The line connecting the corner cells 104c and 104d is a line connecting triangle vertices facing inward of the card. By arranging the code data portion 102a and the code data portion 102b outside the area surrounded by the four corner cells 104, a space in the central area of the game card 4 can be widened, and a character picture or the like can be provided there. It becomes possible to print. Each of the code data portions 102a and 102b can record 12 bits of information, and thus can hold a total of 24 bits of information. It is desirable that the code data portion 102b arranged below the game card 4 is not continuously colored for a predetermined bit length, for example, 3 bits or more, in order to prevent erroneous recognition as the reference cell 100. .

図12の方形セル106を認識する際には、既に基準セル100と、左下および右下のコーナーセル104d、104cが検出されているため、これらの近傍を探索することで、コードデータ部分102aおよび102bを容易に検出することができる。すなわち、コードデータ部分102aは、基準セル100に対してコーナーセル104cおよび104dの反対側に存在し、コードデータ部分102bは、コーナーセル104cおよび104dに対して基準セル100の反対側に存在する。基準セル100とコードデータ部分102aとを近傍に設定し、またコーナーセル104cおよび104dとコードデータ部分102bとを近傍に設定することで、コードデータ部分102の探索効率を高めることが可能となる。   When recognizing the rectangular cell 106 in FIG. 12, since the reference cell 100 and the lower left and lower right corner cells 104d and 104c have already been detected, the code data portion 102a and 102b can be easily detected. That is, the code data portion 102a exists on the opposite side of the corner cells 104c and 104d with respect to the reference cell 100, and the code data portion 102b exists on the opposite side of the reference cell 100 with respect to the corner cells 104c and 104d. By setting the reference cell 100 and the code data portion 102a in the vicinity and setting the corner cells 104c and 104d and the code data portion 102b in the vicinity, the search efficiency of the code data portion 102 can be improved.

なお、図12のゲームカード4においては、コードデータ部分102aおよび102bとが2つに分離した配置を示したが、コードデータ部分102aおよび102bは、隣接して配置されてもよい。すなわち、コードデータ部分102aおよび102bは、基準セル100とゲームカード4の上縁の間に配置されてもよく、またコーナーセル104dおよび104cとゲームカード4の下縁の間に配置されてもよい。   In the game card 4 of FIG. 12, the code data portions 102a and 102b are shown in two separate arrangements, but the code data portions 102a and 102b may be arranged adjacent to each other. That is, the code data portions 102 a and 102 b may be disposed between the reference cell 100 and the upper edge of the game card 4, and may be disposed between the corner cells 104 d and 104 c and the lower edge of the game card 4. .

なお以上は、ゲームカード4を台3上で動かしているが、台3にゲーム用マットを置いて、その上でゲームカード4を動かしてもよい。
図13は、ゲーム用カードを配置するためのゲーム用マットを示す。図1を参照して、ゲーム用マット300は、撮像装置2の撮像領域5に入るように台3に置かれる。ゲーム用マット300は、フェルト生地などの柔らかい素材で作製されて、使用しない間はコンパクトに丸めて収納できることが好ましい。
Although the game card 4 is moved on the table 3 as described above, a game mat may be placed on the table 3 and the game card 4 may be moved thereon.
FIG. 13 shows a game mat for placing game cards. With reference to FIG. 1, the game mat 300 is placed on the table 3 so as to enter the imaging region 5 of the imaging device 2. The game mat 300 is preferably made of a soft material such as felt fabric and can be stored in a compact manner while not in use.

ゲーム用マット300には、複数の仕切り線304により、9つのマス302a、302b、302c、302d、302e、302f、302g、302h、302i(以下、総称する場合は、「マス302」と呼ぶ)が形成されている。ゲーム用マット300は、ゲームアプリケーションに応じて構成され、それぞれのマス302は、ゲームカード4を配置する区画を形成する。1人以上のユーザがゲームカード4をいずれかのマス302に置くと、画像解析装置20が、配置されたマス302を特定してゲームカード4の2次元コードを認識し、ゲーム装置30が、配置されたマスに応じたゲームストーリーを展開してもよい。図13に示すゲーム用マット300では3×3のマス302が形成されているが、マス302の数は、これに限るものではない。ユーザがゲームカード4を動かしてよい領域を「プレイエリア」と呼ぶと、図13に示すゲーム用マット300においては、マス302が形成された正方形の領域がプレイエリア306を形成する。ゲーム用マット300は、その全体が撮像領域5に入るように配置される必要はないが、少なくともプレイエリア306は撮像領域5に入っている必要がある。なお、ゲームカード4を自由に動かしてもよいゲームアプリケーションにおいては、マス302は形成されなくてもよい。   The game mat 300 has nine squares 302a, 302b, 302c, 302d, 302e, 302f, 302g, 302h, and 302i (hereinafter collectively referred to as “mass 302”) by a plurality of partition lines 304. Is formed. The game mat 300 is configured according to the game application, and each cell 302 forms a section in which the game card 4 is placed. When one or more users place the game card 4 on one of the squares 302, the image analysis device 20 identifies the placed square 302, recognizes the two-dimensional code of the game card 4, and the game apparatus 30 You may develop the game story according to the arranged cell. In the game mat 300 shown in FIG. 13, 3 × 3 squares 302 are formed, but the number of squares 302 is not limited to this. When an area where the user can move the game card 4 is called a “play area”, in the game mat 300 shown in FIG. 13, a square area in which a square 302 is formed forms a play area 306. The game mat 300 does not have to be arranged so that the entire game mat 300 enters the imaging region 5, but at least the play area 306 needs to enter the imaging region 5. Note that in the game application in which the game card 4 may be moved freely, the square 302 may not be formed.

ゲーム用マット300において、プレイエリア306の4隅に、段階的に明度が変化するグラデーション領域310a、310b、310c、310d(以下、総称する場合は、「グラデーション領域310」と呼ぶ)が設けられる。色には、色相、明度、彩度の3つの属性があるが、グラデーション領域310は、一つの色相の明度を変化させることで構成され、彩度については変化させなくてもよい。グラデーション領域310の外縁は円形であり、グラデーション領域310の中心から外縁に向かう方向に、高明度から低明度に明度が同心円状に段階的に変化している。   In the game mat 300, gradation areas 310 a, 310 b, 310 c, and 310 d (hereinafter collectively referred to as “gradation areas 310”) whose brightness changes in stages are provided at the four corners of the play area 306. A color has three attributes of hue, brightness, and saturation, but the gradation area 310 is configured by changing the brightness of one hue, and the saturation need not be changed. The outer edge of the gradation region 310 is circular, and the lightness changes in a concentric manner from high lightness to low lightness in a direction from the center of the gradation region 310 toward the outer edge.

図14は、グラデーション領域の外観を示す。グラデーション領域310は、一つの色相で構成され、その色相において段階的に明度を変化させて構成される。色相は、赤、緑、青といった色合いの違いを表し、明度は明るさの違いを表す。ここではグラデーション領域310が色相をもち、すなわち有彩色で表現される場合を想定している。なお、白、黒、グレーなどの無彩色には色相は存在していないが、グラデーション領域310を、白から黒に明度を段階的に変化して構成することも可能である。グラデーション領域310における明度の相違は、RGBフィルタを介してデジタル化される際、輝度の相違として取得される。   FIG. 14 shows the appearance of the gradation area. The gradation area 310 is composed of one hue, and the brightness is gradually changed in the hue. Hue represents a difference in hue such as red, green, and blue, and lightness represents a difference in brightness. Here, it is assumed that the gradation region 310 has a hue, that is, is expressed by a chromatic color. It should be noted that although there is no hue in achromatic colors such as white, black, and gray, the gradation region 310 can be configured by changing the brightness from white to black in stages. The difference in brightness in the gradation area 310 is acquired as a difference in brightness when digitized via the RGB filter.

このように、グラデーション領域310の外縁312の明度が低く、中心314の明度は高く設定される。すなわち、このグラデーション領域310は、外側が濃い有彩色の領域をもち、内側が白く構成される。4つのグラデーション領域310は、4つ全てを同色で構成してもよいが、少なくとも1つの色を変えることでゲーム用マット300の向きを定めるための指標として利用することができる。例えば、3つのグラデーション領域310a、310b、310cを同一の色相で構成し、1つのグラデーション領域310dを別の色相で構成してもよい。このとき、4つのグラデーション領域310を検出することができれば、グラデーション領域310a、310b、310cに対するグラデーション領域310dの位置が既知であるため、ゲーム用マット300の向きを特定することが可能となる。   Thus, the brightness of the outer edge 312 of the gradation area 310 is set low, and the brightness of the center 314 is set high. That is, the gradation area 310 has a dark chromatic area on the outside and white on the inside. The four gradation areas 310 may all be configured with the same color, but can be used as an index for determining the orientation of the game mat 300 by changing at least one color. For example, three gradation areas 310a, 310b, and 310c may be configured with the same hue, and one gradation area 310d may be configured with a different hue. At this time, if the four gradation areas 310 can be detected, the position of the gradation area 310d with respect to the gradation areas 310a, 310b, and 310c is known, so the orientation of the game mat 300 can be specified.

グラデーション領域310は、さらに、ゲームカード4の基準セル100、コーナーセル104および/または方形セル106の画像を2値化して抽出する際のRGBの画素値の閾値を決定するために利用される。例えば、コーナーセル104の色相が緑であり、所定の明度を有して構成されるものとする。このとき、グラデーション領域310の色相を緑に設定し、グラデーションの一部に、コーナーセル104と同一の明度をもつ領域を形成する。したがって、コーナーセル104と同一の明度をもつセル明度領域316が、グラデーション領域310の中心314から外縁312の間の所定位置に設定される。好適には、セル明度領域316は、中心314と外縁312の中間地点に同心円状に形成される。したがって、グラデーション領域310の半径方向において、セル明度領域316と中心314の間には、セル明度領域316よりも明度の高い領域が設けられ、またセル明度領域316と外縁312の間には、セル明度領域316よりも明度の低い領域が設けられる。   The gradation area 310 is further used to determine a threshold value of RGB pixel values when the image of the reference cell 100, the corner cell 104 and / or the rectangular cell 106 of the game card 4 is binarized and extracted. For example, it is assumed that the hue of the corner cell 104 is green and has a predetermined brightness. At this time, the hue of the gradation area 310 is set to green, and an area having the same brightness as the corner cell 104 is formed in a part of the gradation. Therefore, a cell brightness area 316 having the same brightness as the corner cell 104 is set at a predetermined position between the center 314 of the gradation area 310 and the outer edge 312. Preferably, the cell brightness region 316 is formed concentrically at a midpoint between the center 314 and the outer edge 312. Therefore, in the radial direction of the gradation area 310, an area having a higher brightness than the cell brightness area 316 is provided between the cell brightness area 316 and the center 314, and a cell between the cell brightness area 316 and the outer edge 312 is provided. A region having a lightness lower than that of the lightness region 316 is provided.

コーナーセル104と、グラデーション領域310のセル明度領域316とが、同一色相(G)で同一の輝度(階調)をもち、環境光などの影響がない場合には、Gフィルタを介して取得されるG画素値が、例えば127で表現されるものとする。2値化処理部50は、2値化処理するためにRGBの画素値の範囲を設定するが、コーナーセル104の画素値が予め分かっている場合には、理想的には、2値化閾値をコーナーセル104の画素値近傍で設定して、コーナーセル104よりも画素値の低い(すなわち明度の高い)ものを、できるだけ抽出しないように範囲設定することが好ましい。この場合、理論的には、2値化処理部50が、例えば閾値を120として、G画素値の範囲を120〜255に設定することで、コーナーセル104を抽出でき、G画素値が120に満たない画像を2値化処理により”0”に変換できる。2値化処理の際のG画素値の範囲を狭くすることで、他のノイズを低減できる。   When the corner cell 104 and the cell brightness region 316 of the gradation region 310 have the same hue (G) and the same luminance (gradation) and are not affected by ambient light, the corner cell 104 is acquired via a G filter. It is assumed that the G pixel value is expressed by 127, for example. The binarization processing unit 50 sets a range of RGB pixel values for binarization processing, but when the pixel value of the corner cell 104 is known in advance, the binarization threshold is ideally set. Is set in the vicinity of the pixel value of the corner cell 104, and it is preferable to set the range so that a pixel value lower than that of the corner cell 104 (ie, having a high brightness) is not extracted as much as possible. In this case, theoretically, the binarization processing unit 50 can extract the corner cell 104 by setting the G pixel value range from 120 to 255, for example, by setting the threshold value to 120, and the G pixel value becomes 120. An image that does not satisfy the condition can be converted to “0” by binarization processing. By narrowing the range of G pixel values in the binarization process, other noise can be reduced.

しかしながら、実際の環境下では、照明があったり、また太陽光が入るなどして、撮像装置2により取得されるコーナーセル104は、理論値(127)から異なることが多い。なお、「理論値」は、本実施例を説明するために便宜上使用する用語であって、基準となる環境下で画像データから抽出される画素値を意味する。2値化するために設定する画素値の範囲は、狭ければ狭いほど、後処理の負荷を低減できるが、一方で、環境光の影響により実際に取得される画素値が理論値とは異なってくるために、2値化する画素値の範囲が狭ければ、その範囲から外れる可能性が生じる。そのため、本実施例のゲームシステム1では、グラデーション領域310を利用して、2値化する際の画素値範囲にキャリブレーションを施し、環境光などの影響を加味した現実使用環境下での画素値範囲を設定する。   However, in an actual environment, the corner cell 104 acquired by the imaging device 2 is often different from the theoretical value (127) due to lighting or sunlight. The “theoretical value” is a term used for convenience in describing the present embodiment, and means a pixel value extracted from the image data under a reference environment. The narrower the range of pixel values set for binarization, the more the post-processing load can be reduced. On the other hand, the pixel values that are actually acquired differ from the theoretical values due to the influence of ambient light. Therefore, if the range of pixel values to be binarized is narrow, there is a possibility that the range is out of the range. Therefore, in the game system 1 according to the present embodiment, the pixel value under the actual use environment in which the gradation region 310 is used to calibrate the pixel value range when binarizing and the influence of ambient light or the like is taken into consideration. Set the range.

図15は、画像解析装置の別の構成を示す。画像解析装置20は、フレーム画像取得部40および実オブジェクト抽出部42を備える。実オブジェクト抽出部42は、2値化処理部50、領域抽出部60、RGB調整部62を備える。図3に示したブロック図とは異なり、図15では、2値化する際の画素値の範囲をキャリブレーションする構成が示されている。この画像解析装置20の処理機能は、CPU、メモリ、メモリにロードされたプログラムなどによって実現され、ここではそれらの連携によって実現される構成を描いている。プログラムは、画像解析装置20に内蔵されていてもよく、また記録媒体に格納された形態で外部から供給されるものであってもよい。したがってこれらの機能ブロックがハードウエアのみ、ソフトウエアのみ、またはそれらの組合せによっていろいろな形で実現できることは、当業者に理解されるところである。図示の例では、画像解析装置20のCPUが、フレーム画像取得部40、実オブジェクト抽出部42としての機能をもつ。   FIG. 15 shows another configuration of the image analysis apparatus. The image analysis device 20 includes a frame image acquisition unit 40 and a real object extraction unit 42. The real object extraction unit 42 includes a binarization processing unit 50, a region extraction unit 60, and an RGB adjustment unit 62. Unlike the block diagram shown in FIG. 3, FIG. 15 shows a configuration for calibrating the range of pixel values when binarizing. The processing function of the image analysis device 20 is realized by a CPU, a memory, a program loaded in the memory, and the like, and here, a configuration realized by cooperation thereof is illustrated. The program may be built in the image analysis apparatus 20 or may be supplied from the outside in a form stored in a recording medium. Accordingly, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof. In the illustrated example, the CPU of the image analysis device 20 has functions as a frame image acquisition unit 40 and a real object extraction unit 42.

フレーム画像取得部40が、撮像装置2にて撮像された実空間のフレーム画像を取得する。撮像装置2は、周期的にフレーム画像を取得し、好適には1/60秒間隔でフレーム画像を生成する。撮像領域5には、ゲーム用マット300と、ゲーム用マット300上に置かれたゲームカード4が配置されており、したがってフレーム画像は、ゲーム用マット300とゲームカード4を含んでいる。   The frame image acquisition unit 40 acquires a real space frame image captured by the imaging device 2. The imaging device 2 periodically acquires frame images, and preferably generates frame images at 1/60 second intervals. In the imaging area 5, the game mat 300 and the game card 4 placed on the game mat 300 are arranged. Therefore, the frame image includes the game mat 300 and the game card 4.

実オブジェクト抽出部42は、フレーム画像から実オブジェクト画像を抽出する。ここでは、コーナーセル104を2値化する際のRGBの画素値の範囲を調整することを目的とするため、抽出する実オブジェクト画像は、ゲーム用マット300におけるグラデーション領域310である。以下では、コーナーセル104が所定の明度をもった緑色で構成されており、グラデーション領域310が、その所定の明度を含んだ緑色のグラデーションとして形成されている場合について説明する。   The real object extraction unit 42 extracts a real object image from the frame image. Here, in order to adjust the range of RGB pixel values when the corner cell 104 is binarized, the actual object image to be extracted is the gradation region 310 in the game mat 300. Hereinafter, a case will be described in which the corner cell 104 is configured with green having a predetermined brightness, and the gradation area 310 is formed as a green gradation including the predetermined brightness.

2値化処理部50は、2値化するRGBの範囲を設定して、フレーム画像を2進数のビット表現に変換する。具体的に、2値化処理部50は、緑色のグラデーションが施されたグラデーション領域310a、310b、310cを抽出するために、G画素値の範囲を120〜255、R画素値の範囲を0〜20、B画素値の範囲を0〜20に設定し、このRGBの画素値の範囲内にあるRGBの複合画素を抽出する。RBについて画素値の範囲を0としないのは、カラーフィルタの特性などを考慮するためである。2値化処理部50は、設定したRGBの画素値の範囲内にある複合画素を抽出して、その画素値を”1”とする。   The binarization processing unit 50 sets a range of RGB to be binarized and converts the frame image into a binary bit representation. Specifically, the binarization processing unit 50 extracts the G pixel value range from 120 to 255 and the R pixel value range from 0 to 0 in order to extract the gradation regions 310a, 310b, and 310c to which the green gradation is applied. 20. The range of the B pixel value is set to 0 to 20, and RGB composite pixels within the RGB pixel value range are extracted. The reason why the pixel value range for RB is not 0 is to consider the characteristics of the color filter. The binarization processing unit 50 extracts a composite pixel within the set RGB pixel value range and sets the pixel value to “1”.

領域抽出部60は、フレーム画像の2値化データから、ゲーム用マット300のグラデーション領域310を抽出する。グラデーション領域310は、中心部分のG画素値が低く、外周部分のG画素値が高いグラデーションを形成している。2値化処理の結果、グラデーション領域310は、中心部分の複合画素値が0、外周部分の複合画素値が1のビット表現に変換され、中心部分が空白となるドーナツ形状となる。そこで、領域抽出部60は、2値化されたデータの中からドーナツ形状を検出する。2値化処理の結果、グラデーション領域310以外にドーナツ形状に変換される領域は少ないと考えられるため、グラデーション領域310を円形に形成することは、グラデーション領域310の候補を絞る意味においてメリットが高い。   The area extraction unit 60 extracts the gradation area 310 of the game mat 300 from the binarized data of the frame image. The gradation area 310 forms a gradation in which the G pixel value in the central portion is low and the G pixel value in the outer peripheral portion is high. As a result of the binarization processing, the gradation area 310 is converted to a bit representation in which the composite pixel value of the central portion is 0 and the composite pixel value of the outer peripheral portion is 1, and has a donut shape in which the central portion is blank. Therefore, the region extraction unit 60 detects a donut shape from the binarized data. As a result of the binarization process, it is considered that there are few regions that are converted into a donut shape other than the gradation region 310. Therefore, forming the gradation region 310 in a circle is highly advantageous in terms of narrowing the candidates for the gradation region 310.

ここで、4つのグラデーション領域310は、正方形の頂点に配置されている。緑色用の2値化処理および黒色用の2値化処理の結果、複数のドーナツ領域が検出された場合に、それらのドーナツ領域が正方形の頂点にくる関係となるものを抽出し、それらをグラデーション領域310として特定する。緑色のグラデーション領域310a、310b、310cとして特定されたドーナツ領域の形状は、2値化閾値のキャリブレーションのためにRGB調整部62に送られる。   Here, the four gradation regions 310 are arranged at the vertices of a square. When a plurality of donut areas are detected as a result of the binarization process for green and the binarization process for black, those that have a relationship in which the donut areas are at the vertices of a square are extracted and the gradations are extracted. The area 310 is specified. The shapes of the donut areas identified as the green gradation areas 310a, 310b, and 310c are sent to the RGB adjustment unit 62 for binarization threshold calibration.

図16(a)〜図16(c)は、グラデーション領域として特定されたドーナツ領域を示す。以下では、緑色のグラデーション領域310a〜310cをもとに、2値化して同一色のコーナーセル104を検出する際のG画素値の範囲をキャリブレーションする方法について説明する。G画素値の2値化閾値を120とし、抽出範囲を120〜255とする。RGB調整部62は、グラデーション領域310の2値化データをもとに、2値化処理部50において2値化する際のRGBの画素値の範囲を調整する。   Fig.16 (a)-FIG.16 (c) show the donut area | region specified as a gradation area | region. In the following, a method of calibrating the range of G pixel values when binarizing and detecting the corner cells 104 of the same color based on the green gradation areas 310a to 310c will be described. The binarization threshold value of the G pixel value is 120, and the extraction range is 120 to 255. The RGB adjustment unit 62 adjusts the range of RGB pixel values when binarization is performed in the binarization processing unit 50 based on the binarized data in the gradation area 310.

図16(a)は、内径と外径との比が約1:2、正確には121:256となるドーナツ領域を示す。この場合は、撮像装置2により取り込んだフレーム画像において環境光の影響が一切なく、グラデーション領域310が理想的に2値化されている。このドーナツ領域において、方形セル106と同一階調をもつセル明度領域316は、中心と外縁とを1:1に分割した地点に存在し、ドーナツ領域の黒色部分に含まれている。したがって、G画素値の閾値を120に設定することで、コーナーセル104を好適に抽出することが可能となる。   FIG. 16A shows a donut region in which the ratio of the inner diameter to the outer diameter is about 1: 2, more precisely 121: 256. In this case, the gradation area 310 is ideally binarized without any influence of ambient light in the frame image captured by the imaging device 2. In this donut region, a cell brightness region 316 having the same gradation as the square cell 106 exists at a point where the center and the outer edge are divided into 1: 1, and is included in the black portion of the donut region. Therefore, by setting the threshold value of the G pixel value to 120, the corner cell 104 can be preferably extracted.

図16(b)は、ドーナツ領域の外径に対して内径が非常に小さくなった状態を示す。この場合、中心と外縁とを1:1に分割した地点に存在するセル明度領域316は、ドーナツ領域の黒色部分に含まれているが、その内側の階調の低い領域までもが検出されている。例えば、環境光に緑色光が含まれている場合に、緑色光とグラデーション領域310の緑色とが重なり合って、検出光のG成分が強くなることがある。このとき、ドーナツ領域の画素値は、グラデーション領域310の画素値の理論値よりも強い値で検出され、そのため、2値化されて”1”に符号化される領域が必要以上に増えることになる。   FIG. 16B shows a state in which the inner diameter is very small with respect to the outer diameter of the donut region. In this case, the cell brightness region 316 existing at the point where the center and the outer edge are divided into 1: 1 is included in the black portion of the donut region, but even the inner low-tone region is detected. Yes. For example, when green light is included in the ambient light, the green light and the green color in the gradation area 310 may overlap, and the G component of the detection light may become strong. At this time, the pixel value of the donut region is detected as a value stronger than the theoretical value of the pixel value of the gradation region 310, and therefore, the region that is binarized and encoded to “1” increases more than necessary. Become.

したがって、2値化処理部50が、G画素値の範囲を120〜255に設定してゲームカード4の画像を2値化すると、コーナーセル104を抽出することはできるが、コーナーセル104よりも薄い緑色の領域も同様に抽出することになる。コーナーセル104の候補が増えると、それだけコーナーセル104の特定処理に時間がかかるため、コーナーセル104の候補が少なくなるように、2値化する際の画素値の範囲を設定することが好ましい。   Therefore, when the binarization processing unit 50 binarizes the image of the game card 4 by setting the G pixel value range to 120 to 255, the corner cell 104 can be extracted, but the corner cell 104 can be extracted. The light green area is extracted in the same manner. As the number of corner cell 104 candidates increases, it takes time to specify the corner cell 104. Therefore, it is preferable to set a pixel value range for binarization so that the number of corner cell 104 candidates decreases.

RGB調整部62は、グラデーション領域310のグラデーションで表現される階調の分布と、コーナーセル104と同一の階調が存在する領域の位置を予め保持している。したがって、RGB調整部62は、図16(b)に示すドーナツ領域の形状を受け取ると、設定した閾値(120)が低かったことを判定し、閾値を高くする必要があることを決定する。   The RGB adjustment unit 62 holds in advance the distribution of gradation expressed by gradation in the gradation area 310 and the position of the area where the same gradation as the corner cell 104 exists. Therefore, when receiving the shape of the donut area shown in FIG. 16B, the RGB adjustment unit 62 determines that the set threshold value (120) is low, and determines that the threshold value needs to be increased.

例えばRGB調整部62は、グラデーション領域310の階調分布をもとに、ドーナツ領域における中心から内径までの距離(すなわち、白色領域の半径)から、その地点におけるグラデーション領域310のG画素値の理論値を求める。その地点のG画素値の理論値は、本来、120よりも低いG画素値をとるが、図16(b)に示すドーナツ領域では、その地点のG画素値が120として検出されている。したがって、RGB調整部62は、グラデーション領域310上のG画素値の理論値と、設定された閾値120との差を、環境光による上昇分として、閾値の上げ量を定めてもよい。例えば、ドーナツ領域における白色領域と黒色領域の境界のグラデーション領域310上のG画素値の理論値を60とした場合、設定閾値120との差は60となるため、RGB調整部62は、2値化処理におけるG画素値の閾値を180として、2値化処理部50に供給する。   For example, the RGB adjustment unit 62 calculates the G pixel value of the gradation region 310 at that point from the distance from the center to the inner diameter in the donut region (that is, the radius of the white region) based on the gradation distribution of the gradation region 310. Find the value. The theoretical value of the G pixel value at that point is originally a G pixel value lower than 120, but the G pixel value at that point is detected as 120 in the donut region shown in FIG. Therefore, the RGB adjustment unit 62 may determine the amount of increase in the threshold value by using the difference between the theoretical value of the G pixel value on the gradation region 310 and the set threshold value 120 as an increase due to the ambient light. For example, when the theoretical value of the G pixel value on the gradation area 310 at the boundary between the white area and the black area in the donut area is 60, the difference from the setting threshold 120 is 60. The threshold value of the G pixel value in the binarization process is set to 180 and supplied to the binarization processing unit 50.

図16(c)は、ドーナツ領域の内径が外径の半分よりも大きくなった状態を示す。この場合、中心と外縁とを1:1に分割した地点に存在するセル明度領域316は、ドーナツ領域の白色部分に含まれており、したがって、コーナーセル104と同一階調のセル明度領域316は、2値化処理により”0”に変換されていることになる。例えば、環境が非常に暗いような場合に、グラデーション領域310の理論値よりも画素値が低く検出されることがある。   FIG. 16C shows a state where the inner diameter of the donut region is larger than half of the outer diameter. In this case, the cell brightness region 316 existing at the point where the center and the outer edge are divided by 1: 1 is included in the white part of the donut region, and therefore the cell brightness region 316 having the same gradation as the corner cell 104 is It is converted to “0” by the binarization process. For example, when the environment is very dark, the pixel value may be detected lower than the theoretical value of the gradation area 310.

したがって、2値化処理部50が、G画素値の範囲を120〜255に設定してゲームカード4を2値化すると、コーナーセル104を抽出できないことになる。そのため、G画素値の抽出範囲を広げて、コーナーセル104と同一の画素値をもつセル明度領域316を抽出できるように、2値化処理のG画素値の範囲を再設定する必要がある。   Therefore, if the binarization processing unit 50 binarizes the game card 4 by setting the G pixel value range to 120 to 255, the corner cell 104 cannot be extracted. Therefore, it is necessary to reset the G pixel value range of the binarization process so that the cell brightness region 316 having the same pixel value as that of the corner cell 104 can be extracted by expanding the G pixel value extraction range.

RGB調整部62は、図16(c)に示すドーナツ領域の形状を受け取ると、設定した閾値(120)が高かったことを判定し、閾値を低くする必要があることを決定する。例えばRGB調整部62は、グラデーション領域310の階調分布をもとに、ドーナツ領域における中心から内径までの距離(すなわち、白色領域の半径)から、その地点におけるグラデーション領域310のG画素値の理論値を求める。その地点のG画素値の理論値は、本来、120よりも高いG画素値をとるが、図16(c)に示すドーナツ領域では、その地点のG画素値が120として検出されている。したがって、RGB調整部62は、グラデーション領域310上のG画素値の理論値と、設定された閾値120との差を、閾値の下げ量に定めてもよい。例えば、ドーナツ領域における白色領域と黒色領域の境界のグラデーション領域310上のG画素値の理論値を180とした場合、設定閾値120との差は60となるため、RGB調整部62は、2値化処理におけるG画素値の閾値を60として、2値化処理部50に供給する。   When receiving the shape of the donut area shown in FIG. 16C, the RGB adjustment unit 62 determines that the set threshold value (120) is high, and determines that the threshold value needs to be lowered. For example, the RGB adjustment unit 62 calculates the G pixel value of the gradation region 310 at that point from the distance from the center to the inner diameter in the donut region (that is, the radius of the white region) based on the gradation distribution of the gradation region 310. Find the value. The theoretical value of the G pixel value at that point is originally a G pixel value higher than 120, but the G pixel value at that point is detected as 120 in the donut region shown in FIG. Therefore, the RGB adjustment unit 62 may determine the difference between the theoretical value of the G pixel value on the gradation area 310 and the set threshold 120 as the threshold reduction amount. For example, when the theoretical value of the G pixel value on the gradation region 310 at the boundary between the white region and the black region in the donut region is 180, the difference from the setting threshold 120 is 60. The threshold value of the G pixel value in the binarization process is set to 60 and supplied to the binarization processing unit 50.

2値化処理部50は、RGB調整部62より調整された画素値の範囲を受け取ると、その範囲をもとにフレーム画像の2値化処理を実行する。領域抽出部60は、2値化されたデータから、グラデーション領域310に対応するドーナツ領域を検出して、RGB調整部62に供給する。RGB調整部62は、ドーナツ領域をもとに、2値化処理の閾値を調整し、2値化処理部50にフィードバックする。以上のキャリブレーション処理は、ドーナツ領域が、図16(a)に示すような状態となるまで実行されてもよい。   When the binarization processing unit 50 receives the range of pixel values adjusted from the RGB adjustment unit 62, the binarization processing unit 50 executes a binarization process on the frame image based on the range. The region extraction unit 60 detects a donut region corresponding to the gradation region 310 from the binarized data and supplies the detected donut region to the RGB adjustment unit 62. The RGB adjustment unit 62 adjusts the threshold value of the binarization process based on the donut area, and feeds it back to the binarization processing unit 50. The above calibration processing may be executed until the donut region is in a state as shown in FIG.

なお、以上は、2値化する際のG画素値の範囲(閾値)をキャリブレーションする場合について説明したが、他のR、B画素値についても同様である。緑色のグラデーション領域310a、310b、310cの2値化処理時のRB画素値の閾値を20にデフォルト設定しているが、RGB調整部62は、必要に応じてこのデフォルト値を調整することが好ましい。   In the above description, the case of calibrating the range (threshold value) of the G pixel value when binarizing has been described, but the same applies to other R and B pixel values. Although the threshold value of the RB pixel value at the time of binarization processing of the green gradation areas 310a, 310b, and 310c is set to 20 by default, the RGB adjustment unit 62 preferably adjusts this default value as necessary. .

なお、グラデーション領域310a、310b、310cは、空間的に異なる3点に存在しており、環境光などの影響により、その位置によって2値化処理時の最適な画素値の範囲が異なることも考えられる。外部照明の向きにより、グラデーション領域310a、310bの付近が明るく、グラデーション領域310cの付近が暗いような場合、グラデーション領域310cにあわせて、2値化する際の閾値を低く設定してもよい。これにより、ゲームカード4の配置位置にかかわらず、コーナーセル104を検出することが可能となる。   Note that the gradation areas 310a, 310b, and 310c exist at three spatially different points, and it is considered that the optimum pixel value range during binarization processing differs depending on the position due to the influence of ambient light or the like. It is done. When the vicinity of the gradation areas 310a and 310b is bright and the vicinity of the gradation area 310c is dark depending on the direction of the external illumination, the threshold value for binarization may be set low in accordance with the gradation area 310c. This makes it possible to detect the corner cell 104 regardless of the arrangement position of the game card 4.

しかしながら、グラデーション領域310a、310b付近では、2値化閾値が低く設定されることで、コーナーセル104以外の様々な領域を抽出する可能性が高まる。そのため、それぞれのグラデーション領域310の位置における最適な2値化閾値を求め、この3点の2値化閾値から、プレイエリア306中の任意の位置における2値化閾値を導出してもよい。例えば、グラデーション領域310bにおける2値化閾値をT1、グラデーション領域310cにおける2値化閾値をT2とした場合、グラデーション領域310bおよび310cを結ぶライン上では、2値化閾値をT1からT2までリニアに変化させるように設定してもよい。他の任意の位置についても同様であり、3点の2値化閾値からの距離に応じて、それぞれの位置における2値化閾値が算出されてもよい。これにより、照明が近い場合など、カードの位置によって照明環境が異なり、撮影されるコード色が大きく異なるような場合であっても、適切にコードを認識することが可能となる。   However, in the vicinity of the gradation areas 310a and 310b, the possibility of extracting various areas other than the corner cell 104 increases by setting the binarization threshold value low. Therefore, an optimal binarization threshold value at the position of each gradation area 310 may be obtained, and the binarization threshold value at an arbitrary position in the play area 306 may be derived from these three binarization threshold values. For example, when the binarization threshold in the gradation area 310b is T1 and the binarization threshold in the gradation area 310c is T2, the binarization threshold changes linearly from T1 to T2 on the line connecting the gradation areas 310b and 310c. You may set so that it may. The same applies to other arbitrary positions, and the binarization threshold value at each position may be calculated according to the distance from the binarization threshold value of three points. This makes it possible to properly recognize the code even when the illumination environment differs depending on the position of the card, such as when illumination is close, and the code color to be photographed differs greatly.

本実施例のキャリブレーション処理は、定期的に行われることが好ましい。なお、環境に変化がない場合には、頻繁にキャリブレーション処理が行われる必要性は高くないため、環境の変化を検知するセンサを別途設け、そのセンサにより環境変化が検知された場合に、キャリブレーション処理が行われるようにしてもよい。なお、環境変化には、ゲーム用マット300を動かした場合や、外部照明などの明るさが変わった場合などがある。   The calibration process of the present embodiment is preferably performed periodically. If there is no change in the environment, the need for frequent calibration processing is not high, so a separate sensor is provided to detect the change in the environment, and if an environmental change is detected by that sensor, calibration is performed. May be performed. The environmental change includes a case where the game mat 300 is moved and a case where the brightness of the external illumination is changed.

キャリブレーション処理の方法として、グラデーション領域310の所定位置における実際の画素値と、撮影の結果得られる測定値との差分から、2値化閾値を補正してもよいし、グラデーション領域310を2値化したときのドーナツ領域の形状が特定の形状になるように、2値化閾値を補正してもよい。後者の場合、例えば、ドーナツ領域の大小に応じて、2値化閾値をインクリメント又はデクリメントし、ドーナツ領域の形状が理論値に近づくように調整してもよい。また、単に1つの2値化閾値をもとに2値化するだけでなく、上限と下限の2つの閾値を設け、その範囲に入るか否かによって2値化してもよい。例えば、画素値が85以上170以下であれば「0」、それ以外であれば「1」として2値化してもよい。この場合、ある2値化閾値の大小によりグラデーション領域310を2値化して、グラデーション領域310の外径を把握してから、上限と下限の2つの閾値により特定される中間領域のドーナツ領域の実測結果を取得し、その形状が理論値に近づくように上限と下限を補正してもよい。また、上述した例と濃淡が逆転していてもよく、その場合、反転処理をしてから2値化を行ってもよい。   As a method of calibration processing, the binarization threshold value may be corrected based on the difference between the actual pixel value at a predetermined position in the gradation area 310 and the measurement value obtained as a result of photographing. The binarization threshold value may be corrected so that the shape of the donut region when it is converted into a specific shape. In the latter case, for example, the binarization threshold value may be incremented or decremented according to the size of the donut region, and adjusted so that the shape of the donut region approaches the theoretical value. Further, not only binarization based on one binarization threshold value, but also two threshold values of an upper limit and a lower limit may be provided, and binarization may be performed depending on whether or not it falls within the range. For example, the pixel value may be binarized as “0” if the pixel value is 85 to 170, and “1” otherwise. In this case, the gradation region 310 is binarized based on the magnitude of a certain binarization threshold, the outer diameter of the gradation region 310 is grasped, and the donut region of the intermediate region specified by the upper and lower thresholds is actually measured. You may acquire a result and correct | amend an upper limit and a minimum so that the shape may approach a theoretical value. Further, the density may be reversed from the above-described example. In that case, binarization may be performed after performing the reversal process.

図1に示したように、撮像装置2は斜め上方からゲーム用マット300を撮像するので、グラデーション領域310の形状が真円であったとしても、楕円形として認識される可能性がある。この場合であっても、上述したように、ゲーム用マット300の位置や方向などを予め把握することが可能であるから、この情報をもとにグラデーション領域310の認識結果であるドーナツ領域の形状を補正してから、上述したキャリブレーション処理を行ってもよい。   As shown in FIG. 1, since the imaging device 2 images the game mat 300 from obliquely above, even if the shape of the gradation region 310 is a perfect circle, there is a possibility that it is recognized as an ellipse. Even in this case, as described above, the position and direction of the game mat 300 can be grasped in advance, and the shape of the donut area as a recognition result of the gradation area 310 based on this information. The above-described calibration process may be performed after correcting.

また、ゲーム用マット300が固定的に設置されてからキャリブレーション処理を行うことが好ましいので、例えば、グラデーション領域310の認識処理を複数回行って位置が変わらないことを確認してから、または、所定時間をおいて再度認識処理を行って位置が変わらないことを確認してから、キャリブレーション処理を開始してもよい。   Further, since it is preferable to perform the calibration process after the game mat 300 is fixedly installed, for example, after confirming that the position does not change by performing the recognition process of the gradation region 310 a plurality of times, or The calibration process may be started after confirming that the position does not change by performing the recognition process again after a predetermined time.

図17は、実施例における画像データの伝送システムを示す。画像データ伝送システム200は、画像データを生成する画像データ生成装置201、画像データを送信する送信局204、送信された画像データを受信する端末装置202を有して構成される。端末装置202は、受信した画像データを表示するための表示装置203を有する。画像データ伝送システム200は、無線通信によりデータを伝送しているが、有線通信によりデータを伝送するものであってもよい。   FIG. 17 shows an image data transmission system in the embodiment. The image data transmission system 200 includes an image data generation device 201 that generates image data, a transmission station 204 that transmits image data, and a terminal device 202 that receives the transmitted image data. The terminal device 202 has a display device 203 for displaying the received image data. The image data transmission system 200 transmits data by wireless communication, but may transmit data by wired communication.

画像データ生成装置201は、上述した2次元コード、すなわち図2、図8、図9、図10および図12に関して説明した2次元コードの画像データを、端末装置202の表示装置203に表示させるためのデータフォーマットにしたがって生成する。画像データ生成装置201は、図2に示す2次元コードの画像データとして、複数の方形セルを表示装置203上の所定の座標位置に表示させるためのデータと、所定の座標位置に表示される複数の方形セルを取り囲む座標位置に複数のコーナーセルを表示させるためのデータを生成してもよい。画像データ生成装置201は、表示装置203上で、コーナーセルが方形セルよりも大きく表示されるように、コーナーセルと方形セルのデータを設定する。   The image data generation device 201 displays the above-described two-dimensional code, that is, the image data of the two-dimensional code described with reference to FIGS. 2, 8, 9, 10 and 12 on the display device 203 of the terminal device 202. It is generated according to the data format. The image data generation device 201 has, as the image data of the two-dimensional code shown in FIG. 2, data for displaying a plurality of rectangular cells at predetermined coordinate positions on the display device 203, and a plurality of data displayed at the predetermined coordinate positions. Data for displaying a plurality of corner cells at coordinate positions surrounding the rectangular cell may be generated. The image data generation device 201 sets the corner cell and square cell data so that the corner cell is displayed larger than the square cell on the display device 203.

画像データ生成装置201は、図8に示す2次元コードの画像データとして、複数の方形セルを表示装置203上の所定の座標位置に表示させるためのデータと、所定の座標位置に表示される複数の方形セルを取り囲む座標位置に複数のコーナーセルを表示させるためのデータを生成してもよい。画像データ生成装置201は、コーナーセルが丸い形状に表示されるように、コーナーセルのデータを設定する。   The image data generation device 201 has, as the image data of the two-dimensional code shown in FIG. 8, data for displaying a plurality of rectangular cells at predetermined coordinate positions on the display device 203, and a plurality of data displayed at the predetermined coordinate positions. Data for displaying a plurality of corner cells at coordinate positions surrounding the rectangular cell may be generated. The image data generation device 201 sets the corner cell data so that the corner cell is displayed in a round shape.

画像データ生成装置201は、図9に示す2次元コードの画像データとして、所定の形状を有する基準セルを表示装置上の所定の位置に表示させるためのデータと、基準セルに対して定められる領域の範囲内で複数の多辺形セルを表示させるためのデータと、領域を取り囲む座標位置に複数のコーナーセルを表示させるためのデータを生成してもよい。画像データ生成装置201は、基準セル、多辺形セル、コーナーセルの少なくとも一つのセルの色が、他のセルの色と異なるように設定する。また画像データ生成装置201は、図10、図12に示す2次元コードの画像データとして、所定の形状を有する基準セルを表示装置上の所定の位置に表示させるためのデータと、同一形状を有する複数のコーナーセルを表示させるためのデータと、所定の領域に複数のコーナーセルを表示させるためのデータを生成してもよい。画像データ生成装置201は、コーナーセルの色を、基準セルおよび多辺形セルとは異なる色に設定する。   The image data generation device 201 has, as the image data of the two-dimensional code shown in FIG. 9, data for displaying a reference cell having a predetermined shape at a predetermined position on the display device, and an area defined for the reference cell Data for displaying a plurality of polygonal cells within the range of and a data for displaying a plurality of corner cells at coordinate positions surrounding the region may be generated. The image data generation device 201 sets the color of at least one of the reference cell, the polygonal cell, and the corner cell to be different from the colors of the other cells. Further, the image data generation device 201 has the same shape as the data for displaying a reference cell having a predetermined shape at a predetermined position on the display device as the image data of the two-dimensional code shown in FIGS. Data for displaying a plurality of corner cells and data for displaying a plurality of corner cells in a predetermined area may be generated. The image data generation device 201 sets the color of the corner cell to a color different from that of the reference cell and the polygonal cell.

送信局204は、画像データ生成装置201により生成された画像データを、端末装置202に送信する。画像データは、端末装置202において解凍可能な形式で圧縮されていることが好ましく、また端末装置202におけるブラウザ機能などにより表示されるデータフォーマットで作成されている必要がある。送信局204は、例えばセルごとの画像データを表示座標位置に対応付けて送信することで、データ送信量を削減することが可能となる。端末装置202は、表示装置203上に2次元コードを表示する。図1のゲームシステム1において、ユーザは、表示装置203に表示された2次元コードを、ゲームカード4の代わりに使用して、撮像装置2により読み取らせることができる。これにより、ユーザは、ゲームカード4を有していなくても、画像データを端末装置202にダウンロードすることで、ゲームシステム1に参加することができる。   The transmission station 204 transmits the image data generated by the image data generation device 201 to the terminal device 202. The image data is preferably compressed in a format that can be decompressed by the terminal device 202, and needs to be created in a data format displayed by a browser function or the like in the terminal device 202. The transmission station 204 can reduce the amount of data transmission by transmitting image data for each cell in association with the display coordinate position, for example. The terminal device 202 displays a two-dimensional code on the display device 203. In the game system 1 of FIG. 1, the user can use the two-dimensional code displayed on the display device 203 instead of the game card 4 to be read by the imaging device 2. Thereby, even if the user does not have the game card 4, the user can participate in the game system 1 by downloading the image data to the terminal device 202.

以上、本発明を実施例をもとに説明した。この実施例は例示であり、それらの各構成要素や各処理プロセスの組合せにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   In the above, this invention was demonstrated based on the Example. This embodiment is an exemplification, and it will be understood by those skilled in the art that various modifications can be made to the combination of each component and each processing process, and such modifications are also within the scope of the present invention. .

実施例にかかるゲームシステムの構成を示す図である。It is a figure which shows the structure of the game system concerning an Example. ゲームカードの表面に印刷した2次元コードを示す図である。It is a figure which shows the two-dimensional code printed on the surface of the game card. 画像解析装置の構成を示す図である。It is a figure which shows the structure of an image analyzer. 2次元コードの認識処理の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the recognition process of a two-dimensional code. 基準セルの検出処理を示すフローチャートである。It is a flowchart which shows the detection process of a reference | standard cell. コード部の検出処理を示すフローチャートである。It is a flowchart which shows the detection process of a code part. コードデータの検証処理を示すフローチャートである。It is a flowchart which shows the verification process of code data. ゲームカードの表面に印刷した2次元コードの別の例を示す図である。It is a figure which shows another example of the two-dimensional code printed on the surface of the game card. ゲームカードの表面に印刷した2次元コードのさらに別の例を示す図である。It is a figure which shows another example of the two-dimensional code printed on the surface of the game card. ゲームカードの表面に印刷した2次元コードのさらに別の例を示す図である。It is a figure which shows another example of the two-dimensional code printed on the surface of the game card. (a)〜(c)は、コーナーセルであるか否かを判別する方法を説明するための説明図である。(A)-(c) is explanatory drawing for demonstrating the method to discriminate | determine whether it is a corner cell. ゲームカードの表面に印刷した2次元コードのさらに別の例を示す図である。It is a figure which shows another example of the two-dimensional code printed on the surface of the game card. ゲーム用カードを配置するためのゲーム用マットを示す図である。It is a figure which shows the mat for games for arrange | positioning the card for games. グラデーション領域の外観を示す図である。It is a figure which shows the external appearance of a gradation area | region. 画像解析装置の別の構成を示す図である。It is a figure which shows another structure of an image analyzer. (a)〜(c)は、グラデーション領域として特定されたドーナツ領域を示す図である。(A)-(c) is a figure which shows the donut area | region specified as a gradation area | region. 実施例における画像データの伝送システムを示す図である。It is a figure which shows the transmission system of the image data in an Example.

符号の説明Explanation of symbols

1・・・ゲームシステム、2・・・撮像装置、4・・・ゲームカード、6・・・出力装置、7・・・ディスプレイ、10・・・画像処理装置、20・・・画像解析装置、30・・・ゲーム装置、40・・・フレーム画像取得部、42・・・実オブジェクト抽出部、44・・・状態決定部、50・・・2値化処理部、52・・・基準セル検出部、54・・・コード部検出部、56・・・検証処理部、60・・・領域抽出部、62・・・RGB調整部、100・・・基準セル、102・・・コードデータ部分、104・・・コーナーセル、106・・・方形セル、108・・・領域、110・・・コード部、200・・・画像データ伝送システム、201・・・画像データ生成装置、202・・・端末装置、203・・・表示装置、204・・・送信局。

DESCRIPTION OF SYMBOLS 1 ... Game system, 2 ... Imaging device, 4 ... Game card, 6 ... Output device, 7 ... Display, 10 ... Image processing device, 20 ... Image analysis device, DESCRIPTION OF SYMBOLS 30 ... Game device, 40 ... Frame image acquisition part, 42 ... Real object extraction part, 44 ... State determination part, 50 ... Binarization processing part, 52 ... Reference cell detection , 54... Code part detection part, 56... Verification processing part, 60... Region extraction part, 62... RGB adjustment part, 100. 104 ... Corner cell, 106 ... Square cell, 108 ... Area, 110 ... Code part, 200 ... Image data transmission system, 201 ... Image data generator, 202 ... Terminal Device 203... Display device 204. Shin stations.

Claims (9)

所定の形状を有する基準セルと、
コードデータを構成する複数の多辺形セルと、
同一形状を有する複数のコーナーセルと、
を備え、
前記多辺形セルは、前記複数のコーナーセルより取り囲まれる領域以外の部分に配置されることを特徴とするカード。
A reference cell having a predetermined shape;
A plurality of polygonal cells constituting the code data;
A plurality of corner cells having the same shape;
With
The card, wherein the polygonal cell is arranged in a portion other than a region surrounded by the plurality of corner cells.
前記コーナーセルは、前記基準セルおよび前記多辺形セルとは異なる色を付けられることを特徴とする請求項1に記載のカード。   The card according to claim 1, wherein the corner cell is colored differently from the reference cell and the polygonal cell. 前記コーナーセルは三角形であることを特徴とする請求項1または2に記載のカード。   The card according to claim 1, wherein the corner cell is a triangle. 前記コーナーセルは、当該カードの縁部から設けられ、黒色以外の色をつけられることを特徴とする請求項1から3のいずれかに記載のカード。   The card according to any one of claims 1 to 3, wherein the corner cell is provided from an edge of the card and is colored other than black. 所定の形状を有する基準セルと、
コードデータを構成する複数の多辺形セルと、
同一形状を有する複数のコーナーセルと、
を備えた矩形状のカードであって、
前記複数のコーナーセルは、当該カードの相対向する第1縁部および第2縁部において設けられ、
前記複数の多辺形セルの少なくとも一部は、前記第1縁部および前記第2縁部とは異なる第3縁部の近傍において、当該第3縁部に沿って設けられることを特徴とするカード。
A reference cell having a predetermined shape;
A plurality of polygonal cells constituting the code data;
A plurality of corner cells having the same shape;
A rectangular card with
The plurality of corner cells are provided at first and second opposing edges of the card,
At least some of the plurality of polygonal cells are provided along the third edge in the vicinity of a third edge different from the first edge and the second edge. card.
前記複数の多辺形セルの一部が、前記第3縁部に対向する第4縁部の近傍において、当該第4縁部に沿って設けられており、前記第3縁部と前記第4縁部に設けられた複数の多辺形セルが、1つの2次元コードを構成することを特徴とする請求項5に記載のカード。   Some of the plurality of polygonal cells are provided along the fourth edge in the vicinity of the fourth edge facing the third edge, and the third edge and the fourth edge are provided. 6. The card according to claim 5, wherein a plurality of polygonal cells provided on the edge constitute one two-dimensional code. 前記複数のコーナーセルにより取り囲まれる領域には、前記多辺形セルおよび前記基準セルが形成されないことを特徴とする請求項5または6に記載のカード。   The card according to claim 5, wherein the polygonal cell and the reference cell are not formed in a region surrounded by the plurality of corner cells. 所定の形状を有する基準セルと、  A reference cell having a predetermined shape;
コードデータを構成する複数の多辺形セルと、  A plurality of polygonal cells constituting the code data;
同一形状を有する複数のコーナーセルと、  A plurality of corner cells having the same shape;
を備え、  With
前記多辺形セルは、前記複数のコーナーセルより取り囲まれる領域以外の部分に配置されることを特徴とする画像パターン。  The polygonal cell is arranged in a portion other than a region surrounded by the plurality of corner cells.
所定の形状を有する基準セルと、  A reference cell having a predetermined shape;
コードデータを構成する複数の多辺形セルと、  A plurality of polygonal cells constituting the code data;
同一形状を有する複数のコーナーセルと、  A plurality of corner cells having the same shape;
を備えた画像パターンであって、  An image pattern comprising:
前記複数のコーナーセルは、当該画像パターンの相対向する第1縁部および第2縁部において設けられ、  The plurality of corner cells are provided at the first edge and the second edge facing each other in the image pattern,
前記複数の多辺形セルの少なくとも一部は、前記第1縁部および前記第2縁部とは異なる第3縁部の近傍において、当該第3縁部に沿って設けられることを特徴とする画像パターン。  At least some of the plurality of polygonal cells are provided along the third edge in the vicinity of a third edge different from the first edge and the second edge. Image pattern.

JP2005269295A 2004-10-15 2005-09-15 card Expired - Fee Related JP4364186B2 (en)

Priority Applications (9)

Application Number Priority Date Filing Date Title
JP2005269295A JP4364186B2 (en) 2005-09-15 2005-09-15 card
PCT/JP2005/018926 WO2006041149A1 (en) 2004-10-15 2005-10-14 Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
AT05793212T ATE497219T1 (en) 2004-10-15 2005-10-14 MAP AND IMAGE DATA TRANSMISSION METHOD
EP05793212A EP1801735B1 (en) 2004-10-15 2005-10-14 Card and image data transmission method
KR1020067018844A KR100858399B1 (en) 2004-10-15 2005-10-14 Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
EP10195115A EP2330536B1 (en) 2004-10-15 2005-10-14 Object, image data, image data transmission method, card, game mat, card game system, image analysis apparatus and image analysis method
DE602005026145T DE602005026145D1 (en) 2004-10-15 2005-10-14 CARD AND IMAGE DATA TRANSMISSION PROCEDURE
US10/590,759 US7661601B2 (en) 2004-10-15 2005-10-14 Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
US12/534,979 US8066195B2 (en) 2004-10-15 2009-08-04 Object, image data, image data transmission method, card, game mat, card game system, image analysis apparatus, and image analysis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005269295A JP4364186B2 (en) 2005-09-15 2005-09-15 card

Publications (2)

Publication Number Publication Date
JP2007080108A JP2007080108A (en) 2007-03-29
JP4364186B2 true JP4364186B2 (en) 2009-11-11

Family

ID=37940330

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005269295A Expired - Fee Related JP4364186B2 (en) 2004-10-15 2005-09-15 card

Country Status (1)

Country Link
JP (1) JP4364186B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5778967B2 (en) * 2011-04-08 2015-09-16 任天堂株式会社 Information processing program, information processing method, information processing apparatus, and information processing system
JP2017091140A (en) * 2015-11-09 2017-05-25 三星電子株式会社Samsung Electronics Co.,Ltd. Code transmission/reception system, code receiver, code transmitter, code reception method, code transmission method, and program
JP2022048016A (en) 2020-09-14 2022-03-25 株式会社リコー Electronic device, input method and program

Also Published As

Publication number Publication date
JP2007080108A (en) 2007-03-29

Similar Documents

Publication Publication Date Title
KR100858399B1 (en) Object, image data, image data transmission method, card, game mat, card game system, image analysis device, and image analysis method
CN101248454B (en) Image processing method and image processor, digital camera equipment, and recording medium with image processing program stored thereon
KR100947002B1 (en) Image processing method and apparatus, digital camera, and recording medium recording image processing program
US7349588B2 (en) Automatic meter reading
JP2007052670A (en) Method, apparatus and program for detecting side and evaluating corner
CN107567632A (en) Critical point detection with trackability measurement result
JP4662258B2 (en) Image processing method and apparatus, digital camera apparatus, and recording medium recording image processing program
CN111985465A (en) Text recognition method, device, equipment and storage medium
WO2022087846A1 (en) Image processing method and apparatus, device, and storage medium
JP6374849B2 (en) User terminal, color correction system, and color correction method
JP4364186B2 (en) card
JP4312185B2 (en) Game mat, card game system, image analysis apparatus, and image analysis method
CN109919164B (en) User interface object identification method and device
WO2018167974A1 (en) Image processing device, control method, and control program
JP2008067321A (en) Data registration management apparatus
JPWO2019097690A1 (en) Image processing apparatus, control method, and control program
JP3827694B2 (en) Object, image data, and image data transmission method
JP4252519B2 (en) Image analysis apparatus, object recognition method, card, image data, image data transmission method, and image analysis system
CN113947097B (en) Two-dimensional code identification method and electronic equipment
KR100784200B1 (en) Method and Device for decoding the code having code information according to image
JP5314521B2 (en) Image processing system and image processing method
KR101625751B1 (en) AR marker having boundary code, and system, and method for providing augmented reality using the same
WO2018061189A1 (en) Information processing device, display method, reading method, and computer-readable non-transitory storage medium
KR102596670B1 (en) System for providing augmented reality content using products printed with ar markers
CN102968611A (en) Information processor and information processing method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090602

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090818

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4364186

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120828

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130828

Year of fee payment: 4

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

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees