JP4985436B2 - Position detection apparatus and program - Google Patents

Position detection apparatus and program Download PDF

Info

Publication number
JP4985436B2
JP4985436B2 JP2008019746A JP2008019746A JP4985436B2 JP 4985436 B2 JP4985436 B2 JP 4985436B2 JP 2008019746 A JP2008019746 A JP 2008019746A JP 2008019746 A JP2008019746 A JP 2008019746A JP 4985436 B2 JP4985436 B2 JP 4985436B2
Authority
JP
Japan
Prior art keywords
image
code
information
pattern
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2008019746A
Other languages
Japanese (ja)
Other versions
JP2009181340A (en
Inventor
隆志 園田
健司 大西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP2008019746A priority Critical patent/JP4985436B2/en
Publication of JP2009181340A publication Critical patent/JP2009181340A/en
Application granted granted Critical
Publication of JP4985436B2 publication Critical patent/JP4985436B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To identify an instructed position on a medium even if there is a gap between the instructed position on the medium and a position found by photographing a printed image. <P>SOLUTION: A position detection device includes; an image reading part 21 which reads out images; a dot sequence generation part 22 which detects dots from the images to generate a dot sequence; a block detection part 23 which detects blocks from the dot sequence to generate a code sequence; a synchronous code detection part 24 which detects synchronous codes from the code sequence; an identification code detection part 30 which detects identification codes on the basis of the synchronous code; an identification code decoding part 32 which decodes the identification codes to obtain identification information; an X-coordinate code detecting part 40 and a Y-coordinate code detecting part 45 which detect coordinates codes on the basis of the synchronous codes; an X-coordinate code decoding part 42 and a Y-coordinate code decoding part 47 which decode the coordinates codes to obtain coordinates information; and a coordinates correcting part 50 which converts the relative coordinates of the tip of a pen on a photographed image to those on a medium to find the coordinates of the tip of the pen on the medium in addition to its coordinates information. <P>COPYRIGHT: (C)2009,JPO&amp;INPIT

Description

本発明は、位置検出装置、プログラムに関する。   The present invention relates to a position detection device and a program.

表面上の複数の位置を符号化する位置コードを提供する方法は知られている(例えば、特許文献1参照)。この特許文献1では、循環数字列を表面に沿って複数回印刷する。その際、循環数字列の異なるローテーションを、隣り合う数字列間で所定のずれが起こるように使用し、表面を分割した複数のコードウィンドウが、少なくとも3つの循環数字列を備えると共に、隣り合うコードウィンドウの1つの数字列と重なり合う1つの数字列を有するものであり、また、コードウィンドウの位置を、そのコードウィンドウに属している循環数字列間のずれによって符号化している。   A method for providing a position code for encoding a plurality of positions on a surface is known (see, for example, Patent Document 1). In this patent document 1, a cyclic numeral sequence is printed a plurality of times along the surface. At that time, using different rotations of the cyclic numeral sequences so that a predetermined deviation occurs between the adjacent numeric strings, a plurality of code windows divided on the surface include at least three cyclic numeral sequences and adjacent codes. It has one numeric string that overlaps one numeric string of the window, and the position of the code window is encoded by a shift between the cyclic numeric strings belonging to the code window.

論理的に順位付けられたデジタル量子の機械読取り可能なエンコーディングを記録した記録媒体からのエンコーディングの空間的に非同期的な読取りを可能にする技術も知られている(例えば、特許文献2参照)。この特許文献2では、本質的に同一であるエンコーディングの多数のコピーを形成し、機械認識可能な空間同期指標をエンコーディングのコピーの各々の中のプリント位置に組み合わせて、エンコーディングの空間的に同期可能な多数の事例を提供し、それらの事例をレイアウト規則に従って記録媒体における空間的に周期的な中心の格子に書き込んでいる。   There is also known a technique that enables spatially asynchronous reading of encoding from a recording medium that records machine-readable encoding of digital quantum that is logically ranked (see, for example, Patent Document 2). In this document, multiple copies of an encoding that are essentially identical can be formed, and a machine-recognizable spatial synchronization index can be combined with the print position within each of the copies of the encoding to allow spatial synchronization of the encoding. A large number of cases are provided, and these cases are written in a spatially periodic center grid in the recording medium according to the layout rules.

取り込まれた画像の位置をより大きい画像から決定するためのシステム及び方法も知られている(例えば、特許文献3参照)。この特許文献3では、非反復的な系列を、所定のサイズのサブウィンドウ毎に固有とされた非反復的な配列に折り畳み、その取り込まれた位置を非反復的な配列内のサブウィンドウ毎に決定することによって、取り込まれた画像の位置を、より大きいサブウィンドウの画像から決定している。   Systems and methods for determining the position of captured images from larger images are also known (see, for example, Patent Document 3). In this Patent Document 3, a non-repetitive sequence is folded into a non-repetitive sequence unique to each sub-window of a predetermined size, and the captured position is determined for each sub-window in the non-repetitive sequence. Thus, the position of the captured image is determined from the image of the larger subwindow.

光学的に読み取り可能に記録されるマルチメディア情報の長時間記録及び繰り返し再生を可能とする技術も知られている(例えば、特許文献4参照)。この特許文献4において、記録装置は、プリンタシステムや印刷用製版システムにより、オーディオ情報、映像情報、ディジタルコードデータ等を含めた所謂マルチメディア情報を光学的に読み取り可能なドットコードとして、画像や文字と一緒に紙等の媒体上に記録する。ペン型の情報再生装置は、ドットコードの手動走査に応じてそのドットコードを順次取り込んで、元のオーディオ情報を音声出力器にて、元の映像情報を表示装置にて、元のディジタルコードデータをページプリンタ等にて出力する。   A technique that enables long-time recording and repeated reproduction of multimedia information that is optically readable is also known (see, for example, Patent Document 4). In this patent document 4, a recording apparatus uses a printer system or a printing plate making system as a dot code that can optically read so-called multimedia information including audio information, video information, digital code data, etc. And record on a medium such as paper. The pen-type information reproducing device sequentially captures the dot code according to the manual scanning of the dot code, and the original audio information is output by the audio output device, the original video information is displayed by the display device, and the original digital code data Is output by a page printer or the like.

タブレットを使用せずに、媒体上の座標を精緻に検出できるようにする技術も知られている(例えば、特許文献5参照)。この特許文献5において、ペン型の座標入力装置は、媒体上に形成されその媒体上の座標を示すコードシンボルを光学的に読み取り、この読み取ったコードシンボルをデコードし、読み取った画像中におけるコードシンボルの位置、向き及び歪み量を検出する。そして、デコード後の情報と、コードシンボルの位置、向き及び歪み量とにより、先端部の媒体上での位置の座標を検出する。   There is also known a technique that enables precise detection of coordinates on a medium without using a tablet (see, for example, Patent Document 5). In this patent document 5, a pen-type coordinate input device optically reads a code symbol formed on a medium and indicating the coordinates on the medium, decodes the read code symbol, and reads the code symbol in the read image. The position, orientation, and amount of distortion are detected. Then, the coordinates of the position of the tip on the medium are detected based on the decoded information and the position, orientation, and distortion amount of the code symbol.

特表2003−511762号公報JP-T-2003-511762 特開平9−185669号公報JP-A-9-185669 特開2004−152273号公報JP 2004-152273 A 特開平6−231466号公報JP-A-6-231466 特開2000−293303号公報JP 2000-293303 A

ここで、一般に、印刷画像を撮像して求めた位置は、厳密には、媒体上の指示された位置と異なっていた。
本発明の目的は、媒体上の指示された位置と印刷画像を撮像して求めた位置との間にズレがあっても、媒体上の指示された位置を特定できるようにすることにある。
Here, in general, the position obtained by capturing the print image is strictly different from the instructed position on the medium.
An object of the present invention is to make it possible to specify an instructed position on a medium even if there is a deviation between the instructed position on the medium and a position obtained by capturing a print image.

請求項1に記載の発明は、媒体上の位置を指示する指示手段と、前記媒体に印刷され、m(m≧3)箇所のうちのn(1≦n<m)箇所に単位画像を配置したパターン画像を横方向にAx(Ax≧2)個、縦方向にAy(Ay≧2)個並べたパターン画像群が周期的に配置された印刷画像を撮像した撮像画像を取得する画像取得手段と、前記撮像画像から、当該撮像画像の部分を構成する部分画像を抽出する抽出手段と、前記部分画像における前記単位画像の有無を要素として格納する第1の配列を生成する第1の配列生成手段と、前記撮像画像を含む平面上で、前記指示手段により指示された前記媒体上の位置に対応する位置の前記部分画像に対する相対位置を示す第1の位置情報を取得する第1の情報取得手段と、前記第1の配列上で、前記パターン画像と略同じ大きさの区画を前記横方向にAx個、前記縦方向にAy個配置してなる枠を、n個の前記単位画像を含む区画が所定数以上となる枠位置まで移動することにより、当該枠位置における当該枠内の配列である第2の配列と、当該枠位置までの当該枠の前記横方向及び前記縦方向の移動量とを生成する第2の配列生成手段と、前記第2の配列を用いて、前記媒体上の前記印刷画像の当該第2の配列に対応する部分の位置を示す第2の位置情報を取得する第2の情報取得手段と、前記第1の位置情報を、前記指示手段により指示された前記媒体上の位置の前記印刷画像に対する相対位置を示す第3の位置情報に変換する変換手段と、前記第2の位置情報と、前記移動量とに基づいて、前記媒体上の前記印刷画像の前記部分画像に対応する部分の位置を特定する第1の特定手段と、前記印刷画像の前記部分画像に対応する部分の位置と、前記第3の位置情報とに基づいて、前記指示手段により指示された前記媒体上の位置を特定する第2の特定手段とを備えたことを特徴とする位置検出装置である。
請求項2に記載の発明は、前記第1の情報取得手段は、前記部分画像の前記撮像画像に対する傾き角を示す角度情報を更に取得し、前記変換手段は、前記角度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項1記載の位置検出装置である。
請求項3に記載の発明は、前記部分画像は、四辺形であり、前記第1の情報取得手段は、前記部分画像の第1の辺の前記撮像画像に対する傾き角を示す第1の角度情報と、前記部分画像の当該第1の辺に隣接する第2の辺の前記撮像画像に対する傾き角を示す第2の角度情報とを、前記角度情報として取得することを特徴とする請求項2記載の位置検出装置である。
請求項4に記載の発明は、前記第1の情報取得手段は、前記撮像画像における尺度を示す尺度情報を更に取得し、前記変換手段は、前記尺度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項1記載の位置検出装置である。
請求項5に記載の発明は、前記部分画像は、四辺形であり、前記第1の情報取得手段は、前記部分画像の第1の辺に沿った前記撮像画像における尺度を示す第1の尺度情報と、前記部分画像の当該第1の辺に隣接する第2の辺に沿った前記撮像画像における尺度を示す第2の尺度情報とを、前記尺度情報として取得することを特徴とする請求項4記載の位置検出装置である。
請求項6に記載の発明は、前記第1の情報取得手段は、前記撮像画像上の前記単位画像に対応する画像の間隔に基づいて、前記尺度情報を取得することを特徴とする請求項4記載の位置検出装置である。
請求項7に記載の発明は、コンピュータに、媒体に印刷され、m(m≧3)箇所のうちのn(1≦n<m)箇所に単位画像を配置したパターン画像を横方向にAx(Ax≧2)個、縦方向にAy(Ay≧2)個並べたパターン画像群が周期的に配置された印刷画像を撮像した撮像画像を取得する機能と、前記撮像画像から、当該撮像画像の部分を構成する部分画像を抽出する機能と、前記部分画像における前記単位画像の有無を要素として格納する第1の配列を生成する機能と、前記撮像画像を含む平面上で、指示手段により指示された前記媒体上の位置に対応する位置の前記部分画像に対する相対位置を示す第1の位置情報を取得する機能と、前記第1の配列上で、前記パターン画像と略同じ大きさの区画を前記横方向にAx個、前記縦方向にAy個配置してなる枠を、n個の前記単位画像を含む区画が所定数以上となる枠位置まで移動することにより、当該枠位置における当該枠内の配列である第2の配列と、当該枠位置までの当該枠の前記横方向及び前記縦方向の移動量とを生成する機能と、前記第2の配列を用いて、前記媒体上の前記印刷画像の当該第2の配列に対応する部分の位置を示す第2の位置情報を取得する機能と、前記第1の位置情報を、前記指示手段により指示された前記媒体上の位置の前記印刷画像に対する相対位置を示す第3の位置情報に変換する機能と、前記第2の位置情報と、前記移動量とに基づいて、前記媒体上の前記印刷画像の前記部分画像に対応する部分の位置を特定する機能と、前記印刷画像の前記部分画像に対応する部分の位置と、前記第3の位置情報とに基づいて、前記指示手段により指示された前記媒体上の位置を特定する機能とを実現させるためのプログラムである。
請求項8に記載の発明は、前記部分画像の前記撮像画像に対する傾き角を示す角度情報を取得する機能更に前記コンピュータに実現させ、前記変換する機能では、前記角度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項7記載のプログラムである。
請求項9に記載の発明は、前記撮像画像における尺度を示す尺度情報を取得する機能を更に前記コンピュータに実現させ、前記変換する機能では、前記尺度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項7記載のプログラムである。
According to the first aspect of the present invention, an instruction unit that indicates a position on a medium and printed on the medium , unit images are arranged at n (1 ≦ n <m) of m (m ≧ 3). Image acquisition means for acquiring a picked-up image obtained by picking up a print image in which a group of pattern images in which Ax (Ax ≧ 2) in the horizontal direction and Ay (Ay ≧ 2) in the vertical direction are arranged periodically are arranged Extraction means for extracting a partial image constituting a portion of the captured image from the captured image, and a first array generation for generating a first array that stores the presence or absence of the unit image in the partial image as an element And first information acquisition for acquiring first position information indicating a relative position of the position corresponding to the position on the medium instructed by the instruction means on the plane including the captured image with respect to the partial image . and means, on said first sequence, The frame formed by arranging Ax pieces of the same size as the pattern image in the horizontal direction and Ay pieces in the vertical direction is moved to a frame position where the number of the divisions including the n unit images is equal to or more than a predetermined number. A second array generating means for generating a second array that is an array in the frame at the frame position and a movement amount in the horizontal direction and the vertical direction of the frame up to the frame position; Using the second array, second information acquisition means for acquiring second position information indicating the position of a portion corresponding to the second array of the print image on the medium; and the first Converting means for converting the position information into third position information indicating a relative position of the position on the medium instructed by the instruction means with respect to the print image, the second position information, and the movement amount. The portion of the printed image on the medium based on A first specifying means for specifying the position of the portion corresponding to the image, and the position of the portion corresponding to the partial image of the print image, based on said third position information, indicated by said indicating means And a second specifying unit that specifies a position on the medium.
The invention according to claim 2, wherein the first information obtaining means, the further obtains the angle information indicating the tilt angle with respect to the captured image of the partial image, and the converting means, using the angle information, the The position detection device according to claim 1, wherein the first position information is converted into the third position information.
According to a third aspect of the present invention, the partial image is a quadrilateral, and the first information acquisition unit includes first angle information indicating an inclination angle of the first side of the partial image with respect to the captured image. The second angle information indicating an inclination angle of the second side adjacent to the first side of the partial image with respect to the captured image is acquired as the angle information. This is a position detection device.
According to a fourth aspect of the present invention, the first information acquisition unit further acquires scale information indicating a scale in the captured image, and the conversion unit uses the scale information to obtain the first position information. The position detecting device according to claim 1, wherein the position detecting device is converted into the third position information.
According to a fifth aspect of the present invention, the partial image is a quadrilateral, and the first information acquisition unit includes a first scale indicating a scale in the captured image along the first side of the partial image. The information and second scale information indicating a scale in the captured image along a second side adjacent to the first side of the partial image are acquired as the scale information. 4. The position detection device according to 4.
The invention according to claim 6, wherein the first information obtaining means, according to claim 4 based on the image distance corresponding to the unit image on the captured image, and acquires the scale information It is a position detection apparatus of description.
According to the seventh aspect of the present invention, a pattern image printed on a medium and arranged with unit images at n (1 ≦ n <m) of m (m ≧ 3) is displayed in a horizontal direction on an Ax ( A function of acquiring a captured image obtained by capturing a print image in which Ax ≧ 2) and Ay (Ay ≧ 2) pattern images arranged in the vertical direction are periodically arranged; and from the captured image, A function for extracting a partial image constituting a part, a function for generating a first array for storing the presence or absence of the unit image in the partial image as an element , and an instruction means on a plane including the captured image A function of obtaining first position information indicating a relative position of the position corresponding to the position on the medium with respect to the partial image, and a section having substantially the same size as the pattern image on the first array. Ax in the horizontal direction, the vertical The second array, which is an array within the frame at the frame position, by moving the Ay arranged frames to the frame position where the number of sections including the n unit images is equal to or greater than a predetermined number; Corresponding to the second array of the print images on the medium , using the function of generating the horizontal and vertical movement amounts of the frame up to the frame position and the second array A function for obtaining second position information indicating the position of a part; and third position information indicating the relative position of the position on the medium instructed by the instruction means with respect to the print image. Based on the second position information and the movement amount, the function of specifying the position of the part corresponding to the partial image of the print image on the medium, and the print image the position of the portion corresponding to the partial image, said first Based positional information and the a program for realizing a function of specifying a position on the medium designated by the instruction means.
Invention of claim 8, wherein the further implemented to the computer a function of acquiring angular information indicating an inclination angle with respect to the captured image of the partial image, the function of the conversion, by using the angle information, the first 8. The program according to claim 7, wherein the position information of 1 is converted into the third position information.
The invention according to claim 9 further causes the computer to realize a function of acquiring scale information indicating a scale in the captured image, and the function of converting uses the scale information to calculate the first position information. The program according to claim 7, wherein the program is converted into the third position information.

請求項1の発明は、媒体上の指示された位置と印刷画像を撮像して求めた位置との間にズレがあっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項2の発明は、印刷画像を撮像した撮像画像と媒体上の位置を求めるために撮像画像から抽出される部分画像との間に角度の違いがあっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項3の発明は、撮像画像から抽出される部分画像が例えば平行四辺形のように変形している場合であっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項4の発明は、印刷画像とそれを撮像した撮像画像との間に尺度の違いがあっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項5の発明は、撮像画像から抽出される部分画像が例えば平行四辺形のように変形している場合であっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項6の発明は、所定の領域に単位画像を配置した印刷画像が印刷された媒体上の指示された位置を特定する場合に、本構成を有していない場合に比較して、印刷画像とそれを撮像した撮像画像との間の尺度の違いを精度よく求めることができるという効果を有する。
請求項7の発明は、媒体上の指示された位置と印刷画像を撮像して求めた位置との間にズレがあっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項8の発明は、印刷画像を撮像した撮像画像と媒体上の位置を求めるために撮像画像から抽出される部分画像との間に角度の違いがあっても、媒体上の指示された位置を特定することができるという効果を有する。
請求項9の発明は、印刷画像とそれを撮像した撮像画像との間に尺度の違いがあっても、媒体上の指示された位置を特定することができるという効果を有する。
According to the first aspect of the present invention, it is possible to specify the designated position on the medium even when there is a deviation between the designated position on the medium and the position obtained by capturing the print image. Have.
According to the second aspect of the present invention, even if there is a difference in angle between a captured image obtained by capturing a print image and a partial image extracted from the captured image in order to obtain a position on the medium, the indicated position on the medium Has the effect of being able to specify.
The invention of claim 3 has the effect that the indicated position on the medium can be specified even when the partial image extracted from the captured image is deformed, for example, as a parallelogram. .
The invention of claim 4 has the effect that the instructed position on the medium can be specified even if there is a difference in scale between the printed image and the captured image obtained by capturing it.
The invention according to claim 5 has an effect that the indicated position on the medium can be specified even when the partial image extracted from the captured image is deformed, for example, as a parallelogram. .
According to the sixth aspect of the present invention, when the designated position on the medium on which the print image in which the unit image is arranged in the predetermined area is specified, the print image is compared with the case where the configuration is not provided. And the difference between the scales of the captured image and the captured image can be obtained with high accuracy.
According to the seventh aspect of the present invention, it is possible to specify the instructed position on the medium even if there is a deviation between the instructed position on the medium and the position obtained by capturing the print image. Have.
According to the eighth aspect of the present invention, even if there is a difference in angle between a captured image obtained by capturing a print image and a partial image extracted from the captured image in order to obtain a position on the medium, the indicated position on the medium Has the effect of being able to specify.
The invention of claim 9 has the effect that the indicated position on the medium can be specified even if there is a difference in scale between the printed image and the captured image obtained by capturing it.

以下、添付図面を参照して、本発明を実施するための最良の形態(以下、「実施の形態」という)について詳細に説明する。
まず、本実施の形態で利用する符号化方式について説明する。
本実施の形態における符号化方式では、m(m≧3)箇所から選択したn(1≦n<m)箇所に単位画像を配置してなるパターン画像(以下、「符号パターン」という)によってmCn(=m!/{(m−n)!×n!})通りの情報を表現する。つまり、1つの単位画像を情報に対応させるのではなく、複数の単位画像を情報に対応させている。仮に1つの単位画像を情報に対応させたとすると、単位画像が欠損したり、ノイズが加わったりした場合に、誤った情報を表現してしまうという欠点がある。これに対して、例えば2つの単位画像を情報に対応させたとすると、単位画像が1つであったり3つであったりした場合に、容易に誤りであることが分かる。更に、1つの単位画像で1ビット、又は、高々2ビットを表現する方法では、情報を表現するための情報パターンと視覚的に似たパターンで、情報パターンの読出しを制御する同期パターンを表現することができない。このようなことから、本実施の形態では、上記のような符号化方式を採用している。以下では、このような符号化方式をmCn方式と称する。
ここで、単位画像としては、如何なる形状のものを用いてもよい。本実施の形態では、単位画像の一例としてドット画像(以下、単に「ドット」という)を用いるが、例えば、斜線パターン等、他の形状の画像であってもよい。
The best mode for carrying out the present invention (hereinafter referred to as “embodiment”) will be described in detail below with reference to the accompanying drawings.
First, the encoding method used in this embodiment will be described.
In the encoding method according to the present embodiment, mCn is represented by a pattern image (hereinafter referred to as “code pattern”) in which unit images are arranged at n (1 ≦ n <m) locations selected from m (m ≧ 3) locations. (= M! / {(Mn)! × n!}) Express information. 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. Furthermore, in the method of expressing 1 bit or 2 bits at most in one unit image, a synchronous pattern for controlling reading of the information pattern is expressed by a pattern visually similar to the information pattern for expressing the information. I can't. For this reason, the present embodiment employs the above encoding method. Hereinafter, such an encoding method is referred to as an mCn method.
Here, a unit image having any shape may be used. In the present embodiment, a dot image (hereinafter simply referred to as “dot”) is used as an example of a unit image, but an image having another shape such as a hatched pattern may be used.

図1に、mCn方式における符号パターンの例を示す。
図では、黒色の領域と斜線の領域をドット配置可能な領域とし、その間にある白色の領域をドット配置不可能な領域としている。そして、ドット配置可能な領域のうち、黒色の領域にドットが配置され、斜線の領域にはドットが配置されていないことを示している。即ち、図1は、縦3×横3の合計9個のドット配置可能な領域を設けた例を示しており、このうち、(a)は、9個のドット配置可能な領域に2ドットを配置する9C2方式における符号パターンの一例を、(b)は、9個のドット配置可能な領域に3ドットを配置する9C3方式における符号パターンの一例を示している。
FIG. 1 shows an example of a code pattern in the mCn system.
In the figure, a black area and a hatched area are areas where dots can be arranged, and a white area between them is an area where dots cannot be arranged. Of the areas where dots can be arranged, dots are arranged in black areas and dots are not arranged in hatched areas. In other words, FIG. 1 shows an example in which a total of 9 dots can be arranged in 3 × 3, and (a) shows that 2 dots are placed in 9 dots that can be arranged. An example of the code pattern in the 9C2 method to be arranged, (b) shows an example of the code pattern in the 9C3 method in which 3 dots are arranged in an area where nine dots can be arranged.

但し、図1で配置されるドット(黒色の領域)は、あくまで情報表現のためのドットであり、画像を構成する最小単位であるドット(図1の最小の四角)とは一致していない。本実施の形態において、「ドット」というときは前者のドットを指し、後者のドットは「ピクセル」と呼ぶことにすれば、ドットは、600dpiにおける2ピクセル×2ピクセルの大きさを有することになる。600dpiにおける1ピクセルの一辺の長さは0.0423mmなので、1ドットの一辺の長さは、84.6μm(=0.0423mm×2)となる。ドットは、大きくなればなるほど目に付きやすくなるため、できるだけ小さいほうが好ましい。ところが、あまり小さくすると、プリンタで印刷できなくなってしまう。そこで、ドットの大きさとして、50μmより大きく100μmより小さい上記の値を採用している。但し、上記の値84.6μmは、あくまで計算上の数値であり、実際に印刷されたトナー像では100μm程度になる。   However, the dots (black areas) arranged in FIG. 1 are only for information representation, and do not coincide with the dots (minimum squares in FIG. 1) that are the minimum units constituting the image. In this 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 length of one side of one pixel at 600 dpi is 0.0423 mm, the length of one side of one 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.

次いで、図2に、9C2方式における全符号パターンの例を示す。尚、ここでは、ドット間の空白は省略している。図示するように、9C2方式では、36(=)通りの符号パターンが利用される。また、全符号パターンに対して、各符号パターンを一意に識別するための番号であるパターン値が付される。図では、各符号パターンに対するこのパターン値の割り当ての例も示している。但し、図に示した対応はあくまで一例であり、どの符号パターンにどのパターン値を割り当ててもよい。 Next, FIG. 2 shows an example of all code patterns in the 9C2 system. Here, a space between dots is omitted. As shown in the figure, in the 9C2 system, 36 (= 9 C 2 ) code patterns are used. Also, a pattern value that is a number for uniquely identifying each code pattern is attached to all code patterns. In the figure, an example of assignment of the pattern value to each code pattern is also shown. However, the correspondence shown in the figure is merely an example, and any pattern value may be assigned to any code pattern.

また、図3に、9C3方式における全符号パターンの例を示す。尚、ここでも、ドット間の空白は省略している。図示するように、9C3方式では、84(=)通りの符号パターンが利用される。また、この場合も、全符号パターンに対して、各符号パターンを一意に識別するための番号であるパターン値が付される。図では、各符号パターンに対するこのパターン値の割り当ての例も示している。但し、この場合も、図に示した対応はあくまで一例であり、どの符号パターンにどのパターン値を割り当ててもよい。 FIG. 3 shows an example of all code patterns in the 9C3 system. Also here, the space between dots is omitted. As shown in the drawing, in the 9C3 system, 84 (= 9 C 3 ) code patterns are used. Also in this case, a pattern value which is a number for uniquely identifying each code pattern is attached to all code patterns. In the figure, an example of assignment of the pattern value to each code pattern is also shown. However, in this case as well, the correspondence shown in the figure is merely an example, and any pattern value may be assigned to any code pattern.

尚、ここでは、符号パターンが配置される領域(以下、「パターンブロック」という)の大きさを、3ドット×3ドットを配置可能な大きさとした。しかしながら、パターンブロックの大きさはこれに限るものではない。つまり、2ドット×2ドット、4ドット×4ドット等を配置可能な大きさであってもよい。
また、パターンブロックの形状として、正方形でなく、例えば3ドット×4ドットを配置する場合のように長方形を採用してもよい。尚、本明細書において、長方形とは、隣り合う2辺の長さが等しくない矩形、つまり、正方形以外の矩形のことをいうものとする。
更に、任意に決めた数のドット配置可能な領域のうち、幾つの領域にドットを配置するかも、表現したい情報の量と許容できる画像濃度とを考慮して、適宜決めるとよい。
Here, the size of the area where the code pattern is arranged (hereinafter referred to as “pattern block”) is set so that 3 dots × 3 dots can be arranged. However, the size of the pattern block is not limited to this. That is, the size may be 2 dots × 2 dots, 4 dots × 4 dots, and the like.
Further, the shape of the pattern block may not be a square, but may be a rectangle as in the case of arranging 3 dots × 4 dots, for example. In this specification, a rectangle means a rectangle in which the lengths of two adjacent sides are not equal, that is, a rectangle other than a square.
Further, the number of dots to be arranged in an arbitrarily determined number of dot arrangement areas may be appropriately determined in consideration of the amount of information to be expressed and the allowable image density.

このように、本実施の形態では、m箇所からn箇所を選択することでmCn種類の符号パターンを用意している。そして、これらの符号パターンのうち、特定のパターンを情報パターンとして利用し、残りを同期パターンとして利用する。ここで、情報パターンとは、媒体に埋め込む情報を表現するパターンである。また、同期パターンとは、媒体に埋め込まれた情報パターンを取り出すために用いられるパターンである。例えば、情報パターンの位置を特定したり、画像の回転を検出したりするために用いられる。尚、媒体としては、画像を印刷することが可能であれば、如何なるものを用いてもよい。紙が代表例なので、以下では媒体を紙として説明するが、金属、プラスチック、繊維等であってもよい。   Thus, in this embodiment, mCn types of code patterns are prepared by selecting n locations from m locations. Among these code patterns, a specific pattern is used as an information pattern, and the rest is used 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 a representative example, the medium will be described as paper below, but metal, plastic, fiber, or the like may be used.

ここで、図2又は図3に示した符号パターンのうちの同期パターンについて説明する。尚、これらの符号パターンを利用する場合、パターンブロックの形状は正方形となるため、画像の回転を90度単位で認識する必要がある。従って、4種類の符号パターンで1組の同期パターンが構成される。
図4(a)は、9C2方式における同期パターンの例である。ここでは、36種類の符号パターンのうち、32種類の符号パターンを5ビットの情報を表現する情報パターンとし、残りの4種類の符号パターンで1組の同期パターンを構成するものとする。例えば、パターン値「32」の符号パターンを正立した同期パターン、パターン値「33」の符号パターンを右に90度回転した同期パターン、パターン値「34」の符号パターンを右に180度回転した同期パターン、パターン値「35」の符号パターンを右に270度回転した同期パターンとしている。但し、36種類の符号パターンの情報パターンと同期パターンへの振り分け方は、これには限らない。例えば、16種類の符号パターンを4ビットの情報を表現する情報パターンとし、残りの20種類の符号パターンで5組の同期パターンを構成してもよい。
Here, a synchronization pattern among the code patterns shown in FIG. 2 or FIG. 3 will be described. When these code patterns are used, since the shape of the pattern block is a square, it is necessary to recognize the rotation of the image in units of 90 degrees. Therefore, a set of synchronization patterns is constituted by four types of code patterns.
FIG. 4A shows an example of a synchronization pattern in the 9C2 system. Here, of the 36 types of code patterns, 32 types of code patterns are information patterns representing 5-bit information, and the remaining 4 types of code patterns constitute a set of synchronization patterns. For example, the synchronization pattern in which the code pattern of the pattern value “32” is upright, the synchronization pattern in which the code pattern of the pattern value “33” is rotated 90 degrees to the right, and the code pattern of the pattern value “34” is rotated 180 degrees to the right The synchronization pattern is a synchronization pattern obtained by rotating the code pattern of the pattern value “35” to the right by 270 degrees. However, the method of distributing the 36 types of code patterns to the information pattern and the synchronization pattern is not limited to this. For example, 16 types of code patterns may be used as information patterns expressing 4-bit information, and the remaining 20 types of code patterns may constitute five sets of synchronization patterns.

また、図4(b)は、9C3方式における同期パターンの例である。ここでは、84種類の符号パターンのうち、64種類の符号パターンを6ビットの情報を表現する情報パターンとし、残りの20種類の符号パターンで5組の同期パターンを構成するものとする。図は、この5組の同期パターンのうちの2組を示す。例えば、第1組においては、パターン値「64」の符号パターンを正立した同期パターン、パターン値「65」の符号パターンを右に90度回転した同期パターン、パターン値「66」の符号パターンを右に180度回転した同期パターン、パターン値「67」の符号パターンを右に270度回転した同期パターンとしている。また、第2組においては、パターン値「68」の符号パターンを正立した同期パターン、パターン値「69」の符号パターンを右に90度回転した同期パターン、パターン値「70」の符号パターンを右に180度回転した同期パターン、パターン値「71」の符号パターンを右に270度回転した同期パターンとしている。   FIG. 4B is an example of a synchronization pattern in the 9C3 system. Here, out of 84 kinds of code patterns, 64 kinds of code patterns are information patterns expressing 6-bit information, and the remaining 20 kinds of code patterns constitute five sets of synchronization patterns. The figure shows two of the five synchronization patterns. For example, in the first set, a synchronization pattern in which the code pattern of pattern value “64” is erected, a synchronization pattern in which the code pattern of pattern value “65” is rotated 90 degrees to the right, and a code pattern of pattern value “66” The synchronization pattern rotated 180 degrees to the right and the code pattern of pattern value “67” are the synchronization pattern rotated 270 degrees to the right. In the second set, a synchronization pattern in which the code pattern of pattern value “68” is erected, a synchronization pattern in which the code pattern of pattern value “69” is rotated 90 degrees to the right, and a code pattern of pattern value “70” The synchronization pattern rotated 180 degrees to the right and the code pattern of pattern value “71” are the synchronization pattern rotated 270 degrees to the right.

尚、図示しないが、パターンブロックの形状が長方形である場合は、画像の回転の検出のために2種類の符号パターンを同期パターンとして用意すればよい。例えば、縦3ドット×横4ドットを配置可能な領域が検出されるべきなのに、縦4ドット×横3ドットを配置可能な領域が検出された場合は、その時点で画像が90度又は270度回転していることが分かるからである。   Although not shown, when the shape of the pattern block is a rectangle, two types of 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 the 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.

次に、同期パターンと情報パターンを配置してなる情報表現の最小単位(以下、「符号ブロック」という)について説明する。
図5は、符号ブロックのレイアウトの一例を示したものである。
図中、(a)及び(b)のそれぞれの右側に、符号ブロックのレイアウトを示している。ここでは、レイアウトとして、パターンブロックを5個×5個の25個並べたものを採用している。この25個のパターンブロックのうち、左上の1ブロックに同期パターンを配置している。また、同期パターンの右の4ブロックに紙面上の横方向の座標を特定するX座標情報を表す情報パターンを配置し、同期パターンの下の4ブロックに紙面上の縦方向の座標を特定するY座標情報を表す情報パターンを配置している。更に、これらの座標情報を表す情報パターンで囲まれた16ブロックに、紙面又は紙面に印刷される文書の識別情報を表す情報パターンを配置している。
Next, a minimum unit of information expression (hereinafter referred to as “code block”) in which a synchronization pattern and an information pattern are arranged will be described.
FIG. 5 shows an example of the layout of the code block.
In the drawing, the layout of the code block is shown on the right side of each of (a) and (b). Here, a layout in which 25 pattern blocks of 5 × 5 are arranged is employed. 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 for specifying the horizontal coordinate on the paper surface is arranged in the right four blocks of the synchronous pattern, and the vertical coordinate on the paper surface is specified in the four blocks below the synchronous pattern. An information pattern representing coordinate information is arranged. Further, 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.

また、(a)の左側には、9C2方式における符号パターンが各パターンブロックに配置されていることを示している。即ち、36種類の符号パターンを、例えば、4種類の同期パターンと32種類の情報パターンとに分け、各パターンをレイアウトに従って配置している。一方、(b)の左側には、9C3方式における符号パターンが各パターンブロックに配置されていることを示している。即ち、84種類の符号パターンを、例えば、20種類の同期パターンと64種類の情報パターンとに分け、各パターンをレイアウトに従って配置している。   Further, on the left side of (a), it is shown that a code pattern in the 9C2 system is arranged in each pattern block. That is, 36 types of code patterns are divided into, for example, 4 types of synchronization patterns and 32 types of information patterns, and each pattern is arranged according to a layout. On the other hand, the left side of (b) shows that a code pattern in the 9C3 system is arranged in each pattern block. That is, 84 types of code patterns are divided into, for example, 20 types of synchronization patterns and 64 types of information patterns, and each pattern is arranged according to a layout.

尚、本実施の形態において、座標情報は、紙面の縦方向及び横方向にM系列で表現される。ここで、M系列とは、その部分列が、他の部分列と一致することがない系列である。例えば、11次のM系列は、2047ビットのビット列である。そして、この2047ビットのビット列の中から取り出された11ビット以上の部分列と同じ並びは、この2047ビットのビット列の中に自身以外には存在しない。本実施の形態では、1個の符号パターンを4ビットに対応付ける。即ち、2047ビットのビット列を4ビットごとに10進数で表し、図2又は図3の割り当てに従って符号パターンを決定し、紙面の横と縦に渡って印刷する。従って、復号の際は、3つの連続する符号パターンを特定し、符号パターンと座標との対応関係を格納したテーブルを参照することにより、ビット列上の位置が特定されることになる。   In the present embodiment, the coordinate information is expressed in M series in the vertical direction and the horizontal direction on the paper surface. Here, the M series is a series in which the partial sequence does not coincide with 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, one code pattern is associated with 4 bits. That is, a bit string of 2047 bits is represented by a decimal number for every 4 bits, a code pattern is determined according to the assignment in FIG. 2 or FIG. Therefore, at the time of decoding, the position on the bit string is specified by specifying three consecutive code patterns and referring to the table storing the correspondence between the code patterns and the coordinates.

図6に、M系列を用いた座標情報の符号化の例を示す。
(a)は、11次のM系列の例として、「0111000101011010000110010…」というビット列を示している。本実施の形態では、これを4ビットずつに区切り、1つ目の部分列「0111」をパターン値「7」の符号パターンとして、2つ目の部分列「0001」をパターン値「1」の符号パターンとして、3つ目の部分列「0101」をパターン値「5」の符号パターンとして、4つ目の部分列「1010」をパターン値「10」の符号パターンとして、それぞれ紙面上に配置する。
FIG. 6 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 the code pattern of the pattern value “7”, and the second partial sequence “0001” is the pattern value “1”. As the code pattern, the third partial sequence “0101” is arranged on the paper surface as the code pattern of the pattern value “5”, and the fourth partial sequence “1010” is arranged as the code pattern of the pattern value “10”. .

また、このように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つの符号パターンで座標情報を表現している。   Further, when the code patterns are divided into 4 bits and assigned to the code patterns in this way, as shown in (b), all pattern strings are expressed in 4 cycles. That is, since the 11th order M-sequence is 2047 bits, if this sequence is cut out every 4 bits and expressed by a code pattern, 3 bits will be added at the end. The first 1 bit of the M series is added to these 3 bits to form 4 bits, which are represented by a code pattern. Further, a cut-out code pattern is represented 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 fifth cycle starts from the fifth 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 code patterns. Since the M sequence is 11th order, the three consecutive code patterns do not match any other continuous code pattern at any position. Therefore, decoding can be performed by reading three code patterns. However, in the present embodiment, coordinate information is expressed by four code patterns in consideration of the occurrence of errors.

また、識別情報の符号化には、幾つかの方法の利用が考えられるが、本実施の形態では、RS符号化が適している。RS符号は多値の符号法であり、各パターンブロックに配置された符号パターンのパターン値をRS符号の多値に対応させるとよいからである。
尚、本実施の形態における符号パターンの利用形態としては、例えば、文書画像に重ねてその識別情報を紙面に印刷し、ペン状のスキャナで紙面上の部分画像を読み込み、そこから文書画像の識別情報を取得する、といったものが想定される。この場合、紙面上の汚れやスキャナの性能によって誤りが発生するが、この誤りはRS符号により訂正される。
In addition, although some methods can be used for encoding the identification information, RS encoding is suitable in the present embodiment. This is because the RS code is a multi-value coding method, and the pattern value of the code pattern arranged in each pattern block may correspond to the multi-value of the RS code.
In this embodiment, the code pattern is used by, for example, printing the identification information on a paper image over a document image, reading a partial image on the paper surface with a pen-shaped scanner, and then identifying the document image from there. It is assumed that information is acquired. In this case, an error occurs due to dirt on the paper surface or the performance of the scanner, but this error is corrected by the RS code.

ここで、RS符号による訂正及びそのような訂正を行う場合に表現可能な情報量について具体的に説明する。
本実施の形態では、上述したように、1パターンブロック内のドット数が一定である符号パターンを採用している。これにより、仮に1ドットが消失した場合や、1ドットが付加された場合は、パターンブロック内のドット数が変わる。従って、これらは誤りだと分かる誤りとなる。一方で、ドットの消失と付加が同時に起こった場合は、他の符号パターンであると誤認識してしまうので、誤りだと分からない誤りとなる。
例えば、識別情報を表す情報パターンを配置する16ブロックのうち、10ブロックを識別情報そのものを表す情報パターンを配置するブロックとし、6ブロックを訂正のためのブロックとする。この場合、誤りだと分かるブロックは6ブロックまで、誤りだと分からないブロックも3ブロックまで、訂正される。これを例えば9C2方式における32種類の情報パターンで実現したとすると、1ブロックで5ビットの情報が表現されるので、識別情報そのものは10ブロックで50ビット分表現される。また例えば9C3方式における64種類の情報パターンで実現したとすると、1ブロックで6ビットの情報が表現されるので、識別情報そのものは10ブロックで60ビット分表現される。
Here, the correction by the RS code and the amount of information that can be expressed when performing such correction will be specifically described.
In the present embodiment, as described above, a code pattern in which the number of dots in one pattern block is constant is employed. Thereby, if one dot disappears or one dot is added, the number of dots in the pattern block changes. Therefore, these are errors that can be recognized as errors. On the other hand, if the disappearance and addition of dots occur at the same time, they are misrecognized as other code patterns.
For example, out of 16 blocks in which an information pattern representing identification information is arranged, 10 blocks are arranged as information blocks representing identification information itself, and 6 blocks are used as correction blocks. In this case, up to 6 blocks that are known to be errors and up to 3 blocks that are not known to be errors are corrected. If this is realized by 32 types of information patterns in the 9C2 system, for example, 5 bits of information is expressed by 1 block, and therefore the identification information itself is expressed by 50 blocks of 10 bits. Further, for example, if it is realized by 64 types of information patterns in the 9C3 system, 6 bits of information is expressed by one block, and therefore the identification information itself is expressed by 60 bits by 10 blocks.

次いで、上記符号ブロックを含む広範囲のレイアウトについて説明する。
図7は、そのようなレイアウトの一例を示した図である。このレイアウトでは、図5の符号ブロックが基本単位として紙面全体の縦方向及び横方向に周期的に配置されている。
ここで、同期パターンとしては、同じ符号パターンが各符号ブロックにおける左上のパターンブロックに配置されている。図では、同期パターンを「S」で表している。
また、X座標情報としては、符号パターンの同じ並びが、同期パターンが配置されたのと同じ行の各パターンブロックに配置されている。Y座標情報としては、符号パターンの同じ並びが、同期パターンが配置されたのと同じ列の各パターンブロックに配置されている。図では、X座標情報を表すパターンを「X01」、「X02」、…で表し、Y座標情報を表すパターンを「Y01」、「Y02」、…で表している。
更に、識別情報としては、符号パターンの同じ配列が、縦方向及び横方向に周期的に配置されている。図では、識別情報を表すパターンを「I01」、「I02」、…、「I16」で表している。
そして、このようなレイアウトを採用することにより、例えば、図中、丸印で示した範囲が読み取られた場合のように、図5の符号ブロックの全体を含む範囲が読み取られていない場合であっても、後述する処理により、識別情報及び座標情報が得られる。
Next, a wide layout including the code block will be described.
FIG. 7 is a diagram showing an example of such a layout. In this layout, the code blocks in FIG. 5 are periodically arranged as basic units in the vertical and horizontal directions of the entire sheet.
Here, as the synchronization pattern, the same code pattern is arranged in the upper left pattern block in each code block. In the figure, the synchronization pattern is represented by “S”.
As the X coordinate information, the same sequence of code patterns is arranged in each pattern block in the same row as the synchronization pattern is arranged. As the Y coordinate information, the same sequence of code patterns is arranged in each pattern block in the same column as the synchronization pattern is arranged. In the figure, patterns representing X coordinate information are represented by “X01”, “X02”,..., And patterns representing Y coordinate information are represented by “Y01”, “Y02”,.
Furthermore, as the identification information, the same arrangement of code patterns is periodically arranged in the vertical direction and the horizontal direction. In the drawing, patterns representing identification information are represented by “I01”, “I02”,..., “I16”.
By adopting such a layout, for example, when the range indicated by a circle in the figure is read, the range including the entire code block in FIG. 5 is not read. However, identification information and coordinate information can be obtained by the processing described later.

尚、このようなレイアウトで紙面に印刷される符号画像は、例えば電子写真方式を用いて、Kトナー(カーボンを含む赤外光吸収トナー)、又は、特殊トナーにより形成される。
ここで、特殊トナーとしては、可視光領域(400nm〜700nm)における最大吸収率が7%以下であり、近赤外領域(800nm〜1000nm)における吸収率が30%以上の不可視トナーが例示される。ここで、「可視」及び「不可視」は、目視により認識できるかどうかとは関係しない。印刷された媒体に形成された画像が可視光領域における特定の波長の吸収に起因する発色性の有無により認識できるかどうかで「可視」と「不可視」とを区別している。また、可視光領域における特定の波長の吸収に起因する発色性が若干あるが、人間の目で認識し難いものも「不可視」に含める。
The code image printed on the paper surface in such a layout is formed with K toner (infrared light absorbing toner containing carbon) or special toner using, for example, an electrophotographic method.
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 depending on whether or not an image formed on a printed medium 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.

このような符号画像を印刷した画像上の所定位置をペンデバイスで指示すると、ペンデバイスに設けられた撮像素子が、画像の一部を読み取る。そして、この画像からドットパターンが読み取られ、復号処理が行われる。ところが、この場合において、復号された座標情報は、撮像素子が読み取った画像の位置を表しており、厳密には、ペンデバイスで指示した位置を表していない。
以下、このズレの発生について具体的に説明する。
図8は、この説明のためのペンデバイスの概略図である。
図示するように、ペンデバイスの中心を通るペン中心線が紙面と交差する点(ペン先中心)と、撮像素子の中心を通る撮像素子中心線が紙面と交差する点(撮像領域中心)との間には、ペンデバイスに固有のズレIPがある。
When the pen device indicates a predetermined position on the image on which such a code image is printed, an image sensor provided in the pen device reads a part of the image. Then, a dot pattern is read from this image and a decoding process is performed. However, in this case, the decoded coordinate information represents the position of the image read by the image sensor, and does not strictly represent the position designated by the pen device.
The occurrence of this deviation will be specifically described below.
FIG. 8 is a schematic view of a pen device for this explanation.
As shown in the figure, a point where the pen center line passing through the center of the pen device intersects with the paper surface (pen tip center) and a point where the image sensor center line passing through the center of the image sensor intersects with the paper surface (imaging area center) There is a misalignment IP unique to the pen device between them.

また、復号された座標情報とペンデバイスで指示した位置とのズレには、この固定のズレだけでなく、画像処理の結果に応じて動的に決定されるズレも含まれるので、これも併せて説明する。
図9は、ペンデバイスの撮像素子が撮像した領域(以下、「撮像領域」という)上に、ペンデバイスが復号のために読み込む領域(以下、「読み込み領域」という)と、その領域の中心点(以下、「読み込み領域中心」という)と、ペンデバイスのペン先が指示する点(以下、「ペン先中心」という)とを示した図である。
Further, the deviation between the decoded coordinate information and the position designated by the pen device includes not only this fixed deviation but also a deviation that is dynamically determined according to the result of the image processing. I will explain.
FIG. 9 shows an area (hereinafter referred to as “reading area”) that the pen device reads for decoding on an area (hereinafter referred to as “imaging area”) captured by the image sensor of the pen device, and the center point of the area. FIG. 6 is a diagram showing a point (hereinafter referred to as “the center of a reading area”) and a point indicated by a pen point of a pen device (hereinafter referred to as “a center of a pen point”).

ペンデバイスは、撮像領域から、復号のために必要な17ドット×17ドットの領域を読み込む。これが読み込み領域であるが、復号するのに適切な読み込み領域は必ずしも撮像領域の中心付近に存在するとは限らない。照明等の影響により、適切な読み込み領域が中心部からずれた位置にある場合もある。また、読み込み領域は、必ずしも矩形になっているとは限らず、ペンデバイスの回転及び傾きによって平行四辺形(例えば、菱形)に変形していることが多い。そこで、図では、撮像領域の右下寄りの部分に、太い破線で平行四辺形の読み込み領域を示している。   The pen device reads an area of 17 dots × 17 dots necessary for decoding from the imaging area. This is a reading area, but a reading area appropriate for decoding does not necessarily exist near the center of the imaging area. There may be a case where an appropriate reading area is shifted from the center due to the influence of illumination or the like. Further, the reading area is not necessarily rectangular, and is often deformed into a parallelogram (for example, rhombus) due to the rotation and inclination of the pen device. Therefore, in the drawing, a parallelogram reading area is indicated by a thick broken line in a lower right portion of the imaging area.

また、図では、撮像領域上に2つの座標系を示している。
1つは、撮像画像上の座標系である。この座標系では、撮像領域の横枠に平行にX軸をとり、右方向をXの正方向とし、撮像領域の縦枠に平行にY軸をとり、下方向をYの正方向とする。尚、図では、撮像画像上のX軸を「XCCD」と表記し、撮像画像上のY軸を「YCCD」と表記している。
もう1つは、符号画像上の座標系である。これは、撮像画像上の各点に対応する紙面上の各点を表すための座標系である。この座標系では、ドットの列の1つの方向に平行にX軸をとり、右方向をXの正方向とし、ドットの列の別の1つの方向に平行にY軸をとり、下方向をYの正方向とする。尚、図では、符号画像上のX軸を「XCODE」と表記し、符号画像上のY軸を「YCODE」と表記している。
In the figure, two coordinate systems are shown on the imaging region.
One is a coordinate system on the captured image. In this coordinate system, the X axis is parallel to the horizontal frame of the imaging region, the right direction is the positive X direction, the Y axis is parallel to the vertical frame of the imaging region, and the downward direction is the positive Y direction. In the figure, the X axis on the captured image is represented as “X CCD ”, and the Y axis on the captured image is represented as “Y CCD ”.
The other is a coordinate system on the code image. This is a coordinate system for representing each point on the paper surface corresponding to each point on the captured image. In this coordinate system, the X axis is parallel to one direction of the dot row, the right direction is the positive direction of X, the Y axis is parallel to another direction of the dot row, and the downward direction is Y. The positive direction. In the figure, the X axis on the code image is represented as “X CODE ”, and the Y axis on the code image is represented as “Y CODE ”.

これらの座標系のうち、まず、撮像画像上の座標系において、ペン先中心の位置を算出するのに必要なパラメータを定義する。
即ち、読み込み領域中心をCとし、ペン先中心をPとし、PのCに対する相対座標を(P,P)とする。また、符号画像上のX軸の傾き角をθ、符号画像上のY軸の傾き角をθとする。ここで、これらの傾き角は、撮像領域の垂直線、つまり、撮像画像上のY軸の負方向を基準とし、θは時計回りを、θは反時計回りをそれぞれ正方向として表す。更に、符号画像上のX軸の方向のドットの間隔をdとし、符号画像上のY軸の方向のドットの間隔をdとする。
Among these coordinate systems, first, in the coordinate system on the captured image, parameters necessary for calculating the position of the nib center are defined.
That is, assume that the center of the reading area is C, the nib center is P, and the relative coordinates of P with respect to C are (P X , P Y ). In addition, the inclination angle of the X axis on the code image is θ X , and the inclination angle of the Y axis on the code image is θ Y. Here, these inclination angles are based on the vertical line of the imaging region, that is, the negative direction of the Y axis on the captured image, θ X represents clockwise rotation, and θ Y represents counterclockwise rotation as the positive direction. Furthermore, the distance in the direction of the dot of the X-axis on the code image and d X, the distance between the direction of the dots of the Y-axis on the code image and d Y.

次に、これらのパラメータを用いて、符号画像上のペン先中心の位置を算出する方法について説明する。
まず、図9において、Pから符号画像上のX軸に下ろした垂線の足の符号画像上での座標を(H,0)、符号画像上のY軸に下ろした垂線の足の符号画像上での座標を(0,H)とする。すると、P、P、H、H、θ、θの間には、次のような関係が成り立つ。
Next, a method for calculating the position of the nib center on the code image using these parameters will be described.
First, in FIG. 9, the coordinates on the code image of the perpendicular foot drawn from P to the X axis on the code image are (H X , 0), and the code image of the vertical foot drawn on the Y axis on the code image Let the coordinates above be (0, H Y ). Then, the following relationship is established among P X , P Y , H X , H Y , θ X , and θ Y.

Figure 0004985436
Figure 0004985436

これにより、H、Hは、P、P、θ、θを用いて次のように表される。 Accordingly, H X and H Y are expressed as follows using P X , P Y , θ X , and θ Y.

Figure 0004985436
Figure 0004985436

即ち、ペン先中心PのX座標及びY座標が、符号画像上のX軸及びY軸上における数値で表されている。但し、ここで求められるH、Hは、あくまで撮像画像上の尺度に基づくものである。つまり、符号画像上でのドットの間隔は、図1に示したように、X軸方向、Y軸方向共に4ピクセルであるが、撮像画像上では同じ長さとは限らない。そこで、先に述べたように、撮像画像上のドットの間隔をd、dとし、尺度に関する補正を行う必要がある。 That is, the X coordinate and the Y coordinate of the nib center P are represented by numerical values on the X axis and the Y axis on the code image. However, H X and H Y obtained here are based solely on the scale on the captured image. That is, the dot interval on the code image is 4 pixels in both the X-axis direction and the Y-axis direction as shown in FIG. 1, but it is not necessarily the same length on the captured image. Therefore, as described above, it is necessary to perform scale-related correction by setting the dot intervals on the captured image to be d X and d Y.

図10は、撮像画像上の座標系から符号画像上の座標系への座標変換の様子を示したものである。読み込み領域は、座標変換前の撮像画像上では、図9に示したような平行四辺形になっているが、座標変換後の符号画像上では、矩形になっている。
ここで、撮像画像上の読み込み領域中心に対応する符号画像上の点をCとし、ペン先中心Pに対応する符号画像上の点をQとし、QのCに対する相対座標を(Q,Q)とする。すると、Q、Qは、上記で求めたH、Hにドットの間隔に関する補正を施すことにより、次のように求められる。
FIG. 10 shows a state of coordinate conversion from the coordinate system on the captured image to the coordinate system on the code image. The reading area is a parallelogram as shown in FIG. 9 on the captured image before coordinate conversion, but is rectangular on the code image after coordinate conversion.
Here, the point on the code image corresponding to the center of the read area on the captured image is C, the point on the code image corresponding to the pen tip center P is Q, and the relative coordinates of Q with respect to C are (Q X , Q Y ). Then, Q X and Q Y are obtained as follows by applying corrections related to the dot spacing to H X and H Y obtained above.

Figure 0004985436
Figure 0004985436

その後、読み込み領域内のパターン画像に基づいて読み込み領域中心の座標が算出され、この座標に上記のQ、Qを加えることにより、紙面上のペン先中心の座標が算出される。
以下、このような紙面上のペン先中心の座標の算出について、より詳細に説明する。尚、本実施の形態では、如何なるmCn方式を利用してもよいが、以降の説明においては、簡単のため、9C2方式の利用を前提とする。また、以下では、パターンブロックのことを単に「ブロック」ともいう。
Thereafter, the coordinates of the center of the reading area are calculated based on the pattern image in the reading area, and the coordinates of the nib center on the paper surface are calculated by adding the above-mentioned Q X and Q Y to the coordinates.
Hereinafter, the calculation of the coordinates of the nib center on the paper surface will be described in more detail. In the present embodiment, any mCn method may be used. However, in the following description, for the sake of simplicity, it is assumed that the 9C2 method is used. Hereinafter, the pattern block is also simply referred to as “block”.

まず、紙面に形成された符号画像を読み取って処理する画像処理装置20について説明する。
図11は、画像処理装置20の構成例を示したブロック図である。
図示するように、画像処理装置20は、画像読取部21と、ドット配列生成部22と、ブロック検出部23と、同期符号検出部24とを備える。また、識別符号検出部30と、識別符号復号部32と、X座標符号検出部40と、X座標符号復号部42と、Y座標符号検出部45と、Y座標符号復号部47と、座標補正部50と、情報出力部55とを備える。
First, the image processing apparatus 20 that reads and processes a code image formed on a paper surface will be described.
FIG. 11 is a block diagram illustrating a configuration example of the image processing apparatus 20.
As illustrated, the image processing apparatus 20 includes an image reading unit 21, a dot array generation unit 22, a block detection unit 23, and a synchronization code detection unit 24. Also, the identification code detector 30, the identification code decoder 32, the X coordinate code detector 40, the X coordinate code decoder 42, the Y coordinate code detector 45, the Y coordinate code decoder 47, and the coordinate correction Unit 50 and an information output unit 55.

画像読取部21は、CCD(Charge Coupled Devices)やCMOS(Complementary Metal Oxide Semiconductor)等の撮像素子を用いて、紙面に印刷された符号画像を読み取る。
ドット配列生成部22は、読み取った符号画像からドットを検出し、ドットの位置を参照して、ドット配列を生成する。尚、符号画像からのドット検出の前処理として、読み取った画像に含まれるノイズを除去するための処理も行う。ここで、ノイズには、例えば、撮像素子感度のばらつきや電子回路により発生するノイズがある。ノイズ除去の処理の種類は、撮像系の特性に合わせるべきだが、ぼかし処理やアンシャープマスキング等の先鋭化処理を適用するとよい。また、ドットの検出は、次のように行う。即ち、まず、2値化処理によりドット画像の部分と、その他の背景画像の部分とを切り分け、2値化された個々の画像位置からドットの位置を検出する。その際、2値化された画像にノイズ成分が多数含まれる場合があるため、2値化された画像の面積や形状によりドットの判定を行うフィルタ処理を組み合わせる必要がある。その後、ドット配列の生成は、2次元の配列上で、例えば、ドットがある位置を「1」、ドットがない位置を「0」というように、画像として検出したドットをデジタルデータに置き換えることにより行う。本実施の形態では、撮像画像を取得する画像取得手段の一例として、また、部分画像を抽出する抽出手段の一例として、ドット配列生成部22を設けている。更に、撮像画像を含む平面上での媒体上の指示された位置の相対位置を示す第1の位置情報の一例として、ペン先中心の読み込み領域中心に対する相対座標(P,P)を用い、第1の位置情報を取得する第1の情報取得手段の一例として、ドット配列生成部22を設けている。
The image reading unit 21 reads a code image printed on a paper surface using an imaging element such as a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS).
The dot array generation unit 22 detects dots from the read code image, and generates a dot array with reference to the dot positions. Note that, as preprocessing for dot detection from the code image, processing for removing noise included in the read image is also performed. Here, the noise includes, for example, variations in image sensor sensitivity and noise generated by an electronic circuit. The type of noise removal processing should match the characteristics of the imaging system, but sharpening processing such as blurring processing and unsharp masking may be applied. In addition, dot detection is performed as follows. That is, first, a dot image portion and other background image portions are separated by binarization processing, and a dot position is detected from each binarized image position. At that time, since there are cases where a lot of noise components are included in the binarized image, it is necessary to combine filter processing for determining dots based on the area and shape of the binarized image. Thereafter, the dot array is generated by replacing the dot detected as an image with digital data on the two-dimensional array, for example, “1” for the position where the dot is and “0” for the position where there is no dot. Do. In the present embodiment, the dot array generation unit 22 is provided as an example of an image acquisition unit that acquires a captured image and as an example of an extraction unit that extracts a partial image. Furthermore, as an example of the first position information indicating the relative position of the designated position on the medium on the plane including the captured image, relative coordinates (P X , P Y ) with respect to the reading area center of the nib center are used. The dot array generation unit 22 is provided as an example of a first information acquisition unit that acquires the first position information.

ブロック検出部23は、ドット配列上で、符号ブロック内のパターンブロックを検出する。即ち、符号ブロックと同じ大きさ及び形状のフレームで、パターンブロックと同じ大きさ及び形状のブロックを有するブロックフレームをドット配列上で適宜動かし、ブロック内のドット数が均等になる位置を正しいフレーム位置とし、各ブロック内のパターン値を格納した符号配列を生成する。   The block detection unit 23 detects a pattern block in the code block on the dot array. In other words, a frame with the same size and shape as the code block and a block frame having the same size and shape as the pattern block are moved as needed on the dot array, and the position where the number of dots in the block is equal is the correct frame position. A code array storing pattern values in each block is generated.

同期符号検出部24は、ドット配列から検出された各符号パターンの種類を参照して、同期符号を検出する。また、同期符号検出部24は、検出した同期符号に基づいて、画像の回転の判定も行う。例えば、正方形の符号パターンを用いた場合、90度単位で回転している可能性がある。そこで、検出した同期符号が4種類の同期パターンのいずれに対応しているかによって、その向きを検出する。また、長方形の符号パターンを用いた場合、180度単位で回転している可能性がある。そこで、検出された同期符号が2種類の同期パターンのいずれに対応しているかによって、その向きを検出する。更に、同期符号検出部24は、このように検出された回転角度だけ符号配列を回転させて、符号配列を正しい向きに設定する。   The synchronization code detection unit 24 detects the synchronization code with reference to the type of each code pattern detected from the dot array. The synchronization code detector 24 also determines image rotation based on the detected synchronization code. For example, when a square code pattern is used, it may be rotated by 90 degrees. Therefore, the direction is detected depending on which of the four types of synchronization patterns the detected synchronization code corresponds to. In addition, when a rectangular code pattern is used, there is a possibility that the pattern is rotated by 180 degrees. Therefore, the direction is detected depending on which of the two types of synchronization patterns the detected synchronization code corresponds to. Furthermore, the synchronous code detection unit 24 rotates the code array by the rotation angle detected in this way, and sets the code array in the correct direction.

識別符号検出部30は、角度が補正された符号配列から、同期符号の位置を基準にして、識別符号を検出する。
識別符号復号部32は、上述したRS符号の符号化処理で用いたパラメータ(ブロック数等)と同じパラメータを用いて識別符号を復号し、識別情報を出力する。
The identification code detection unit 30 detects the identification code from the code array whose angle is corrected with reference to the position of the synchronization code.
The identification code decoding unit 32 decodes the identification code using the same parameters (such as the number of blocks) used in the RS code encoding process described above, and outputs identification information.

X座標符号検出部40は、角度が補正された符号配列から、同期符号の位置を基準にしてX座標符号を検出する。
X座標符号復号部42は、検出されたX座標符号からM系列の部分系列を取り出し、画像生成に使用したM系列におけるこの部分系列の位置を参照し、この位置を符号ブロックのシフト量で補正した値をX座標情報として出力する。本実施の形態では、媒体上の印刷画像の位置を示す第2の位置情報の一例として、X座標情報を用い、第2の位置情報を取得する第2の情報取得手段の一例として、X座標符号復号部42を設けている。
The X coordinate code detection unit 40 detects the X coordinate code from the code array whose angle is corrected with reference to the position of the synchronization code.
The X coordinate code decoding unit 42 extracts the M series partial sequence from the detected X coordinate code, refers to the position of this partial sequence in the M sequence used for image generation, and corrects this position with the shift amount of the code block The obtained value is output as X coordinate information. In the present embodiment, X coordinate information is used as an example of second position information indicating the position of a print image on a medium, and X coordinate is used as an example of second information acquisition means for acquiring the second position information. An encoding / decoding unit 42 is provided.

Y座標符号検出部45は、角度が補正された符号配列から、同期符号の位置を基準にしてY座標符号を検出する。
Y座標符号復号部47は、検出されたY座標符号からM系列の部分系列を取り出し、画像生成に使用したM系列におけるこの部分系列の位置を参照し、この位置を符号ブロックのシフト量で補正した値をY座標情報として出力する。本実施の形態では、媒体上の印刷画像の位置を示す第2の位置情報の一例として、Y座標情報を用い、第2の位置情報を取得する第2の情報取得手段の一例として、Y座標符号復号部47を設けている。
The Y coordinate code detection unit 45 detects the Y coordinate code from the code array whose angle is corrected with reference to the position of the synchronization code.
The Y coordinate code decoding unit 47 extracts the M series partial sequence from the detected Y coordinate code, refers to the position of this partial sequence in the M sequence used for image generation, and corrects this position with the shift amount of the code block. The obtained value is output as Y coordinate information. In the present embodiment, Y coordinate information is used as an example of the second position information indicating the position of the print image on the medium, and the Y coordinate is used as an example of a second information acquisition unit that acquires the second position information. An encoding / decoding unit 47 is provided.

座標補正部50は、X座標符号復号部42から出力されたX座標情報とY座標符号復号部47から出力されたY座標情報とからなる座標情報を補正して、紙面上のペン先中心の座標情報を取得する。ここで、補正は、ドット配列生成部22で取得したペン先中心の読み込み領域中心に対する相対座標や、撮像画像上での読み込み領域の傾き角や、撮像画像上でのドットの間隔を用いて行う。本実施の形態では、媒体上での指示された位置の相対位置を示す第3の位置情報の一例として、ペン先中心の読み込み領域中心に対する相対座標(Q,Q)を用い、第1の位置情報を第3の位置情報に変換する変換手段の一例として、座標補正部50を設けている。また、媒体上の指示された位置を特定する特定手段の一例として、座標補正部50を設けている。
情報出力部55は、識別符号復号部32、座標補正部50からそれぞれ取得した識別情報、ペン先中心のX座標情報及びY座標情報を出力する。
The coordinate correction unit 50 corrects the coordinate information made up of the X coordinate information output from the X coordinate code decoding unit 42 and the Y coordinate information output from the Y coordinate code decoding unit 47 to obtain the center of the pen tip on the paper surface. Get coordinate information. Here, the correction is performed by using the relative coordinates of the pen tip center acquired by the dot array generation unit 22 with respect to the reading area center, the inclination angle of the reading area on the captured image, and the dot interval on the captured image. . In the present embodiment, as an example of the third position information indicating the relative position of the instructed position on the medium, the relative coordinates (Q X , Q Y ) with respect to the reading area center of the nib center are used, As an example of conversion means for converting the position information into the third position information, a coordinate correction unit 50 is provided. In addition, a coordinate correction unit 50 is provided as an example of a specifying unit that specifies the instructed position on the medium.
The information output unit 55 outputs the identification information obtained from the identification code decoding unit 32 and the coordinate correction unit 50, and the X coordinate information and Y coordinate information of the nib center.

次いで、この画像処理装置20の動作を説明する。尚、この動作の説明では、9C2方式の符号パターンが図5のレイアウトで配置されていることを前提とする。
まず、画像読取部21が、紙面に印刷された符号画像を撮像素子で読み取る。
Next, the operation of the image processing apparatus 20 will be described. In the description of this operation, it is assumed that 9C2 code patterns are arranged in the layout of FIG.
First, the image reading unit 21 reads a code image printed on a paper surface with an imaging element.

次に、ドット配列生成部22が、読み取った符号画像からドットの検出に適した領域を切り出す。この領域の切り出しは、公知の画像処理によって行えばよいが、例えば、次のような方法が考えられる。即ち、まず、撮像領域を複数の小領域に分割する。この場合、各小領域は1つのドットより大きなものとなるようにする。次に、小領域ごとに、その中のドットの部分とドット以外の部分とのコントラストを評価する。そして、最も高コントラストであった小領域を中心として、次に高コントラストであった周囲の小領域を連結していく。これを繰り返し、17ドット×17ドット分の大きさをカバーできる程度の大きさになるまで領域を広げていき、最終的に得られた領域を撮像領域から切り出す。
このようにしてドットの検出に適した領域を切り出すと、ドット配列生成部22は、その領域の中からドットを検出する。
Next, the dot array generation unit 22 cuts out a region suitable for dot detection from the read code image. This region may be cut out by known image processing. For example, the following method can be considered. That is, first, the imaging area is divided into a plurality of small areas. In this case, each small area is larger than one dot. Next, for each small region, the contrast between the dot portion and the portion other than the dot is evaluated. Then, the surrounding small areas having the next highest contrast are connected with the small area having the highest contrast as the center. This process is repeated, and the area is expanded until it is large enough to cover the size of 17 dots × 17 dots, and the finally obtained area is cut out from the imaging area.
When an area suitable for dot detection is cut out in this way, the dot array generation unit 22 detects a dot from the area.

また、ドット配列生成部22は、ドットの列の傾き角も求める。
図12(a)に、ドットの列の傾き角を求める方法の一例を示す。
まず、左側の図に示すように、近接するドット対を結ぶ直線の傾き角を幾つか求める。そして、それらの傾き角の中から第1軸角度、第2軸角度、第3軸角度を選択し、右側の図に示すように設定する。ここで、第1軸角度は、最も頻度が多い傾き角である。第2軸角度は、第1軸角度から90度オフセットした角度近傍で最も頻度が高い傾き角である。第3軸角度は、第1軸角度から90度オフセットした角度に対する第2軸角度の対称角度近傍で最も頻度が高い傾き角である。そして、例えば、第1軸角度と、第2軸角度及び第3軸角度のうち第1軸角度から90度オフセットした角度に最も近い角度とを、ドットの列の2つの傾き角とする。
The dot array generation unit 22 also obtains the inclination angle of the dot row.
FIG. 12A shows an example of a method for obtaining the inclination angle of the dot row.
First, as shown in the figure on the left side, several inclination angles of straight lines connecting adjacent pairs of dots are obtained. Then, the first axis angle, the second axis angle, and the third axis angle are selected from these inclination angles, and are set as shown in the right figure. Here, the first axis angle is an inclination angle with the highest frequency. The second axis angle is an inclination angle having the highest frequency in the vicinity of an angle offset by 90 degrees from the first axis angle. The third axis angle is the inclination angle that is most frequently in the vicinity of the symmetrical angle of the second axis angle with respect to the angle offset by 90 degrees from the first axis angle. For example, the first axis angle and the angle closest to the angle of the second axis angle and the third axis angle offset by 90 degrees from the first axis angle are set as the two inclination angles of the dot row.

また、図12(b)に、ドットの列の傾き角を更に正確に求める方法の一例を示す。
まず、左上の図に示すように、ドットの座標を同期原点からの相対座標に変換する。図において、縦軸と横軸の交点が同期原点であり、例えば、検出された複数のドットの重心に最も近いドットを同期原点に設定するとよい。次に、右上の図に示すように、ドットの座標をθ回転する。更に、右下の図に示すように、回転後のドットの座標に格子を当てはめ、例えば、縦の格子からのドットの座標のずれ量を算出する。そして、左下の図に示すように、同じ列のドットごとに分散を計算して積算し、分散が最小となるθを傾き角とする。尚、傾き角は、X方向とY方向について独立に推定するのが好ましい。
FIG. 12B shows an example of a method for more accurately obtaining the inclination angle of the dot row.
First, as shown in the upper left figure, the dot coordinates are converted into relative coordinates from the synchronization origin. In the figure, the intersection of the vertical axis and the horizontal axis is the synchronization origin. For example, a dot closest to the center of gravity of a plurality of detected dots may be set as the synchronization origin. Next, as shown in the upper right figure, the dot coordinates are rotated by θ. Furthermore, as shown in the lower right diagram, a grid is applied to the coordinates of the rotated dots, and for example, the amount of deviation of the coordinates of the dots from the vertical grid is calculated. Then, as shown in the lower left figure, the variance is calculated and integrated for each dot in the same row, and θ that minimizes the variance is set as the inclination angle. Note that the inclination angle is preferably estimated independently for the X direction and the Y direction.

その後、ドット配列生成部22は、ドットを検出した位置に「1」を、ドットを検出しなかった位置に「0」を設定したドット配列を生成する。
図13は、ドット配列生成部22によるドット画像からドット配列への変換を示した図である。図示するように、ドット配列生成部22は、読み込み領域内の17×17のドットを、17×17のドットの配列へと変換する。この配列の各要素には、対応する位置にドットがあれば「1」が、対応する位置にドットがなければ「0」が格納される。尚、この際、復号処理のために切り出した17ドット×17ドットの読み込み領域の中心の撮像領域中心からのズレが分かる。そこで、このズレの情報と、予め分かっているペン先中心と撮像領域中心のズレの情報とから、ペン先中心の読み込み領域中心に対する相対座標(P,P)を求め、図示しないメモリに記憶しておく。
Thereafter, the dot array generation unit 22 generates a dot array in which “1” is set at the position where the dot is detected and “0” is set at the position where the dot is not detected.
FIG. 13 is a diagram illustrating conversion from a dot image to a dot array by the dot array generation unit 22. As shown in the figure, the dot array generation unit 22 converts 17 × 17 dots in the reading area into a 17 × 17 dot array. Each element of this array stores “1” if there is a dot at the corresponding position, and “0” if there is no dot at the corresponding position. At this time, the deviation from the center of the imaging area at the center of the 17 dot × 17 dot reading area cut out for the decoding process is known. Therefore, relative coordinates (P X , P Y ) with respect to the reading area center of the nib center are obtained from the misalignment information and information about the misalignment between the nib center and the imaging area center which are known in advance, and are stored in a memory (not shown). Remember.

次いで、ブロック検出部23が、読み込み領域に対応するドット配列上で、パターンブロックを検出する。
図14は、ブロックフレームを移動させてパターンブロックを検出する際の処理を具体的に示した図である。ここでは、9C2方式で符号化が行われたことが分かっており、9C2方式で復号する場合について示している。
まず、ブロック検出部23は、ドット配列生成部22からドット配列を取得する。ここで取得するドット配列のサイズは予め設定されており、(復号に必要なパターンブロック数×パターンブロックの一辺のドット数+パターンブロックの一辺のドット数−1)である。ところが、このドット配列は、画像の任意に選択された領域に対応しているので、パターンブロックの区切り位置は分からない。そこで、まず、ドット配列の端を検出開始位置としてブロックフレームを重ねる。この例では、m=9なので、3ドット×3ドットの大きさのフレームを含むブロックフレームを重ねる。次に、各フレーム内のドットを数える。この例では、n=2なので、各フレーム内に2ドットずつ存在する場合のブロックフレームの位置が、パターンブロックの区切り位置を示す。しかしながら、この位置ではドット数がばらついているので、パターンブロックの区切り位置ではないことが分かる。そこで、ブロックフレームをずらしてフレーム内のドット数を数える。即ち、開始位置、右方向へ1ドット分移動した位置、右方向へ2ドット分移動した位置においてドットを数える。また、これらの位置のそれぞれに対し、下方向へ1ドット分移動した位置、下方向へ2ドット分移動した位置においてもドットを数える。その結果、右方向へ1ドット分移動し、下方向へ2ドット分移動した位置において、全てのフレーム内のドット数が「2」となる。従って、このときのブロックフレームの位置がパターンブロックの区切り位置であることが分かる。
Next, the block detection unit 23 detects a pattern block on the dot array corresponding to the reading area.
FIG. 14 is a diagram specifically showing processing when a block block is moved to detect a pattern block. Here, it is known that encoding has been performed by the 9C2 system, and a case of decoding by the 9C2 system is shown.
First, the block detection unit 23 acquires a dot array from the dot array generation unit 22. The size of the dot array acquired here is preset, and is (number of pattern blocks necessary for decoding × number of dots on one side of pattern block + number of dots on one side of pattern block−1) 2 . However, since this dot arrangement corresponds to an arbitrarily selected area of the image, the position where the pattern block is separated is unknown. Therefore, first, the block frames are overlapped with the end of the dot array as the detection start position. In this example, since m = 9, block frames including a frame of 3 dots × 3 dots are overlapped. Next, the dots in each frame are counted. In this example, since n = 2, the position of the block frame when there are 2 dots in each frame indicates the pattern block delimiter position. However, since the number of dots varies at this position, it can be seen that it is not a pattern block break position. Therefore, the number of dots in the frame is counted by shifting the block frame. That is, the dots are counted at the start position, the position moved by one dot in the right direction, and the position moved by two dots in the right direction. In addition, with respect to each of these positions, dots are also counted at a position moved by one dot downward and a position moved by two dots downward. As a result, the number of dots in all the frames is “2” at the position moved by one dot to the right and moved by two dots downward. Therefore, it can be seen that the position of the block frame at this time is the pattern block delimiter position.

図15に、ブロック検出部23により決定されたパターンブロックの区切り位置を示す。
ここでは、太線で示した位置にブロックフレームを重ねた場合に、全てのブロックに2つの「1」が含まれるので、この位置がパターンブロックの区切り位置となっている。また、ブロックの検出はどの位置から開始してもよいが、ここでも、ドット配列の左上を起点としており、この起点からパターンブロックの区切り位置を見つけるまでのブロックフレームの移動量を、X方向にMXドット、Y方向にMYドットとしている。図では、MX=0、MY=1である。以下、ブロックの区切り位置が見つかったときにブロックフレームが重なっている5ブロック×5ブロックの領域(図の太線の枠内の部分)を「復号領域」と称する。
FIG. 15 shows the pattern block delimiter positions determined by the block detector 23.
Here, when a block frame is overlapped at a position indicated by a bold line, two “1” s are included in all the blocks, and this position is a pattern block separation position. The block detection may be started from any position, but here again, the upper left of the dot array is the starting point, and the amount of movement of the block frame from the starting point until the pattern block delimiter is found is determined in the X direction. MX dots and MY dots in the Y direction. In the figure, MX = 0 and MY = 1. Hereinafter, a 5 block × 5 block area (a part within a bold line frame in the figure) in which block frames overlap when a block delimiter position is found is referred to as a “decoding area”.

また、ブロック検出部23は、各パターンブロックにおけるドット位置(「0」及び「1」の配置)からパターン値を求める。このとき、図2又は図3に示したドット位置とパターン値との対応を参照する。
図16は、各パターンブロックにパターン値を割り当てた場合の例を示した図である。
例えば、左上のブロックでは、ブロック内の左上と右下にドットがあることが示されているので、図2の対応からパターン値「0」となる。また、その右のブロックでは、ブロック内の左上と右中央にドットがあることが示されているので、図2の対応からパターン値「12」となる。
Further, the block detection unit 23 obtains a pattern value from the dot position (arrangement of “0” and “1”) in each pattern block. At this time, the correspondence between the dot position and the pattern value shown in FIG. 2 or 3 is referred to.
FIG. 16 is a diagram illustrating an example when pattern values are assigned to each pattern block.
For example, since the upper left block indicates that there are dots at the upper left and lower right in the block, the pattern value is “0” from the correspondence in FIG. In the right block, since it is shown that there are dots at the upper left and right center in the block, the pattern value is “12” from the correspondence in FIG.

ここで、ブロック検出部23の詳細な動作について説明する。
図17は、ブロック検出部23の動作例を示したフローチャートである。
まず、ブロック検出部23は、ドット配列生成部22からドット配列を取得する(ステップ201)。このドット配列の大きさは、(復号に必要なブロック数×ブロックの一辺のドット数+ブロックの一辺のドット数−1)である。本実施の形態では、復号に必要なブロック数は5×5であり、ブロックの一辺のドット数が3であるので、17×17のドット配列を取得する。
Here, the detailed operation of the block detection unit 23 will be described.
FIG. 17 is a flowchart illustrating an operation example of the block detection unit 23.
First, the block detector 23 acquires a dot array from the dot array generator 22 (step 201). The size of this dot array is (number of blocks necessary for decoding × number of dots on one side of block + number of dots on one side of block−1) 2 . In this embodiment, the number of blocks necessary for decoding is 5 × 5, and the number of dots on one side of the block is 3, so a 17 × 17 dot array is acquired.

次に、取得したドット配列に、ブロックフレームを重ね合わせる(ステップ202)。そして、カウンタI、Jに「0」を代入し、MaxBNにも「0」を代入する(ステップ203)。ここで、I、Jは、ブロックフレームを初期位置から移動させたステップ数をカウントするものである。画像の1ラインごとにブロックフレームを移動させ、そのとき移動させたライン数をカウンタI、Jでカウントする。また、MaxBNは、ブロック内で検出されるドット数が「2」となるブロック数をブロックフレームを移動させながらカウントしていったときに、最大となるカウント値を記録するものである。   Next, a block frame is superimposed on the acquired dot array (step 202). Then, “0” is substituted into the counters I and J, and “0” is substituted into MaxBN (step 203). Here, I and J count the number of steps in which the block frame is moved from the initial position. The block frame is moved for each line of the image, and the number of lines moved at that time is counted by counters I and J. MaxBN records the maximum count value when counting the number of blocks in which the number of dots detected in the block is “2” while moving the block frame.

次に、ブロック検出部23は、ブロックフレームをX方向にI、Y方向にJ移動させる(ステップ204)。初期状態においてI、Jは「0」であるので、ブロックフレームは移動しない。そして、ブロックフレームの各ブロックに含まれるドット数をカウントして、ドット数が「2」となるブロックの数をカウントする。カウントしたブロック数はIB[I,J]に格納する(ステップ205)。IB[I,J]のI、Jには、ブロックフレームの移動量を示すIとJの値がそれぞれ記録される。   Next, the block detector 23 moves the block frame I in the X direction and J in the Y direction (step 204). Since I and J are “0” in the initial state, the block frame does not move. Then, the number of dots included in each block of the block frame is counted, and the number of blocks in which the number of dots is “2” is counted. The counted number of blocks is stored in IB [I, J] (step 205). In I and J of IB [I, J], values of I and J indicating the movement amount of the block frame are recorded, respectively.

次に、ブロック検出部23は、IB[I,J]とMaxBNとを比較する(ステップ206)。MaxBNは初期値が「0」であるので、最初の比較では、IB[I,J]がMaxBNよりも大きくなる。この場合、MaxBNにIB[I,J]の値を代入すると共に、MXにIの値を、MYにJの値を代入する(ステップ207)。尚、IB[I,J]がMaxBN以下である場合は、MaxBN、MX、MYの値はそのままにしておく。   Next, the block detection unit 23 compares IB [I, J] with MaxBN (step 206). Since MaxBN has an initial value “0”, in the first comparison, IB [I, J] is larger than MaxBN. In this case, the value of IB [I, J] is substituted for MaxBN, the value of I is substituted for MX, and the value of J is substituted for MY (step 207). When IB [I, J] is MaxBN or less, the values of MaxBN, MX, and MY are left as they are.

その後、ブロック検出部23は、I=2であるかどうかを判定する(ステップ208)。
ここで、I=2でない場合には、Iに「1」を加算する(ステップ209)。そして、ステップ204、205の処理を繰り返し行い、IB[I,J]とMaxBNとを比較していく(ステップ206)。
IB[I,J]が前回までのIB[I,J]の最大値であるMaxBNよりも大きいと、MaxBNにIB[I,J]の値を代入し、そのときのIの値をMXに、Jの値をMYに代入する(ステップ207)。また、MaxBNのほうがIB[I,J]よりも大きい場合には、I=2であるかどうかを判定する(ステップ208)。I=2となると、次にJ=2であるかどうかを判定する(ステップ210)。J=2でない場合には、Iに「0」を代入し、Jに「1」を加算する(ステップ211)。このような手順を繰り返し行い、(I,J)が(0,0)から(2,2)までで、IB[I,J]が最大のものを検出する。
Thereafter, the block detection unit 23 determines whether I = 2 (step 208).
If I = 2 is not satisfied, “1” is added to I (step 209). Then, the processing in steps 204 and 205 is repeated to compare IB [I, J] with MaxBN (step 206).
If IB [I, J] is greater than MaxBN, which is the maximum value of IB [I, J] up to the previous time, the value of IB [I, J] is assigned to MaxBN, and the value of I at that time is set to MX. , J is substituted for MY (step 207). If MaxBN is larger than IB [I, J], it is determined whether I = 2 (step 208). When I = 2, it is next determined whether J = 2 or not (step 210). If J = 2 is not satisfied, “0” is substituted for I, and “1” is added to J (step 211). Such a procedure is repeated to detect a case where (I, J) is (0, 0) to (2, 2) and IB [I, J] is maximum.

I=2、J=2までの処理が終了すると、ブロック検出部23は、保存しているMaxBNと閾値TBとを比較する(ステップ212)。閾値TBは、ドット数が「2」のブロックの数が復号可能な程度のものかを判定するための閾値である。
ここで、MaxBNが閾値TBよりも大きい場合には、ブロックフレームをMX、MYの位置に固定し、その位置で各ブロックのパターン値を検出する。そして、検出したパターン値を、各ブロックを識別する変数X、Yと共に符号配列PA[X,Y]としてメモリに記録する(ステップ213)。尚、このとき、対応するパターン値に変換することができなければ、パターン値として用いられていない「−1」を記録する。そして、ブロック検出部23は、MX、MYと、符号配列PA[X,Y]とを同期符号検出部24に出力する(ステップ214)。
一方、MaxBNが閾値TB以下である場合には、画像のノイズが大きく復号は不可能と判定し、復号不能を出力する(ステップ215)。
When the processing up to I = 2 and J = 2 is completed, the block detection unit 23 compares the stored MaxBN with the threshold value TB (step 212). The threshold value TB is a threshold value for determining whether the number of blocks having a dot number of “2” is such that decoding is possible.
Here, when MaxBN is larger than the threshold value TB, the block frame is fixed at the positions of MX and MY, and the pattern value of each block is detected at that position. Then, the detected pattern value is recorded in the memory as a code array PA [X, Y] together with variables X and Y for identifying each block (step 213). At this time, if the pattern value cannot be converted, “−1” which is not used as a pattern value is recorded. Then, the block detection unit 23 outputs MX and MY and the code array PA [X, Y] to the synchronous code detection unit 24 (step 214).
On the other hand, if MaxBN is equal to or less than the threshold value TB, it is determined that decoding is impossible due to large noise in the image, and decoding is impossible (step 215).

次に、同期符号検出部24は、ブロック検出部23が検出したパターン値の中から、同期パターンのパターン値を探す。例えば、本実施の形態では、パターン値32〜35の符号パターンを同期パターンとしているので、この番号を探す。図16の例では、パターン値「35」が同期パターンとなる。
図4を参照すると、パターン値「35」の同期パターンは、正立した同期パターンであるパターン値「32」の同期パターンを右に270度回転した同期パターンである。従って、符号配列を正立した方向にするには、符号配列を左に270度回転する必要がある。その場合、符号配列内の各要素のパターン値は、左に270度回転した場合のパターン値に変更する必要がある。
Next, the synchronization code detection unit 24 searches for the pattern value of the synchronization pattern from the pattern values detected by the block detection unit 23. For example, in the present embodiment, the code pattern of the pattern values 32 to 35 is used as the synchronization pattern, so this number is searched. In the example of FIG. 16, the pattern value “35” is the synchronization pattern.
Referring to FIG. 4, the synchronization pattern having the pattern value “35” is a synchronization pattern obtained by rotating the synchronization pattern having the pattern value “32”, which is an upright synchronization pattern, to the right by 270 degrees. Therefore, in order to make the code array upright, the code array needs to be rotated 270 degrees to the left. In that case, it is necessary to change the pattern value of each element in the code array to the pattern value when rotated 270 degrees to the left.

図18は、正立位置の符号パターンのパターン値と、正立位置の符号パターンを右に90度回転した符号パターンのパターン値と、正立位置の符号パターンを右に180度回転した符号パターンのパターン値と、正立位置の符号パターンを右に270度回転した符号パターンのパターン値との対応表である。このような対応表を図示しないメモリに記憶し、同期符号検出部24は、この対応表を参照してパターン値を付け替えるようにすればよい。   FIG. 18 shows a pattern value of a code pattern at an upright position, a pattern value of a code pattern obtained by rotating the code pattern at an upright position 90 degrees to the right, and a code pattern obtained by rotating the code pattern at an upright position 180 degrees to the right. Is a correspondence table between the pattern value of the erect position and the pattern value of the code pattern obtained by rotating the code pattern at the upright position 270 degrees to the right. Such a correspondence table may be stored in a memory (not shown), and the synchronization code detection unit 24 may refer to this correspondence table and change pattern values.

図19(a)は、このときのパターン値の変更を具体的に示したものである。例えば、左上のパターン値「0」のブロックは、左に270度回転することで、右上のパターン値「1」のブロックとなる。また、その右のパターン値「12」のブロックは、左に270度回転することで、最右列の上から2番目のパターン値「13」のブロックとなる。
また、符号配列を回転させた場合、復号領域から読み込み領域への変換に用いる値も異なってくる。つまり、復号領域の左上点から読み込み領域の左上点までのピクセル数を、符号座標上のX軸方向にRDX、符号画像上のY軸方向にRDYとすると、これらの値として異なる値を用いる必要がある。そこで、同期符号検出部24は、図19(b)に示すように、各同期パターンに対し、回転角度に加え、RDX及びRDYの値を図示しないメモリに記憶しておく。
FIG. 19A specifically shows the pattern value change at this time. For example, a block with a pattern value “0” in the upper left turns into a block with a pattern value “1” in the upper right by rotating 270 degrees to the left. Further, the block with the pattern value “12” on the right is rotated to the left by 270 degrees to become the second block with the pattern value “13” from the top in the rightmost column.
When the code array is rotated, the values used for conversion from the decoding area to the reading area are also different. In other words, if the number of pixels from the upper left point of the decoding area to the upper left point of the reading area is RDX in the X-axis direction on the code coordinates and RDY in the Y-axis direction on the code image, it is necessary to use different values as these values. There is. Therefore, as shown in FIG. 19B, the synchronization code detection unit 24 stores the values of RDX and RDY in a memory (not shown) in addition to the rotation angle for each synchronization pattern.

ここで、同期符号検出部24の詳細な動作について説明する。
図20は、同期符号検出部24の動作例を示したフローチャートである。
まず、同期符号検出部24は、ブロック検出部23からMX、MYと、符号配列PA[X,Y]とを取得する(ステップ251)。
次に、同期符号検出部24は、K、Lに「1」を代入する(ステップ252)。尚、KはX方向のブロック数を示すカウンタであり、LはY方向のブロック数を示すカウンタである。
Here, the detailed operation of the synchronization code detector 24 will be described.
FIG. 20 is a flowchart illustrating an operation example of the synchronization code detection unit 24.
First, the synchronization code detection unit 24 acquires MX and MY and the code array PA [X, Y] from the block detection unit 23 (step 251).
Next, the synchronous code detection unit 24 substitutes “1” for K and L (step 252). K is a counter indicating the number of blocks in the X direction, and L is a counter indicating the number of blocks in the Y direction.

次に、同期符号検出部24は、PA[K,L]のパターン値が「32」かどうかを判定する(ステップ253)。
PA[K,L]のパターン値が「32」であれば、符号配列PA[X,Y]の回転は必要ないと判定し、同期符号のあるブロックのX座標SXにKを代入し、Y座標SYにLを代入する。また、ブロックフレームのX方向への移動量ShiftXにMXを代入し、Y方向への移動量ShiftYにMYを代入する(ステップ254)。
Next, the synchronization code detector 24 determines whether the pattern value of PA [K, L] is “32” (step 253).
If the pattern value of PA [K, L] is “32”, it is determined that the code array PA [X, Y] does not need to be rotated, and K is substituted for the X coordinate SX of the block having the synchronization code, and Y Substitute L for coordinates SY. Further, MX is substituted for the movement amount ShiftX in the X direction of the block frame, and MY is substituted for the movement amount ShiftY in the Y direction (step 254).

次に、同期符号検出部24は、PA[K,L]のパターン値が「33」かどうかを判定する(ステップ255)。
PA[K,L]のパターン値が「33」であれば、符号配列PA[X,Y]を左方向に90度回転させる(ステップ256)。図4(a)に示すようにパターン値「33」の符号パターンは、パターン値「32」の符号パターンを右方向に90度回転させた画像であるので、逆方向に90度回転させて画像を正立させている。尚、このとき、符号配列PA[X,Y]内の全てのパターン値が、左方向に90度回転させた場合のパターン値に変換される。
また、この回転に伴って、同期符号のあるブロックのX座標SXにLを代入し、Y座標SYに6−Kを代入する。また、ブロックフレームのX方向への移動量ShiftXにMYを代入し、Y方向への移動量ShiftYに2−MXを代入する(ステップ257)。
Next, the synchronization code detector 24 determines whether the pattern value of PA [K, L] is “33” (step 255).
If the pattern value of PA [K, L] is “33”, the code array PA [X, Y] is rotated 90 degrees to the left (step 256). As shown in FIG. 4A, the code pattern of the pattern value “33” is an image obtained by rotating the code pattern of the pattern value “32” by 90 degrees in the right direction. Is upright. At this time, all pattern values in the code array PA [X, Y] are converted into pattern values when rotated 90 degrees to the left.
In accordance with this rotation, L is substituted for the X coordinate SX of the block having the synchronization code, and 6-K is substituted for the Y coordinate SY. Also, MY is substituted for the movement amount ShiftX in the X direction of the block frame, and 2-MX is substituted for the movement amount ShiftY in the Y direction (step 257).

次に、同期符号検出部24は、PA[K,L]のパターン値が「34」かどうかを判定する(ステップ258)。
PA[K,L]のパターン値が「34」であれば、符号配列PA[X,Y]を左方向に180度回転させる(ステップ259)。図4(a)に示すようにパターン値「34」の符号パターンは、パターン値「32」の符号パターンを180度回転させた画像であるので、パターン値「34」の符号パターンを180度回転させて画像を正立させている。尚、このとき、符号配列PA[X,Y]内の全てのパターン値が、180度回転させた場合のパターン値に変換される。
また、この回転に伴って、同期符号のあるブロックのX座標SXに6−Kを代入し、Y座標SYに6−Lを代入する。また、ブロックフレームのX方向への移動量ShiftXに2−MXを代入し、Y方向への移動量ShiftYに2−MYを代入する(ステップ260)。
Next, the synchronization code detection unit 24 determines whether or not the pattern value of PA [K, L] is “34” (step 258).
If the pattern value of PA [K, L] is “34”, the code array PA [X, Y] is rotated 180 degrees to the left (step 259). As shown in FIG. 4A, since the code pattern of the pattern value “34” is an image obtained by rotating the code pattern of the pattern value “32” by 180 degrees, the code pattern of the pattern value “34” is rotated by 180 degrees. Let the image stand upright. At this time, all the pattern values in the code array PA [X, Y] are converted into pattern values when rotated 180 degrees.
In accordance with this rotation, 6-K is substituted for the X coordinate SX of the block having the synchronization code, and 6-L is substituted for the Y coordinate SY. Further, 2-MX is substituted for the movement amount ShiftX in the X direction of the block frame, and 2-MY is substituted for the movement amount ShiftY in the Y direction (step 260).

次に、同期符号検出部24は、PA[K,L]のパターン値が「35」かどうかを判定する(ステップ261)。
PA[K,L]のパターン値が「35」であれば、符号配列PA[X,Y]を左方向に270度回転させる(ステップ262)。図4(a)に示すようにパターン値「35」の符号パターンは、パターン値「32」の符号パターンを右に270度回転させた画像であるので、逆方向に270度回転させて画像を正立させている。尚、このとき、符号配列PA[X,Y]内の全てのパターン値が、左方向に270度回転させた場合のパターン値に変換される。
また、この回転に伴って、同期符号のあるブロックのX座標SXに6−Lを代入し、Y座標SYにKを代入する。また、ブロックフレームのX方向への移動量ShiftXに2−MYを代入し、Y方向への移動量ShiftYにMXを代入する(ステップ263)。
Next, the synchronization code detection unit 24 determines whether the pattern value of PA [K, L] is “35” (step 261).
If the pattern value of PA [K, L] is “35”, the code array PA [X, Y] is rotated 270 degrees to the left (step 262). As shown in FIG. 4A, the code pattern with the pattern value “35” is an image obtained by rotating the code pattern with the pattern value “32” to the right by 270 degrees, so that the image is rotated by 270 degrees in the reverse direction. Erect. At this time, all the pattern values in the code array PA [X, Y] are converted into pattern values when rotated 270 degrees in the left direction.
In accordance with this rotation, 6-L is substituted for the X coordinate SX of the block having the synchronization code, and K is substituted for the Y coordinate SY. Further, 2-MY is substituted for the movement amount ShiftX in the X direction of the block frame, and MX is substituted for the movement amount ShiftY in the Y direction (step 263).

そして、ステップ254、257、260、263で、SX、SY、ShiftX、ShiftYに値が代入された場合、同期符号検出部24は、PA[X,Y]とこれらの値を識別符号検出部30、X座標符号検出部40、Y座標符号検出部45に出力する(ステップ264)。
また、PA[K,L]がパターン値「32」〜「35」のいずれでもなければ、同期符号検出部24は、K=5であるかどうかを判定する(ステップ265)。K=5でない場合には、Kに「1」を加算し(ステップ266)、ステップ253に戻る。K=5であれば、L=5であるかどうかを判定する(ステップ267)。L=5でない場合には、Kに「1」を代入し、Lに「1」を加算し(ステップ268)、ステップ253に戻る。即ち、ステップ253〜264の処理を、パターン値「32」〜「35」のブロックを検出するまでK、Lの値を変更しながら繰り返し行う。また、K=5、L=5になっても、パターン値「32」〜「35」のブロックを検出することができなかった場合には、復号不能の判定信号を出力する(ステップ269)。
When values are assigned to SX, SY, ShiftX, and ShiftY in steps 254, 257, 260, and 263, the synchronization code detection unit 24 converts PA [X, Y] and these values into the identification code detection unit 30. The X coordinate code detection unit 40 and the Y coordinate code detection unit 45 are output (step 264).
If PA [K, L] is not any of the pattern values “32” to “35”, the synchronization code detector 24 determines whether K = 5 (step 265). If K = 5 is not satisfied, “1” is added to K (step 266), and the process returns to step 253. If K = 5, it is determined whether L = 5 (step 267). If L = 5 is not satisfied, “1” is substituted for K, “1” is added to L (step 268), and the process returns to step 253. That is, the processes in steps 253 to 264 are repeated while changing the values of K and L until the blocks having pattern values “32” to “35” are detected. In addition, even if K = 5 and L = 5, if a block having pattern values “32” to “35” cannot be detected, a determination signal indicating that decoding is impossible is output (step 269).

その後、識別符号検出部30及び識別符号復号部32が、読み込み領域から紙面又は紙面上の画像を識別する識別情報を取得する。
図21は、識別符号検出部30及び識別符号復号部32の動作例を示したフローチャートである。
まず、識別符号検出部30は、同期符号検出部24から符号配列PA[X,Y]、SX、SYを取得する(ステップ301)。
次に、識別符号検出部30は、識別符号配列IA[X,Y]の全ての要素を「−1」で初期化する(ステップ302)。尚、この「−1」は、パターン値として用いられていない番号とする。そして、符号ブロックにおける各ブロックを識別するためのカウンタIX、IYに「1」を代入する(ステップ303)。ここで、IXは、X方向のブロック数を示すカウンタであり、IYは、Y方向のブロック数を示すカウンタである。
Thereafter, the identification code detection unit 30 and the identification code decoding unit 32 acquire identification information for identifying the paper surface or the image on the paper surface from the reading area.
FIG. 21 is a flowchart showing an operation example of the identification code detection unit 30 and the identification code decoding unit 32.
First, the identification code detection unit 30 acquires the code arrays PA [X, Y], SX, and SY from the synchronization code detection unit 24 (step 301).
Next, the identification code detection unit 30 initializes all elements of the identification code array IA [X, Y] with “−1” (step 302). Note that “−1” is a number that is not used as a pattern value. Then, “1” is substituted into counters IX and IY for identifying each block in the code block (step 303). Here, IX is a counter indicating the number of blocks in the X direction, and IY is a counter indicating the number of blocks in the Y direction.

また、識別符号検出部30は、IY−SYが「5」で割り切れるかどうかを判定する(ステップ304)。即ち、IYで特定される行に同期符号が配置されているかどうかを判定する。
ここで、IY−SYが「5」で割り切れた場合、つまり、この行に同期符号が配置されている場合は、識別符号を取り出す対象ではないため、IYに「1」を加算し(ステップ305)、ステップ304へ進む。
一方、IY−SYが「5」で割り切れなかった場合、つまり、この行に同期符号が配置されていない場合は、IX−SXが「5」で割り切れるかどうかを判定する(ステップ306)。即ち、IXで特定される列に同期符号が配置されているかどうかを判定する。
The identification code detection unit 30 determines whether IY-SY is divisible by “5” (step 304). That is, it is determined whether or not the synchronization code is arranged in the row specified by IY.
Here, when IY-SY is divisible by “5”, that is, when a synchronization code is arranged in this row, since the identification code is not extracted, “1” is added to IY (step 305). ), Go to step 304.
On the other hand, if IY-SY is not divisible by “5”, that is, if no synchronization code is arranged in this row, it is determined whether IX-SX is divisible by “5” (step 306). That is, it is determined whether or not the synchronization code is arranged in the column specified by IX.

ここで、IX−SXが「5」で割り切れた場合、つまり、この列に同期符号が配置されている場合は、識別符号を取り出す対象ではないため、IXに「1」を加算し(ステップ307)、ステップ306へ進む。
一方、IX−SXが「5」で割り切れなかった場合、つまり、この列に同期符号が配置されていない場合、識別符号検出部30は、IA[(IX−SX)mod5,(IY−SY)mod5]にPA[IX,IY]を代入する(ステップ308)。
Here, when IX-SX is divisible by “5”, that is, when a synchronization code is arranged in this column, “1” is added to IX because the identification code is not extracted (step 307). ), Go to Step 306.
On the other hand, when IX-SX is not divisible by “5”, that is, when a synchronization code is not arranged in this column, the identification code detection unit 30 performs IA [(IX-SX) mod5, (IY-SY) mod [5] is substituted for PA [IX, IY] (step 308).

そして、IX=5であるかどうかを判定する(ステップ309)。
ここで、IX=5でない場合には、IXに「1」を加算して(ステップ307)、ステップ306〜308の処理をIX=5となるまで繰り返し行う。また、IX=5となると、次に、IY=5であるかどうかを判定する(ステップ310)。IY=5でない場合には、IXに「1」を代入し(ステップ311)、IYに「1」を加算して(ステップ305)、ステップ304〜309の処理をIY=5となるまで繰り返し行う。また、IY=5となると、識別符号復号部32の処理に移る。
Then, it is determined whether or not IX = 5 (step 309).
If IX = 5 is not satisfied, “1” is added to IX (step 307), and the processing of steps 306 to 308 is repeated until IX = 5. When IX = 5, it is next determined whether IY = 5 (step 310). If IY = 5 is not satisfied, “1” is substituted for IX (step 311), “1” is added to IY (step 305), and the processing of steps 304 to 309 is repeated until IY = 5. . When IY = 5, the process proceeds to the identification code decoding unit 32.

即ち、識別符号復号部32は、IA[X,Y]を復号できるかどうかを判定する(ステップ312)。
ここで、IA[X,Y]を復号できると判定すると、識別符号復号部32は、IA[X,Y]から識別情報を得る(ステップ313)。また、IA[X,Y]を復号できないと判定すると、識別情報にN/Aを代入する(ステップ314)。
That is, the identification code decoding unit 32 determines whether or not IA [X, Y] can be decoded (step 312).
If it is determined that IA [X, Y] can be decoded, the identification code decoding unit 32 obtains identification information from IA [X, Y] (step 313). If it is determined that IA [X, Y] cannot be decoded, N / A is substituted for identification information (step 314).

また、X座標符号検出部40及びX座標符号復号部42が、読み込み領域のX方向の位置を取得する。
図22は、X座標符号検出部40及びX座標符号復号部42の動作例を示したフローチャートである。
まず、X座標符号検出部40は、同期符号検出部24から符号配列PA[X,Y]、SX、SY、ShiftX、ShiftYを取得する(ステップ401)。
次に、X座標符号検出部40は、X座標符号配列XA[X]の全ての要素を「−1」で初期化する(ステップ402)。尚、この「−1」は、パターン値として用いられていない番号とする。そして、符号ブロックにおける各ブロックを識別するためのカウンタIX、IYに「1」を代入する。ここで、IXは、X方向のブロック数を示すカウンタであり、IYは、Y方向のブロック数を示すカウンタである。更に、X座標符号検出部40は、X座標符号配列における各要素を識別するためのカウンタKXにも「1」を代入する(ステップ403)。
In addition, the X coordinate code detection unit 40 and the X coordinate code decoding unit 42 acquire the position of the reading area in the X direction.
FIG. 22 is a flowchart illustrating an operation example of the X coordinate code detection unit 40 and the X coordinate code decoding unit 42.
First, the X coordinate code detection unit 40 acquires the code arrays PA [X, Y], SX, SY, ShiftX, and ShiftY from the synchronization code detection unit 24 (step 401).
Next, the X coordinate code detection unit 40 initializes all elements of the X coordinate code array XA [X] with “−1” (step 402). Note that “−1” is a number that is not used as a pattern value. Then, “1” is substituted into counters IX and IY for identifying each block in the code block. Here, IX is a counter indicating the number of blocks in the X direction, and IY is a counter indicating the number of blocks in the Y direction. Furthermore, the X coordinate code detection unit 40 substitutes “1” into a counter KX for identifying each element in the X coordinate code array (step 403).

また、X座標符号検出部40は、IY−SYが「5」で割り切れるかどうかを判定する(ステップ404)。即ち、IYで特定される行に同期符号が配置されているかどうかを判定する。
ここで、IY−SYが「5」で割り切れなかった場合、つまり、この行に同期符号が配置されていない場合は、X座標符号を取り出す対象ではないため、IYに「1」を加算し(ステップ405)、ステップ404へ進む。
一方、IY−SYが「5」で割り切れた場合、つまり、この行に同期符号が配置されている場合、X座標符号検出部40は、IX−SXが「5」で割り切れるかどうかを判定する(ステップ406)。即ち、IXで特定される列に同期符号が配置されているかどうかを判定する。
Further, the X coordinate code detection unit 40 determines whether IY-SY is divisible by “5” (step 404). That is, it is determined whether or not the synchronization code is arranged in the row specified by IY.
Here, if IY-SY is not divisible by “5”, that is, if no synchronous code is arranged in this row, the X coordinate code is not extracted, so “1” is added to IY ( Step 405), the process proceeds to Step 404.
On the other hand, when IY-SY is divisible by “5”, that is, when a synchronous code is arranged in this row, the X coordinate code detection unit 40 determines whether IX-SX is divisible by “5”. (Step 406). That is, it is determined whether or not the synchronization code is arranged in the column specified by IX.

ここで、IX−SXが「5」で割り切れた場合、つまり、この列に同期符号が配置されている場合は、X座標符号を取り出す対象ではないため、IXに「1」を加算し(ステップ407)、ステップ406へ進む。
一方、IX−SXが「5」で割り切れなかった場合、つまり、この列に同期符号が配置されていない場合、X座標符号検出部40は、XA[KX]にPA[IX,IY]を代入する(ステップ408)。
Here, when IX-SX is divisible by “5”, that is, when the synchronization code is arranged in this column, “1” is added to IX because the X coordinate code is not extracted (step 1). 407), go to step 406.
On the other hand, if IX-SX is not divisible by “5”, that is, if no synchronization code is arranged in this column, the X coordinate code detection unit 40 substitutes PA [IX, IY] for XA [KX]. (Step 408).

そして、IX=5であるかどうかを判定する(ステップ409)。
ここで、IX=5でない場合には、KXに「1」を加算し(ステップ410)、IXに「1」を加算して(ステップ407)、ステップ406〜408の処理をIX=5となるまで繰り返し行う。また、IX=5となると、X座標符号復号部42の処理に移る。
Then, it is determined whether or not IX = 5 (step 409).
If IX = 5 is not satisfied, “1” is added to KX (step 410), “1” is added to IX (step 407), and the processing of steps 406 to 408 becomes IX = 5. Repeat until When IX = 5, the process proceeds to the process of the X coordinate code decoding unit 42.

即ち、X座標符号復号部42は、XA[X]を復号できるかどうかを判定する(ステップ411)。
ここで、XA[X]を復号できると判定すると、X座標符号復号部42は、XA[X]とShiftXからX座標情報を復号する(ステップ412)。また、XA[X]が復号できないと判定された場合は、X座標情報にN/Aを代入する(ステップ413)。
That is, the X coordinate code decoding unit 42 determines whether or not XA [X] can be decoded (step 411).
If it is determined that XA [X] can be decoded, the X coordinate code decoding unit 42 decodes X coordinate information from XA [X] and ShiftX (step 412). If it is determined that XA [X] cannot be decoded, N / A is substituted into the X coordinate information (step 413).

尚、ここでは、X座標符号検出部40及びX座標符号復号部42の動作のみ説明したが、Y座標符号検出部45及びY座標符号復号部47も同様の動作を行う。   Although only the operations of the X coordinate code detection unit 40 and the X coordinate code decoding unit 42 have been described here, the Y coordinate code detection unit 45 and the Y coordinate code decoding unit 47 perform the same operation.

そして、最後に、座標補正部50が、X座標符号復号部42が取得したX座標情報及びY座標符号復号部47が取得したY座標情報から紙面上のペン先中心の座標を求める。
図23は、座標補正部50の動作例を示したフローチャートである。
まず、座標補正部50は、撮像画像上での読み込み領域中心に対するペン先中心の相対座標(P,P)と、撮像領域に対する読み込み領域の傾き角(θ,θ)と、撮像画像上のドットの間隔(d,d)とを取得する(ステップ501)。ここで、(P,P)、(θ,θ)、(d,d)は、ドット配列生成部22がドットを検出した際にメモリに記憶しているので、それを読み出す。そして、符号画像上での読み込み領域中心に対するペン先中心の相対座標(Q,Q)を算出する(ステップ502)。ここで、(Q,Q)は、先にも述べた通り、次の式により算出される。
Finally, the coordinate correction unit 50 obtains the coordinates of the nib center on the paper surface from the X coordinate information acquired by the X coordinate code decoding unit 42 and the Y coordinate information acquired by the Y coordinate code decoding unit 47.
FIG. 23 is a flowchart showing an operation example of the coordinate correction unit 50.
First, the coordinate correction unit 50 takes the relative coordinates (P X , P Y ) of the center of the pen tip with respect to the center of the reading area on the captured image, the inclination angle (θ X , θ Y ) of the reading area with respect to the imaging area, and the imaging. The dot spacing (d X , d Y ) on the image is acquired (step 501). Here, (P X , P Y ), (θ X , θ Y ), and (d X , d Y ) are stored in the memory when the dot array generation unit 22 detects the dot, read out. Then, the relative coordinates (Q X , Q Y ) of the nib center with respect to the reading area center on the code image are calculated (step 502). Here, (Q X , Q Y ) is calculated by the following equation as described above.

Figure 0004985436
Figure 0004985436

次に、座標補正部50は、ブロックフレームの移動量のピクセル数(RDX,RDY)を取得する(ステップ503)。ここで、(RDX,RDY)は、同期符号検出部24が符号画像の回転を検出した際にメモリに記憶しているので、それを読み出す。
また、座標補正部50は、X座標符号復号部42から符号ブロックの左端のパターンブロックの位置BXを取得すると共に、Y座標符号復号部47から符号ブロックの上端のパターンブロックの位置BYを取得する(ステップ504)。
Next, the coordinate correction unit 50 acquires the number of pixels (RDX, RDY) of the movement amount of the block frame (step 503). Here, (RDX, RDY) is stored in the memory when the synchronous code detection unit 24 detects the rotation of the code image, so that it is read out.
Also, the coordinate correction unit 50 acquires the position BX of the leftmost pattern block of the code block from the X coordinate code decoding unit 42 and acquires the position BY of the pattern block at the upper end of the code block from the Y coordinate code decoding unit 47. (Step 504).

その後、座標補正部50は、復号領域開始点(復号領域の左上点)のピクセル位置(DSX,DSY)を求める(ステップ505)。符号ブロックの左端のパターンブロックにおける左端のピクセル位置がDSXであり、符号ブロックの上端のパターンブロックにおける上端のピクセル位置がDSYである。そして、1ブロックは12ピクセルなので、(DSX,DSY)は、
DSX=(BX−1)×12+1
DSY=(BY−1)×12+1
により求められる。
Thereafter, the coordinate correction unit 50 obtains the pixel position (DSX, DSY) of the decoding area start point (the upper left point of the decoding area) (step 505). The leftmost pixel position in the leftmost pattern block of the code block is DSX, and the uppermost pixel position in the uppermost pattern block of the code block is DSY. And since one block is 12 pixels, (DSX, DSY) is
DSX = (BX−1) × 12 + 1
DSY = (BY-1) × 12 + 1
Is required.

これまでの処理により、復号領域の左上のピクセル位置は求められるが、先に述べたように、復号領域と読み込み領域とは同じ位置ではないので、読み込み領域中心の位置を求めるためには、補正が必要である。そこで、座標補正部50は、復号領域開始点のピクセル位置(DSX,DSY)を読み込み領域開始点(読み込み領域の左上点)のピクセル位置(RSX,RSY)へと補正する(ステップ506)。この補正において、ステップ503でメモリから読み出した(RDX,RDY)が用いられる。つまり、読み込み領域の左上の座標(RSX,RSY)は、
RSX=DSX+RDX
RSY=DSY+RDY
により求められる。
By the process so far, the upper left pixel position of the decoding area is obtained, but as described above, since the decoding area and the reading area are not the same position, in order to obtain the position of the reading area center, correction is performed. is required. Therefore, the coordinate correction unit 50 corrects the pixel position (DSX, DSY) of the decoding area start point to the pixel position (RSX, RSY) of the reading area start point (upper left point of the reading area) (step 506). In this correction, (RDX, RDY) read from the memory in step 503 is used. That is, the upper left coordinates (RSX, RSY) of the reading area are
RSX = DSX + RDX
RSY = DSY + RDY
Is required.

更に、座標補正部50は、読み込み領域中心のピクセル位置(CRX,CRY)を求める(ステップ507)。ここで、読み込み領域の幅と高さは予め決められた設計値である。そこで、これらをそれぞれDAW,DAHとすると、読み込み領域中心(CRX,CRY)は、
CRX=RSX+DAW/2
CRY=RSY+DAH/2
により求められる。
Further, the coordinate correction unit 50 obtains the pixel position (CRX, CRY) at the center of the reading area (step 507). Here, the width and height of the reading area are predetermined design values. Therefore, if these are DAW and DAH, respectively, the reading area center (CRX, CRY) is
CRX = RSX + DAW / 2
CRY = RSY + DAH / 2
Is required.

そして、最後に、ペン先中心のピクセル位置(PPX,PPY)を求める(ステップ508)。ステップ502で読み込み領域中心に対するペン先中心の相対座標(Q,Q)を求めたので、これを、ステップ507で求めた読み込み領域中心のピクセル位置に加算する。つまり、(PPX,PPY)は、
PPX=CRX+Q
PPY=CRY+Q
により求められる。
以上により、本実施の形態の動作の説明を終了する。
Finally, the pixel position (PPX, PPY) at the nib center is obtained (step 508). In step 502, the relative coordinates (Q X , Q Y ) of the nib center with respect to the reading area center are obtained, and this is added to the pixel position of the reading area center obtained in step 507. That is, (PPX, PPY) is
PPX = CRX + Q X
PPY = CRY + Q Y
Is required.
This is the end of the description of the operation of the present embodiment.

尚、上記説明では、撮像画像上での読み込み領域中心に対するペン先中心の相対座標(P,P)と、撮像領域に対する読み込み領域の傾き角(θ,θ)と、撮像画像上のドットの間隔(d,d)とを用いて、紙面上のペン先中心の座標を求めた。しかしながら、これらの全てのパラメータを必ず用いなければならないわけではない。例えば、読み込み領域が矩形であることが保証されている場合には、2つの方向の傾き角(θ,θ)の代わりに、1つの方向の傾き角θを用いればよく、2つの方向のドット間隔(d,d)の代わりに、1つの方向のドット間隔dを用いればよい。また、撮像領域と読み込み領域との間に角度の違いがないことが保証されている場合には、傾き角(θ,θ)は用いなくてもよい。更に、撮像画像と符号画像との間に尺度の違いがないことが保証されている場合には、ドット間隔(d,d)は用いなくてもよい。 In the above description, the relative coordinates (P X , P Y ) of the pen tip center with respect to the reading area center on the captured image, the inclination angle (θ X , θ Y ) of the reading area with respect to the imaging area, The coordinates of the center of the pen tip on the paper surface were obtained using the dot spacing (d X , d Y ). However, not all of these parameters must be used. For example, when the reading area is guaranteed to be rectangular, the inclination angle θ in one direction may be used instead of the inclination angles (θ X , θ Y ) in the two directions. Instead of the dot interval (d X , d Y ), the dot interval d in one direction may be used. In addition, when it is ensured that there is no difference in angle between the imaging area and the reading area, the inclination angles (θ X , θ Y ) may not be used. Furthermore, when it is guaranteed that there is no difference in scale between the captured image and the code image, the dot spacing (d X , d Y ) may not be used.

次に、本実施の形態における画像処理装置20の具体的なハードウェア構成について説明する。
まず、画像処理装置20を実現するペンデバイス60について説明する。
図24は、ペンデバイス60の機構を示した図である。
図示するように、ペンデバイス60は、ペン全体の動作を制御する制御回路61を備える。また、制御回路61は、入力画像から検出した符号画像を処理する画像処理部61aと、そこでの処理結果から識別情報及び位置情報を抽出するデータ処理部61bとを含む。
そして、制御回路61には、ペンデバイス60による筆記動作をペンチップ69に加わる圧力によって検出する圧力センサ62が接続されている。また、媒体上に赤外光を照射する赤外LED63と、画像を入力する赤外CMOS64も接続されている。更に、識別情報及び位置情報を記憶するための情報メモリ65と、外部装置と通信するための通信回路66と、ペンを駆動するためのバッテリ67と、ペンの識別情報(ペンID)を記憶するペンIDメモリ68も接続されている。
Next, a specific hardware configuration of the image processing apparatus 20 in the present embodiment will be described.
First, the pen device 60 that implements the image processing apparatus 20 will be described.
FIG. 24 is a view showing the mechanism of the pen device 60.
As illustrated, the pen device 60 includes a control circuit 61 that controls the operation of the entire pen. In addition, 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 position information from the processing result.
The control circuit 61 is connected to a pressure sensor 62 that detects the writing operation by the pen device 60 by the 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 position 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.

尚、図11に示した画像読取部21は、例えば、図24の赤外CMOS64にて実現される。また、ドット配列生成部22は、例えば、図24の画像処理部61aにて実現される。更に、図11に示したブロック検出部23、同期符号検出部24、識別符号検出部30、識別符号復号部32、X座標符号検出部40、X座標符号復号部42、Y座標符号検出部45、Y座標符号復号部47、座標補正部50、情報出力部55は、例えば、図24のデータ処理部61bにて実現される。   The image reading unit 21 shown in FIG. 11 is realized by, for example, the infrared CMOS 64 in FIG. The dot array generation unit 22 is realized by, for example, the image processing unit 61a in FIG. Furthermore, the block detection unit 23, the synchronization code detection unit 24, the identification code detection unit 30, the identification code decoding unit 32, the X coordinate code detection unit 40, the X coordinate code decoding unit 42, and the Y coordinate code detection unit 45 shown in FIG. The Y coordinate code decoding unit 47, the coordinate correction unit 50, and the information output unit 55 are realized by, for example, the data processing unit 61b in FIG.

また、本実施の形態では、媒体上の位置を指示する指示手段の一例として、ペンデバイス60のペンチップ69を設けたが、これには限らない。媒体に筆記を行うための構成ではなく、単に媒体上の所定位置をポイントするための構成を指示手段として捉えてもよい。   In the present embodiment, the pen tip 69 of the pen device 60 is provided as an example of the instruction unit that indicates the position on the medium. However, the present invention is not limited to this. Instead of writing on the medium, a structure for simply pointing to a predetermined position on the medium may be regarded as the instruction means.

また、図24の画像処理部61a又はデータ処理部61bにて実現される処理は、例えば、汎用のコンピュータで実現してもよい。そこで、かかる処理をコンピュータ90で実現するものとし、コンピュータ90のハードウェア構成について説明する。
図25は、コンピュータ90のハードウェア構成を示した図である。
図示するように、コンピュータ90は、演算手段であるCPU(Central Processing Unit)91と、記憶手段であるメインメモリ92及び磁気ディスク装置(HDD:Hard Disk Drive)93とを備える。ここで、CPU91は、OS(Operating System)やアプリケーション等の各種ソフトウェアを実行し、上述した各機能を実現する。また、メインメモリ92は、各種ソフトウェアやその実行に用いるデータ等を記憶する記憶領域であり、磁気ディスク装置93は、各種ソフトウェアに対する入力データや各種ソフトウェアからの出力データ等を記憶する記憶領域である。
更に、コンピュータ90は、外部との通信を行うための通信I/F94と、ビデオメモリやディスプレイ等からなる表示機構95と、キーボードやマウス等の入力デバイス96とを備える。
The processing realized by the image processing unit 61a or the data processing unit 61b in FIG. 24 may be realized by a general-purpose computer, for example. Accordingly, assuming that such processing is realized by the computer 90, the hardware configuration of the computer 90 will be described.
FIG. 25 is a diagram illustrating a hardware configuration of the computer 90.
As shown in the figure, the computer 90 includes a CPU (Central Processing Unit) 91 as a calculation means, a main memory 92 as a storage means, and a magnetic disk device (HDD: Hard Disk Drive) 93. Here, the CPU 91 executes various types of software such as an OS (Operating System) and applications to realize the above-described functions. The main memory 92 is a storage area for storing various software and data used for execution thereof, and the magnetic disk device 93 is a storage area for storing input data for various software, output data from various software, and the like. .
Further, the computer 90 includes a communication I / F 94 for performing communication with the outside, a display mechanism 95 including a video memory and a display, and an input device 96 such as a keyboard and a mouse.

尚、本実施の形態を実現するプログラムは、通信手段により提供することはもちろん、CD−ROM等の記録媒体に格納して提供することも可能である。   The program for realizing the present embodiment can be provided not only by communication means but also by storing it in a recording medium such as a CD-ROM.

9C2方式及び9C3方式における符号パターンの一例を示した図である。It is the figure which showed an example of the code pattern in 9C2 system and 9C3 system. 9C2方式における全符号パターンの一例を示した図である。It is the figure which showed an example of all the code patterns in 9C2 system. 9C3方式における全符号パターンの一例を示した図である。It is the figure which showed an example of all the code patterns in 9C3 system. 9C2方式及び9C3方式における同期パターンの例を示した図である。It is the figure which showed the example of the synchronous pattern in 9C2 system and 9C3 system. 符号ブロックの基本的なレイアウトの例を示した図である。It is the figure which showed the example of the basic layout of a code block. M系列による座標の表現について説明するための図である。It is a figure for demonstrating the expression of the coordinate by M series. 符号ブロックの広範囲のレイアウトの例を示した図である。It is the figure which showed the example of the extensive layout of a code block. ペン先中心と撮像領域中心とのズレについて説明するための図である。It is a figure for demonstrating the shift | offset | difference of a nib center and an imaging area center. 撮像画像上にペン先中心、読み込み領域中心等の位置を示した図である。It is the figure which showed positions, such as a nib center and a reading area center, on a captured image. 撮像画像上の座標系から符号画像上の座標系への座標変換について説明するための図である。It is a figure for demonstrating the coordinate transformation from the coordinate system on a captured image to the coordinate system on a code | cord | chord image. 本実施の形態における画像処理装置の機能構成を示したブロック図である。It is the block diagram which showed the function structure of the image processing apparatus in this Embodiment. ドットの列の傾き角の算出について説明するための図である。It is a figure for demonstrating calculation of the inclination angle of a row | line | column of a dot. ドット配列を生成する際の処理を説明するための図である。It is a figure for demonstrating the process at the time of producing | generating a dot array. ドット配列上でブロックを検出する際の処理を説明するための図である。It is a figure for demonstrating the process at the time of detecting a block on a dot arrangement | sequence. ドット配列上でブロックを検出した後の状態を説明するための図である。It is a figure for demonstrating the state after detecting a block on a dot arrangement | sequence. ドット配列から符号配列へ変換する際の処理を説明するための図である。It is a figure for demonstrating the process at the time of converting from a dot arrangement to a code arrangement. 本実施の形態におけるブロック検出部の動作例を示したフローチャートである。It is the flowchart which showed the operation example of the block detection part in this Embodiment. 回転角度とパターン番号の対応を示した図である。It is the figure which showed the correspondence of a rotation angle and a pattern number. 符号配列の回転及び回転に伴う情報の記憶について説明するための図である。It is a figure for demonstrating the memory | storage of the information accompanying rotation of a code arrangement | sequence and rotation. 本実施の形態における同期符号検出部の動作例を示したフローチャートである。It is the flowchart which showed the operation example of the synchronous code detection part in this Embodiment. 本実施の形態における識別符号検出部等の動作例を示したフローチャートである。It is the flowchart which showed the operation example of the identification code | cord | chord detection part etc. in this Embodiment. 本実施の形態におけるX座標符号検出部等の動作例を示したフローチャートである。It is the flowchart which showed the operation example of the X coordinate code | symbol detection part etc. in this Embodiment. 本実施の形態における座標補正部の動作例を示したフローチャートである。It is the flowchart which showed the operation example of the coordinate correction | amendment part in this Embodiment. 本実施の形態における画像処理装置を実現可能なペンデバイスの機構を示した図である。It is the figure which showed the mechanism of the pen device which can implement | achieve the image processing apparatus in this Embodiment. 本実施の形態を適用可能なコンピュータのハードウェア構成図である。It is a hardware block diagram of the computer which can apply this Embodiment.

符号の説明Explanation of symbols

20…画像処理装置、21…画像読取部、22…ドット配列生成部、23…ブロック検出部、24…同期符号検出部、30…識別符号検出部、32…識別符号復号部、40…X座標符号検出部、42…X座標符号復号部、45…Y座標符号検出部、47…Y座標符号復号部、50…座標補正部、55…情報出力部 DESCRIPTION OF SYMBOLS 20 ... Image processing apparatus, 21 ... Image reading part, 22 ... Dot array production | generation part, 23 ... Block detection part, 24 ... Synchronization code detection part, 30 ... Identification code detection part, 32 ... Identification code decoding part, 40 ... X coordinate Code detection unit, 42 ... X coordinate code decoding unit, 45 ... Y coordinate code detection unit, 47 ... Y coordinate code decoding unit, 50 ... Coordinate correction unit, 55 ... Information output unit

Claims (9)

媒体上の位置を指示する指示手段と、
前記媒体に印刷され、m(m≧3)箇所のうちのn(1≦n<m)箇所に単位画像を配置したパターン画像を横方向にAx(Ax≧2)個、縦方向にAy(Ay≧2)個並べたパターン画像群が周期的に配置された印刷画像を撮像した撮像画像を取得する画像取得手段と、
前記撮像画像から、当該撮像画像の部分を構成する部分画像を抽出する抽出手段と、
前記部分画像における前記単位画像の有無を要素として格納する第1の配列を生成する第1の配列生成手段と、
前記撮像画像を含む平面上で、前記指示手段により指示された前記媒体上の位置に対応する位置の前記部分画像に対する相対位置を示す第1の位置情報を取得する第1の情報取得手段と、
前記第1の配列上で、前記パターン画像と略同じ大きさの区画を前記横方向にAx個、前記縦方向にAy個配置してなる枠を、n個の前記単位画像を含む区画が所定数以上となる枠位置まで移動することにより、当該枠位置における当該枠内の配列である第2の配列と、当該枠位置までの当該枠の前記横方向及び前記縦方向の移動量とを生成する第2の配列生成手段と、
前記第2の配列を用いて、前記媒体上の前記印刷画像の当該第2の配列に対応する部分の位置を示す第2の位置情報を取得する第2の情報取得手段と、
前記第1の位置情報を、前記指示手段により指示された前記媒体上の位置の前記印刷画像に対する相対位置を示す第3の位置情報に変換する変換手段と、
前記第2の位置情報と、前記移動量とに基づいて、前記媒体上の前記印刷画像の前記部分画像に対応する部分の位置を特定する第1の特定手段と、
前記印刷画像の前記部分画像に対応する部分の位置と、前記第3の位置情報とに基づいて、前記指示手段により指示された前記媒体上の位置を特定する第2の特定手段と
を備えたことを特徴とする位置検出装置。
Indicating means for indicating a position on the medium;
Ax (Ax ≧ 2) pattern images in the horizontal direction and Ay (Ay in the vertical direction) are printed on the medium, and unit images are arranged at n (1 ≦ n <m) of m (m ≧ 3). Ay ≧ 2) an image acquisition means for acquiring a captured image obtained by capturing a print image in which a group of pattern images arranged periodically is arranged ;
Extracting means for extracting a partial image constituting a portion of the captured image from the captured image;
First array generation means for generating a first array for storing the presence or absence of the unit image in the partial image as an element;
First information acquisition means for acquiring first position information indicating a relative position with respect to the partial image at a position corresponding to a position on the medium instructed by the instruction means on a plane including the captured image;
On the first array, a frame including n pieces of unit images having a frame formed by arranging Ax pieces of the same size as the pattern image in the horizontal direction and Ay pieces in the vertical direction is predetermined. By moving to a frame position that is greater than or equal to the number, a second array that is an array within the frame at the frame position and the amount of movement of the frame in the horizontal direction and the vertical direction up to the frame position are generated. Second array generating means for
Second information acquisition means for acquiring second position information indicating a position of a portion corresponding to the second array of the print image on the medium using the second array ;
Conversion means for converting the first position information into third position information indicating a relative position of the position on the medium instructed by the instruction means with respect to the print image;
First specifying means for specifying a position of a portion corresponding to the partial image of the print image on the medium based on the second position information and the movement amount;
A second specifying unit that specifies a position on the medium instructed by the instruction unit based on a position of a portion corresponding to the partial image of the print image and the third position information; A position detecting device characterized by that.
前記第1の情報取得手段は、前記部分画像の前記撮像画像に対する傾き角を示す角度情報を更に取得し、
前記変換手段は、前記角度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項1記載の位置検出装置。
It said first information acquisition means further acquires angular information indicating an inclination angle with respect to the captured image of the partial image,
The position detection apparatus according to claim 1, wherein the conversion unit converts the first position information into the third position information using the angle information.
前記部分画像は、四辺形であり、
前記第1の情報取得手段は、前記部分画像の第1の辺の前記撮像画像に対する傾き角を示す第1の角度情報と、前記部分画像の当該第1の辺に隣接する第2の辺の前記撮像画像に対する傾き角を示す第2の角度情報とを、前記角度情報として取得することを特徴とする請求項2記載の位置検出装置。
The partial image is a quadrilateral,
The first information acquisition unit includes first angle information indicating an inclination angle of the first side of the partial image with respect to the captured image, and a second side adjacent to the first side of the partial image. The position detection apparatus according to claim 2, wherein second angle information indicating an inclination angle with respect to the captured image is acquired as the angle information.
前記第1の情報取得手段は、前記撮像画像における尺度を示す尺度情報を更に取得し、
前記変換手段は、前記尺度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項1記載の位置検出装置。
The first information acquisition means further acquires scale information indicating a scale in the captured image,
The position detecting apparatus according to claim 1, wherein the converting unit converts the first position information into the third position information using the scale information.
前記部分画像は、四辺形であり、
前記第1の情報取得手段は、前記部分画像の第1の辺に沿った前記撮像画像における尺度を示す第1の尺度情報と、前記部分画像の当該第1の辺に隣接する第2の辺に沿った前記撮像画像における尺度を示す第2の尺度情報とを、前記尺度情報として取得することを特徴とする請求項4記載の位置検出装置。
The partial image is a quadrilateral,
The first information acquisition means includes first scale information indicating a scale in the captured image along the first side of the partial image, and a second side adjacent to the first side of the partial image. 5. The position detection apparatus according to claim 4, wherein second scale information indicating a scale in the captured image along the line is acquired as the scale information.
前記第1の情報取得手段は、前記撮像画像上の前記単位画像に対応する画像の間隔に基づいて、前記尺度情報を取得することを特徴とする請求項4記載の位置検出装置。 The position detecting device according to claim 4, wherein the first information acquisition unit acquires the scale information based on an interval between images corresponding to the unit images on the captured image. コンピュータに、
媒体に印刷され、m(m≧3)箇所のうちのn(1≦n<m)箇所に単位画像を配置したパターン画像を横方向にAx(Ax≧2)個、縦方向にAy(Ay≧2)個並べたパターン画像群が周期的に配置された印刷画像を撮像した撮像画像を取得する機能と、
前記撮像画像から、当該撮像画像の部分を構成する部分画像を抽出する機能と、
前記部分画像における前記単位画像の有無を要素として格納する第1の配列を生成する機能と、
前記撮像画像を含む平面上で、指示手段により指示された前記媒体上の位置に対応する位置の前記部分画像に対する相対位置を示す第1の位置情報を取得する機能と、
前記第1の配列上で、前記パターン画像と略同じ大きさの区画を前記横方向にAx個、前記縦方向にAy個配置してなる枠を、n個の前記単位画像を含む区画が所定数以上となる枠位置まで移動することにより、当該枠位置における当該枠内の配列である第2の配列と、当該枠位置までの当該枠の前記横方向及び前記縦方向の移動量とを生成する機能と、
前記第2の配列を用いて、前記媒体上の前記印刷画像の当該第2の配列に対応する部分の位置を示す第2の位置情報を取得する機能と、
前記第1の位置情報を、前記指示手段により指示された前記媒体上の位置の前記印刷画像に対する相対位置を示す第3の位置情報に変換する機能と、
前記第2の位置情報と、前記移動量とに基づいて、前記媒体上の前記印刷画像の前記部分画像に対応する部分の位置を特定する機能と、
前記印刷画像の前記部分画像に対応する部分の位置と、前記第3の位置情報とに基づいて、前記指示手段により指示された前記媒体上の位置を特定する機能と
を実現させるためのプログラム。
On the computer,
Ax (Ax ≧ 2) pattern images printed in the medium and having unit images arranged at n (1 ≦ n <m) of m (m ≧ 3) locations in the horizontal direction and Ay (Ay in the vertical direction) ≧ 2) a function of acquiring a captured image obtained by capturing a print image in which a group of pattern images arranged periodically is arranged ;
A function of extracting a partial image constituting a portion of the captured image from the captured image;
A function of generating a first array that stores the presence or absence of the unit image in the partial image as an element;
A function of acquiring first position information indicating a relative position of the position corresponding to the position on the medium instructed by the instruction unit with respect to the partial image on a plane including the captured image;
On the first array, a frame including n pieces of unit images having a frame formed by arranging Ax pieces of the same size as the pattern image in the horizontal direction and Ay pieces in the vertical direction is predetermined. By moving to a frame position that is greater than or equal to the number, a second array that is an array within the frame at the frame position and the amount of movement of the frame in the horizontal direction and the vertical direction up to the frame position are generated. Function to
A function of acquiring second position information indicating a position of a portion corresponding to the second array of the print image on the medium using the second array ;
A function of converting the first position information into third position information indicating a relative position of the position on the medium instructed by the instruction unit with respect to the print image;
A function of specifying a position of a portion corresponding to the partial image of the print image on the medium based on the second position information and the movement amount;
A program for realizing a function of specifying a position on the medium instructed by the instruction unit based on a position of a part corresponding to the partial image of the print image and the third position information.
前記部分画像の前記撮像画像に対する傾き角を示す角度情報を取得する機能更に前記コンピュータに実現させ、
前記変換する機能では、前記角度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項7記載のプログラム。
Further to realize said computer a function of acquiring angular information indicating an inclination angle with respect to the captured image of the partial image,
8. The program according to claim 7, wherein the converting function converts the first position information into the third position information using the angle information.
前記撮像画像における尺度を示す尺度情報を取得する機能を更に前記コンピュータに実現させ、
前記変換する機能では、前記尺度情報を用いて、前記第1の位置情報を前記第3の位置情報に変換することを特徴とする請求項7記載のプログラム。
The computer further realizes a function of acquiring scale information indicating a scale in the captured image,
8. The program according to claim 7, wherein the converting function converts the first position information into the third position information by using the scale information.
JP2008019746A 2008-01-30 2008-01-30 Position detection apparatus and program Active JP4985436B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008019746A JP4985436B2 (en) 2008-01-30 2008-01-30 Position detection apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008019746A JP4985436B2 (en) 2008-01-30 2008-01-30 Position detection apparatus and program

Publications (2)

Publication Number Publication Date
JP2009181340A JP2009181340A (en) 2009-08-13
JP4985436B2 true JP4985436B2 (en) 2012-07-25

Family

ID=41035276

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008019746A Active JP4985436B2 (en) 2008-01-30 2008-01-30 Position detection apparatus and program

Country Status (1)

Country Link
JP (1) JP4985436B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2993988B1 (en) * 2012-07-27 2015-06-26 Horiba Jobin Yvon Sas DEVICE AND METHOD FOR CHARACTERIZING A SAMPLE BY LOCALIZED MEASUREMENTS
JP6267074B2 (en) * 2014-07-22 2018-01-24 グリッドマーク株式会社 Handwriting input / output system and optical reader
CN110956660B (en) * 2018-09-26 2023-10-10 深圳市优必选科技有限公司 Positioning method, robot, and computer storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4037026B2 (en) * 1999-02-03 2008-01-23 株式会社リコー Coordinate input device, information processing system, and medium
JP2005173672A (en) * 2003-12-08 2005-06-30 Laboratories Of Image Information Science & Technology Form, electronic pen, and program
JP4967823B2 (en) * 2007-05-30 2012-07-04 富士ゼロックス株式会社 Position detection apparatus and program

Also Published As

Publication number Publication date
JP2009181340A (en) 2009-08-13

Similar Documents

Publication Publication Date Title
JP5763441B2 (en) Stream dot pattern, stream dot pattern forming medium, stream dot pattern reading device
JP2007179111A (en) Code pattern, printed matter, image forming device, image processor, image forming method, and information specifying method
JP2007226678A (en) Printed matter with identification function, image generation device, and image processing device and method
JP5609469B2 (en) Image processing apparatus, identification apparatus, electronic writing instrument, and program
JP4985436B2 (en) Position detection apparatus and program
JP4967823B2 (en) Position detection apparatus and program
KR20130139225A (en) Dot code pattern for absolute position and other information using an optical pen, process of printing the dot code, process of reading the dot code
US8019181B2 (en) Image generation apparatus, image processing apparatus, computer readable medium and computer data signal
JP2012065124A (en) Image processing apparatus, identification apparatus and program
JP2009181341A (en) Position detection device and program
JP2009175845A (en) Image processor, pen device, and program
JP4973316B2 (en) Image processing apparatus and program
JP5125548B2 (en) Image processing apparatus and program
JP5125547B2 (en) Image generating apparatus, image processing apparatus, program, and print medium
JP5098441B2 (en) Image processing apparatus and program
JP4973317B2 (en) Image processing apparatus and program
JP2009176249A (en) Image generation device, image processor, program and print medium
JP5028955B2 (en) Image processing apparatus and program
JP4915211B2 (en) Image generating apparatus, print medium, and program
JP2008301120A (en) Image processor, image generating apparatus and program
JP2009176251A (en) Image processing device and program
JP2008109578A (en) Image generating device, information reader, and recording medium
JP2008301128A (en) Image processor, image-generating apparatus and program
JP2009181346A (en) Image processor, pen device, and program
JP2009181347A (en) Image-processing device, pen device, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101217

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120110

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120309

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120403

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120416

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4985436

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150511

Year of fee payment: 3

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350