JP2009181346A - Image processor, pen device, and program - Google Patents

Image processor, pen device, and program Download PDF

Info

Publication number
JP2009181346A
JP2009181346A JP2008019872A JP2008019872A JP2009181346A JP 2009181346 A JP2009181346 A JP 2009181346A JP 2008019872 A JP2008019872 A JP 2008019872A JP 2008019872 A JP2008019872 A JP 2008019872A JP 2009181346 A JP2009181346 A JP 2009181346A
Authority
JP
Japan
Prior art keywords
angle
unit
dot
image
unit images
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008019872A
Other languages
Japanese (ja)
Inventor
Kenji Onishi
健司 大西
Takashi Sonoda
隆志 園田
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP2008019872A priority Critical patent/JP2009181346A/en
Publication of JP2009181346A publication Critical patent/JP2009181346A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To detect the direction of a pattern image by specifying a direction in which unit images configuring the pattern image are arranged. <P>SOLUTION: An image processor includes: a position detection part for imaging a recording medium in which unit images arrayed along at least two directions crossing at a prescribed angle are recorded by an imaging part, and for detecting unit images (dots) from the acquired image; a near dot pair detection part 221 for detecting a pair of near dots being the combination of the most closely positioned unit images as regards the unit images detected from the image by the position detection part; a first axial angle extraction part 223, a second axial angle extraction part 224, a third axial angle extraction part 225 and an angle specification part 226 for specifying an angle showing the inclination of the array of the unit images on the basis of the appearance frequency of the inclination of a straight line connecting the respective unit images configuring the pair of near dots detected by the near dot pair detection part 221. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、画像処理装置、ペン・デバイスおよびプログラムに関する。   The present invention relates to an image processing apparatus, a pen device, and a program.

印刷用紙等の媒体上にコード化された情報を表すパターン画像や特定の意味を付与されたパターン画像を埋め込み、読み取り装置で読み取ってコード情報を復号したり付与された意味に応じて装置を制御したりすることが、従来から行われている。パターン画像により表される情報としては、パターン画像が埋め込まれた媒体自体の識別情報や媒体に記録された文書の識別情報、媒体上の位置を表す位置情報などがある。   Embed a pattern image representing information coded on a medium such as printing paper or a pattern image with a specific meaning, read it with a reading device, decode the code information, and control the device according to the given meaning It has been performed conventionally. Information represented by the pattern image includes identification information of the medium itself in which the pattern image is embedded, identification information of a document recorded on the medium, position information indicating a position on the medium, and the like.

この種の技術では、パターン画像で記述したコード情報を復号するために、読み取り画像におけるパターン画像の向きを検出することが必要である。特に、ペン・デバイスのような使用者が手に持って操作する読み取り装置は、媒体に対する読み取り装置の向きや角度が随時変わるため、適切にパターン画像の向きを検出することが非常に重要である。   In this type of technology, it is necessary to detect the orientation of the pattern image in the read image in order to decode the code information described in the pattern image. In particular, it is very important to properly detect the orientation of a pattern image in a reading device such as a pen device that is held and operated by a user, because the orientation and angle of the reading device with respect to a medium change from time to time. .

特許文献1には、コード枠とコード枠に囲まれたセルとを含む2次元コードにおいて、データ等と共にコードの向きを表すパターンがセルに記録される従来技術が開示されている。   Patent Document 1 discloses a conventional technique in which, in a two-dimensional code including a code frame and a cell surrounded by the code frame, a pattern indicating the direction of the code together with data or the like is recorded in the cell.

特開2006−85679号公報JP 2006-85679 A

媒体に埋め込まれるパターン画像は、情報密度を上げるために冗長なパターンを少なくすることが望まれる。
本発明は、以上のような課題に鑑みてなされたものであり、パターン画像を構成する単位画像が並ぶ方向を特定し、パターン画像の向きを検出できるようにすることを目的とする。また、読み取った画像に歪みがある場合でも単位画像が並ぶ方向を特定できるようにすることを目的とする。
The pattern image embedded in the medium is desired to reduce redundant patterns in order to increase the information density.
The present invention has been made in view of the above problems, and an object of the present invention is to identify the direction in which unit images constituting a pattern image are arranged and to detect the direction of the pattern image. It is another object of the present invention to specify the direction in which unit images are arranged even when the read image is distorted.

請求項1に係る発明は、所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像装置により撮像して得られた画像から単位画像を検出する単位画像検出手段と、前記単位画像検出手段により前記画像から検出された単位画像に関して、最も近い位置にある単位画像どうしの組み合わせを検出する組み合わせ検出手段と、前記組み合わせ検出手段により検出された単位画像の組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する角度特定手段とを備えることを特徴とする画像処理装置である。
請求項2に係る発明は、前記角度特定手段により角度が特定された配列における前記単位画像の基準間隔を、前記単位画像の組み合わせを構成する各単位画像の間の距離に基づいて特定する間隔特定手段をさらに備える請求項1に記載の画像処理装置である。
請求項3に係る発明は、前記角度特定手段は、前記単位画像を結ぶ直線の傾きのうち、出現頻度の最も高い角度を第1の角度とし、当該第1の角度に対して所定の角度だけ遷移させた基準角度を含む一定範囲において出現頻度の最も高い角度を第2の角度とし、当該第1の角度および当該第2の角度を前記2方向の角度とすることを特徴とする請求項1に記載の画像処理装置である。
請求項4に係る発明は、前記角度特定手段は、前記基準角度に対して前記第2の角度の対称となる角度を含む一定範囲において出現頻度の最も高い角度を第3の角度とし、所定の基準に基づいて、前記第1の角度と前記第2の角度と当該第3の角度のうち2つを選んで、前記2方向の角度とすることを特徴とする請求項3に記載の画像処理装置である。
請求項5に係る発明は、前記単位画像検出手段により検出された単位画像および前記角度特定手段により特定された当該単位画像の配列の角度に基づき、当該単位画像によって符号化されて記録された情報を復号する復号手段をさらに備え、前記角度特定手段は、前記第1の角度、第2の角度、第3の角度のうち、前記復号手段による復号が成功したときの前記単位画像の配列の角度に近い2つの角度を選択することを特徴とする請求項4に記載の画像処理装置である。
請求項6に係る発明は、所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像する撮像手段と、前記撮像手段により撮像して得られた画像から単位画像を検出する単位画像検出手段と、前記単位画像検出手段により前記画像から検出された単位画像に関して、最も近い位置にある単位画像どうしの組み合わせを検出する組み合わせ検出手段と、前記組み合わせ検出手段により検出された単位画像の組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する角度特定手段とを備えることを特徴とするペン・デバイスである。
請求項7に係る発明は、前記角度特定手段により角度が特定された配列における前記単位画像の基準間隔を、前記単位画像の組み合わせを構成する各単位画像の間の距離に基づいて特定する間隔特定手段をさらに備える請求項6に記載のペン・デバイスである。
請求項8に係る発明は、コンピュータに、所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像装置により撮像して得られた画像から単位画像を検出する機能と、前記画像から検出された単位画像に関して、最も近い位置にある単位画像どうしの組み合わせを検出する機能と、検出された単位画像の組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する機能と、を実現させるためのプログラムである。
請求項9に係る発明は、前記コンピュータに、角度が特定された配列における前記単位画像の基準間隔を、前記単位画像の組み合わせを構成する各単位画像の間の距離に基づいて特定する機能をさらに実現させる請求項8に記載のプログラムである。
The invention according to claim 1 is a unit image for detecting a unit image from an image obtained by imaging a recording medium on which unit images arranged along at least two directions intersecting at a predetermined angle are recorded by an imaging device. A combination of a detection unit, a combination detection unit that detects a combination of unit images that are closest to each other with respect to a unit image detected from the image by the unit image detection unit, and a combination of unit images detected by the combination detection unit And an angle specifying means for specifying an angle representing the inclination of the arrangement of the unit images on the basis of the appearance frequency of the inclination of the straight line connecting the unit images constituting the unit image.
According to a second aspect of the present invention, the interval specification for specifying the reference interval of the unit images in the array in which the angle is specified by the angle specifying means based on the distance between the unit images constituting the combination of the unit images. The image processing apparatus according to claim 1, further comprising means.
According to a third aspect of the present invention, the angle specifying means sets the angle having the highest appearance frequency among the inclinations of the straight lines connecting the unit images as a first angle, and only a predetermined angle with respect to the first angle. The angle having the highest appearance frequency in a certain range including the transitioned reference angle is defined as a second angle, and the first angle and the second angle are defined as angles in the two directions. The image processing apparatus described in the above.
According to a fourth aspect of the present invention, the angle specifying means sets the angle having the highest appearance frequency as a third angle in a certain range including an angle that is symmetrical to the second angle with respect to the reference angle. 4. The image processing according to claim 3, wherein two of the first angle, the second angle, and the third angle are selected based on a reference and set as the angles in the two directions. 5. Device.
The invention according to claim 5 is the information encoded and recorded by the unit image based on the unit image detected by the unit image detecting unit and the angle of the arrangement of the unit images specified by the angle specifying unit. The angle specifying means includes an angle of the arrangement of the unit images when the decoding by the decoding means is successful among the first angle, the second angle, and the third angle. The image processing apparatus according to claim 4, wherein two angles close to are selected.
According to a sixth aspect of the present invention, there is provided an imaging means for imaging a recording medium on which unit images arranged along at least two directions intersecting at a predetermined angle are recorded, and an image obtained by imaging by the imaging means. A unit image detecting unit for detecting a unit image, a combination detecting unit for detecting a combination of unit images located closest to the unit image detected from the image by the unit image detecting unit, and the combination detecting unit. A pen comprising: an angle specifying means for specifying an angle representing an inclination of the arrangement of the unit images based on an appearance frequency of a slope of a straight line connecting the unit images constituting the combination of the detected unit images; -It is a device.
The invention according to claim 7 is the interval specification that specifies the reference interval of the unit images in the array in which the angle is specified by the angle specifying unit based on the distance between the unit images constituting the combination of the unit images. The pen device according to claim 6, further comprising means.
According to an eighth aspect of the invention, a unit image is detected from an image obtained by imaging a recording medium on which a unit image arranged along at least two directions intersecting at a predetermined angle is recorded by an imaging device. A function for detecting the combination of unit images located closest to the unit image detected from the image, and the appearance of a slope of a straight line connecting the unit images constituting the combination of detected unit images And a function for specifying an angle representing the inclination of the arrangement of the unit images based on the frequency.
The invention according to claim 9 further includes a function of specifying, in the computer, a reference interval of the unit images in the array in which the angles are specified based on a distance between the unit images constituting the unit image combination. The program according to claim 8 to be realized.

請求項1に係る発明によれば、近接する単位画素の組み合わせに基づいて、単位画素の配列の傾きを特定することができる。
請求項2に係る発明によれば、単位画素の配列の傾きと共に、単位画素の基準間隔を特定することができる。
請求項3に係る発明によれば、単位画素の配列における2方向の傾きを特定することができる。
請求項4に係る発明によれば、単位画像の並びが3方向検出される場合でも、単位画素の配列における2方向の傾きを特定することができる。
請求項5に係る発明によれば、情報の復号の成否に基づいて、単位画素の配列における傾きを、より適切に特定することができる。
請求項6に係る発明によれば、ペン・デバイスにおいて、近接する単位画素の組み合わせに基づいて、単位画素の配列の傾きを特定することができる。
請求項7に係る発明によれば、ペン・デバイスにおいて、単位画素の配列の傾きと共に、単位画素の基準間隔を特定することができる。
請求項8に係る発明によれば、画像処理装置の機能を実現するコンピュータにおいて、近接する単位画素の組み合わせに基づいて、単位画素の配列の傾きを特定することができる。
請求項9に係る発明によれば、画像処理装置の機能を実現するコンピュータにおいて、単位画素の配列の傾きと共に、単位画素の基準間隔を特定することができる。
According to the first aspect of the present invention, it is possible to specify the inclination of the arrangement of unit pixels based on the combination of adjacent unit pixels.
According to the second aspect of the present invention, the unit pixel reference interval can be specified along with the inclination of the unit pixel array.
According to the third aspect of the present invention, it is possible to specify the inclination in two directions in the unit pixel array.
According to the fourth aspect of the present invention, even when the arrangement of unit images is detected in three directions, the inclination in two directions in the arrangement of unit pixels can be specified.
According to the invention which concerns on Claim 5, the inclination in the arrangement | sequence of a unit pixel can be specified more appropriately based on the success or failure of decoding of information.
According to the invention of claim 6, in the pen device, the inclination of the arrangement of the unit pixels can be specified based on the combination of the adjacent unit pixels.
According to the invention of claim 7, in the pen device, the reference interval of the unit pixels can be specified together with the inclination of the arrangement of the unit pixels.
According to the eighth aspect of the present invention, in the computer that realizes the function of the image processing apparatus, the inclination of the arrangement of unit pixels can be specified based on the combination of adjacent unit pixels.
According to the ninth aspect of the present invention, in the computer that implements the function of the image processing apparatus, the unit pixel reference interval can be specified along with the inclination of the unit pixel array.

以下、添付図面を参照して、本発明の実施形態について詳細に説明する。
本実施形態は、紙等の媒体に印刷されたパターン画像を読み取り、このパターン画像によって記録された情報(コード情報等)を復号する処理に関するものである。本実施形態の前提として、まず、パターン画像の構成例について説明する。
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The present embodiment relates to a process of reading a pattern image printed on a medium such as paper and decoding information (code information or the like) recorded by the pattern image. As a premise of the present embodiment, first, a configuration example of a pattern image will be described.

<パターン画像の構成例>
本実施形態では、媒体である紙面全体または紙面の特定の領域に、特定の情報を表す情報ブロックが配置される。情報ブロックは、意味のある情報を表現するパターンの最小単位である。この情報ブロックは、複数のパターンブロックの集合で構成され、このパターンブロックには、単位符号パターンが配置される。単位符号パターンは、情報を記録するための符号を表すものであり、パターン画像の最小単位である。
<Configuration example of pattern image>
In the present embodiment, an information block representing specific information is arranged in the entire paper surface as a medium or in a specific area on the paper surface. An information block is a minimum unit of a pattern expressing meaningful information. This information block is composed of a set of a plurality of pattern blocks, and a unit code pattern is arranged in this pattern block. The unit code pattern represents a code for recording information and is the minimum unit of the pattern image.

図1は、単位符号パターン、情報ブロック、紙面(媒体)の関係を示す図である。
図1において、単位符号パターンP1の集合により、情報ブロックP2が構成されている。そして、情報ブロックP2の集合により、紙面の太枠で囲まれた領域P3に情報が記録されている。次に、この単位符号パターンおよび情報ブロックの具体的な構成例について、詳細に説明する。
FIG. 1 is a diagram showing the relationship between unit code patterns, information blocks, and paper (medium).
In FIG. 1, an information block P2 is configured by a set of unit code patterns P1. Information is recorded in a region P3 surrounded by a thick frame on the paper surface by a set of information blocks P2. Next, a specific configuration example of the unit code pattern and the information block will be described in detail.

本実施の形態では、m(m≧3)箇所から選択したn(1≦n<m)箇所に単位画像を配置してなるパターン画像によってmCn(=m!/{(m−n)!×n!})通りの情報を表現する。このパターン画像を、単位符号パターンとする。つまり、1つの単位画像を情報に対応させるのではなく、複数の単位画像を情報に対応させている。仮に1つの単位画像を情報に対応させたとすると、単位画像が欠損したり、ノイズが加わったりした場合に、誤った情報を表現してしまうという欠点がある。これに対して、例えば2つの単位画像を情報に対応させたとすると、単位画像が1つであったり3つであったりした場合に、容易に誤りであることが分かる。さらに、1つの単位画像で1ビット、または、高々2ビットを表現する方法では、情報を表現するパターンと視覚的に似たパターンで、情報パターンの読出しを制御する同期パターンを表現することができない。このようなことから、本実施形態では、上記のような符号化方式を採用している。以下では、このような符号化方式をmCn方式と称する。
ここで、単位画像としては、いかなる形状のものを用いてもよいが、本実施の形態では、単位画像の一例としてドット画像(以下、単に「ドット」という)を用いている。
In the present embodiment, mCn (= m! / {(Mn)! ×) by a pattern image in which unit images are arranged at n (1 ≦ n <m) locations selected from m (m ≧ 3) locations. n!}) Represents street information. This pattern image is a unit code pattern. That is, instead of associating one unit image with information, a plurality of unit images are associated with information. Assuming that one unit image is associated with information, there is a drawback in that erroneous information is expressed when the unit image is lost or noise is added. On the other hand, for example, if two unit images are associated with information, it can be easily understood that there is an error when the number of unit images is one or three. Further, in the method of expressing 1 bit or 2 bits at most in one unit image, it is not possible to express a synchronous pattern that controls reading of the information pattern with a pattern visually similar to the pattern that represents information. . For this reason, in the present embodiment, the above encoding method is adopted. Hereinafter, such an encoding method is referred to as an mCn method.
Here, the unit image may have any shape, but in the present embodiment, a dot image (hereinafter simply referred to as “dot”) is used as an example of the unit image.

図2は、mCn方式における単位符号パターンの例を示す図である。
図2に示す例では、黒色の領域と斜線の領域をドット配置可能な領域としている。このドット配置可能な領域の間にある白色の領域は、個々のドットを識別するための隙間(空白)を形成するドット配置不可能な領域である。ドット配置可能な領域のうち、黒色の領域にドットが配置され、斜線の領域にはドットが配置されていないことを示している。すなわち、図2は、縦3ドット、横3ドットの合計9ドットを配置可能な領域を設けた例を示しており、(a)は、ドット配置可能な領域に2ドットを配置する9C2方式における単位符号パターンであり、(b)は、ドット配置可能な領域に3ドットを配置する9C3方式における単位符号パターンである。
FIG. 2 is a diagram illustrating an example of a unit code pattern in the mCn system.
In the example shown in FIG. 2, the black area and the hatched area are areas where dots can be arranged. The white area between the dot-placeable areas is a non-dot-placeable area that forms a gap (blank) for identifying individual dots. Of the areas where dots can be arranged, dots are arranged in black areas and dots are not arranged in hatched areas. That is, FIG. 2 shows an example in which a region where a total of 9 dots of 3 dots in the vertical direction and 3 dots in the horizontal direction can be arranged is provided. FIG. FIG. 6B shows a unit code pattern, and FIG. 5B shows a unit code pattern in the 9C3 system in which 3 dots are arranged in a dot arrangementable area.

ところで、図2で配置されるドット(黒色の領域)は、あくまで情報表現のためのドットであり、画像を構成する最小単位であるドット(図2の最小の四角)とは必ずしも一致しない。本実施形態において、「ドット」というときは前者のドットを指し、後者のドットは「ピクセル」と呼ぶことにすれば、ドットは、600dpiにおける2ピクセル×2ピクセルの大きさを有することになる。600dpiにおける1ピクセルの大きさは0.0423mmなので、ドットの一辺は、84.6μm(=0.0423mm×2)である。ドットは、大きくなればなるほど目に付きやすくなるため、できるだけ小さいほうが好ましい。ところが、あまり小さくすると、プリンタで印刷できなくなってしまう。そこで、ドットの大きさとして、50μmより大きく100μmより小さい上記の値を採用している。ただし、上記の値84.6μmは、あくまで計算上の数値であり、実際に印刷されたトナー像では100μm程度になる。   By the way, the dots (black areas) arranged in FIG. 2 are only for information representation, and do not necessarily match the dots (minimum squares in FIG. 2) which are the minimum units constituting the image. In the present embodiment, when “dot” refers to the former dot and the latter dot is referred to as “pixel”, the dot has a size of 2 pixels × 2 pixels at 600 dpi. Since the size of one pixel at 600 dpi is 0.0423 mm, one side of the dot is 84.6 μm (= 0.0423 mm × 2). The larger the dot, the more likely it will be noticeable, so it is preferable to make it as small as possible. However, if it is too small, printing with a printer becomes impossible. Therefore, the above value is adopted as the dot size, which is larger than 50 μm and smaller than 100 μm. However, the above value 84.6 μm is a numerical value to the last, and is about 100 μm in the actually printed toner image.

図3は、図2に示した単位符号パターンの種類を網羅的に示した図である。なお、この図では、表示の簡略化のためドット間の空白を省略している。
図3(a)は、図2(a)に示した9C2方式における全ての単位符号パターンを示している。9C2方式では、これらの単位符号パターンを用いて、36(=)通りの情報を表現する。また、図3(b)は、図2(b)に示した9C3方式における全ての単位符号パターンを示している。9C3方式では、これらの単位符号パターンを用いて、84(=)通りの情報を表現する。
FIG. 3 is a diagram comprehensively showing the types of unit code patterns shown in FIG. In this figure, a space between dots is omitted for simplification of display.
FIG. 3A shows all unit code patterns in the 9C2 system shown in FIG. In the 9C2 system, 36 (= 9 C 2 ) types of information are expressed using these unit code patterns. FIG. 3B shows all unit code patterns in the 9C3 system shown in FIG. In the 9C3 system, 84 (= 9 C 3 ) types of information are expressed using these unit code patterns.

なお、単位符号パターンは、m=9の場合に限定されるものではなく、mの値として、例えば、4、16等の値を採用してもよい。また、nの値も1≦n<mを満たしていればいかなる値を採用してもよい。
また、mの値としては、平方数(整数の2乗)だけでなく、異なる2つの整数の積を採用してもよい。つまり、ドットを配置可能な領域は、3ドット×3ドットを配置する場合のような正方形の領域に限らず、3ドット×4ドットを配置する場合のような長方形の領域であってもよい。なお、本明細書において、長方形とは、隣り合う2辺の長さが等しくない矩形のことをいうものとする。
Note that the unit code pattern is not limited to m = 9, and a value such as 4, 16 may be employed as the value of m. Any value of n may be adopted as long as 1 ≦ n <m is satisfied.
Further, as the value of m, not only a square number (the square of an integer) but also a product of two different integers may be adopted. That is, the area in which dots can be arranged is not limited to a square area as in the case of arranging 3 dots × 3 dots, but may be a rectangular area as in the case of arranging 3 dots × 4 dots. In the present specification, the rectangle means a rectangle in which the lengths of two adjacent sides are not equal.

ところで、mCn方式における全ての単位符号パターンには、各単位符号パターンを識別するための番号であるパターン値が付されている。
図4に、9C2方式における単位符号パターンとパターン値との対応を示す。9C2方式における単位符号パターンは36個であるので、パターン値としては0〜35が用いられる。ただし、図4に示した対応はあくまで一例であり、どの単位符号パターンにどのパターン値を割り当ててもよい。なお、9C3方式については、図示しないが、各単位符号パターンに0〜83のパターン値が付されることになる。
By the way, all unit code patterns in the mCn system are assigned pattern values that are numbers for identifying each unit code pattern.
FIG. 4 shows the correspondence between unit code patterns and pattern values in the 9C2 system. Since there are 36 unit code patterns in the 9C2 system, 0 to 35 are used as pattern values. However, the correspondence shown in FIG. 4 is merely an example, and any pattern value may be assigned to any unit code pattern. In addition, although not shown in the figure for the 9C3 method, each unit code pattern is assigned a pattern value of 0 to 83.

このように、m箇所からn箇所を選択することでmCn種類の単位符号パターンを用意しているが、本実施形態では、これらの単位符号パターンのうち、特定のパターンを情報パターンとして利用し、残りを同期パターンとして利用する。ここで、情報パターンとは、媒体に埋め込む情報を表現するパターンである。また、同期パターンとは、媒体に埋め込まれた情報パターンを取り出すために用いられるパターンである。例えば、情報パターンの位置を特定したり、画像の回転を検出したりするために用いられる。なお、媒体としては、画像を印刷することが可能であれば、いかなるものを用いてもよい。紙が最も一般的に用いられるので、以下では媒体を紙として説明するが、金属、プラスチック、繊維等であってもよい。   In this way, mCn types of unit code patterns are prepared by selecting n locations from m locations, but in this embodiment, a specific pattern is used as an information pattern among these unit code patterns, Use the rest as a synchronization pattern. Here, the information pattern is a pattern representing information to be embedded in the medium. The synchronization pattern is a pattern used for extracting an information pattern embedded in the medium. For example, it is used for specifying the position of the information pattern or detecting the rotation of the image. Any medium may be used as long as an image can be printed. Since paper is most commonly used, the medium will be described as paper in the following, but it may be metal, plastic, fiber, or the like.

ここで、同期パターンについて説明する。
図5は、9C2方式における同期パターンの例である。
図5に示すように、単位符号パターンが正方形(縦横のドット数が同じ)である場合は、画像の回転の検出のために4種類の単位符号パターンを同期パターンとして用意する必要がある。ここでは、パターン値32の単位符号パターンを正立した同期パターンとしている。また、パターン値33の単位符号パターンを右に90度回転した同期パターン、パターン値34の単位符号パターンを右に180度回転した同期パターン、パターン値35の単位符号パターンを右に270度回転した同期パターンとしている。この場合、36種類の単位符号パターンからこの4種類の同期パターンを除いた残りを情報パターンとし、5ビットの情報を表現するとよい。ただし、36種類の単位符号パターンの情報パターンと同期パターンへの振り分け方は、これには限らない。例えば、4種類で1組を構成する同期パターンの組を5つ用意し、残りの16種類の情報パターンで4ビットの情報を表現してもよい。
Here, the synchronization pattern will be described.
FIG. 5 is an example of a synchronization pattern in the 9C2 system.
As shown in FIG. 5, when the unit code pattern is a square (the same number of vertical and horizontal dots), it is necessary to prepare four types of unit code patterns as synchronization patterns in order to detect image rotation. Here, the unit code pattern of the pattern value 32 is an upright synchronization pattern. In addition, the unit code pattern of the pattern value 33 is rotated 90 degrees to the right, the synchronization pattern of the pattern value 34 is rotated 180 degrees to the right, and the unit code pattern of the pattern value 35 is rotated 270 degrees to the right. The synchronization pattern is used. In this case, 5-bit information may be expressed by using the remainder obtained by removing these four types of synchronization patterns from 36 types of unit code patterns as an information pattern. However, the method of assigning 36 types of unit code patterns to information patterns and synchronization patterns is not limited to this. For example, five sets of synchronization patterns that constitute one set of four types may be prepared, and the remaining 16 types of information patterns may represent 4-bit information.

一方、特に図示しないが、単位符号パターンが長方形(縦横のドット数が異なる)である場合は、画像の回転の検出のために2種類の単位符号パターンを同期パターンとして用意すればよい。例えば、縦3ドット×横4ドットを配置可能な領域が検出されるべきなのに、縦4ドット×横3ドットを配置可能な領域が検出された場合は、その時点で画像が90度または270度回転していることが分かるからである。   On the other hand, although not particularly illustrated, when the unit code pattern is a rectangle (different in the number of vertical and horizontal dots), two types of unit code patterns may be prepared as synchronization patterns in order to detect image rotation. For example, when an area in which 3 dots in the vertical direction and 4 dots in the horizontal direction should be detected but an area in which 4 dots in the vertical direction and 3 dots in the horizontal direction can be arranged is detected, the image is 90 degrees or 270 degrees at that time. It is because it turns out that it is rotating.

次に、上記の符号パターンを配置して識別情報と座標情報を表現する方法を述べる。
まず、単位符号パターンにより構成される情報ブロックについて説明する。
図6は、情報ブロックの構成例を示す図である。
図6に示す例では、9C2方式における単位符号パターンを使用していることも同時に示している。すなわち、36種類の単位符号パターンを、例えば、同期パターンとして使用する4パターンと、情報パターンとして使用する32パターンとに分け、各パターンをレイアウトに従って配置する。
Next, a method for expressing the identification information and the coordinate information by arranging the above code patterns will be described.
First, an information block composed of unit code patterns will be described.
FIG. 6 is a diagram illustrating a configuration example of an information block.
In the example shown in FIG. 6, it is shown at the same time that the unit code pattern in the 9C2 system is used. That is, 36 types of unit code patterns are divided into, for example, 4 patterns used as synchronization patterns and 32 patterns used as information patterns, and each pattern is arranged according to a layout.

また、図6に示す例では、情報ブロックのレイアウトとして、3ドット×3ドットの単位符号パターンを配置可能なパターンブロックを5個×5個の25個並べたものを採用している。そして、この25個のパターンブロックのうち、左上の1ブロックに同期パターンを配置している。また、同期パターンの右の4ブロックに紙面上のX方向の座標を特定するX座標情報を表す情報パターンを配置し、同期パターンの下の4ブロックに紙面上のY方向の座標を特定するY座標情報を表す情報パターンを配置している。さらに、これらの座標情報を表す情報パターンで囲まれた16ブロックに、紙面または紙面に印刷される文書の識別情報を表す情報パターンを配置している。
なお、上述した9C2方式における単位符号パターンは例示に過ぎず、図の左下に示すように、9C3方式における単位符号パターンを使用してもよい。
Further, in the example shown in FIG. 6, a layout in which 25 pattern blocks in which 5 × 5 unit code patterns of 3 × 3 dots can be arranged is arranged is used as the information block layout. Of the 25 pattern blocks, a synchronization pattern is arranged in one block at the upper left. In addition, an information pattern representing X coordinate information that specifies coordinates in the X direction on the paper surface is arranged in the four blocks to the right of the synchronization pattern, and the Y direction coordinates on the paper surface are specified in the four blocks below the synchronization pattern. An information pattern representing coordinate information is arranged. Furthermore, an information pattern representing the identification information of the document printed on the paper surface or the paper surface is arranged in 16 blocks surrounded by the information pattern representing the coordinate information.
The unit code pattern in the 9C2 system described above is merely an example, and the unit code pattern in the 9C3 system may be used as shown in the lower left of the figure.

次に、本実施形態における識別情報と座標情報を表現するためのレイアウトについて説明する。
図7に、このようなレイアウトの一部を示す。
図7に示すレイアウトでは、図6に示した情報ブロックを基本単位とし、この情報ブロックを紙面全体に周期的に配置する。図では、同期パターンを「S」で表し、X座標を表すパターンを「X1」、「X2」、…で表し、Y座標を表すパターンを「Y1」、「Y2」、…で表している。座標情報は、例えば紙面の縦及び横に渡ってM系列で表現する。また、識別情報の符号化には、幾つかの方法の利用が考えられるが、本実施形態では、RS符号化が適している。RS符号は多値の符号法であり、この場合、ブロックの表現をRS符号の多値に対応させるとよいからである。図7では、識別情報を表すパターンを「IXY」(X=1〜4,Y=1〜4)で表している。
Next, a layout for expressing identification information and coordinate information in the present embodiment will be described.
FIG. 7 shows a part of such a layout.
In the layout shown in FIG. 7, the information block shown in FIG. 6 is used as a basic unit, and this information block is periodically arranged on the entire sheet. In the figure, the synchronization pattern is represented by “S”, the pattern representing the X coordinate is represented by “X1”, “X2”,..., And the pattern representing the Y coordinate is represented by “Y1”, “Y2”,. The coordinate information is expressed in M series over, for example, the vertical and horizontal directions of the page. Further, although some methods can be used for encoding the identification information, RS encoding is suitable in this embodiment. This is because the RS code is a multi-level coding method, and in this case, the block representation should correspond to the multi-value of the RS code. In FIG. 7, the pattern representing the identification information is represented by “IXY” (X = 1 to 4, Y = 1 to 4).

ここで、座標情報を表現するのに用いるM系列について説明する。
M系列とは、その部分列が、他の部分列と一致することがない系列である。例えば、11次のM系列は、2047ビットのビット列である。そして、この2047ビットのビット列の中から取り出された11ビット以上の部分列と同じ並びは、この2047ビットのビット列の中に自身以外には存在しない。本実施形態では、16個の単位符号パターンを4ビットに対応付ける。すなわち、2047ビットのビット列を4ビットごとに10進数で表し、図4に示したような数値対応に従って単位符号パターンを決定し、座標符号として紙面の横と縦に渡って表現する。したがって、復号の際は、3つの連続する単位符号パターンを特定することにより、ビット列上の位置が特定されることになる。
Here, the M series used for expressing the coordinate information will be described.
The M sequence is a sequence whose partial sequence does not match other partial sequences. For example, the eleventh order M-sequence is a bit string of 2047 bits. The same sequence as the partial sequence of 11 bits or more extracted from the 2047-bit bit string does not exist in the 2047-bit bit string other than itself. In the present embodiment, 16 unit code patterns are associated with 4 bits. That is, a 2047-bit bit string is represented in decimal notation for every 4 bits, a unit code pattern is determined according to the numerical value correspondence as shown in FIG. 4, and is expressed as a coordinate code across the paper in the horizontal and vertical directions. Therefore, at the time of decoding, the position on the bit string is specified by specifying three consecutive unit code patterns.

図8に、M系列を用いた座標情報の符号化の例を示す。
(a)は、11次のM系列の例として、「0111000101011010000110010…」というビット列を示している。本実施の形態では、これを4ビットずつに区切り、1つ目の部分列「0111」をパターン値7の単位符号パターンとして、2つ目の部分列「0001」をパターン値1の単位符号パターンとして、3つ目の部分列「0101」をパターン値5の単位符号パターンとして、4つ目の部分列「1010」をパターン値10の単位符号パターンとして、それぞれ紙面上に配置する。
FIG. 8 shows an example of encoding coordinate information using an M sequence.
(A) shows a bit string “0111000101011010000110010...” As an example of the 11th order M-sequence. In the present embodiment, this is divided into 4 bits, and the first partial sequence “0111” is a unit code pattern of pattern value 7 and the second partial sequence “0001” is a unit code pattern of pattern value 1. As a result, the third partial sequence “0101” is arranged as a unit code pattern with a pattern value of 5, and the fourth partial sequence “1010” is arranged as a unit code pattern of a pattern value of 10, respectively.

このように、4ビットずつ区切って単位符号パターンに割り当てると、(b)に示すように、4周期で全てのパターン列を表現できる。すなわち、11次のM系列は、2047ビットなので、この系列を4ビットごとに切り出し、単位符号パターンで表現していくと、最後に3ビットあまることになる。この3ビットに、M系列の最初の1ビットを加えて4ビットとし単位符号パターンで表す。さらに、M系列の2ビット目から4ビットごとに切り出し単位符号パターンで表す。すると、次の周期は、M系列の3ビット目から始まり、その次の周期は、M系列の4ビット目から始まる。さらに、5周期目は、5ビット目からとなるが、これは最初の周期と一致する。したがって、M系列の4周期を4ビットごとに切り出していくと、2047個の単位符号パターンで全てを尽くすことができる。M系列は11次であるので、3つの連続する単位符号パターンは、他のどの位置の連続する符号パターンとも一致することはない。そこで、読出し時には3つの単位符号パターンを読み出せば、復号が可能である。ただし、本実施形態では、誤りの発生を考慮し、4つの単位符号パターンで座標情報を表現している。   As described above, when 4 bits are divided and assigned to the unit code pattern, all pattern strings can be expressed in 4 cycles as shown in FIG. That is, since the 11th order M-sequence is 2047 bits, if this sequence is cut out every 4 bits and expressed by a unit code pattern, 3 bits will be added at the end. The first 1 bit of the M sequence is added to these 3 bits to form 4 bits, which are represented by a unit code pattern. Further, the unit code pattern is cut out every 4 bits from the second bit of the M sequence. Then, the next cycle starts from the third bit of the M sequence, and the next cycle starts from the fourth bit of the M sequence. Furthermore, the 5th cycle starts from the 5th bit, which coincides with the first cycle. Therefore, if four cycles of the M sequence are cut out every 4 bits, it is possible to use all 2047 unit code patterns. Since the M sequence is 11th order, the three consecutive unit code patterns do not match the continuous code pattern at any other position. Therefore, decoding can be performed by reading three unit code patterns at the time of reading. However, in the present embodiment, coordinate information is expressed by four unit code patterns in consideration of occurrence of errors.

ところで、このような符号化を行った場合、4周期のM系列は2047個のブロックに分割して格納される。そして、図7のようなレイアウトでは、同期パターンを配置したブロックが間に挟まれるので、4周期のM系列で2558個(≒2047個×5/4)のブロック分の長さをカバーすることになる。1つのブロックの一辺の長さは、0.508mm(600dpiで12ピクセル)なので、2558個のブロックの長さは1299.5mmである。つまり、1299.5mmの長さが符号化されることになる。A0サイズの長辺が1188.0mmであるので、本実施の形態では、A0サイズの用紙上の座標を符号化することになる。   By the way, when such encoding is performed, the M sequence of 4 periods is divided into 2047 blocks and stored. In the layout as shown in FIG. 7, since the blocks where the synchronization pattern is arranged are sandwiched between them, the length of 2558 blocks (≈2047 × 5/4) is covered with the M sequence of 4 cycles. become. Since the length of one side of one block is 0.508 mm (12 pixels at 600 dpi), the length of 2558 blocks is 1299.5 mm. That is, a length of 1299.5 mm is encoded. Since the long side of the A0 size is 1188.0 mm, in this embodiment, the coordinates on the A0 size paper are encoded.

以上のように構成されるパターン画像は、例えば電子写真方式を用いて、Kトナー(カーボンを含む赤外光吸収トナー)、または、特殊トナーにより、媒体である紙面上に形成される。
ここで、特殊トナーとしては、可視光領域(400nm〜700nm)における最大吸収率が7%以下であり、近赤外領域(800nm〜1000nm)における吸収率が30%以上の不可視トナーが例示される。ここで、「可視」及び「不可視」は、目視により認識できるかどうかとは関係しない。印刷された紙面に形成された画像が可視光領域における特定の波長の吸収に起因する発色性の有無により認識できるかどうかで「可視」と「不可視」とを区別している。また、可視光領域における特定の波長の吸収に起因する発色性が若干あるが、人間の目で認識し難いものも「不可視」に含める。
The pattern image configured as described above is formed on a sheet of paper, which is a medium, using K toner (infrared light absorbing toner containing carbon) or special toner, for example, using an electrophotographic system.
Here, as the special toner, an invisible toner having a maximum absorption rate of 7% or less in the visible light region (400 nm to 700 nm) and an absorption rate of 30% or more in the near infrared region (800 nm to 1000 nm) is exemplified. . Here, “visible” and “invisible” are not related to whether they can be recognized visually. “Visible” and “invisible” are distinguished based on whether or not an image formed on the printed paper can be recognized by the presence or absence of color development due to absorption of a specific wavelength in the visible light region. Further, “invisible” includes those that have some color developability due to absorption of a specific wavelength in the visible light region but are difficult to recognize with human eyes.

<画像処理装置の構成および動作>
次に、紙面上に印刷された(媒体上に形成された)パターン画像を読み取る画像処理装置について説明する。
図9は、画像処理装置の機能構成例を示す図である。
図9に示すように、画像処理装置10は、パターン画像を撮像する撮像部100と、パターン画像を形成するドットを検出するドット解析部200と、検出されたドットにより単位符号パターンや情報ブロックを復元し情報を復号する復号部300とを備える。
<Configuration and Operation of Image Processing Device>
Next, an image processing apparatus that reads a pattern image printed on a paper surface (formed on a medium) will be described.
FIG. 9 is a diagram illustrating a functional configuration example of the image processing apparatus.
As illustrated in FIG. 9, the image processing apparatus 10 includes an imaging unit 100 that captures a pattern image, a dot analysis unit 200 that detects dots forming the pattern image, and a unit code pattern and an information block based on the detected dots. A decoding unit 300 for restoring and decoding the information.

撮像部100は、CCD(Charge Coupled Devices)やCMOS(Complementary Metal Oxide Semiconductor)等の撮像素子を用いて構成され、紙面上に形成されたパターン画像を、連続的な画像フレームとして読み取る。そして、読み取ったパターン画像を、8ビットの画像データとしてドット解析部200に送る。撮像部100により読み取られる画像のサイズは、特に限定されないが、ここでは156画素×156画素とする。   The imaging unit 100 is configured using an imaging device such as a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS), and reads a pattern image formed on a paper surface as a continuous image frame. Then, the read pattern image is sent to the dot analysis unit 200 as 8-bit image data. The size of the image read by the imaging unit 100 is not particularly limited, but is 156 pixels × 156 pixels here.

ドット解析部200は、プログラム制御されたCPUおよびメモリ等で実現され、撮像部100により撮像された画像からドットを検出し、2次元のビット列を生成する。このドット解析部200は、画像データを解析する機能として、位置検出部210と、角度検出部220と、同期化部230とを備える。   The dot analysis unit 200 is realized by a program-controlled CPU, memory, and the like, detects dots from the image captured by the imaging unit 100, and generates a two-dimensional bit string. The dot analysis unit 200 includes a position detection unit 210, an angle detection unit 220, and a synchronization unit 230 as functions for analyzing image data.

位置検出部210は、撮像部100から受け取った8ビットの画像からドットの位置を検出する。具体的には、取得した画像フレームからドットを検出し、さらに検出したドットの画像フレーム上での位置情報(座標値)を算出する。したがって、位置検出部210は、単位画像であるドットを検出する単位画像検出手段である。   The position detection unit 210 detects a dot position from the 8-bit image received from the imaging unit 100. Specifically, dots are detected from the acquired image frame, and position information (coordinate values) of the detected dots on the image frame is calculated. Therefore, the position detection unit 210 is a unit image detection unit that detects dots that are unit images.

角度検出部220は、位置検出部210により検出された画像上のドットの整列角度を検出する。ドットの整列角度とは、画像におけるドットの整列方向の傾きであり、ドット本来の配列に対する回転角度である。ドット本来の配列とは、例えば、図3に示したような単位符号パターンにおける縦横のドットの並びである。   The angle detection unit 220 detects the alignment angle of dots on the image detected by the position detection unit 210. The dot alignment angle is an inclination of the dot alignment direction in the image, and is a rotation angle with respect to the original arrangement of dots. The original arrangement of dots is, for example, an arrangement of vertical and horizontal dots in a unit code pattern as shown in FIG.

同期化部230は、位置検出部210および角度検出部220の検出結果として得られたドットの配列を、2次元のビット配列に変換する。この変換を同期化と呼び、得られたビット配列における各ビットの並びを同期ラインと呼ぶ。また、角度検出部220により検出されたドットの整列角度はビット列(同期ライン)の角度となる。
得られたビット配列と、同期ラインの角度および間隔の情報は、復号部300に送られる。
The synchronization unit 230 converts the dot arrangement obtained as a detection result of the position detection unit 210 and the angle detection unit 220 into a two-dimensional bit arrangement. This conversion is called synchronization, and the arrangement of each bit in the obtained bit arrangement is called a synchronization line. The dot alignment angle detected by the angle detector 220 is the angle of the bit string (synchronization line).
The obtained bit arrangement and information on the angle and interval of the synchronization line are sent to the decoding unit 300.

復号部300は、プログラム制御されたCPUおよびメモリ等で実現される。この復号部300は、ドット解析部200から受け取ったビット配列、同期ラインの角度および間隔の情報に基づいて、3ドット×3ドットのパターンブロックを検出する。そして、得られたパターンブロックを回転補正し、情報ブロックを復元した後、この情報ブロックにより記録された情報を復号する。また、画像処理装置10が、パターン画像が形成された用紙上に筆記しながらパターン画像を読み取るペン・デバイス(ペン・デバイスの詳細な構成については後述)である場合、ペン先の位置と撮像部100により撮像される位置との間には、一定のずれがある。そこで、復号部300は、同期ラインの角度および間隔の情報に基づいて、画像から得られた座標をペン先の座標に変換する。   Decoding section 300 is realized by a program-controlled CPU, memory, and the like. The decoding unit 300 detects a pattern block of 3 dots × 3 dots based on the bit arrangement received from the dot analysis unit 200, the synchronization line angle and interval information. The obtained pattern block is rotationally corrected to restore the information block, and then the information recorded by the information block is decoded. Further, when the image processing apparatus 10 is a pen device that reads a pattern image while writing on a sheet on which the pattern image is formed (the detailed configuration of the pen device will be described later), the position of the pen tip and the imaging unit There is a certain deviation from the position imaged by 100. Therefore, the decoding unit 300 converts the coordinates obtained from the image into the coordinates of the pen tip based on the information on the angle and interval of the synchronization line.

また、図9に示すように、ドット解析部200の位置検出部210、角度検出部220および同期化部230には、復号部300における復号の成否についての情報がフィードバックされる。位置検出部210、角度検出部220および同期化部230は、この復号の成否の情報に基づいて、各々の処理において使用するパラメータを決定する。具体的には、所定のパラメータを使用して処理を行った結果、復号に成功した(正しい復号結果が得られた)場合は、次の画像フレームに対しても同じパラメータを使用して処理を行うこととする。一方、復号に失敗した場合は、次の画像フレームに対しては、過去の処理履歴を参照し、成功率が最も高かったパラメータを選択して使用することとする。   Also, as shown in FIG. 9, information about the success or failure of decoding in the decoding unit 300 is fed back to the position detection unit 210, angle detection unit 220, and synchronization unit 230 of the dot analysis unit 200. The position detection unit 210, the angle detection unit 220, and the synchronization unit 230 determine parameters to be used in each process based on the information on the success or failure of the decoding. Specifically, as a result of processing using predetermined parameters, if decoding is successful (a correct decoding result is obtained), processing is performed using the same parameters for the next image frame. I will do it. On the other hand, when decoding fails, the parameter with the highest success rate is selected and used for the next image frame with reference to the past processing history.

また、画像処理装置10が後述するペン・デバイスである場合、画像処理装置10には、ペンによる筆記が行われているか否かを認識する機能が設けられる。そして、ドット解析部200の位置検出部210、角度検出部220および同期化部230と、復号部300には、ペンによる筆記が開始されたことを示すストローク開始信号が供給される。ストローク開始信号が供給されると、これらの機能ブロックは、各設定を初期化する。さらにまた、画像処理装置10がペン・デバイスである場合、復号部300には、復号結果からペン先を補正するための、ペン先から撮像面までの相対距離情報(ペン−チップ距離情報)が供給される。   When the image processing apparatus 10 is a pen device to be described later, the image processing apparatus 10 is provided with a function for recognizing whether writing with a pen is performed. The position detection unit 210, the angle detection unit 220, the synchronization unit 230, and the decoding unit 300 of the dot analysis unit 200 are supplied with a stroke start signal indicating that writing with a pen has started. When a stroke start signal is supplied, these function blocks initialize their settings. Furthermore, when the image processing apparatus 10 is a pen device, the decoding unit 300 has relative distance information (pen-tip distance information) from the pen tip to the imaging surface for correcting the pen tip from the decoding result. Supplied.

図10は、ドット解析部200および復号部300による処理の流れを示すフローチャートである。
初期動作として、撮像部100により媒体である紙面の撮像が行われたものとする。
図10に示すように、まず、位置検出部210が、メモリにおけるドットの座標格納領域を初期化し(ステップ1001)、ドットの位置を検出する(ステップ1002)。位置検出に成功したならば(ステップ1003でYes)、次に、角度検出部220が、メモリにおけるドットの整列角度格納領域を初期化し(ステップ1004)、ドットの整列角度を検出する(ステップ1005)。角度検出に成功したならば(ステップ1006でYes)、次に、同期化部230が、メモリのビット配列格納領域を初期化し(ステップ1007)、ドット配列をビット配列に同期させる(ステップ1008)。ドット配列の同期に成功したならば(ステップ1009でYes)、次に、復号部300が、メモリの復号結果格納領域を初期化し(ステップ1010)、復号処理を行う(ステップ1011)。復号に成功したならば(ステップ1012でYes)、復号部300は、復号に成功したことを示す信号を位置検出部210、角度検出部220および同期化部230に送信し(ステップ1013)、復号結果を出力する(ステップ1014)。
FIG. 10 is a flowchart showing the flow of processing performed by the dot analysis unit 200 and the decoding unit 300.
As an initial operation, it is assumed that the imaging unit 100 has captured a sheet of paper as a medium.
As shown in FIG. 10, first, the position detection unit 210 initializes the dot coordinate storage area in the memory (step 1001), and detects the dot position (step 1002). If the position detection is successful (Yes in Step 1003), the angle detection unit 220 then initializes the dot alignment angle storage area in the memory (Step 1004) and detects the dot alignment angle (Step 1005). . If the angle detection is successful (Yes in Step 1006), the synchronization unit 230 then initializes the bit array storage area of the memory (Step 1007) and synchronizes the dot array with the bit array (Step 1008). If the dot array synchronization is successful (Yes in Step 1009), the decoding unit 300 then initializes the decoding result storage area of the memory (Step 1010) and performs the decoding process (Step 1011). If the decoding is successful (Yes in Step 1012), the decoding unit 300 transmits a signal indicating that the decoding is successful to the position detection unit 210, the angle detection unit 220, and the synchronization unit 230 (Step 1013). The result is output (step 1014).

位置検出部210によるドットの位置の検出、角度検出部220によるドットの整列角度の検出、同期化部230によるドット配列の同期のいずれかに失敗した場合(ステップ1003、1006、1009でNo)は、失敗したステップ以後の処理は行われない。これらの場合、および復号部300による復号に失敗した場合(ステップ1012でNo)は、復号部300が、復号に失敗したことを示す信号を、位置検出部210、角度検出部220および同期化部230に送信し(ステップ1015)、かつ復号結果として出力する(ステップ1014)。   When detection of the position of the dot by the position detection unit 210, detection of the dot alignment angle by the angle detection unit 220, or synchronization of the dot arrangement by the synchronization unit 230 fails (No in steps 1003, 1006, and 1009) No processing after the failed step is performed. In these cases, and when decoding by the decoding unit 300 fails (No in step 1012), the position detection unit 210, the angle detection unit 220, and the synchronization unit transmit signals indicating that the decoding unit 300 has failed in decoding. 230 (step 1015) and output as a decoding result (step 1014).

<ドットの整列角度の検出方法>
ここで、ドットの並びに対する画像の歪みの影響と、本実施形態の角度検出部220による角度検出の方法について説明する。
図11乃至図13は、撮像部100により撮像された画像(以下、撮像画像と呼ぶ)の例を示す図である。
図11は、ドットの整列角度が0度の場合の撮像画像の例であり、図12は、ドットの整列角度が45度の場合の撮像画像の例である。これらの図において、撮像画像に対して直交するXY座標系を設定し、横方向をX軸、縦方向をY軸とする。そして、ドットの整列方向がX軸およびY軸に沿っている場合を角度0度とする。
<Dot alignment angle detection method>
Here, the influence of image distortion on the arrangement of dots and an angle detection method by the angle detection unit 220 of the present embodiment will be described.
11 to 13 are diagrams illustrating examples of images captured by the imaging unit 100 (hereinafter referred to as captured images).
FIG. 11 is an example of a captured image when the dot alignment angle is 0 degree, and FIG. 12 is an example of a captured image when the dot alignment angle is 45 degrees. In these figures, an XY coordinate system orthogonal to the captured image is set, and the horizontal direction is the X axis and the vertical direction is the Y axis. The case where the dot alignment direction is along the X axis and the Y axis is defined as an angle of 0 degree.

図11および図12では、撮像部100の撮像面とドットが形成された紙面とは並行である。これらの図に示す状態では、各ドットは互いに直交する2方向に並んでいる(図中、実線および破線で示した方向がドットの整列方向)。また、隣り合う4つのドットで形成される四角形が正方形をなしている。これらの場合は、近接する2つのドットの位置関係を調べることにより、ドットの整列方向を特定し、ドット本来の配列に対する整列角度を検出することは容易である。   11 and 12, the imaging surface of the imaging unit 100 and the paper surface on which dots are formed are parallel. In the state shown in these drawings, the dots are arranged in two directions orthogonal to each other (in the drawings, the directions indicated by the solid line and the broken line are the dot alignment directions). A quadrangle formed by four adjacent dots forms a square. In these cases, it is easy to specify the alignment direction of the dots by examining the positional relationship between two adjacent dots and to detect the alignment angle with respect to the original arrangement of the dots.

画像処理装置10が後述するペン・デバイスである場合、紙面に対するペン・デバイスの角度によって、撮像部100の撮像面が紙面に対して傾き、撮像画像に歪みが生じてしまう。図13は、図12に対して画像の上方が奥に、下方が手前に傾いた状態の撮像画像である。この状態では、撮像画像におけるドットの2方向の並びが直交していないので、隣り合う4つのドットで形成される四角形は菱形や平行四辺形となる。   When the image processing apparatus 10 is a pen device described later, the imaging surface of the imaging unit 100 is inclined with respect to the paper surface depending on the angle of the pen device with respect to the paper surface, and the captured image is distorted. FIG. 13 is a captured image in a state in which the upper side of the image is inclined to the back and the lower side is inclined to the front with respect to FIG. In this state, since the arrangement in the two directions of the dots in the captured image is not orthogonal, a quadrangle formed by four adjacent dots is a rhombus or a parallelogram.

図13のように撮像画像が歪むと、隣り合う4つのドットで形成される四角形において、短い対角線の長さが2辺の長さに近づくため、正しいドットの整列方向を検出することが困難になる。図13に示す例では、ドットは、実線で示した方向、破線で示した方向、一点鎖線で示した方向の3方向にドットが並んでいるように認められる。そこで、本実施形態の角度検出部220は、以下に説明する手法により、このような場合に適切なドットの整列方向を特定し、整列角度を検出する。   When the captured image is distorted as shown in FIG. 13, in a quadrangle formed by four adjacent dots, the length of a short diagonal line approaches the length of two sides, making it difficult to detect the correct dot alignment direction. Become. In the example shown in FIG. 13, the dots are recognized as being arranged in three directions: a direction indicated by a solid line, a direction indicated by a broken line, and a direction indicated by a one-dot chain line. Therefore, the angle detection unit 220 according to the present embodiment specifies an appropriate dot alignment direction in such a case and detects the alignment angle by the method described below.

角度検出部220は、まず、位置検出部210により撮像画像から検出された各ドットに関して、近接ドット対を検出する。近接ドット対は、所定のドットに注目した場合に、そのドットとそのドットに最も近い位置にあるドットとで構成される。次に、検出された近接ドット対の角度の度数分布に基づき、3つの角度を抽出する。そして、抽出された3つの角度の関係等に基づいて、ドットの整列角度を特定する。   First, the angle detection unit 220 detects adjacent dot pairs for each dot detected from the captured image by the position detection unit 210. The adjacent dot pair is composed of a dot and a dot closest to the dot when attention is paid to a predetermined dot. Next, three angles are extracted based on the detected frequency distribution of the angles of adjacent dot pairs. Then, the alignment angle of the dots is specified based on the relationship between the extracted three angles.

<角度検出部の機能>
次に、角度検出部220の機能についてさらに詳細に説明する。
図14は、角度検出部220の機能構成を示す図である。
角度検出部220は、近接ドット対を検出する近接ドット対検出部221と、検出された近接ドット対の度数分布データを生成する度数分布生成部222とを備える。そして、生成された度数分布データに基づいて3つの角度を抽出する第1軸角度抽出部223、第2軸角度抽出部224および第3軸角度抽出部225と、抽出された3つの角度からドットの整列角度を選択し特定する角度特定部226とを備える。図示の構成において、度数分布生成部222、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225および角度特定部226(図中、破線で囲まれた部分)は、ドットの整列角度を特定する角度特定手段である。
<Function of angle detector>
Next, the function of the angle detection unit 220 will be described in more detail.
FIG. 14 is a diagram illustrating a functional configuration of the angle detection unit 220.
The angle detection unit 220 includes a proximity dot pair detection unit 221 that detects a proximity dot pair, and a frequency distribution generation unit 222 that generates frequency distribution data of the detected proximity dot pair. Then, a first axis angle extracting unit 223, a second axis angle extracting unit 224, and a third axis angle extracting unit 225 that extract three angles based on the generated frequency distribution data, and dots from the extracted three angles And an angle specifying unit 226 for selecting and specifying the alignment angle. In the configuration shown in the figure, the frequency distribution generation unit 222, the first axis angle extraction unit 223, the second axis angle extraction unit 224, the third axis angle extraction unit 225, and the angle specification unit 226 (the part surrounded by a broken line in the figure). Is an angle specifying means for specifying the dot alignment angle.

近接ドット対検出部221は、位置検出部210により検出されたドットの画像フレーム上での位置情報(座標値)を取得し、近接ドット対を検出する。言い換えれば、近接ドット対検出部221は、位置検出部210の出力であるドット座標値から最も近い位置にあるドット座標値の組み合わせを検出する手段である。近接ドット対の詳細な検出方法については後述する。   The proximity dot pair detection unit 221 acquires position information (coordinate values) on the image frame of the dots detected by the position detection unit 210, and detects a proximity dot pair. In other words, the proximity dot pair detection unit 221 is means for detecting a combination of dot coordinate values that are closest to the dot coordinate value that is the output of the position detection unit 210. A detailed method for detecting the adjacent dot pair will be described later.

度数分布生成部222は、近接ドット対検出部221により検出された近接ドット対がなす角度の度数分布データを生成する。ここで、近接ドット対がなす角度とは、近接ドット対を構成する2つのドットを結ぶ直線が、位置検出部210の出力であるドット位置情報の基準となる所定の方向(例えば、撮像画像に設定されたXY座標のX軸方向)に対してなす角度である。   The frequency distribution generation unit 222 generates frequency distribution data of the angle formed by the adjacent dot pair detected by the adjacent dot pair detection unit 221. Here, the angle formed by the adjacent dot pair is a predetermined direction (for example, in the captured image) in which a straight line connecting the two dots constituting the adjacent dot pair serves as a reference for the dot position information output from the position detection unit 210. This is an angle formed with respect to the set XY coordinate (X-axis direction).

第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225は、度数分布生成部222により生成された度数分布データに基づいて、ドットの整列方向の候補となる3方向の角度(第1軸角度、第2軸角度、第3軸角度)を抽出する。各々の角度の詳細な検出方法については後述する。   The first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225 are candidates for dot alignment directions based on the frequency distribution data generated by the frequency distribution generation unit 222. The direction angle (first axis angle, second axis angle, third axis angle) is extracted. A detailed method of detecting each angle will be described later.

角度特定部226は、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225により抽出された第1軸角度、第2軸角度、第3軸角度に基づいて、ドット本来の配列の方向に対応するドットの整列方向の角度(整列角度)を特定し出力する。例えば、図3に示したような単位符号パターンの場合、ドットは縦横の2方向に並んでいるので、この縦横2方向に対応する2方向の整列角度が特定される。図14では、この2方向をX軸およびY軸と記載している。整列角度の詳細な特定方法については後述する。   The angle specifying unit 226 is based on the first axis angle, the second axis angle, and the third axis angle extracted by the first axis angle extracting unit 223, the second axis angle extracting unit 224, and the third axis angle extracting unit 225. The angle (alignment angle) of the dot alignment direction corresponding to the direction of the original dot arrangement is specified and output. For example, in the case of the unit code pattern as shown in FIG. 3, since the dots are arranged in two vertical and horizontal directions, the alignment angles in two directions corresponding to the two vertical and horizontal directions are specified. In FIG. 14, these two directions are described as an X axis and a Y axis. A detailed method for specifying the alignment angle will be described later.

また、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225は、抽出した角度に沿って並ぶ近接ドット対のドット間の距離に基づいて、この方向でのドット間の基準間隔を算出する。そして、角度特定部226は、2方向の整列角度におけるドット間の基準間隔を特定する。すなわち、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225、角度特定部226は、撮像画像から検出されたドット配列におけるドット間隔を特定する間隔特定手段としても機能する。基準間隔の検出方法については後述する。   Further, the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225 are based on the distance between dots of adjacent dot pairs arranged along the extracted angle in this direction. A reference interval between dots is calculated. Then, the angle specifying unit 226 specifies a reference interval between dots at two alignment angles. In other words, the first axis angle extracting unit 223, the second axis angle extracting unit 224, the third axis angle extracting unit 225, and the angle specifying unit 226 serve as an interval specifying unit that specifies the dot interval in the dot arrangement detected from the captured image. Also works. A method for detecting the reference interval will be described later.

<近接ドット対の検出方法>
次に、近接ドット対検出部221による近接ドット対の検出方法について詳細に説明する。
図15は、ドットが検出された画像から、近接ドット対が検出された様子を示す図である。図15(a)は位置検出部210により検出されたドット位置の一例であり、図15(b)は図15(a)に対して近接ドット対の検出が行われた状態を示す。図15(b)では、近接ドット対を、線で結んで表現している。この場合、あるドットAから最も近いドットBが、他のドットCと近接ドット対を成している場合は、ドットAは他のどのドットとも近接ドット対を成していない(A、B、Cは特に図示していない)。
<Detection method of adjacent dot pairs>
Next, a method for detecting a proximity dot pair by the proximity dot pair detection unit 221 will be described in detail.
FIG. 15 is a diagram illustrating a state in which a pair of adjacent dots is detected from an image in which dots are detected. FIG. 15A shows an example of the dot position detected by the position detection unit 210, and FIG. 15B shows a state in which the proximity dot pair is detected with respect to FIG. 15A. In FIG. 15B, adjacent dot pairs are represented by connecting lines. In this case, when the dot B closest to a certain dot A forms a close dot pair with another dot C, the dot A does not form a close dot pair with any other dot (A, B, C is not particularly shown).

図16は、近接ドット対の検出方法の具体例を示す図である。
図16において、例えば、番号1から4までのドットに対して近接ドット対を検出するものとする。
近接ドット対検出部221は、まず、位置検出部210が検出した番号1から4までのドットの位置を認識する。そして、番号1のドットを基準に他の番号のドットまでの距離をスキャンしていく。その結果、番号1のドットに最も近いドットは番号3のドットであり、両者の距離(PD)は20と認識される。そして、近接ドット対検出部221は、番号1のドットに関して、番号3のドットが近接ドットであることを示す情報“Pair[1]=3”と、番号3のドットまでの距離が20であることを示す情報“MPD[1]=20”とを生成する。同様に、番号3のドットに関して、“Pair[3]=1”と“MPD[3]=20”の情報(以下、属性情報)を生成する。
FIG. 16 is a diagram illustrating a specific example of a method for detecting a neighboring dot pair.
In FIG. 16, for example, it is assumed that adjacent dot pairs are detected for dots numbered 1 to 4.
The proximity dot pair detection unit 221 first recognizes the positions of dots numbered 1 to 4 detected by the position detection unit 210. Then, the distance to the dots of other numbers is scanned based on the dot of number 1. As a result, the dot closest to the number 1 dot is the number 3 dot, and the distance (PD) between them is recognized as 20. Then, the proximity dot pair detection unit 221 has information “Pair [1] = 3” indicating that the number 3 dot is a proximity dot for the number 1 dot, and the distance to the number 3 dot is 20. Information “MPD [1] = 20” is generated. Similarly, information (hereinafter, attribute information) of “Pair [3] = 1” and “MPD [3] = 20” is generated for the dot of number 3.

ここで、Pair[ ]の[ ]内の番号は自らのドットの番号を示し、Pair[ ]=で定義される値は、現時点で近接ドット対となっている相手のドットの番号を示す。また、MPD[ ]の[ ]内の番号は自らのドットの番号を示し、MPD[ ]の値は、現時点での近接ドット対となっている相手のドットまでの距離を示す。   Here, the number in [] of Pair [] indicates the number of its own dot, and the value defined by Pair [] = indicates the number of the partner dot that is currently a close dot pair. Further, the number in [] of MPD [] indicates the number of its own dot, and the value of MPD [] indicates the distance to the partner dot that is the adjacent dot pair at the present time.

次に、近接ドット対検出部221は、番号2のドットを基準に、番号1以外のドットまでの距離をスキャンしていく。先に番号1のドットをスキャンした時点で、番号1のドットは番号2のドットから最も近いドットではないと判断されているため、番号1のドットをスキャンの対象から外している。
このスキャンの結果、番号2のドットに最も近いドットは番号3のドットであり、両者の距離(PD)は15と認識される。この距離は、番号1と番号3とのドットの距離(20)よりも短い。したがって、位置検出部210は、番号2のドットに関して“Pair[2]=3”と“MPD[2]=15”の属性情報を生成し、番号3のドットに関して“Pair[3]=2”と“MPD[3]=15”の属性情報を生成する。そして、この時点で番号1のドットは、番号2のドットに番号3のドットを奪われたため、属性情報が“Pair[1]=−1”と“MPD[1]=−1”に変更され、番号1のドットはどの番号のドットとも近接ドット対を成していない状態になる。
Next, the proximity dot pair detection unit 221 scans the distance to dots other than number 1 with reference to the number 2 dot. When the dot number 1 is scanned first, it is determined that the dot number 1 is not the closest dot to the number 2 dot, so the dot number 1 is excluded from the scan target.
As a result of this scan, the dot closest to the number 2 dot is the number 3 dot, and the distance (PD) between them is recognized as 15. This distance is shorter than the dot distance (20) between number 1 and number 3. Therefore, the position detection unit 210 generates attribute information “Pair [2] = 3” and “MPD [2] = 15” for the dot of number 2 and “Pair [3] = 2” for the dot of number 3. And attribute information “MPD [3] = 15” is generated. At this time, since the dot of number 1 is deprived of the dot of number 3 by the dot of number 2, the attribute information is changed to “Pair [1] = − 1” and “MPD [1] = − 1”. , The dot of number 1 is in a state of not forming a close dot pair with any number of dots.

同様にして、近接ドット対検出部221は、番号3のドットを基準に、番号が1と2以外のドットまでの距離をスキャンしていく。その結果、番号3のドットに最も近いドットは番号4のドットであり、両者の間隔(PD)は10と認識される。この距離は、番号2と番号3とのドットの距離(15)よりも短い。したがって、位置検出部210は、番号3のドットに関して“Pair[3]=4”と“MPD[3]=10”の属性情報を生成し、番号4のドットに関して“Pair[4]=3”と“MPD[4]=10”の属性情報を生成する。そして、この時点で番号2のドットは、番号4のドットに番号3のドットを奪われたため、属性情報が“Pair[2]=−1”と“MPD[2]=−1”に変更され、番号2のドットはどの番号のドットとも近接ドット対を成していない状態になる。   Similarly, the proximity dot pair detection unit 221 scans the distance to dots other than the numbers 1 and 2 with the number 3 as a reference. As a result, the dot closest to the number 3 dot is the number 4 dot, and the distance (PD) between them is recognized as 10. This distance is shorter than the dot distance (15) between number 2 and number 3. Therefore, the position detection unit 210 generates attribute information “Pair [3] = 4” and “MPD [3] = 10” for the dot of number 3, and “Pair [4] = 3” for the dot of number 4. And “MPD [4] = 10” attribute information is generated. At this time, since the dot of number 2 is deprived of the dot of number 3 by the dot of number 4, the attribute information is changed to “Pair [2] = − 1” and “MPD [2] = − 1”. , The dot of number 2 is in a state that does not form a close dot pair with any of the dots of any number.

この時点で、スキャンしていないドットは番号4のドットだけであるが、このドットは既に番号3のドットと近接ドット対を成しているため、改めてスキャンされることはなく処理は終了する。なお、ここでは一例としてドットの数が4個の場合を取り上げたが、ドットの数が5個以上ある場合も上述したスキャンの手順を繰り返していくことで近接ドット対が順次検出される。   At this time, the dot that has not been scanned is only the dot with the number 4, but since this dot has already formed a close dot pair with the dot with the number 3, the process is finished without being scanned again. Although the case where the number of dots is four is taken as an example here, even when the number of dots is five or more, adjacent dot pairs are sequentially detected by repeating the scanning procedure described above.

図17は、近接ドット対検出部221による近接ドット対の検出処理の流れを説明するフローチャートである。
近接ドット対の検出は、図16を参照して説明したように、複数のドットの各々を順次基準とし、他のドットとの位置関係を調べることによって行われる。この基準となるドットを基準ドット、他のドットを対象ドットと呼ぶ。図17に示すように、近接ドット対検出部221は、各ドットを順次基準ドットとしながら、以下のループ処理を実行する。
FIG. 17 is a flowchart for explaining the flow of proximity dot pair detection processing by the proximity dot pair detection unit 221.
As described with reference to FIG. 16, the proximity dot pair is detected by sequentially examining each of the plurality of dots as a reference and examining the positional relationship with other dots. This reference dot is called a reference dot, and the other dots are called target dots. As shown in FIG. 17, the proximity dot pair detection unit 221 performs the following loop processing while sequentially setting each dot as a reference dot.

まず、近接ドット対検出部221は、基準ドットとして選んだドットの座標値を取得し(ステップ1701)、ドット対番号(PairIndex)を生成して基準ドットに付与する(ステップ1702)。ここでは、基準ドットの座標値を(Xs,Ys)とする。次に、近接ドット対検出部221は、基準ドット以外の各ドットを順次対象ドットとしながら、以下のループ処理を実行する。   First, the proximity dot pair detection unit 221 acquires the coordinate value of the dot selected as the reference dot (step 1701), generates a dot pair number (PairIndex), and assigns it to the reference dot (step 1702). Here, the coordinate value of the reference dot is (Xs, Ys). Next, the proximity dot pair detection unit 221 executes the following loop processing while sequentially setting each dot other than the reference dot as a target dot.

まず、近接ドット対検出部221は、対象ドットとして選んだドットの座標値を取得する(ステップ1703)。ここでは、対象ドットの座標値を(Xe,Ye)とする。次に、近接ドット対検出部221は、基準ドットと対象ドットの間の距離((Xs,Ys)−(Xe,Ye))を計算する(ステップ1704)。そして、算出されたドット間距離が、現在の基準ドットに関するドット間距離のうちで最小値である場合は(ステップ1705でYes)、その対象ドットと基準ドットとの関係を表すドット対情報(例えば、対象ドットのドット番号および基準ドットと対象ドット間の距離)を保存する(ステップ1706)。このとき、他のドットを対象ドットとするドット対情報があれば、そのドット対情報は消去される。   First, the proximity dot pair detection unit 221 acquires the coordinate value of the dot selected as the target dot (step 1703). Here, the coordinate value of the target dot is (Xe, Ye). Next, the proximity dot pair detection unit 221 calculates the distance ((Xs, Ys) − (Xe, Ye)) between the reference dot and the target dot (step 1704). When the calculated inter-dot distance is the minimum value among the inter-dot distances regarding the current reference dot (Yes in step 1705), dot pair information (for example, the relationship between the target dot and the reference dot) The dot number of the target dot and the distance between the reference dot and the target dot are stored (step 1706). At this time, if there is dot pair information that uses other dots as target dots, the dot pair information is deleted.

一方、ステップ1704で算出されたドット間距離が現在の基準ドットに関するドット間距離のうちで最小値でない場合(ステップ1705でNo)、言い換えれば、ドット間距離がより短い他のドットに関するドット対情報が既に保存されている場合は、既に保存されているドット対情報がそのまま保持される。   On the other hand, when the inter-dot distance calculated in step 1704 is not the minimum value among the inter-dot distances regarding the current reference dot (No in step 1705), in other words, dot pair information regarding other dots with shorter inter-dot distances. Is already stored, the already stored dot pair information is retained as it is.

基準ドット以外の全てのドットを対象ドットとしてステップ1703〜1706のループ処理が行われると、その基準ドットに最も近い位置にある1つのドットを対象ドットとして、この対象ドットと基準ドットとの関係を表すドット対情報が保存されることとなる。この後、近接ドット対検出部221は、この基準ドットおよび対象ドットに関して、ステップ1706で保存されたドット対情報に基づいて、近接ドット対か否かを判別する処理を行う(ステップ1707)。図18は、ステップ1707に示す近接ドット対の判別処理の詳細を説明するフローチャートである。   When the loop processing of steps 1703 to 1706 is performed with all the dots other than the reference dots as the target dots, the relationship between the target dots and the reference dots is determined by setting one dot closest to the reference dot as the target dot. The dot pair information to be represented is saved. Thereafter, the proximity dot pair detection unit 221 performs processing for determining whether the reference dot and the target dot are proximity dot pairs based on the dot pair information stored in Step 1706 (Step 1707). FIG. 18 is a flowchart for explaining the details of the proximity dot pair discrimination processing shown in step 1707.

図18を参照すると、近接ドット対検出部221は、まず、対象ドットが他のドットとリンクされているか否かを調べる。すなわち、対象ドットが他のドットと既に対をなしているか否かを、図16で説明した属性情報(Pair[]およびMPD[])を参照して調べる。対象ドットに属性情報が設定されていれば、それは対象ドットが他のドットとリンクされており、対象ドットに属性情報が設定されていなければ、対象ドットは他のドットとリンクしていない。対象ドットと他のドットとの間のリンクが存在する場合(ステップ1801でYes)、次に近接ドット対検出部221は、対象ドットと基準ドットとの間のドット間距離と、対象ドットとリンク先の他のドットとの間のドット間距離とを比較する。そして、基準ドットとの間のドット間距離の方が短い場合(ステップ1802でNo)、近接ドット対検出部221は、対象ドットと他のドットとの間のリンクを削除する(ステップ1803)。   Referring to FIG. 18, the proximity dot pair detection unit 221 first checks whether or not the target dot is linked to another dot. That is, it is checked with reference to the attribute information (Pair [] and MPD []) described with reference to FIG. 16 whether or not the target dot is already paired with another dot. If the attribute information is set for the target dot, the target dot is linked to another dot. If the attribute information is not set for the target dot, the target dot is not linked to another dot. If there is a link between the target dot and another dot (Yes in step 1801), the adjacent dot pair detection unit 221 next determines the inter-dot distance between the target dot and the reference dot, and the target dot and link. The inter-dot distance between the other dots is compared. If the inter-dot distance between the reference dot and the reference dot is shorter (No in step 1802), the proximity dot pair detection unit 221 deletes the link between the target dot and another dot (step 1803).

対象ドットと他のドットとの間のリンクが存在しない場合(ステップ1801でNo)、またはステップ1803で対象ドットと他のドットとの間のリンクを削除した後、近接ドット対検出部221は、基準ドットが他のドットとリンクされているか否かを調べる。基準ドットと他のドットとの間のリンクが存在する場合(ステップ1804でYes)、次に近接ドット対検出部221は、基準ドットと対象ドットとの間のドット間距離と、基準ドットとリンク先の他のドットとの間のドット間距離とを比較する。そして、対象ドットとの間のドット間距離の方が短い場合(ステップ1805でNo)、近接ドット対検出部221は、基準ドットと他のドットとの間のリンクを削除する(ステップ1806)。   When there is no link between the target dot and another dot (No in Step 1801), or after deleting the link between the target dot and another dot in Step 1803, the proximity dot pair detection unit 221 Check whether the reference dot is linked to other dots. If there is a link between the reference dot and another dot (Yes in step 1804), the adjacent dot pair detection unit 221 then determines the inter-dot distance between the reference dot and the target dot, and the reference dot and link. The inter-dot distance between the other dots is compared. If the inter-dot distance to the target dot is shorter (No in Step 1805), the proximity dot pair detection unit 221 deletes the link between the reference dot and other dots (Step 1806).

この後、近接ドット対検出部221は、基準ドットと対象ドットとをリンクさせる(ステップ1807)。これにより、基準ドットと対象ドットとは近接ドット対となる。
一方、基準ドットと対象ドットとの間のドット間距離よりも、対象ドットとリンク先の他のドットとの間のドット間距離の方が短い場合(ステップ1802でYes)、または、基準ドットとリンク先の他のドットとの間のドット間距離の方が短い場合(ステップ1805でYes)は、近接ドット対検出部221は、基準ドットと対象ドットとをリンクさせない。したがって、これらの組み合わせは近接ドット対とはならない。
Thereafter, the proximity dot pair detection unit 221 links the reference dot and the target dot (step 1807). Thereby, the reference dot and the target dot form a close dot pair.
On the other hand, when the inter-dot distance between the target dot and the other linked dots is shorter than the inter-dot distance between the reference dot and the target dot (Yes in step 1802), or When the inter-dot distance between other linked dots is shorter (Yes in step 1805), the proximity dot pair detection unit 221 does not link the reference dot and the target dot. Therefore, these combinations do not form adjacent dot pairs.

<第1軸角度、第2軸角度、第3軸角度の抽出方法>
次に、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225による第1軸角度、第2軸角度、第3軸角度の抽出方法について詳細に説明する。
まず、前処理として、度数分布生成部222が、近接ドット対検出部221により検出された近接ドット対がなす角度の度数分布データを生成する。この度数分布データは、近接ドット対がなす角度の値ごとに、その出現度数を積算したデータである。
<Method for extracting first axis angle, second axis angle, and third axis angle>
Next, a method for extracting the first axis angle, the second axis angle, and the third axis angle by the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225 will be described in detail.
First, as preprocessing, the frequency distribution generation unit 222 generates frequency distribution data of angles formed by adjacent dot pairs detected by the adjacent dot pair detection unit 221. The frequency distribution data is data obtained by integrating the appearance frequency for each angle value formed by the adjacent dot pair.

図19は、度数分布生成部222により生成される近接ドット対がなす角度の度数分布の例を視覚的に表現したヒストグラムである。
度数分布データは、180度の範囲(図19の例では、−90度から+90度まで)で生成される。この度数分布データを用いて、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225が、第1軸角度、第2軸角度、第3軸角度をそれぞれ抽出する。
FIG. 19 is a histogram that visually represents an example of the frequency distribution of angles formed by pairs of adjacent dots generated by the frequency distribution generation unit 222.
The frequency distribution data is generated in a range of 180 degrees (in the example of FIG. 19, from −90 degrees to +90 degrees). Using this frequency distribution data, the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225 extract the first axis angle, the second axis angle, and the third axis angle, respectively. To do.

第1軸角度抽出部223は、度数分布生成部222により生成された度数分布データに基づき、最大頻度の角度を第1軸角度として抽出する。最大頻度の角度は、次のようにして求まる。
第1軸角度抽出部223は、まず、出現度数が最大である角度を検出する。そして、検出した角度を中心とする一定の範囲(以下、対象範囲)で、出現度数に基づく平均角度を計算する。算出された角度が最大頻度の角度であり、第1軸角度となる。平均角度は、対象範囲の角度ごとに出現度数を乗算した値を加算し、総出現度数(対象範囲内の出現度数を全て加算した値)で除算した値である。
The first axis angle extraction unit 223 extracts the angle of the maximum frequency as the first axis angle based on the frequency distribution data generated by the frequency distribution generation unit 222. The angle of the maximum frequency is obtained as follows.
The first axis angle extraction unit 223 first detects an angle having the maximum appearance frequency. Then, an average angle based on the appearance frequency is calculated in a certain range centered on the detected angle (hereinafter, target range). The calculated angle is the angle with the highest frequency and is the first axis angle. The average angle is a value obtained by adding a value obtained by multiplying the appearance frequency for each angle of the target range and dividing by the total appearance frequency (a value obtained by adding all the appearance frequencies in the target range).

例えば、出現度数が最大の角度を10度、対象範囲を−2度から+2度までの範囲とすると、8度から12度の範囲で平均角度の計算が行われる。また例えば、この範囲において、8度の出現度数を10、9度の出現度数を20、10度の出現度数を100、11度の出現度数を50、12度の出現度数を40とすると、平均角度は、下記の計算により10.4度となる。

(8×10+9×20+10×100+11×50+12×40)/(10+20+100+50+40)=10.4
For example, assuming that the angle having the highest appearance frequency is 10 degrees and the target range is a range from −2 degrees to +2 degrees, the average angle is calculated in the range of 8 degrees to 12 degrees. Also, for example, in this range, if the appearance frequency of 8 degrees is 10, the appearance frequency of 9 degrees is 20, the appearance frequency of 10 degrees is 100, the appearance frequency of 11 degrees is 50, and the appearance frequency of 12 degrees is 40, the average The angle is 10.4 degrees according to the following calculation.

(8 × 10 + 9 × 20 + 10 × 100 + 11 × 50 + 12 × 40) / (10 + 20 + 100 + 50 + 40) = 10.4

第2軸角度抽出部224は、第1軸角度抽出部223により抽出された第1軸角度から一定の角度だけ遷移(オフセット)させた角度(以下、基準角度)を想定し、その基準角度を中心とする一定の範囲内で最大頻度の角度を第2軸角度として抽出する。そして、第1軸角度の算出と同様に、所定の対象範囲で出現頻度に基づく平均角度を算出し、それを第2軸角度とする。ここで、第1軸角度と基準角度とがなす遷移角度は、ドット本来の配列に基づいて設定される。例えば、図3に示した単位符号パターンの場合、90度である。最大頻度の角度の計算方法は、第1軸角度の場合と同様である。基準角度を含む一定の範囲は、任意に定めて良いが、第2軸角度の検出可否や復号部300による復号成否の履歴に基づいて定めても良い。   The second axis angle extraction unit 224 assumes an angle (hereinafter referred to as a reference angle) obtained by making a transition (offset) by a certain angle from the first axis angle extracted by the first axis angle extraction unit 223, and determines the reference angle. The angle with the highest frequency is extracted as the second axis angle within a certain range as the center. Then, similarly to the calculation of the first axis angle, an average angle based on the appearance frequency is calculated in a predetermined target range, and is set as the second axis angle. Here, the transition angle formed by the first axis angle and the reference angle is set based on the original arrangement of dots. For example, the unit code pattern shown in FIG. 3 is 90 degrees. The calculation method of the maximum frequency angle is the same as in the case of the first axis angle. The fixed range including the reference angle may be arbitrarily determined, but may be determined based on whether or not the second axis angle can be detected and the history of decoding success / failure by the decoding unit 300.

第3軸角度抽出部225は、基準角度に対して第2軸角度と対称な角度を中心とする一定の範囲内で、最大頻度の角度を第3軸角度として抽出する。そして、所定の対象範囲で出現頻度に基づく平均角度を算出し、それを第3軸角度とする。例えば、基準角度が100度、第2軸角度が80度である場合、基準角度に対して第2軸角度と対称な角度は、120度である。この角度を含む一定の範囲は、任意に定めて良いが、第2軸角度の検出可否や復号部300による復号成否の履歴に基づいて定めても良い。また、最大頻度の角度の計算方法は、第1軸角度の場合と同様である。   The third axis angle extraction unit 225 extracts the angle with the highest frequency as the third axis angle within a certain range centered on an angle symmetrical to the second axis angle with respect to the reference angle. Then, an average angle based on the appearance frequency is calculated in a predetermined target range, and is set as the third axis angle. For example, when the reference angle is 100 degrees and the second axis angle is 80 degrees, the angle symmetrical to the second axis angle with respect to the reference angle is 120 degrees. The fixed range including this angle may be arbitrarily determined, but may be determined based on whether or not the second axis angle can be detected and the history of decoding success / failure by the decoding unit 300. The calculation method of the maximum frequency angle is the same as in the case of the first axis angle.

図20は、度数分布生成部222、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225による第1軸角度、第2軸角度、第3軸角度の抽出処理の流れを説明するフローチャートである。
図20に示すように、まず、度数分布生成部222が、各近接ドット対を順次対象として、以下のループ処理を実行する。
FIG. 20 illustrates extraction of the first axis angle, the second axis angle, and the third axis angle by the frequency distribution generation unit 222, the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225. It is a flowchart explaining the flow of a process.
As shown in FIG. 20, first, the frequency distribution generation unit 222 executes the following loop processing for each adjacent dot pair sequentially.

度数分布生成部222は、まず、近接ドット対の2つのドットの座標(X1,Y1)、(X2,Y2)を取得し(ステップ2001)、この近接ドット対がなす角度θを、下式により計算する(ステップ2002)。そして、得られた角度θの、度数分布データの度数を1加算する(ステップ2003)。

θ=tan-1{(Y1−Y2)/(X1−X2)}
First, the frequency distribution generation unit 222 acquires the coordinates (X1, Y1) and (X2, Y2) of the two dots of the adjacent dot pair (step 2001), and calculates the angle θ formed by the adjacent dot pair by the following equation: Calculate (step 2002). Then, 1 is added to the frequency of the frequency distribution data of the obtained angle θ (step 2003).

θ = tan −1 {(Y1-Y2) / (X1-X2)}

全ての近接ドット対に対してステップ2001〜2003の処理が行われると、次に第1軸角度抽出部223が、生成された度数分布データに基づいて、第1軸角度を抽出する(ステップ2004)。また、第1軸角度に沿ったドット間の基準間隔を算出する(ステップ2005)。なお、基準間隔およびその検出方法の詳細は後述する。   Once the processing of steps 2001 to 2003 has been performed for all adjacent dot pairs, the first axis angle extraction unit 223 next extracts the first axis angle based on the generated frequency distribution data (step 2004). ). Further, a reference interval between dots along the first axis angle is calculated (step 2005). The details of the reference interval and its detection method will be described later.

次に、第2軸角度抽出部224が、度数分布データおよび第1軸角度に基づいて、第2軸角度を抽出し(ステップ2006)、第2軸角度に沿ったドット間の基準間隔を算出する(ステップ2007)。さらに、第3軸角度抽出部225が、度数分布データ、基準角度および第2軸角度に基づいて、第3軸角度を抽出し(ステップ2008)、第3軸角度に沿ったドット間の基準間隔を算出する(ステップ2009)。   Next, the second axis angle extraction unit 224 extracts the second axis angle based on the frequency distribution data and the first axis angle (step 2006), and calculates a reference interval between dots along the second axis angle. (Step 2007). Further, the third axis angle extraction unit 225 extracts the third axis angle based on the frequency distribution data, the reference angle, and the second axis angle (step 2008), and the reference interval between dots along the third axis angle. Is calculated (step 2009).

図21は、抽出された3方向の角度のイメージを示す図である。
図21(a)に示すように並ぶドットが検出され、図21(b)に示すように第1軸角度が抽出されたものとする。この第1軸角度に対して90度オフセットした基準角度を挟んで、第2軸角度と第3軸角度とが抽出されている。
FIG. 21 is a diagram showing an image of the extracted angles in the three directions.
Assume that the dots arranged as shown in FIG. 21A are detected and the first axis angle is extracted as shown in FIG. The second axis angle and the third axis angle are extracted with a reference angle offset by 90 degrees with respect to the first axis angle.

<整列角度の特定方法>
次に、角度特定部226による整列角度の特定方法について詳細に説明する。
角度特定部226は、度数分布生成部222、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225により抽出された第1軸角度、第2軸角度、第3軸角度に基づき、ドットの整列角度を特定し出力する。具体的には、ドット本来の配列の方向に対応する2方向のドットの整列方向(図14ではX軸およびY軸と記載)の角度が特定される。この整列角度の特定は、以下の手順で行われる。
<Identification method of alignment angle>
Next, a method for specifying the alignment angle by the angle specifying unit 226 will be described in detail.
The angle specifying unit 226 includes a first axis angle, a second axis angle, a first axis angle extracted by the frequency distribution generation unit 222, the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225. Based on the triaxial angle, the dot alignment angle is specified and output. Specifically, the angles of the two dot alignment directions (referred to as X axis and Y axis in FIG. 14) corresponding to the original dot arrangement direction are specified. This alignment angle is specified by the following procedure.

角度特定部226は、まず、第1軸角度、第2軸角度、第3軸角度と、直前の画像フレーム(以下、前フレームと呼ぶ)に対する復号部300による復号の成否の情報を取得する。前フレームに対する復号が成功した場合、角度特定部226は、第1軸角度、第2軸角度、第3軸角度のうち、前フレームにおいて特定した整列角度に近い2つを選んで整列角度とする。前フレームと現フレームとは連続的に読み取られているため、適切な整列角度は大きく変わらないと考えられる。ただし、画像処理装置10がペン・デバイスである場合、撮像部100と紙面との位置関係が随時変化する。そこで、前フレームにおいて特定した整列角度と同一ではなく、近い角度が選ばれる。   First, the angle specifying unit 226 acquires the first axis angle, the second axis angle, the third axis angle, and information on the success or failure of decoding by the decoding unit 300 with respect to the immediately preceding image frame (hereinafter referred to as the previous frame). When decoding for the previous frame is successful, the angle specifying unit 226 selects two of the first axis angle, the second axis angle, and the third axis angle that are close to the alignment angle specified in the previous frame as the alignment angle. . Since the previous frame and the current frame are read continuously, it is considered that the appropriate alignment angle does not change greatly. However, when the image processing apparatus 10 is a pen device, the positional relationship between the imaging unit 100 and the paper surface changes as needed. Therefore, a close angle is selected that is not the same as the alignment angle specified in the previous frame.

前フレームに対する復号が失敗した場合、角度特定部226は、例えば次のようにして2方向の整列角度を特定する。
第1軸角度、第2軸角度、第3軸角度の全てが抽出されている場合、第1軸角度と、第2軸角度または第3軸角度のうちで基準角度に近い方とを選び、整列角度とする。
第3軸角度が抽出されなかった場合、角度特定部226は、第1軸角度と第2軸角度とを選び、整列角度とする。第3軸角度が抽出されない場合とは、度数分布データにおいて、基準角度に対して第2軸角度と対称な角度を中心とする一定の範囲内に出現度数の多い角度が存在しない場合、第2軸角度と基準角度とが一致している場合などである。
また、第2軸角度も抽出されなかった場合、角度特定部226は、第1軸角度と、第1軸角度に対して一定角度オフセットした基準角度とを整列角度とする。第2軸角度が抽出されない場合とは、度数分布データにおいて、基準角度を中心とする一定の範囲に出現度数の多い角度が存在しない場合などである。
When decoding for the previous frame fails, the angle specifying unit 226 specifies the alignment angle in two directions as follows, for example.
If all of the first axis angle, the second axis angle, and the third axis angle have been extracted, select the first axis angle and the second axis angle or the third axis angle that is closer to the reference angle, The alignment angle.
When the third axis angle is not extracted, the angle specifying unit 226 selects the first axis angle and the second axis angle and sets it as the alignment angle. The case where the third axis angle is not extracted means that, in the frequency distribution data, when there is no angle having a high appearance frequency within a certain range centered on an angle symmetrical to the second axis angle with respect to the reference angle, This is the case when the shaft angle and the reference angle are the same.
When the second axis angle is not extracted, the angle specifying unit 226 sets the first axis angle and a reference angle offset by a certain angle with respect to the first axis angle as the alignment angle. The case where the second axis angle is not extracted is a case where, in the frequency distribution data, there is no angle having a high appearance frequency in a certain range centered on the reference angle.

さらに、角度特定部226は、所定の画像フレームで復号に失敗した場合に、次の画像フレームにおける整列角度として、復号に失敗した画像フレームとは異なる角度を選ぶようにしても良い。具体的には例えば、第1軸角度と第2軸角度を整列角度として復号に失敗した場合に、次の画像フレームでは、第1軸角度と第3軸角度とを整列角度とする、第2軸角度と第3軸角度とを整列角度とする、等である。   Furthermore, when decoding fails in a predetermined image frame, the angle specifying unit 226 may select an angle different from that of the image frame that has failed in decoding as the alignment angle in the next image frame. Specifically, for example, when decoding fails using the first axis angle and the second axis angle as the alignment angles, in the next image frame, the first axis angle and the third axis angle are set as the alignment angles. The axis angle and the third axis angle are set as the alignment angle, and so on.

<基準間隔の算出方法>
次に、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225による基準間隔の算出方法について説明する。
基準間隔とは、一定の方向に沿って並ぶ近接ドット対におけるドット間距離の平均値である。ただし、ドット間距離が突出して大きい近接ドット対を排除するため、一定の閾値(最大ドット間距離)を設け、ドット間距離がこの閾値以下である近接ドット対に関して、平均値を計算する。この閾値は、例えば、次のようにして決定される。
<Calculation method of reference interval>
Next, a method for calculating a reference interval by the first axis angle extraction unit 223, the second axis angle extraction unit 224, and the third axis angle extraction unit 225 will be described.
The reference interval is an average value of inter-dot distances in adjacent dot pairs arranged along a certain direction. However, in order to eliminate the proximity dot pairs with a large inter-dot distance protruding, a certain threshold value (maximum inter-dot distance) is provided, and an average value is calculated for the proximity dot pairs whose inter-dot distance is equal to or less than this threshold value. This threshold is determined as follows, for example.

まず、度数分布生成部222が、近接ドット対検出部221により検出された近接ドット対のドット間距離の度数分布データを生成する。この度数分布データは、近接ドット対のドット間距離の値ごとに、その出現度数を積算したデータである。そして、出現度数が最大であるドット間距離よりも若干長い距離を閾値とする。図22に、ドット間距離の度数分布の例を視覚的に表現したヒストグラムを示す。図22において、出現頻度最大のドット間距離よりも若干長い距離に閾値が設定されている。   First, the frequency distribution generation unit 222 generates frequency distribution data of the inter-dot distances of the adjacent dot pairs detected by the adjacent dot pair detection unit 221. The frequency distribution data is data obtained by integrating the appearance frequency for each value of the inter-dot distance of the adjacent dot pair. A distance slightly longer than the inter-dot distance where the appearance frequency is the maximum is set as a threshold value. FIG. 22 shows a histogram that visually represents an example of the frequency distribution of the inter-dot distance. In FIG. 22, the threshold is set to a distance slightly longer than the inter-dot distance with the maximum appearance frequency.

第1軸角度抽出部223は、第1軸角度に沿って並ぶ近接ドット対のうち、ドット間距離が上記のようにして求めた閾値以下のものを抽出する。そして、ドット間距離の平均値を計算し、第1軸方向のドットの基準間隔とする。なお、各種の誤差を考慮し、近接ドット対がなす角度は、第1軸角度に対して一定の幅(−α度から+α度)を含むものとする。すなわち、近接ドット対がなす角度が第1基準角度±αである近接ドット対が、第1軸角度に沿って並ぶ近接ドット対である。   The first axis angle extraction unit 223 extracts a pair of adjacent dots arranged along the first axis angle that has an inter-dot distance equal to or less than the threshold value obtained as described above. Then, the average value of the inter-dot distance is calculated and set as the reference interval of the dots in the first axis direction. In consideration of various errors, the angle formed by the adjacent dot pair includes a certain width (−α degrees to + α degrees) with respect to the first axis angle. That is, the adjacent dot pair whose angle formed by the adjacent dot pair is the first reference angle ± α is the adjacent dot pair arranged along the first axis angle.

同様にして、第2軸角度抽出部224は、第2軸角度に沿って並ぶ近接ドット対のうち、ドット間距離が上記のようにして求めた閾値以下のものを抽出し、第2軸方向のドットの基準間隔を算出する。また、第3軸角度抽出部225は、第3軸角度に沿って並ぶ近接ドット対のうち、ドット間距離が上記のようにして求めた閾値以下のものを抽出し、第3軸方向のドットの基準間隔を算出する。   Similarly, the second axis angle extraction unit 224 extracts a pair of adjacent dots arranged along the second axis angle, in which the inter-dot distance is equal to or less than the threshold obtained as described above, and the second axis direction The dot reference interval is calculated. Further, the third axis angle extraction unit 225 extracts a pair of adjacent dots arranged along the third axis angle that has a dot-to-dot distance equal to or less than the threshold value obtained as described above. The reference interval is calculated.

角度特定部226は、第1軸角度抽出部223、第2軸角度抽出部224、第3軸角度抽出部225から各々の方向の基準間隔を取得する。そして、整列角度として特定された方向(図14のX軸およびY軸)の基準間隔を選択し、整列角度と共に出力する。この整列角度および整列角度における基準間隔の情報は、同期化部230において同期化を行うための同期ラインの特定に用いられる。   The angle specifying unit 226 acquires a reference interval in each direction from the first axis angle extracting unit 223, the second axis angle extracting unit 224, and the third axis angle extracting unit 225. Then, a reference interval in the direction (X axis and Y axis in FIG. 14) specified as the alignment angle is selected and output together with the alignment angle. The alignment angle and the information on the reference interval at the alignment angle are used by the synchronization unit 230 to specify a synchronization line for synchronization.

<ペン・デバイスの構成>
次に、本実施の形態における画像処理装置10の具体的なハードウェア構成について説明する。ここでは、画像処理装置10を実現するペン・デバイスの構成例について説明する。
図23は、ペン・デバイスの機構を示した図である。
図示するように、ペン・デバイス60は、ペン全体の動作を制御する制御回路61を備える。制御回路61は、入力画像から検出した符号画像を処理する画像処理部61aと、そこでの処理結果から識別情報及び座標情報を抽出するデータ処理部61bとを含む。また、特に図示しないが、制御回路61は、これら画像処理部61aおよびデータ処理部61bを動作させるためのプログラムを格納する不揮発性メモリとを含む。この制御回路61には、ペン・デバイス60による筆記動作をペンチップ69に加わる圧力によって検出する圧力センサ62が接続されている。また、媒体上に赤外光を照射する赤外LED63と、画像を入力する赤外CMOS64も接続されている。さらに、識別情報及び座標情報を記憶するための情報メモリ65と、外部装置と通信するための通信回路66と、ペンを駆動するためのバッテリ67と、ペンの識別情報(ペンID)を記憶するペンIDメモリ68も接続されている。
<Configuration of pen device>
Next, a specific hardware configuration of the image processing apparatus 10 in the present embodiment will be described. Here, a configuration example of a pen device that realizes the image processing apparatus 10 will be described.
FIG. 23 shows the mechanism of the pen device.
As illustrated, the pen device 60 includes a control circuit 61 that controls the operation of the entire pen. The control circuit 61 includes an image processing unit 61a that processes a code image detected from an input image, and a data processing unit 61b that extracts identification information and coordinate information from the processing result there. Although not particularly shown, the control circuit 61 includes a non-volatile memory that stores programs for operating the image processing unit 61a and the data processing unit 61b. The control circuit 61 is connected to a pressure sensor 62 that detects a writing operation by the pen device 60 by a pressure applied to the pen tip 69. Further, an infrared LED 63 that irradiates infrared light onto the medium and an infrared CMOS 64 that inputs an image are also connected. Further, an information memory 65 for storing identification information and coordinate information, a communication circuit 66 for communicating with an external device, a battery 67 for driving the pen, and pen identification information (pen ID) are stored. A pen ID memory 68 is also connected.

図9に示した画像処理装置10において、撮像部100は、例えば、図23の赤外CMOS64にて実現される。また、ドット解析部200は、例えば、図23の画像処理部61aにて実現される。さらに、復号部300は、例えば、図23のデータ処理部61bにて実現される。なお、画像処理装置10は、図23に示すようなペン・デバイス60の他、画像処理部61a又はデータ処理部61bにて実現される機能を、例えば、汎用のコンピュータで実現しても良い。   In the image processing apparatus 10 illustrated in FIG. 9, the imaging unit 100 is realized by, for example, the infrared CMOS 64 in FIG. 23. The dot analysis unit 200 is realized by, for example, the image processing unit 61a in FIG. Furthermore, the decoding unit 300 is realized by, for example, the data processing unit 61b in FIG. In addition to the pen device 60 as shown in FIG. 23, the image processing apparatus 10 may realize functions realized by the image processing unit 61a or the data processing unit 61b with, for example, a general-purpose computer.

画像処理部61aおよびデータ処理部61bの機能を実現するプログラムは、通信手段を介して提供したり、CD−ROM等の記録媒体に格納して提供したりすることができる。また、制御回路61に含まれる上述した不揮発性メモリに格納して提供しても良い。   Programs that realize the functions of the image processing unit 61a and the data processing unit 61b can be provided via communication means or stored in a recording medium such as a CD-ROM. Further, it may be provided by being stored in the above-described nonvolatile memory included in the control circuit 61.

本実施形態で用いられる単位符号パターン、情報ブロック、紙面(媒体)の関係を示す図である。It is a figure which shows the relationship between the unit code pattern used by this embodiment, an information block, and a paper surface (medium). mCn方式における単位符号パターンの例を示す図である。It is a figure which shows the example of the unit code pattern in a mCn system. 図2に示した単位符号パターンの種類を網羅的に示した図である。FIG. 3 is a diagram comprehensively showing types of unit code patterns shown in FIG. 2. 9C2方式における単位符号パターンとパターン値との対応を示す図である。It is a figure which shows a response | compatibility with the unit code pattern and pattern value in 9C2 system. 9C2方式における同期パターンの例を示す図である。It is a figure which shows the example of the synchronous pattern in 9C2 system. 情報ブロックの構成例を示す図である。It is a figure which shows the structural example of an information block. 本実施形態における識別情報と座標情報を表現するためのレイアウトの例を示す図である。It is a figure which shows the example of the layout for expressing the identification information and coordinate information in this embodiment. M系列を用いた座標情報の符号化の例を示す図である。It is a figure which shows the example of the encoding of the coordinate information using M series. 本実施形態の画像処理装置の機能構成例を示す図である。It is a figure which shows the function structural example of the image processing apparatus of this embodiment. 本実施形態のドット解析部および復号部による処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process by the dot analysis part and decoding part of this embodiment. 撮像画像の例を示す図であり、ドットの整列角度が0度の場合の撮像画像の例である。It is a figure which shows the example of a captured image, and is an example of a captured image in case the alignment angle of a dot is 0 degree | times. 撮像画像の例を示す図であり、ドットの整列角度が45度の場合の撮像画像の例である。It is a figure which shows the example of a captured image, and is an example of a captured image in case the alignment angle of a dot is 45 degree | times. 図12に対して画像の上方が奥に、下方が手前に傾いた状態の撮像画像を示す図である。It is a figure which shows the picked-up image of the state where the upper part of the image leans back and the lower part leans forward. 本実施形態の角度検出部の機能構成を示す図である。It is a figure which shows the function structure of the angle detection part of this embodiment. ドットが検出された画像から、近接ドット対が検出された様子を示す図である。It is a figure which shows a mode that the proximity | contact dot pair was detected from the image from which the dot was detected. 本実施形態における近接ドット対の検出方法の具体例を示す図である。It is a figure which shows the specific example of the detection method of the proximity | contact dot pair in this embodiment. 本実施形態の近接ドット対検出部による近接ドット対の検出処理の流れを説明するフローチャートである。It is a flowchart explaining the flow of the detection process of the proximity dot pair by the proximity dot pair detection part of this embodiment. 図17のステップ1707に示す近接ドット対の判別処理の詳細を説明するフローチャートである。FIG. 18 is a flowchart illustrating details of proximity dot pair determination processing shown in step 1707 of FIG. 17. FIG. 本実施形態の度数分布生成部により生成される近接ドット対がなす角度の度数分布の例を視覚的に表現したヒストグラムである。It is the histogram which expressed visually the example of the frequency distribution of the angle which the close dot pair produced | generated by the frequency distribution production | generation part of this embodiment makes. 本実施形態の度数分布生成部、第1軸角度抽出部、第2軸角度抽出部、第3軸角度抽出部による第1軸角度、第2軸角度、第3軸角度の抽出処理の流れを説明するフローチャートである。Flow of extraction processing of the first axis angle, the second axis angle, and the third axis angle by the frequency distribution generation unit, the first axis angle extraction unit, the second axis angle extraction unit, and the third axis angle extraction unit of the present embodiment. It is a flowchart to explain. 本実施形態で抽出された3方向の角度のイメージを示す図である。It is a figure which shows the image of the angle of 3 directions extracted by this embodiment. 本実施形態におけるドット間距離の度数分布の例を視覚的に表現したヒストグラムである。It is the histogram which expressed the example of frequency distribution of the distance between dots in this embodiment visually. 画像処理装置であるペン・デバイスの機構を示した図である。It is the figure which showed the mechanism of the pen device which is an image processing apparatus.

符号の説明Explanation of symbols

10…画像処理装置、100…撮像部、200…ドット解析部、210…位置検出部、220…角度検出部、221…近接ドット対検出部、222…度数分布生成部、223…第1軸角度抽出部、224…第2軸角度抽出部、225…第3軸角度抽出部、226…角度特定部、230…同期化部、300…復号部 DESCRIPTION OF SYMBOLS 10 ... Image processing apparatus, 100 ... Imaging part, 200 ... Dot analysis part, 210 ... Position detection part, 220 ... Angle detection part, 221 ... Proximity dot pair detection part, 222 ... Frequency distribution generation part, 223 ... 1st axis angle Extraction unit, 224 ... second axis angle extraction unit, 225 ... third axis angle extraction unit, 226 ... angle identification unit, 230 ... synchronization unit, 300 ... decoding unit

Claims (9)

所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像装置により撮像して得られた画像から単位画像を検出する単位画像検出手段と、
前記単位画像検出手段により前記画像から検出された前記単位画像に関して、最も近い位置にある単位画像どうしの組み合わせを検出する組み合わせ検出手段と、
前記組み合わせ検出手段により検出された単位画像の前記組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する角度特定手段と
を備えることを特徴とする画像処理装置。
Unit image detecting means for detecting a unit image from an image obtained by imaging a recording medium on which a unit image arranged along at least two directions intersecting at a predetermined angle is recorded by an imaging device;
A combination detection unit that detects a combination of unit images that are closest to each other with respect to the unit image detected from the image by the unit image detection unit;
Angle specifying means for specifying an angle representing the inclination of the arrangement of the unit images based on the appearance frequency of the inclination of the straight line connecting the unit images constituting the combination of the unit images detected by the combination detecting means. An image processing apparatus.
前記角度特定手段により角度が特定された配列における前記単位画像の基準間隔を、単位画像の前記組み合わせを構成する各単位画像の間の距離に基づいて特定する間隔特定手段をさらに備えることを特徴とする請求項1に記載の画像処理装置。   The apparatus further comprises interval specifying means for specifying a reference interval of the unit images in the array whose angles are specified by the angle specifying means based on a distance between the unit images constituting the combination of unit images. The image processing apparatus according to claim 1. 前記角度特定手段は、前記単位画像を結ぶ直線の傾きのうち、出現頻度の最も高い角度を第1の角度とし、当該第1の角度に対して所定の角度だけ遷移させた基準角度を含む一定範囲において出現頻度の最も高い角度を第2の角度とし、当該第1の角度および当該第2の角度を前記2方向の角度とすることを特徴とする請求項1に記載の画像処理装置。   The angle specifying means includes a reference angle obtained by setting a first angle as an angle with the highest appearance frequency among inclinations of straight lines connecting the unit images, and including a reference angle that is shifted by a predetermined angle with respect to the first angle. The image processing apparatus according to claim 1, wherein an angle having the highest appearance frequency in the range is a second angle, and the first angle and the second angle are angles in the two directions. 前記角度特定手段は、前記基準角度に対して前記第2の角度の対称となる角度を含む一定範囲において出現頻度の最も高い角度を第3の角度とし、所定の基準に基づいて、前記第1の角度と当該第2の角度と当該第3の角度のうち2つを選んで、前記2方向の角度とすることを特徴とする請求項3に記載の画像処理装置。   The angle specifying means sets the angle having the highest appearance frequency as a third angle in a certain range including an angle that is symmetrical to the second angle with respect to the reference angle, and sets the first angle based on a predetermined reference. 4. The image processing apparatus according to claim 3, wherein two of the angle, the second angle, and the third angle are selected and set as the angles in the two directions. 5. 前記単位画像検出手段により検出された単位画像および前記角度特定手段により特定された当該単位画像の配列の角度に基づき、当該単位画像によって符号化されて記録された情報を復号する復号手段をさらに備え、
前記角度特定手段は、前記第1の角度、第2の角度、第3の角度のうち、前記復号手段による復号が成功したときの前記単位画像の配列の角度に近い2つの角度を選択することを特徴とする請求項4に記載の画像処理装置。
The apparatus further comprises decoding means for decoding the information encoded and recorded by the unit image based on the unit image detected by the unit image detecting means and the angle of the arrangement of the unit images specified by the angle specifying means. ,
The angle specifying means selects two angles close to the array angle of the unit images when decoding by the decoding means is successful among the first angle, the second angle, and the third angle. The image processing apparatus according to claim 4.
所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像する撮像手段と、
前記撮像手段により撮像して得られた画像から単位画像を検出する単位画像検出手段と、
前記単位画像検出手段により前記画像から検出された前記単位画像に関して、最も近い位置にある当該単位画像どうしの組み合わせを検出する組み合わせ検出手段と、
前記組み合わせ検出手段により検出された単位画像の前記組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する角度特定手段と
を備えることを特徴とするペン・デバイス。
Imaging means for imaging a recording medium on which unit images arranged along at least two directions intersecting at a predetermined angle are recorded;
Unit image detection means for detecting a unit image from an image obtained by imaging by the imaging means;
A combination detection unit that detects a combination of the unit images at the closest position with respect to the unit image detected from the image by the unit image detection unit;
Angle specifying means for specifying an angle representing the inclination of the arrangement of the unit images based on the appearance frequency of the inclination of the straight line connecting the unit images constituting the combination of the unit images detected by the combination detecting means. A pen device characterized by that.
前記角度特定手段により角度が特定された配列における前記単位画像の基準間隔を、前記単位画像の組み合わせを構成する各単位画像の間の距離に基づいて特定する間隔特定手段をさらに備えることを特徴とする請求項6に記載のペン・デバイス。   The apparatus further comprises interval specifying means for specifying a reference interval of the unit images in the array in which the angles are specified by the angle specifying means based on a distance between the unit images constituting the combination of the unit images. The pen device according to claim 6. コンピュータに、
所定の角度で交差する少なくとも2方向に沿って配列される単位画像が記録された記録媒体を撮像装置により撮像して得られた画像から単位画像を検出する機能と、
前記画像から検出された前記単位画像に関して、最も近い位置にある単位画像どうしの組み合わせを検出する機能と、
検出された単位画像の前記組み合わせを構成する各単位画像を結ぶ直線の傾きの出現頻度に基づいて、当該単位画像の配列の傾きを表す角度を特定する機能と、
を実現させるためのプログラム。
On the computer,
A function of detecting a unit image from an image obtained by imaging a recording medium in which unit images arranged along at least two directions intersecting at a predetermined angle are recorded by an imaging device;
A function for detecting a combination of unit images located closest to each other with respect to the unit image detected from the image;
A function for specifying an angle representing the inclination of the arrangement of the unit images based on the appearance frequency of the inclination of a straight line connecting the unit images constituting the combination of the detected unit images;
A program to realize
前記コンピュータに、角度が特定された配列における前記単位画像の基準間隔を、前記単位画像の組み合わせを構成する各単位画像の間の距離に基づいて特定する機能をさらに実現させる請求項8に記載のプログラム。   9. The computer according to claim 8, further comprising a function of specifying a reference interval of the unit images in the array in which the angle is specified based on a distance between the unit images constituting the combination of the unit images. program.
JP2008019872A 2008-01-30 2008-01-30 Image processor, pen device, and program Pending JP2009181346A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008019872A JP2009181346A (en) 2008-01-30 2008-01-30 Image processor, pen device, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008019872A JP2009181346A (en) 2008-01-30 2008-01-30 Image processor, pen device, and program

Publications (1)

Publication Number Publication Date
JP2009181346A true JP2009181346A (en) 2009-08-13

Family

ID=41035281

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008019872A Pending JP2009181346A (en) 2008-01-30 2008-01-30 Image processor, pen device, and program

Country Status (1)

Country Link
JP (1) JP2009181346A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010146335A (en) * 2008-12-19 2010-07-01 Denso Wave Inc Information code reading device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010146335A (en) * 2008-12-19 2010-07-01 Denso Wave Inc Information code reading device

Similar Documents

Publication Publication Date Title
US8459565B2 (en) Two-dimensional code generating apparatus, image forming system, two-dimensional code reading apparatus, and computer readable medium
US6959866B2 (en) 2-Dimensional code pattern, 2-dimensional code pattern supporting medium, 2-dimensional code pattern generating method, and 2-dimensional code reading apparatus and method
US6929183B2 (en) Reconstruction of virtual raster
JP4198456B2 (en) Two-dimensional code pattern, two-dimensional code pattern carrying medium, two-dimensional code pattern generation method, two-dimensional code reading apparatus and reading method
JP4996245B2 (en) Method, apparatus, computer program and storage medium for position decoding
JP2008107996A (en) Image processor and program
JP5609469B2 (en) Image processing apparatus, identification apparatus, electronic writing instrument, and program
JP4893643B2 (en) Detection method and detection apparatus
US8019181B2 (en) Image generation apparatus, image processing apparatus, computer readable medium and computer data signal
US8657205B2 (en) Image processing apparatus, identification apparatus, method for determining bit sequence and computer readable medium
JP4967823B2 (en) Position detection apparatus and program
JP2009175845A (en) Image processor, pen device, and program
JP2009181346A (en) Image processor, pen device, and program
JP4985436B2 (en) Position detection apparatus and program
JP4973316B2 (en) Image processing apparatus and program
JP2009181347A (en) Image-processing device, pen device, and program
CN100367169C (en) Methods, apparatus, computer program and storage medium for position decoding
JP5592234B2 (en) Two-dimensional code generation device, two-dimensional code reading device, two-dimensional code, two-dimensional code generation method, two-dimensional code reading method, and program
JP5098267B2 (en) WRITING INFORMATION PROCESSING DEVICE, WRITING INFORMATION PROCESSING METHOD, AND PROGRAM
JP5125548B2 (en) Image processing apparatus and program
JP4397866B2 (en) Two-dimensional pattern reading device, two-dimensional pattern reading method
JP2009181341A (en) Position detection device and program
JP5098441B2 (en) Image processing apparatus and program
JP5125547B2 (en) Image generating apparatus, image processing apparatus, program, and print medium
JP2009175986A (en) Image processor and program