JP2015170130A - recognition device, recognition method and program - Google Patents

recognition device, recognition method and program Download PDF

Info

Publication number
JP2015170130A
JP2015170130A JP2014044342A JP2014044342A JP2015170130A JP 2015170130 A JP2015170130 A JP 2015170130A JP 2014044342 A JP2014044342 A JP 2014044342A JP 2014044342 A JP2014044342 A JP 2014044342A JP 2015170130 A JP2015170130 A JP 2015170130A
Authority
JP
Japan
Prior art keywords
character
candidate
recognition
collation
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2014044342A
Other languages
Japanese (ja)
Other versions
JP6334209B2 (en
Inventor
鈴木 智久
Tomohisa Suzuki
智久 鈴木
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions 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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2014044342A priority Critical patent/JP6334209B2/en
Publication of JP2015170130A publication Critical patent/JP2015170130A/en
Application granted granted Critical
Publication of JP6334209B2 publication Critical patent/JP6334209B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Character Discrimination (AREA)

Abstract

PROBLEM TO BE SOLVED: To synchronize processing different from collation processing with the collation processing and execute the processing different therefrom.SOLUTION: A recognition device comprises: a candidate detection section detecting character candidates being a group of pixels estimated to include characters from an input image; a recognition section recognizing individual ones of the character candidates and generating at least one recognition candidate being the characters of the candidate of recognition results; a collation section collating each of at least one recognition candidate with a knowledge dictionary obtained by modeling a character string of a recognition object and generating collation results obtained by collating a character string estimated to be included in the input image with the knowledge dictionary; and a command processing section executing an issued command. The knowledge dictionary is a finite automaton and is allocated with any one of an actual character code representing the character and a virtual character code specifying a command to an edge. The collation section issues the command specified by the virtual character code allocated to the edge to the command processing section when the virtual character code causes a state of the knowledge dictionary to be subjected to transition in accordance the edge allocated with the virtual character code.

Description

本発明の実施形態は、認識装置、認識方法およびプログラムに関する。   Embodiments described herein relate generally to a recognition apparatus, a recognition method, and a program.

文字認識における知識処理を行う方法として、認識対象の文字列をモデル化して知識辞書に格納し、モデルに合致する文字列を知識辞書の結果とする方法が知られている。例えば、照合したい単語を登録した単語辞書部と単語辞書部に登録された単語を受理する有限オートマトンを有する単語照合部を備え、有限オートマトンが受理した単語を知識処理の結果として出力するシステムが知られている(例えば、特許文献1参照)。また、文脈自由文法で記述した地名表記と文字認識候補を照合することで知識処理を行う技術が知られている(例えば、特許文献2参照)。   As a method for performing knowledge processing in character recognition, a method is known in which a character string to be recognized is modeled and stored in a knowledge dictionary, and a character string matching the model is used as a result of the knowledge dictionary. For example, a system is known that includes a word dictionary unit that registers words to be collated and a word collation unit that has a finite automaton that accepts words registered in the word dictionary unit, and outputs the words received by the finite automaton as a result of knowledge processing. (For example, refer to Patent Document 1). In addition, a technique for performing knowledge processing by collating a place name notation described in a context-free grammar with a character recognition candidate is known (see, for example, Patent Document 2).

特開平11−143893号公報JP-A-11-143893 特許第4006176号公報Japanese Patent No. 4006176

しかしながら、従来の技術では、文字列と文字列との間のスペースを検出し、スペースの検出結果を照合のスコアに反映させる等の知識処理とは異なる処理を、知識処理と同期させて実行させることが困難であった。   However, in the conventional technology, a process different from the knowledge process such as detecting a space between character strings and reflecting the space detection result on the matching score is executed in synchronization with the knowledge process. It was difficult.

本発明が解決しようとする課題は、知識辞書を用いて文字認識をするとともに、照合処理に同期させて照合処理とは異なる処理を実行することにある。   The problem to be solved by the present invention is to perform character recognition using a knowledge dictionary and execute a process different from the collation process in synchronization with the collation process.

実施形態に係る認識装置は、入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、与えられた命令を実行する命令処理部と、を備え、前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、前記照合部は、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を前記命令処理部に与える。   The recognition apparatus according to the embodiment recognizes each of the character candidates from a candidate detection unit that detects a character candidate that is a set of pixels estimated to include a character from the input image, and recognizes each of the character candidates. A recognition unit that generates at least one recognition candidate, and each of the at least one recognition candidate is compared with a knowledge dictionary that models a character string to be recognized, and is estimated to be included in the input image. A collation unit that generates a collation result obtained by collating the character string with the knowledge dictionary, and an instruction processing unit that executes a given command. The knowledge dictionary is a finite automaton, and represents an actual character. Either one of the character code and the virtual character code designating the instruction is assigned to the edge, and the collation unit determines the state of the knowledge dictionary according to the edge to which the virtual character code is assigned. When causing the transfer, giving the specified instruction by the virtual character code allocated to the edge to the instruction processing unit.

図1は、実施形態に係る認識装置10の構成を示す図である。FIG. 1 is a diagram illustrating a configuration of a recognition device 10 according to the embodiment. 図2は、実施形態に係る認識装置10の処理を示すフロー図である。FIG. 2 is a flowchart showing processing of the recognition apparatus 10 according to the embodiment. 図3は、入力画像の一例を示す図である。FIG. 3 is a diagram illustrating an example of an input image. 図4は、様式データの構成を示す図である。FIG. 4 is a diagram showing the configuration of style data. 図5は、入力画像から一連の文字候補を生成する処理を示す図である。FIG. 5 is a diagram illustrating a process for generating a series of character candidates from an input image. 図6は、断片データの構成を示す図である。FIG. 6 is a diagram showing the structure of fragment data. 図7は、断片番号の一例を示す図である。FIG. 7 is a diagram illustrating an example of a fragment number. 図8は、文字候補データの構成を示す図である。FIG. 8 is a diagram illustrating a configuration of character candidate data. 図9は、文字候補番号の一例を示す図である。FIG. 9 is a diagram illustrating an example of character candidate numbers. 図10は、文字候補の始点番号および終点番号の一例を示す図である。FIG. 10 is a diagram illustrating an example of the start point number and end point number of a character candidate. 図11は、文字候補マトリクスの一例を示す図である。FIG. 11 is a diagram illustrating an example of a character candidate matrix. 図12は、文字認識辞書の構成を示す図である。FIG. 12 is a diagram showing the configuration of the character recognition dictionary. 図13は、認識候補の配列の構成を示す図である。FIG. 13 is a diagram showing the configuration of recognition candidate sequences. 図14は、知識辞書の構成を示す図である。FIG. 14 is a diagram illustrating a configuration of the knowledge dictionary. 図15は、コードの符号化方法の一例を示す図である。FIG. 15 is a diagram illustrating an example of a code encoding method. 図16は、命令データの一例を示す図である。FIG. 16 is a diagram illustrating an example of instruction data. 図17は、照合結果データの構成を示す図である。FIG. 17 is a diagram illustrating a configuration of the collation result data. 図18は、照合処理を示すフロー図である。FIG. 18 is a flowchart showing the matching process. 図19は、知識辞書探索処理を示すフロー図である。FIG. 19 is a flowchart showing the knowledge dictionary search process. 図20は、知識辞書探索処理でのデータのアクセスの流れの一例を示す図である。FIG. 20 is a diagram illustrating an example of the flow of data access in the knowledge dictionary search process. 図21は、命令実行処理を示すフロー図である。FIG. 21 is a flowchart showing instruction execution processing. 図22は、命令実行処理でのデータのアクセスの流れの一例を示す図である。FIG. 22 is a diagram illustrating an example of the flow of data access in the instruction execution process. 図23は、文字間のスペースの確認の様子を示す図である。FIG. 23 is a diagram showing how to check the space between characters. 図24は、結果抽出の処理の流れを示すフロー図である。FIG. 24 is a flowchart showing the result extraction process. 図25は、結果抽出において参照されるデータとスタック上に積まれる文字コードの一例を示す図である。FIG. 25 is a diagram illustrating an example of data referred to in the result extraction and a character code stacked on the stack. 図26は、実施形態に係る認識装置10のハードウェア構成を示す図である。FIG. 26 is a diagram illustrating a hardware configuration of the recognition apparatus 10 according to the embodiment.

図1は、実施形態に係る認識装置10の構成を示す図である。認識装置10は、例えばスキャナ等により読み取られた入力画像に含まれる文字列を認識し、認識した文字列を出力する。   FIG. 1 is a diagram illustrating a configuration of a recognition device 10 according to the embodiment. For example, the recognition device 10 recognizes a character string included in an input image read by a scanner or the like, and outputs the recognized character string.

認識装置10は、入力部30と、入力画像記憶部32と、様式データ記憶部34と、候補検出部36と、候補記憶部38と、文字認識辞書記憶部40と、認識部42と、知識辞書記憶部44と、照合部46と、照合結果記憶部48と、命令処理部51と、結果抽出部54と、出力部56を備える。   The recognition device 10 includes an input unit 30, an input image storage unit 32, a style data storage unit 34, a candidate detection unit 36, a candidate storage unit 38, a character recognition dictionary storage unit 40, a recognition unit 42, knowledge A dictionary storage unit 44, a verification unit 46, a verification result storage unit 48, an instruction processing unit 51, a result extraction unit 54, and an output unit 56 are provided.

入力部30は、スキャナ等により取り込まれた入力画像を入力する。入力部30は、ネットワーク等を介して他のコンピュータから入力画像を入力してもよい。入力画像記憶部32は、入力部30により入力された入力画像を記憶する。   The input unit 30 inputs an input image captured by a scanner or the like. The input unit 30 may input an input image from another computer via a network or the like. The input image storage unit 32 stores the input image input by the input unit 30.

様式データ記憶部34は、入力画像における文字列が記載された領域を特定する様式データを記憶する。   The form data storage unit 34 stores form data for specifying an area in which a character string in the input image is described.

候補検出部36は、様式データ記憶部34に記憶された様式データに基づいて、入力画像から、文字候補を検出する。それぞれの文字候補は、1つの文字を含むと推測される画素の集合である。候補検出部36は、検出した文字候補を候補記憶部38に書き込む。   The candidate detection unit 36 detects a character candidate from the input image based on the format data stored in the format data storage unit 34. Each character candidate is a set of pixels estimated to include one character. The candidate detection unit 36 writes the detected character candidate in the candidate storage unit 38.

候補記憶部38は、文字候補を記憶する。さらに、候補記憶部38は、文字候補のそれぞれに対応させて、その文字候補の認識結果の候補の文字である認識候補を記憶する。   The candidate storage unit 38 stores character candidates. Furthermore, the candidate memory | storage part 38 memorize | stores the recognition candidate which is a candidate character of the recognition result of the character candidate corresponding to each of a character candidate.

文字認識辞書記憶部40は、文字認識辞書を記憶する。文字認識辞書は、認識対象の画像と、予め登録された文字のそれぞれとの類似度を算出するための情報を格納する。   The character recognition dictionary storage unit 40 stores a character recognition dictionary. The character recognition dictionary stores information for calculating the degree of similarity between the image to be recognized and each character registered in advance.

認識部42は、文字認識辞書記憶部40に記憶された文字認識辞書に基づいて、候補記憶部38に記憶された文字候補のそれぞれを認識する。そして、認識部42は、1つの文字候補に対して、認識結果の候補の文字である表す少なくとも1つの認識候補を生成する。認識部42は、生成した少なくとも1つの認識候補を、文字候補に対応付けて候補記憶部38に書き込む。   The recognition unit 42 recognizes each of the character candidates stored in the candidate storage unit 38 based on the character recognition dictionary stored in the character recognition dictionary storage unit 40. Then, the recognition unit 42 generates at least one recognition candidate representing a recognition result candidate character for one character candidate. The recognition unit 42 writes the generated at least one recognition candidate in the candidate storage unit 38 in association with the character candidate.

知識辞書記憶部44は、認識対象の文字列をモデル化した知識辞書を記憶する。本実施形態においては、知識辞書は、認識対象の文字列をモデル化した決定性有限オートマトンである。知識辞書は、エッジに、文字を表す実文字コードおよび、命令を指定する仮想文字コードのいずれか一方が割り当てられている。   The knowledge dictionary storage unit 44 stores a knowledge dictionary obtained by modeling a character string to be recognized. In the present embodiment, the knowledge dictionary is a deterministic finite automaton that models a character string to be recognized. In the knowledge dictionary, one of a real character code representing a character and a virtual character code designating a command is assigned to the edge.

照合部46は、少なくとも1つの認識候補のそれぞれを知識辞書と照合して、入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する。この過程において、照合部46は、認識候補が割り当てられたエッジに従って知識辞書の状態を順次に遷移させることにより、照合を行う。また、照合部46は、対応する文字列の尤もらしさを表すスコアを含む照合結果を生成する。そして、照合部46は、生成した照合結果を照合結果記憶部48に書き込む。   The collation unit 46 collates each of at least one recognition candidate with the knowledge dictionary, and generates a collation result obtained by collating the character string estimated to be included in the input image with the knowledge dictionary. In this process, the collation unit 46 performs collation by sequentially changing the state of the knowledge dictionary according to the edge to which the recognition candidate is assigned. Moreover, the collation part 46 produces | generates the collation result containing the score showing the likelihood of a corresponding character string. Then, the matching unit 46 writes the generated matching result in the matching result storage unit 48.

さらに、照合部46は、仮想文字コードが割り当てられたエッジに従って知識辞書の状態を遷移させる場合、当該エッジに割り当てられた仮想文字コードにより指定された命令を命令処理部51に与える。   Furthermore, when the state of the knowledge dictionary is changed according to the edge to which the virtual character code is assigned, the matching unit 46 gives the instruction specified by the virtual character code assigned to the edge to the instruction processing unit 51.

照合結果記憶部48は、照合部46により生成された照合結果を記憶する。照合結果記憶部48は、文字候補の認識候補を並べて得られる文字列を先頭から知識辞書と照合していく過程における開始時点、途中段階および完了時点での照合結果を記憶する。なお、照合部46は、照合の途中段階において、記憶領域を節約することを目的として、スコアの低い照合結果を削除してもよい。   The verification result storage unit 48 stores the verification result generated by the verification unit 46. The collation result storage unit 48 stores collation results at the start point, the middle stage, and the completion point in the process of collating character strings obtained by arranging recognition candidates of character candidates with the knowledge dictionary from the top. Note that the collation unit 46 may delete a collation result having a low score for the purpose of saving the storage area in the middle of the collation.

命令処理部51は、照合部46から与えられた命令を実行する。命令処理部51は、一例として、スコアに指定された値を加算する処理または文字間のスペースを確認する処理等を実行する。   The instruction processing unit 51 executes the instruction given from the collation unit 46. For example, the command processing unit 51 executes a process of adding a value designated to the score or a process of checking a space between characters.

結果抽出部54は、照合部46による照合および命令処理部51による処理が全て完了した後において、照合結果記憶部48に記憶された照合結果からスコアに基づき1個以上の照合結果を選択し、選択した1個以上の照合結果により特定される文字列を抽出する。結果抽出部54は、一例として、スコアが最も良い照合結果により特定される文字列を抽出する。   The result extraction unit 54 selects one or more collation results based on the scores from the collation results stored in the collation result storage unit 48 after the collation by the collation unit 46 and the processing by the instruction processing unit 51 are all completed. A character string specified by one or more selected matching results is extracted. As an example, the result extraction unit 54 extracts a character string specified by a matching result having the best score.

出力部56は、結果抽出部54により抽出された文字列を外部へと出力する。   The output unit 56 outputs the character string extracted by the result extraction unit 54 to the outside.

図2は、実施形態に係る認識装置10の処理を示すフロー図である。まず、ステップS1において、認識装置10は、入力画像を入力する。   FIG. 2 is a flowchart showing processing of the recognition apparatus 10 according to the embodiment. First, in step S1, the recognition apparatus 10 inputs an input image.

続いて、ステップS2において、認識装置10は、入力画像から、1つの文字を含むと推測される画素の集合である文字候補を検出する。続いて、ステップS3において、認識装置10は、文字認識辞書に基づいて、文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する。   Subsequently, in step S <b> 2, the recognition apparatus 10 detects a character candidate that is a set of pixels presumed to include one character from the input image. Subsequently, in step S3, the recognition apparatus 10 recognizes each of the character candidates based on the character recognition dictionary, and generates at least one recognition candidate that is a candidate character of the recognition result.

続いて、ステップS4において、認識装置10は、少なくとも1つの認識候補のそれぞれを知識辞書と照合して、入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する。これとともに、ステップS4において、認識装置10は、仮想文字コードが割り当てられたエッジに従って知識辞書の状態を遷移させる場合、当該エッジに割り当てられた仮想文字コードにより指定された命令を実行する。   Subsequently, in step S4, the recognition apparatus 10 collates each knowledge candidate with at least one recognition candidate, and obtains a collation result obtained by collating the character string estimated to be included in the input image with the knowledge dictionary. Generate. At the same time, in step S4, when the recognition device 10 changes the state of the knowledge dictionary according to the edge to which the virtual character code is assigned, the recognition device 10 executes the instruction specified by the virtual character code assigned to the edge.

続いて、ステップS5において、認識装置10は、照合処理が全て完了した後において、照合結果からスコアに基づき1つの照合結果を選択し、選択した照合結果により特定される文字列を抽出し、認識結果の文字列とする。文字候補の個数が0個の場合、すなわち入力画像上に文字が含まれない場合、ステップS5において選択すべき照合結果が生成されないが、この場合は認識結果の文字列を空文字列とする。最後に、ステップS6において、認識装置10は、認識結果の文字列を出力する。   Subsequently, in step S5, the recognition device 10 selects one collation result based on the score from the collation result after extracting all the collation processes, extracts a character string specified by the selected collation result, and recognizes it. The result string. When the number of character candidates is 0, that is, when no character is included in the input image, a collation result to be selected is not generated in step S5. In this case, the character string of the recognition result is an empty character string. Finally, in step S6, the recognition device 10 outputs a character string as a recognition result.

図3は、入力画像の一例を示す図である。本実施形態において、入力画像は、図3に示すように、商品を発注するための注文書をスキャナ等により取り込んで得られた画像データである。入力画像の予め定められた記入枠の内側には、発注者の名前が記入されている。本実施形態において、認識装置10は、予め定められた記入枠の内側に記入された日本語の名前の文字列を認識し、認識した文字列を表すテキストデータを出力する。   FIG. 3 is a diagram illustrating an example of an input image. In the present embodiment, as shown in FIG. 3, the input image is image data obtained by taking an order form for ordering a product with a scanner or the like. The name of the orderer is entered inside a predetermined entry frame of the input image. In the present embodiment, the recognition apparatus 10 recognizes a character string with a Japanese name entered inside a predetermined entry frame, and outputs text data representing the recognized character string.

図4は、様式データの構成を示す図である。様式データ記憶部34は、予め作成された様式データを記憶する。   FIG. 4 is a diagram showing the configuration of style data. The form data storage unit 34 stores form data created in advance.

様式データは、図4に示すように、入力画像に含まれる記入枠の個数を示す値と、記入枠の個数分の記入枠レコードを格納する配列を含む。本例において、配列の最初のエントリのインデックスは、0である。すなわち、配列は、0オリジンである。なお、本実施形態で用いる他の配列も、特別の記載が無い限り0オリジンである。記入枠レコードのそれぞれは、入力画像に含まれるそれぞれの記入枠に一対一で対応する。   As shown in FIG. 4, the format data includes a value indicating the number of entry frames included in the input image and an array for storing entry frame records for the number of entry frames. In this example, the index of the first entry in the array is zero. That is, the sequence is 0 origin. Other sequences used in this embodiment are also 0 origin unless otherwise specified. Each entry frame record corresponds to each entry frame included in the input image on a one-to-one basis.

それぞれの記入枠レコードは、入力画像内における、対応する記入枠の位置を示す情報を含む。本例において、記入枠の位置を示す情報は、対応する記入枠の左右の端のX座標(横方向の座標)および上下の端のY座標(縦方向の座標)である。   Each entry frame record includes information indicating the position of the corresponding entry frame in the input image. In this example, the information indicating the position of the entry frame is the X coordinate (horizontal coordinate) of the left and right ends and the Y coordinate (vertical coordinate) of the upper and lower ends of the corresponding entry frame.

図5は、入力画像から一連の文字候補を生成する処理を示す図である。候補検出部36は、記入枠レコードに示された情報に基づいて記入枠の領域を特定し(例えば図5中の点線で囲まれた領域)、特定した領域から部分領域画像を抽出する。続いて、候補検出部36は、抽出した部分領域画像を二値化して二値画像を生成する。続いて、候補検出部36は、二値画像上で黒画素の連結成分を抽出し、それぞれの連結成分に対してラベリングを行う。ラベリングしたそれぞれの連結成分は、文字を構成する要素であり、断片と呼ぶ。続いて、候補検出部36は、連続して並んだ1個以上の断片を組み合わせて、文字候補を生成する。文字候補は、1個の文字を表していると推測される画素の集合である。   FIG. 5 is a diagram illustrating a process for generating a series of character candidates from an input image. The candidate detection unit 36 specifies an area of the entry frame based on the information indicated in the entry frame record (for example, an area surrounded by a dotted line in FIG. 5), and extracts a partial area image from the specified area. Subsequently, the candidate detection unit 36 binarizes the extracted partial region image to generate a binary image. Subsequently, the candidate detection unit 36 extracts black pixel connected components on the binary image and performs labeling on each connected component. Each labeled connected component is an element constituting a character and is called a fragment. Subsequently, the candidate detection unit 36 generates a character candidate by combining one or more pieces arranged in a row. A character candidate is a set of pixels presumed to represent one character.

図6は、断片データの構成を示す図である。候補記憶部38は、断片を表す断片データを記憶する。断片データは、図6に示すように、断片の個数を示す値と、断片の個数分の断片レコードを格納する配列を含む。断片レコードのそれぞれは、それぞれの断片と一対一で対応する。   FIG. 6 is a diagram showing the structure of fragment data. The candidate storage unit 38 stores fragment data representing a fragment. As shown in FIG. 6, the fragment data includes a value indicating the number of fragments and an array for storing fragment records for the number of fragments. Each fragment record has a one-to-one correspondence with each fragment.

それぞれの断片レコードは、対応する断片の位置を示す情報と、断片の形状を示す二値画像を含む。本例において、断片の位置を示す情報は、対応する断片の左右の端のX座標および上下の端のY座標であり、当該断片の外接矩形を示す。断片の形状を示す二値画像は、当該断片の外接矩形内で当該連結成分上の画素を黒画素とし、残りを白画素とした画像である。   Each fragment record includes information indicating the position of the corresponding fragment and a binary image indicating the shape of the fragment. In this example, the information indicating the position of the fragment is the X coordinate of the left and right ends of the corresponding fragment and the Y coordinate of the upper and lower ends, and indicates the circumscribed rectangle of the fragment. A binary image indicating the shape of a fragment is an image in which pixels on the connected component are black pixels and the rest are white pixels in a circumscribed rectangle of the fragment.

候補検出部36は、それぞれの断片について、中心のX座標と、中心のY座標を算出する。中心のX座標は、左右の端のX座標の平均値である。中心のY座標は、上下の端のY座標の平均値である。そして、候補検出部36は、配列内の複数の断片レコードを、中心のX座標の昇順に整列する。これにより、候補検出部36は、配列内の複数の断片レコードを、記入枠における文字記入方向(本例では左から右に向かう方向)に整列することができる。   The candidate detection unit 36 calculates the center X coordinate and the center Y coordinate for each fragment. The center X coordinate is an average value of the X coordinates of the left and right ends. The center Y coordinate is an average value of the Y coordinates of the upper and lower ends. Then, the candidate detection unit 36 sorts the plurality of fragment records in the array in ascending order of the center X coordinate. Thereby, the candidate detection unit 36 can align the plurality of fragment records in the array in the character entry direction in the entry frame (in this example, the direction from left to right).

図7は、断片番号の一例を示す図である。それぞれの断片レコードは、配列のインデックスにより識別される。断片レコードを文字記入方向に整列した後のインデックスを、断片番号と呼ぶ。従って、それぞれの断片には、図7に示すように断片番号が対応付けられる。   FIG. 7 is a diagram illustrating an example of a fragment number. Each fragment record is identified by an array index. The index after the fragment records are arranged in the character entry direction is called a fragment number. Therefore, each fragment is associated with a fragment number as shown in FIG.

図8は、文字候補データの構成を示す図である。候補検出部36は、連続して並んだ1個以上の断片を組み合わせて、文字候補を生成する。この過程において、候補検出部36は、外接の矩形の横幅Lが予め定められた長さ(Lmax)以下となる全てのパターンで1個以上の断片を組み合わせて、文字候補を生成する。   FIG. 8 is a diagram illustrating a configuration of character candidate data. The candidate detection unit 36 generates a character candidate by combining one or more pieces arranged in a row. In this process, the candidate detection unit 36 generates a character candidate by combining one or more fragments in all patterns in which the lateral width L of the circumscribed rectangle is equal to or less than a predetermined length (Lmax).

候補記憶部38は、文字候補を表す文字候補データを記憶する。文字候補データは、図8に示すように、生成した文字候補の個数を示す値と、文字候補マトリクス(詳細後述)と、文字候補の個数分の文字候補レコードを格納する配列を含む。文字候補レコードのそれぞれは、それぞれの文字候補と一対一で対応する。   The candidate storage unit 38 stores character candidate data representing character candidates. As shown in FIG. 8, the character candidate data includes a value indicating the number of generated character candidates, a character candidate matrix (described later in detail), and an array for storing character candidate records for the number of character candidates. Each character candidate record has a one-to-one correspondence with each character candidate.

それぞれの文字候補レコードは、対応する文字候補の位置を示す情報と、対応する文字候補の始点番号および終点番号(詳細後述)と、文字候補の形状を示す二値画像と、認識候補エントリを含む認識候補の配列(詳細後述)を含む。本例において、文字候補の位置を示す情報は、対応する文字候補の左右の端のX座標および上下の端のY座標であり、二値画像上での当該文字候補の外接矩形を示す。文字候補の形状を示す二値画像は、当該文字候補の外接矩形内で当該文字候補上の画素を黒画素とし、残りを白画素とした画像である。認識候補エントリは、認識部42により値が設定され、候補検出部36では値は設定されない。   Each character candidate record includes information indicating the position of the corresponding character candidate, a start point number and an end point number (described later in detail) of the corresponding character candidate, a binary image indicating the shape of the character candidate, and a recognition candidate entry. Includes recognition candidate sequences (described in detail below). In this example, the information indicating the position of the character candidate is the X coordinate of the left and right ends and the Y coordinate of the upper and lower ends of the corresponding character candidate, and indicates the circumscribed rectangle of the character candidate on the binary image. A binary image showing the shape of a character candidate is an image in which the pixels on the character candidate are black pixels and the rest are white pixels in the circumscribed rectangle of the character candidate. A value of the recognition candidate entry is set by the recognition unit 42, and no value is set by the candidate detection unit 36.

図9は、文字候補番号の一例を示す図である。それぞれの文字候補レコードは、配列のインデックスにより識別される。文字候補レコードのインデックスを、文字候補番号と呼ぶ。従って、それぞれの文字候補には、図9に示すように文字候補番号が対応付けられる。   FIG. 9 is a diagram illustrating an example of character candidate numbers. Each character candidate record is identified by an array index. The index of the character candidate record is called a character candidate number. Therefore, a character candidate number is associated with each character candidate as shown in FIG.

図10は、文字候補の始点番号および終点番号の一例を示す図である。文字候補は、連続して並んだ1個以上の断片を組み合わせて生成される。このため文字候補は、元となった1個以上の断片の並びのうちの先頭の断片に対する断片番号と、最後の断片に対する断片番号に1を加算した値とのセットで、一意に識別することができる。   FIG. 10 is a diagram illustrating an example of the start point number and end point number of a character candidate. Character candidates are generated by combining one or more pieces arranged in series. For this reason, character candidates are uniquely identified by a set of a fragment number for the first fragment in the sequence of one or more fragments as a source and a value obtained by adding 1 to the fragment number for the last fragment. Can do.

本実施形態では、先頭の断片に対する断片番号を、その文字候補の始点番号と呼び、最後の断片に対する断片番号に1を加算した値を、その文字候補の終点番号と呼ぶ。従って、それぞれの文字候補には、図10に示すように、始点番号および終点番号が対応付けられる。なお、始点番号および終点番号は、文字候補の区切り位置を表すことから、始点番号および終点番号の両者をまとめて位置番号とも呼ぶ。   In this embodiment, the fragment number for the first fragment is called the start point number of the character candidate, and the value obtained by adding 1 to the fragment number for the last fragment is called the end point number of the character candidate. Accordingly, each character candidate is associated with a start point number and an end point number as shown in FIG. Note that the start point number and the end point number represent character character delimiter positions, and thus both the start point number and the end point number are collectively referred to as position numbers.

図11は、文字候補マトリクスの一例を示す図である。文字候補マトリクスは、図11に示すように、始点番号を第1インデックス、終点番号を第2インデックスとする文字候補番号の二次元配列である。文字候補マトリクスは、文字候補レコードの生成の開始前に、全てのエントリを−1に設定することで初期化される。そして、候補検出部36は、文字候補を作成する毎に、文字候補マトリクスの対応するエントリに文字候補番号を書き込む。   FIG. 11 is a diagram illustrating an example of a character candidate matrix. As shown in FIG. 11, the character candidate matrix is a two-dimensional array of character candidate numbers having a start point number as a first index and an end point number as a second index. The character candidate matrix is initialized by setting all entries to -1 before starting the generation of character candidate records. Each time the candidate detection unit 36 creates a character candidate, it writes the character candidate number in the corresponding entry of the character candidate matrix.

図12は、文字認識辞書の構成を示す図である。文字認識辞書記憶部40は、予め作成された文字認識辞書を記憶する。文字認識辞書は、図12に示すように、辞書エントリの個数を示す値と、辞書エントリを格納する配列を含む。   FIG. 12 is a diagram showing the configuration of the character recognition dictionary. The character recognition dictionary storage unit 40 stores a character recognition dictionary created in advance. As shown in FIG. 12, the character recognition dictionary includes a value indicating the number of dictionary entries and an array for storing dictionary entries.

それぞれの辞書エントリは、文字コードと、予め定められたDsub個の基底ベクトルを含む。基底ベクトルは、文字コードに対応する文字を表す部分空間の特徴ベクトルである。特徴ベクトルは、一例として、対応する文字の二値画像を縦方向および横方向に予め任意に定めた個数で分割し、分割した領域のそれぞれの黒画素の個数の比率を求め、求めた一連の比率を特徴ベクトルの要素とすることで算出される。 Each dictionary entry includes a character code and predetermined D sub basis vectors. A base vector is a feature vector of a subspace representing a character corresponding to a character code. As an example, the feature vector is obtained by dividing a binary image of a corresponding character by a predetermined number in the vertical direction and the horizontal direction, obtaining a ratio of the number of black pixels in each divided area, It is calculated by using the ratio as an element of the feature vector.

図13は、認識候補の配列の構成を示す図である。文字候補レコードに格納される認識候補の配列は、図13に示すように、予め定められたNcand個の認識候補エントリを含む。それぞれの認識候補エントリは、文字コードと、類似度を含む。 FIG. 13 is a diagram showing the configuration of recognition candidate sequences. The recognition candidate array stored in the character candidate record includes predetermined N cand recognition candidate entries as shown in FIG. Each recognition candidate entry includes a character code and a similarity.

認識部42は、文字候補のそれぞれに対して文字認識をして、認識結果の候補の文字である少なくとも1つの認識候補を生成する。本実施形態においては、認識部42は、それぞれの文字候補レコードに対して、予め定められたNcand個の認識候補エントリを生成して、認識候補の配列に書き込む。 The recognition unit 42 performs character recognition for each of the character candidates, and generates at least one recognition candidate that is a candidate character of the recognition result. In the present embodiment, the recognition unit 42 generates N cand recognition candidate entries determined in advance for each character candidate record, and writes them in the recognition candidate array.

より具体的には、認識部42は、対応する文字候補レコードに含まれる二値画像から特徴ベクトルを抽出し、文字認識辞書のそれぞれの辞書エントリに格納された基底ベクトルと部分空間法により照合して類似度を算出する。認識部42は、類似度が上位Ncand個の辞書エントリのそれぞれについて、その辞書エントリに格納された文字コードを抽出し、抽出した文字コードと算出した類似度を含む認識候補エントリを生成する。そして、認識部42は、生成したNcand個の認識候補エントリを対応する文字候補レコードの認識候補の配列に書き込む。さらに、認識部42は、それぞれの文字候補レコードの認識候補の配列に含まれる認識候補エントリを、類似度の降順で整列する。 More specifically, the recognition unit 42 extracts a feature vector from a binary image included in the corresponding character candidate record, and collates it with a base vector stored in each dictionary entry of the character recognition dictionary by a subspace method. To calculate the similarity. The recognizing unit 42 extracts the character code stored in the dictionary entry for each of the top N cand dictionary entries having the similarity, and generates a recognition candidate entry including the extracted character code and the calculated similarity. Then, the recognition unit 42 writes the generated N cand recognition candidate entries in the recognition candidate array of the corresponding character candidate record. Furthermore, the recognition unit 42 arranges the recognition candidate entries included in the recognition candidate arrays of the respective character candidate records in descending order of similarity.

図14は、知識辞書の構成を示す図である。知識辞書記憶部44は、設計者等が予め作成した知識辞書を記憶する。   FIG. 14 is a diagram illustrating a configuration of the knowledge dictionary. The knowledge dictionary storage unit 44 stores a knowledge dictionary created in advance by a designer or the like.

本実施形態において、知識辞書は、認識対象の文字列をモデル化した決定性有限オートマトンである。本実施形態では、決定性有限オートマトンである知識辞書を、DFAαとも呼ぶ。DFAαは、例えば、設計者が認識対象の文字列を正規表現で記述し、その正規表現を決定性有限オートマトンに変換することで生成される。正規表現から非決定性有限オートマトンまたは決定性有限オートマトンを生成する方法、非決定性有限オートマトンから決定性有限オートマトンを生成する方法は、例えば、A.V.エイホ,R.セシィ,J.D.ウルマン著、原田健一訳、コンパイラI,初版 1986、pp.134−172等に記載されている。   In the present embodiment, the knowledge dictionary is a deterministic finite automaton that models a character string to be recognized. In the present embodiment, a knowledge dictionary that is a deterministic finite automaton is also referred to as DFAα. For example, DFAα is generated by a designer describing a character string to be recognized in a regular expression and converting the regular expression into a deterministic finite automaton. A method for generating a nondeterministic finite automaton or a deterministic finite automaton from a regular expression, and a method for generating a deterministic finite automaton from a nondeterministic finite automaton are disclosed in, for example, A. V. Aiho, R.A. Cessie, J.H. D. Written by Ullman, translated by Kenichi Harada, Compiler I, first edition 1986, pp. 134-172 and the like.

DFAαは、図14に示すように、状態数を示す値と、状態の数分の状態レコードを格納する状態配列と、エッジの数分のエッジレコードを格納するエッジ配列を含む。   As shown in FIG. 14, DFAα includes a value indicating the number of states, a state array for storing state records for the number of states, and an edge array for storing edge records for the number of edges.

それぞれの状態レコードは、DFAαに含まれるそれぞれの状態と一対一に対応し、状態は状態レコードの番号すなわち状態番号で一意に識別される。なお、状態配列は0オリジンであり、従って状態番号が0の状態は開始状態である。それぞれの状態レコードは、受理状態フラグと、エッジ配列内のエッジレコードへのポインタと、エッジレコードの要素数を含む。   Each state record has a one-to-one correspondence with each state included in DFAα, and the state is uniquely identified by the number of the state record, that is, the state number. It should be noted that the state array is 0 origin, and therefore the state with the state number 0 is the start state. Each status record includes an acceptance status flag, a pointer to the edge record in the edge array, and the number of elements in the edge record.

受理状態フラグは、当該状態が受理状態であるか否かを示す。受理状態フラグは、一例として、1の場合に受理状態であることを示し、0の場合に受理状態ではないことを示す。   The acceptance state flag indicates whether or not the state is an acceptance state. As an example, the acceptance status flag indicates that it is in an acceptance state when it is 1, and indicates that it is not in an acceptance state when it is 0.

エッジレコードへのポインタは、エッジ配列内における、当該状態から出て行くエッジの集合の格納位置を示す。エッジレコードの要素数は、当該状態から出て行くエッジの個数を表す。エッジレコードへのポインタおよび要素数により、当該状態から出て行く全てのエッジに対応するエッジレコードを特定することができる。   The pointer to the edge record indicates the storage position of the set of edges that exit from the state in the edge array. The number of elements in the edge record represents the number of edges that exit from the state. The edge record corresponding to all the edges going out from the state can be specified by the pointer to the edge record and the number of elements.

それぞれのエッジレコードは、DFAαに含まれるそれぞれのエッジと一対一に対応する。それぞれのエッジレコードは、遷移先の状態番号と、コードを含む。   Each edge record has a one-to-one correspondence with each edge included in DFAα. Each edge record includes a transition destination state number and a code.

遷移先の状態番号は、当該エッジによる遷移先の状態を特定する状態番号を表す。なお、状態番号が0の状態は、開始状態である。   The state number of the transition destination represents a state number that specifies the state of the transition destination by the edge. Note that the state having a state number of 0 is a start state.

コードは、当該エッジにより表される遷移を起こす入力記号を表す。本実施形態においては、コードには、文字を表す実文字コードまたは、命令を指定する仮想文字コードが格納される。DFAαでは、エッジに実文字コードが割り当てられている場合には、認識候補の文字を表す文字コードにより、そのエッジに従ってある状態から他の状態への遷移が起きる。また、DFAαでは、エッジに仮想文字コードが割り当てられている場合には、認識候補の文字に関わらず、そのエッジに従ってある状態から他の状態へと遷移が起きるとともに、仮想文字コードにより指定された命令コードが出力される。   The code represents the input symbol that causes the transition represented by the edge. In the present embodiment, the code stores a real character code representing a character or a virtual character code designating an instruction. In DFAα, when an actual character code is assigned to an edge, a transition from one state to another state occurs according to the edge by a character code representing a recognition candidate character. In addition, in DFAα, when a virtual character code is assigned to an edge, a transition occurs from one state to another state according to the edge regardless of the recognition candidate character, and the virtual character code is designated. The instruction code is output.

図15は、コードの符号化方法の一例を示す図である。知識辞書のエッジレコードに含まれるコードは、一例として、先頭のビットが符号ビットを表し、2番目のビットが実文字コードか仮想文字コードかの区別を表す。例えば、2番目のビットが0の場合には、実文字コードを表し、2番目のビットが1の場合には仮想文字コードを表し、当該コードにより後述の命令コードが指定される。   FIG. 15 is a diagram illustrating an example of a code encoding method. As an example, the code included in the edge record of the knowledge dictionary represents the distinction between the first bit representing a sign bit and the second bit representing a real character code or a virtual character code. For example, when the second bit is 0, it represents an actual character code, and when the second bit is 1, it represents a virtual character code, and an instruction code described later is designated by the code.

図16は、命令データの一例を示す図である。命令処理部51は、コマンドインタプリタを実行し、仮想文字コードにより指定された命令コードを解釈して、命令コードで定義された処理を実行する。命令データは、例えば、文字列の配列で定義され、仮想文字コードの上位2ビットを0で置き換えた番号を配列の要素の番号とすることで指定される。例えば、図16の命令コード#0は「ADD_SCORE 300」と文字列で記述されており、後述するスコアに指定された値300を加算する加算命令である。また、例えば、図16の命令コード#1は「CHEK_SPACE 5mm」と文字列で記述されており、文字間のスペースが5mm以上であるかを確認する間隔確認命令である。   FIG. 16 is a diagram illustrating an example of instruction data. The instruction processing unit 51 executes a command interpreter, interprets an instruction code specified by a virtual character code, and executes a process defined by the instruction code. The instruction data is defined by, for example, an array of character strings, and is specified by using the number obtained by replacing the upper 2 bits of the virtual character code with 0 as the element number of the array. For example, the instruction code # 0 in FIG. 16 is described as a character string “ADD_SCORE 300”, and is an addition instruction for adding a value 300 designated to a score to be described later. Further, for example, the instruction code # 1 in FIG. 16 is described as a character string “CHEK_SPACE 5 mm”, and is an interval confirmation instruction for confirming whether the space between characters is 5 mm or more.

図17は、照合結果データの構成を示す図である。照合部46は、文字候補に含まれる認識候補のそれぞれを、先頭から順次に知識辞書と照合して、入力画像の記入枠内に記載されていると推測される文字列と知識辞書を照合して得られる照合結果を生成する。そして、照合部46は、生成した照合結果を、照合結果記憶部48に書き込む。   FIG. 17 is a diagram illustrating a configuration of the collation result data. The collation unit 46 collates each of the recognition candidates included in the character candidates with the knowledge dictionary sequentially from the top, and collates the character string estimated to be described in the entry frame of the input image with the knowledge dictionary. The verification result obtained is obtained. Then, the matching unit 46 writes the generated matching result in the matching result storage unit 48.

照合結果記憶部48は、照合結果データを記憶する。照合結果データは、それぞれの位置番号毎に、照合結果の個数と、照合結果の配列含む。   The verification result storage unit 48 stores verification result data. The matching result data includes the number of matching results and an array of matching results for each position number.

照合結果の個数は、当該位置番号に関連付けられた照合結果の個数を表す。照合結果の配列は、当該位置番号に関連付けられた照合結果を格納する。それぞれの照合結果は、状態番号αと、スコアと、コードと、位置番号および照合結果の番号のペア含む。また、それぞれの照合結果は、格納先の配列が関連付けられた位置番号および、格納先の配列内での配列要素としての番号のペアで一意に識別される。以降では、照合結果の格納先の配列が関連付けられた位置番号を「照合結果が関連付けられた位置番号」、照合結果の格納先の配列内での配列要素としての番号を「照合結果の番号」と呼称する。   The number of matching results represents the number of matching results associated with the position number. The collation result array stores the collation result associated with the position number. Each collation result includes a pair of a state number α, a score, a code, a position number, and a collation result number. Each collation result is uniquely identified by a pair of a position number associated with the storage destination array and a number as an array element in the storage destination array. From now on, the position number associated with the collation result storage array is referred to as "position number associated with the collation result", and the number as the array element in the collation result storage array is referred to as "collation result number". It is called.

状態番号αは、知識辞書(DFAα)の状態を表す。すなわち、状態番号αは、先頭の認識候補から当該位置の認識候補までのそれぞれの文字に応じて、DFAαを開始状態から順次に遷移させた場合に到達する状態を示す。   The state number α represents the state of the knowledge dictionary (DFAα). That is, the state number α indicates a state reached when DFAα is sequentially shifted from the start state in accordance with each character from the first recognition candidate to the recognition candidate at the position.

スコアは、先頭の認識候補から当該位置の認識候補までのそれぞれに対応付けられた類似度を累積した値を表す。すなわち、スコアは、先頭の認識候補から当該位置の認識候補までの文字列の尤もらしさを表す。コードは、当該位置の認識候補の文字を表す文字コードである。   The score represents a value obtained by accumulating the degrees of similarity associated with the recognition candidates at the head to the recognition candidates at the position. That is, the score represents the likelihood of the character string from the first recognition candidate to the recognition candidate at the position. The code is a character code representing a recognition candidate character at the position.

位置番号および照合結果の番号のペアは、先頭から当該位置まで1個ずつ文字候補をたどりながら文字候補の認識候補を入力記号としてDFAαを遷移させながら照合結果を生成していく過程における、直前の照合結果が関連付けられた位置番号および、直前の照合結果の番号を表す。位置番号および照合結果の番号のペアは、結果抽出部54が認識結果の文字列を抽出する際に参照される。   The pair of the position number and the number of the matching result is obtained immediately after the character candidate is traced one by one from the head to the corresponding position while the matching result is generated while the DFAα is transitioned using the character candidate recognition candidate as the input symbol. It represents the position number associated with the collation result and the number of the previous collation result. The pair of the position number and the collation result number is referred to when the result extraction unit 54 extracts the character string of the recognition result.

図18は、照合処理を示すフロー図である。図2のステップS4に示した照合処理の詳細について図18を参照して説明する。   FIG. 18 is a flowchart showing the matching process. Details of the collation process shown in step S4 of FIG. 2 will be described with reference to FIG.

まず、ステップS11において、照合部46は、照合結果データを初期化する。具体的には、照合部46は、照合結果データの全ての位置番号について、照合結果の個数を0に設定するとともに、照合結果の配列を空にする。   First, in step S11, the collation unit 46 initializes collation result data. Specifically, the collation unit 46 sets the number of collation results to 0 for all the position numbers of the collation result data and empties the collation result array.

続いて、ステップS12において、照合部46は、位置番号0に関連付けて、新たな1つの照合結果を生成する。新たな1つの照合結果は、状態番号αが0に、スコアが0に、位置番号および照合結果の番号が−1に、コードが−1に設定される。続いて、ステップS13において、照合部46は、位置番号0に関連付けられた照合結果の個数を1に設定する。続いて、ステップS14において、照合部46は、位置番号を表す変数Pstに0を代入する。   Subsequently, in step S12, the collation unit 46 generates a new collation result in association with the position number 0. For one new collation result, the state number α is set to 0, the score is set to 0, the position number and the collation result number are set to -1, and the code is set to -1. Subsequently, in step S13, the matching unit 46 sets the number of matching results associated with the position number 0 to 1. Subsequently, in step S14, the collation unit 46 substitutes 0 for a variable Pst representing the position number.

続いて、ステップS15において、照合部46は、Pstが、Pstmax以下であるか否かを判断する。Pstmaxは、最後の位置番号Pedから1を減じた値である。照合部46は、PstがPstmax以下である場合(ステップS15の真)、処理をステップS16に進める。   Subsequently, in step S15, the collation unit 46 determines whether or not Pst is equal to or less than Pstmax. Pstmax is a value obtained by subtracting 1 from the last position number Ped. When Pst is equal to or less than Pstmax (true in step S15), the collation unit 46 advances the process to step S16.

ステップS16において、照合部46は、対応する状態から出て行くエッジに、仮想文字コードが割り当てられたエッジが存在するかを判断する。そして、照合部46は、仮想文字コードが割り当てられたエッジが存在する場合には、状態を遷移させるとともに、仮想文字コードにより指定された命令コードを命令処理部51に与えて、命令を実行させる。なお、命令の実行処理の詳細については、図21および図22を参照して後述する。   In step S <b> 16, the collation unit 46 determines whether an edge to which a virtual character code is assigned exists at an edge that exits from the corresponding state. Then, when there is an edge to which the virtual character code is assigned, the collating unit 46 changes the state and gives the instruction processing unit 51 the instruction code specified by the virtual character code to execute the instruction. . The details of the instruction execution process will be described later with reference to FIGS.

続いて、ステップS17において、照合部46は、Pstに関連付けられた照合結果を、スコアが最上位からNpr番目までに絞り込む。すなわち、照合部46は、スコアがNpr番目より低い照合結果を削除する。   Subsequently, in step S <b> 17, the matching unit 46 narrows down the matching results associated with Pst from the highest score to the Npr-th score. That is, the matching unit 46 deletes the matching result whose score is lower than the Nprth.

続いて、ステップS18において、照合部46は、Pstに関連付けられたそれぞれの照合結果に対して、知識辞書を用いて知識辞書探索処理を実行する。これにより、照合部46は、Pstより後ろの位置番号に関連付けた新たな照合結果を生成することができる。なお、知識辞書探索処理については、図19および図20を参照して後述する。   Subsequently, in step S18, the collation unit 46 executes a knowledge dictionary search process using the knowledge dictionary for each collation result associated with Pst. Thereby, the collation part 46 can produce | generate the new collation result linked | related with the position number after Pst. The knowledge dictionary search process will be described later with reference to FIGS. 19 and 20.

続いて、ステップS19において、照合部46は、Pstに1を加算する。照合部46は、ステップS19を終了すると、処理をステップS15に戻す。そして、照合部46は、PstがPstmaxを超えるまで、ステップS16からステップS19の処理を繰り返す。   Subsequently, in step S19, the collation unit 46 adds 1 to Pst. The collation part 46 will return a process to step S15, after complete | finishing step S19. And the collation part 46 repeats the process of step S16 to step S19 until Pst exceeds Pstmax.

PstがPstmax以下ではなくなった場合(ステップS15の偽)、照合部46は、処理をステップS20に進める。ステップS20において、照合部46は、最後の位置番号Pedに関連付けられたそれぞれの照合結果について、ステップS16と同様の処理を実行する。そして、照合部46は、ステップS20の処理を終えると、本フローを終了する。   When Pst is no longer equal to or less than Pstmax (No in step S15), the collation unit 46 advances the process to step S20. In step S20, the matching unit 46 performs the same process as in step S16 on each matching result associated with the last position number Ped. And the collation part 46 complete | finishes this flow, after finishing the process of step S20.

図19は、知識辞書探索処理を示すフローチャートである。図20は、知識辞書探索処理でのデータアクセスの流れの一例を示す。   FIG. 19 is a flowchart showing the knowledge dictionary search process. FIG. 20 shows an example of the flow of data access in the knowledge dictionary search process.

図19および図20を参照しながら、図18のステップS18の知識辞書探索処理を説明する。まず、ステップS31において、照合部46は、照合結果データを参照し、Pstに関連付けられた全ての照合結果を列挙する。   The knowledge dictionary search process in step S18 of FIG. 18 will be described with reference to FIGS. First, in step S31, the collation unit 46 refers to the collation result data and lists all the collation results associated with Pst.

続いて、ステップS32において、照合部46は、文字候補データの配列内の文字候補レコードを参照し、Pstを始点位置とする全ての文字候補を、文字候補データの配列内の列挙する。照合部46は、文字候補マトリクスにおける始点番号がPstに一致する全てのエントリを走査し、−1以外の文字候補の番号を収集することで、Pstを始点位置とする全ての文字候補を列挙することができる。   Subsequently, in step S32, the collation unit 46 refers to the character candidate records in the character candidate data array, and lists all the character candidates starting from Pst in the character candidate data array. The collating unit 46 scans all entries whose starting point numbers match Pst in the character candidate matrix and collects all character candidates having Pst as the starting point position by collecting the numbers of character candidates other than -1. be able to.

続いて、照合部46は、ステップS32で列挙した全ての文字候補レコードのそれぞれに対して、ステップS34〜ステップS48の処理を実行する(ステップS33とステップS49との間のループ処理)。以降ではこのループ処理における処理対象の文字候補レコードに対応する文字候補を「文字候補Cc」と称する。   Subsequently, the collation unit 46 performs the processing of step S34 to step S48 for each of all the character candidate records listed in step S32 (loop processing between step S33 and step S49). Hereinafter, the character candidate corresponding to the character candidate record to be processed in this loop processing is referred to as “character candidate Cc”.

ステップS34において、照合部46は、文字候補Ccに対応する文字候補レコードの認識候補の配列を参照し、当該文字候補の全ての認識候補エントリを列挙する。   In step S34, the collation unit 46 refers to the recognition candidate array of the character candidate record corresponding to the character candidate Cc, and lists all recognition candidate entries of the character candidate.

続いて、照合部46は、ステップS34で列挙した全ての認識候補エントリのそれぞれに対して、ステップS36〜ステップS47の処理を実行する(ステップS35とステップS48との間のループ処理)。以降ではこのループ処理における処理対象の認識候補エントリに対応する認識候補を「認識候補Cr」と称する。   Subsequently, the collation unit 46 performs the processing of Step S36 to Step S47 for each of all the recognition candidate entries listed in Step S34 (loop processing between Step S35 and Step S48). Hereinafter, the recognition candidate corresponding to the recognition candidate entry to be processed in this loop processing is referred to as “recognition candidate Cr”.

続いて、照合部46は、ステップS31で列挙した、Pstに関連付けられた全ての照合結果のそれぞれに対して、ステップS37〜ステップS46の処理を実行する(ステップS36とステップS47との間のループ処理)。以降ではこのループ処理における処理対象の照合結果を「照合結果Mp」と称する。   Subsequently, the collation unit 46 performs the processing of step S37 to step S46 on each of all the collation results associated with Pst listed in step S31 (loop between step S36 and step S47). processing). Hereinafter, the verification result to be processed in this loop process is referred to as “matching result Mp”.

ステップS37において、照合部46は、知識辞書(DFAα)を参照して、処理対象の照合結果Mpに含まれる状態番号αに対応する状態レコードを列挙する。   In step S37, the collation unit 46 refers to the knowledge dictionary (DFAα) and enumerates state records corresponding to the state number α included in the collation result Mp to be processed.

続いて、ステップS38において、照合部46は、ステップS37で列挙した状態レコードに含まれるエッジレコードへのポインタおよびエッジレコードの要素数により、状態番号αの状態から出て行くエッジを表すエッジレコードの格納された範囲を特定することで、状態番号αの状態から出て行くエッジを表す全てのエッジレコードを列挙する。   Subsequently, in step S38, the collation unit 46 creates an edge record representing an edge that exits from the state of the state number α based on the pointer to the edge record included in the state record enumerated in step S37 and the number of elements of the edge record. By specifying the stored range, all edge records representing the edges going out from the state of the state number α are listed.

続いて、照合部46は、ステップS38で列挙した全てのエッジレコードのそれぞれに対して、ステップS40〜ステップS45の処理を実行する(ステップS39とステップS46との間のループ処理)。以降ではこのループ処理における処理対象のエッジレコードを「エッジレコードEr」と称する。   Subsequently, the collation unit 46 performs the processing of Step S40 to Step S45 for each of all the edge records listed in Step S38 (loop processing between Step S39 and Step S46). Hereinafter, the edge record to be processed in this loop processing is referred to as “edge record Er”.

ステップS40において、照合部46は、認識候補Crの認識候補エントリに設定された文字コードと、エッジレコードErに設定された文字コードとが一致するか否かを判断する。一致しない場合(ステップS40のNo)、照合部46は、次のエッジレコードに処理を移し、ステップS40からの処理を繰り返す。一致する場合(ステップS40のYes)、照合部46は、処理をステップS41に進める。   In step S40, the collation unit 46 determines whether or not the character code set in the recognition candidate entry of the recognition candidate Cr matches the character code set in the edge record Er. If they do not match (No in step S40), the collation unit 46 moves the process to the next edge record and repeats the process from step S40. If they match (Yes in step S40), the collation unit 46 advances the process to step S41.

ステップS41において、照合部46は、文字候補Ccの文字候補レコードの終点位置に関連付けて新しい照合結果Mnを生成して、照合結果データに書き込む。   In step S41, the collation unit 46 generates a new collation result Mn in association with the end point position of the character candidate record of the character candidate Cc, and writes it in the collation result data.

続いて、ステップS42において、照合部46は、新しい照合結果Mnに状態番号αにとして、エッジレコードErに設定された状態番号(遷移先の状態番号)を設定する。   Subsequently, in step S42, the collation unit 46 sets the state number (transition destination state number) set in the edge record Er as the state number α in the new collation result Mn.

続いて、ステップS43において、照合部46は、新しい照合結果Mnにコードとして、認識候補Crの認識候補エントリに設定された文字コードを設定する。   Subsequently, in step S43, the collation unit 46 sets the character code set in the recognition candidate entry of the recognition candidate Cr as a code for the new collation result Mn.

続いて、ステップS44において、照合部46は、新しい照合結果Mnに位置番号として、照合結果Mpが関連付けられた位置番号Pstを設定する。また、照合部46は、新しい照合結果Mnに照合結果の番号として、処理対象の照合結果Mpの番号を格納する。   Subsequently, in step S44, the collation unit 46 sets the position number Pst associated with the collation result Mp as the position number for the new collation result Mn. The collation unit 46 stores the number of the collation result Mp to be processed as the collation result number in the new collation result Mn.

続いて、ステップS45において、照合部46は、新しい照合結果Mnにスコアとして、処理対象の照合結果Mpに格納されたスコアと、認識候補Crの認識候補エントリに格納された類似度加算した値を設定する。   Subsequently, in step S45, the collation unit 46 uses the score stored in the collation result Mp to be processed as a score for the new collation result Mn and the value obtained by adding the similarity stored in the recognition candidate entry of the recognition candidate Cr. Set.

ステップS46において、照合部46は、全てのエッジレコードについて、ステップS40〜ステップS45の処理を終えると、ループを抜けて処理をステップS47に進める。   In step S46, the collation unit 46 exits from the loop and proceeds to step S47 after completing the process of steps S40 to S45 for all edge records.

ステップS47において、照合部46は、Pstに関連付けられた全ての照合結果について、ステップS37〜ステップS46の処理を終えると、ループを抜けて処理をステップS48に進める。   In step S47, the collation unit 46 exits from the loop and proceeds to step S48 after completing the processes of step S37 to step S46 for all the collation results associated with Pst.

ステップS48において、照合部46は、文字候補Ccに対応する全ての認識候補エントリについて、ステップS36〜ステップS47の処理を終えると、ループを抜けて処理をステップS49に進める。   In step S48, the collation unit 46 exits from the loop and proceeds to step S49 after completing the process of steps S36 to S47 for all the recognition candidate entries corresponding to the character candidate Cc.

そして、ステップS49において、照合部46は、全ての文字候補レコードについて、ステップS34〜ステップS48の処理を終えると、ループを抜けて、本フローを終了する。   In step S49, the collation unit 46 exits from the loop and ends the present flow after completing the processes in steps S34 to S48 for all the character candidate records.

このように照合部46は、第1の文字候補の照合結果に、照合により到達した知識辞書(DFAα)の状態を示す番号(状態番号α)を書き込む。そして、照合部46は、第1の文字候補に続く第2の文字候補を知識辞書(DFAα)と照合する際、第1の文字候補の照合結果に書き込まれた番号(状態番号α)に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合する。   As described above, the collation unit 46 writes the number (state number α) indicating the state of the knowledge dictionary (DFAα) reached by collation in the collation result of the first character candidate. Then, when the collation unit 46 collates the second character candidate following the first character candidate with the knowledge dictionary (DFAα), the collation unit 46 indicates the number (state number α) written in the collation result of the first character candidate. The second character candidate is collated by following the edge corresponding to the state transition by the recognition candidate of the second character candidate.

図21は、命令実行処理を示すフローチャートである。図22は、命令実行処理でのデータの流れを示す。図23は、文字間のスペースの確認の様子を示す図である。   FIG. 21 is a flowchart showing instruction execution processing. FIG. 22 shows a data flow in the instruction execution process. FIG. 23 is a diagram showing how to check the space between characters.

図21および図22を参照しながら、図18のステップS16の命令実行処理を説明する。まず、ステップS51において、照合部46は、照合結果データを参照し、Pstに関連付けられた全ての照合結果を列挙する。   The instruction execution process in step S16 in FIG. 18 will be described with reference to FIGS. First, in step S51, the collation unit 46 refers to the collation result data and lists all the collation results associated with Pst.

続いて、照合部46は、ステップS51で列挙した、Pstに関連付けられた全ての照合結果のそれぞれに対して、ステップS53〜ステップS61の処理を実行する(ステップS52とステップS62との間のループ処理)。以降ではこのループ処理における処理対象の照合結果を「照合結果Mp」と称する。   Subsequently, the collation unit 46 executes the processing of step S53 to step S61 for each of all the collation results associated with Pst listed in step S51 (loop between step S52 and step S62). processing). Hereinafter, the verification result to be processed in this loop process is referred to as “matching result Mp”.

ステップS53において、照合部46は、知識辞書(DFAα)を参照して、処理対象の照合結果Mpに設定された状態番号αに対応する状態レコードを列挙する。   In step S53, the collation unit 46 refers to the knowledge dictionary (DFAα) and enumerates state records corresponding to the state number α set in the collation result Mp to be processed.

続いて、ステップS54において、照合部46は、ステップS53で列挙した状態レコードに設定されたエッジレコードへのポインタおよびエッジレコードの要素数を参照して、状態番号αの状態から出て行くエッジを表す全てのエッジレコードを列挙する。   Subsequently, in step S54, the collation unit 46 refers to the edge record set in the state record enumerated in step S53 and the number of elements of the edge record, and refers to the edge exiting from the state of the state number α. List all edge records that represent it.

続いて、照合部46は、ステップS54で列挙した全てのエッジレコードのそれぞれに対して、ステップS56〜ステップS60の処理を実行する(ステップS55とステップS61との間のループ処理)。以降ではこのループ処理における処理対象のエッジレコードを「エッジレコードEr」と称する。   Subsequently, the collation unit 46 executes the processing of Step S56 to Step S60 for each of all the edge records listed in Step S54 (loop processing between Step S55 and Step S61). Hereinafter, the edge record to be processed in this loop processing is referred to as “edge record Er”.

ステップS56において、照合部46は、エッジレコードErのコードが、仮想文字コードであるか否かを判断する。照合部46は、一例として、コードの先頭から2ビット目を検出して、仮想文字コードであるか否かを判断する。仮想文字コードではない場合(ステップS56のNo)、照合部46は、次のエッジレコードに処理を移し、ステップS56からの処理を繰り返す。仮想文字コードである場合(ステップS56のYes)、照合部46は、処理をステップS57に進める。   In step S56, the collation unit 46 determines whether or not the code of the edge record Er is a virtual character code. As an example, the collating unit 46 detects the second bit from the beginning of the code and determines whether or not the character code is a virtual character code. If it is not a virtual character code (No in step S56), the collation unit 46 moves the process to the next edge record and repeats the process from step S56. When it is a virtual character code (Yes of step S56), the collation part 46 advances a process to step S57.

ステップS57において、照合部46は、Pstに関連付けて新しい照合結果Mnを生成して、照合結果データに書き込む。   In step S57, the collation unit 46 generates a new collation result Mn in association with Pst and writes it in the collation result data.

続いて、ステップS58において、照合部46は、新しい照合結果Mnに状態番号αとして、エッジレコードErに設定された状態番号(遷移先の状態番号)を設定する。   Subsequently, in step S58, the collation unit 46 sets the state number (transition destination state number) set in the edge record Er as the state number α in the new collation result Mn.

続いて、ステップS59において、照合部46は、新しい照合結果Mnに状態番号α以外の要素(スコア、コード、位置番号および照合結果の番号)として、照合結果Mpの対応する値を複写する。これにより、照合部46は、仮想文字コードが割り当てられたエッジに従って、状態を遷移させることができる。   Subsequently, in step S59, the collation unit 46 copies the corresponding value of the collation result Mp as an element (score, code, position number, and collation result number) other than the state number α to the new collation result Mn. Thereby, the collation part 46 can change a state according to the edge to which the virtual character code was allocated.

続いて、ステップS60において、照合部46は、命令処理部51を呼び出して、仮想文字コードにより指定された命令コードを与えて、命令を実行させる。命令処理部51は、コマンドインタプリタを実装しており、与えられた命令コードを解釈して、当該命令コードで定義された処理を実行する。   Subsequently, in step S60, the collation unit 46 calls the instruction processing unit 51, gives the instruction code specified by the virtual character code, and executes the instruction. The instruction processing unit 51 is mounted with a command interpreter, interprets a given instruction code, and executes a process defined by the instruction code.

例えば、命令処理部51は、加算命令「ADD_SCORE」が与えられた場合には、引数で指定された値を対応する照合結果のスコアに加算する。これにより、命令処理部51は、予め定められた条件の場合にスコアに重みを加えて、文字列の尤もらしさの評価を操作することができる。   For example, when the addition instruction “ADD_SCORE” is given, the instruction processing unit 51 adds the value specified by the argument to the corresponding matching result score. Thus, the instruction processing unit 51 can operate the evaluation of the likelihood of the character string by adding a weight to the score in the case of a predetermined condition.

また、例えば、図21のステップS60において位置番号Pstに関連付けられた照合結果Mpの処理中に、仮想文字コードにより間隔確認命令「CHECK_SPACE」を含む命令コードが実行された場合、図23に示すように、命令処理部51は、位置番号Pstの直前の断片と直後の断片の間隔を確認することで、位置番号Mpの前後の文字間のスペースを確認する。そして、命令処理部51は、間隔が指定された距離以下の場合には、照合結果Mpを削除する。これにより、命令処理部51は、例えば、性と名との間の区切りのスペースを確認し、予め定められた距離より長いスペースが検出されない場合に照合結果を削除することができる。   Further, for example, when an instruction code including an interval check instruction “CHECK_SPACE” is executed by a virtual character code during the processing of the matching result Mp associated with the position number Pst in step S60 of FIG. 21, as shown in FIG. In addition, the instruction processing unit 51 confirms the space between the characters before and after the position number Mp by confirming the interval between the fragment immediately before and after the position number Pst. Then, the instruction processing unit 51 deletes the matching result Mp when the interval is equal to or less than the specified distance. Thereby, for example, the instruction processing unit 51 can confirm the separation space between the sex and the name, and can delete the collation result when a space longer than a predetermined distance is not detected.

続いて、ステップS61において、照合部46は、全てのエッジレコードについて、ステップS56〜ステップS60の処理を終えると、ループを抜けて処理をステップS62に進める。   Subsequently, in step S61, the collation unit 46 exits from the loop and proceeds to step S62 after completing the processes of steps S56 to S60 for all the edge records.

ステップS62において、照合部46は、Pstに関連付けられた全ての照合結果について、ステップS53〜ステップS61の処理を終えると、ループを抜けて、本フローを終了する。   In step S62, the collation unit 46 exits the loop and terminates the present flow after completing the processes of step S53 to step S61 for all the collation results associated with Pst.

このように照合部46は、第1の文字候補の照合結果に、照合により到達した知識辞書(DFAα)の状態を示す番号(状態番号α)を書き込む。そして、照合部46は、第1の文字候補に続く第2の文字候補を知識辞書(DFAα)と照合する際、第1の文字候補の照合結果に書き込まれた番号(状態番号α)に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合し、第2の文字候補の照合結果を生成する。   As described above, the collation unit 46 writes the number (state number α) indicating the state of the knowledge dictionary (DFAα) reached by collation in the collation result of the first character candidate. Then, when the collation unit 46 collates the second character candidate following the first character candidate with the knowledge dictionary (DFAα), the collation unit 46 indicates the number (state number α) written in the collation result of the first character candidate. The second character candidate is collated by following the edge corresponding to the state transition by the recognition candidate of the second character candidate from the state to be generated, and the collation result of the second character candidate is generated.

さらに、照合部46は、仮想文字コードが割り当てられたエッジが検出された場合には、そのエッジに従って状態を遷移させるとともに、仮想文字コードにより指定された命令コードを命令処理部51に与えて、命令を実行させることができる。   Furthermore, when an edge to which a virtual character code is assigned is detected, the matching unit 46 changes the state according to the edge, and gives an instruction code specified by the virtual character code to the instruction processing unit 51. The instruction can be executed.

図24は、結果抽出部で行われる文字列の抽出の処理の流れを示すフロー図である。図25は、結果抽出において参照されるデータとスタック上に積まれる文字コードの様子を示す図である。   FIG. 24 is a flowchart showing the flow of character string extraction processing performed by the result extraction unit. FIG. 25 is a diagram illustrating data referred to in the result extraction and a state of character codes stacked on the stack.

図2のステップS5に示した結果抽出は結果抽出部54で行われる。以降では、結果抽出の詳細について図24および図25を参照して説明する。まず、ステップS70において結果抽出部54は、文字候補の個数が0であるか否か確認し、文字候補の個数が0の場合はステップS84において認識結果の文字列を空文字列として本フローを終了する。文字候補の個数が0でない場合は、ステップS71において、結果抽出部54は、最後の位置番号Pedに関連付けられた全ての照合結果を列挙した上でステップS72以降の処理を実行する。   The result extraction shown in step S5 of FIG. Hereinafter, details of the result extraction will be described with reference to FIGS. 24 and 25. First, in step S70, the result extraction unit 54 checks whether or not the number of character candidates is 0. If the number of character candidates is 0, the flow ends with the recognition result character string as an empty character string in step S84. To do. If the number of character candidates is not 0, in step S71, the result extraction unit 54 enumerates all the collation results associated with the last position number Ped, and then executes the processing after step S72.

続いて、ステップS72において、結果抽出部54は、ステップS71において列挙した照合結果のそれぞれについて、知識辞書(DFAα)から状態番号αに対応する状態レコードを取得して、受理状態フラグを確認する。   Subsequently, in step S72, the result extraction unit 54 acquires a state record corresponding to the state number α from the knowledge dictionary (DFAα) for each of the matching results listed in step S71, and confirms the acceptance state flag.

続いて、ステップS73において、結果抽出部54は、状態番号αに対応する状態が受理状態の照合結果があるかを判断する。以降では、状態番号αに対応する状態が受理状態の照合結果を「DFAαで受理状態の照合結果」と称する。DFAαで受理状態の照合結果がある場合には(ステップS73のYes)、ステップS74において、結果抽出部54は、DFAαで受理状態の照合結果のうち、スコアが最大の照合結果を照合結果Mxとして選択する。DFAαで受理状態の照合結果が無い場合には(ステップS73のNo)、ステップS75において、結果抽出部54は、列挙した全ての照合結果のうち、スコアが最大の照合結果を照合結果Mxとして選択する。   Subsequently, in step S73, the result extraction unit 54 determines whether there is a collation result in which the state corresponding to the state number α is an accepted state. Hereinafter, the collation result in which the state corresponding to the state number α is the accepting state is referred to as “the collation result of the accepting state with DFAα”. If there is a matching result in the accepted state in DFAα (Yes in step S73), in step S74, the result extracting unit 54 sets the matching result having the maximum score among the matching results in the accepted state in DFAα as the matching result Mx. select. When there is no collation result in the accepted state in DFAα (No in step S73), in step S75, the result extraction unit 54 selects the collation result having the maximum score as the collation result Mx among all the collation results listed. To do.

ステップS74またはステップS75の処理に続いて、ステップS76において、結果抽出部54は、位置番号を表す変数pに、選択した照合結果Mxが関連付けられた位置番号pxを代入する。また、結果抽出部54は、照合結果の番号を表す変数mに、選択した照合結果Mxの番号mxを代入する。   Subsequent to step S74 or step S75, in step S76, the result extraction unit 54 substitutes the position number px associated with the selected matching result Mx for the variable p representing the position number. Further, the result extraction unit 54 substitutes the number mx of the selected matching result Mx into the variable m representing the number of the matching result.

続いて、ステップS77において、結果抽出部54は、FILO(First In Last Out)メモリであるスタックを空にする。   Subsequently, in step S77, the result extraction unit 54 empties the stack which is a FILO (First In Last Out) memory.

続いて、ステップS78において、pとmとが指す照合結果のコードが−1であるかを判断する。pとmとが指す照合結果のコードが−1ではない場合(ステップS78の偽)、結果抽出部54は、処理をステップS79に進める。   Subsequently, in step S78, it is determined whether the collation result code indicated by p and m is -1. When the code of the collation result indicated by p and m is not −1 (false in step S78), the result extraction unit 54 advances the process to step S79.

ステップS79において、結果抽出部54は、pとmとが指す照合結果に格納されているコードをスタックに積む。続いて、ステップS80において、結果抽出部54は、pにpとmとが指す照合結果に格納された位置番号を、mにpとmとが指す照合結果に格納された照合結果の番号を代入する。   In step S79, the result extraction unit 54 loads the code stored in the matching result indicated by p and m on the stack. Subsequently, in step S80, the result extraction unit 54 sets the position number stored in the matching result indicated by p and m to p, and the number of the matching result stored in the matching result indicated by p and m in p. substitute.

そして、結果抽出部54は、ステップS80の処理を終えると、処理をステップS78に戻して、pとmとが指す照合結果に格納されたコードが−1となるまで、ステップS79とステップS80の処理を繰り返す。これにより、結果抽出部54は、図25に示すように、文字列の末尾から順に文字コードを選択して、スタックに積み上げていくことができる。   And the result extraction part 54 complete | finishes the process of step S80, returns a process to step S78, and until the code stored in the collation result which p and m point to becomes -1, the process of step S79 and step S80 is carried out. Repeat the process. Thereby, as shown in FIG. 25, the result extraction unit 54 can select character codes in order from the end of the character string and accumulate them in the stack.

pとmとが指す照合結果のコードが−1である場合(ステップS78の真)、すなわち、位置番号が0に関連付けられた照合結果を指す場合には、結果抽出部54は、処理をステップS81に進める。ステップS81において、結果抽出部54は、メモリに格納された認識結果の文字列を空文字列に初期化する。   When the code of the matching result pointed to by p and m is −1 (true in step S78), that is, when the position number indicates the matching result associated with 0, the result extraction unit 54 performs the process. Proceed to S81. In step S81, the result extraction unit 54 initializes the character string of the recognition result stored in the memory to an empty character string.

続いて、ステップS82において、スタックが空であるかを判断する。スタックが空ではない場合(ステップS82の偽)、結果抽出部54は、ステップS83において、スタックのトップからコードを1つ取り出して、メモリに格納された認識結果の文字列の末尾に追加する。   Subsequently, in step S82, it is determined whether the stack is empty. If the stack is not empty (false in step S82), the result extraction unit 54 extracts one code from the top of the stack and adds it to the end of the character string of the recognition result stored in the memory in step S83.

ステップS83の処理を終えると、結果抽出部54は、処理をステップS82に戻して、スタックが空になるまで、ステップS83の処理を繰り返す。これにより、結果抽出部54は、文字列の先頭から末尾までを生成することができる。   When the process of step S83 is completed, the result extraction unit 54 returns the process to step S82 and repeats the process of step S83 until the stack becomes empty. As a result, the result extraction unit 54 can generate the character string from the beginning to the end.

そして、結果抽出部54は、スタックが空となった場合(ステップS82の真)、本フローの処理を終了する。   Then, when the stack becomes empty (true in step S82), the result extraction unit 54 ends the process of this flow.

以上のように、本実施形態に係る認識装置10は、知識辞書を用いて文字認識をするとともに、照合処理に同期させて照合処理とは異なる処理を実行することができる。   As described above, the recognition apparatus 10 according to the present embodiment can perform character recognition using the knowledge dictionary and execute processing different from the collation processing in synchronization with the collation processing.

図26は、実施形態に係る認識装置10のハードウェア構成を示す図である。   FIG. 26 is a diagram illustrating a hardware configuration of the recognition apparatus 10 according to the embodiment.

認識装置10は、プログラムを実行可能な一般的なコンピュータシステムにより実現することができる。認識装置10は、一例として、ディスプレイ110と、キーボード112と、スキャナ114と、外部記憶装置116と、通信装置118と、コンピュータ120備える。   The recognition apparatus 10 can be realized by a general computer system that can execute a program. As an example, the recognition device 10 includes a display 110, a keyboard 112, a scanner 114, an external storage device 116, a communication device 118, and a computer 120.

ディスプレイ110は、表示装置であり、認識した文字列等を表示する。キーボード112は、入力装置であり、ユーザからの操作を受け付けて情報を入力する。スキャナ114は、用紙等に記載された情報を読み取って入力画像等を取得する。外部記憶装置116は、ハードディスクドライブまたは光ディスクドライブ等であり、各種の情報を記憶する。通信装置118は、インターネット等を介して外部のコンピュータ等と情報を入出力し、例えば入力画像を外部から取得したり、文字列を外部へと出力したりする。   The display 110 is a display device and displays a recognized character string or the like. The keyboard 112 is an input device, and receives information from a user and inputs information. The scanner 114 obtains an input image or the like by reading information written on a sheet or the like. The external storage device 116 is a hard disk drive or an optical disk drive, and stores various types of information. The communication device 118 inputs and outputs information with an external computer or the like via the Internet or the like, and acquires, for example, an input image from the outside or outputs a character string to the outside.

コンピュータ120は、一例として、CPU122と、入出力制御部124と、記憶装置126有する。CPU122、入出力制御部124および記憶装置126は、バス128により接続される。   As an example, the computer 120 includes a CPU 122, an input / output control unit 124, and a storage device 126. The CPU 122, the input / output control unit 124, and the storage device 126 are connected by a bus 128.

CPU122は、プログラムを実行して認識装置10の全体の制御をする。入出力制御部124は、ディスプレイ110、キーボード112、スキャナ114、外部記憶装置116および通信装置118等とのインターフェイスである。また、入出力制御部124は、バス128を介したデータ転送等も制御する。   The CPU 122 executes a program to control the entire recognition apparatus 10. The input / output control unit 124 is an interface with the display 110, the keyboard 112, the scanner 114, the external storage device 116, the communication device 118, and the like. The input / output control unit 124 also controls data transfer via the bus 128.

記憶装置126は、ROM、RAMまたはハードディスクドライブ等を含む。記憶装置126では、同一のアドレス空間により、ROM、RAMまたはハードディスクドライブ等の何れのデバイスに対してもアクセスが可能である。記憶装置126は、プログラム、入力画像、様式データ、辞書データ(文字認識辞書および知識辞書)、作業データ(文字候補および照合結果)、および、命令データ等を記憶する。これらのデータは、記憶装置を構成する何れのデバイス(ROM、RAMおよびハードディスクドライブ)に記憶されていてもよい。また、これらのデータは、一部または全部が、外部記憶装置116、または、通信装置118を介してアクセスされるサーバ等に記憶されていてもよい。   The storage device 126 includes a ROM, a RAM, a hard disk drive, or the like. In the storage device 126, any device such as a ROM, a RAM, or a hard disk drive can be accessed by the same address space. The storage device 126 stores programs, input images, style data, dictionary data (character recognition dictionaries and knowledge dictionaries), work data (character candidates and collation results), command data, and the like. These data may be stored in any device (ROM, RAM, and hard disk drive) constituting the storage device. Further, part or all of these data may be stored in a server or the like accessed via the external storage device 116 or the communication device 118.

本実施形態の認識装置10で実行されるプログラムは、インストール可能な形式又は実行可能な形式のファイルでCD−ROM、フレキシブルディスク(FD)、CD−R、DVD等のコンピュータで読み取り可能な記録媒体に記録されて提供される。また、本実施形態の認識装置10で実行されるプログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成してもよい。また、本実施形態の認識装置10で実行されるプログラムをインターネット等のネットワーク経由で提供または配布するように構成してもよい。   The program executed by the recognition apparatus 10 of the present embodiment is an installable or executable file, and is a computer-readable recording medium such as a CD-ROM, a flexible disk (FD), a CD-R, or a DVD. Recorded and provided. The program executed by the recognition apparatus 10 of the present embodiment may be configured to be stored by being stored on a computer connected to a network such as the Internet and downloaded via the network. Further, the program executed by the recognition apparatus 10 of the present embodiment may be configured to be provided or distributed via a network such as the Internet.

本実施形態の認識装置10で実行されるプログラムは、上述した各部(入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56)を含むモジュール構成となっており、実際のハードウェアとしてはCPU(プロセッサ)が上記記憶媒体からプログラムを読み出して実行することにより上記各部が主記憶装置上にロードされ、入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56が記憶装置126上に生成されるようになっている。なお、入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56は、一部または全部がハードウェアで構成されていてもよい。   The program executed by the recognition apparatus 10 according to the present embodiment includes the above-described units (the input unit 30, the candidate detection unit 36, the recognition unit 42, the collation unit 46, the instruction processing unit 51, the result extraction unit 54, and the output unit 56). As the actual hardware, the CPU (processor) reads out the program from the storage medium and executes it to load the respective units onto the main storage device. The input unit 30 and the candidate detection unit 36 The recognition unit 42, the collation unit 46, the instruction processing unit 51, the result extraction unit 54, and the output unit 56 are generated on the storage device 126. Note that the input unit 30, the candidate detection unit 36, the recognition unit 42, the collation unit 46, the instruction processing unit 51, the result extraction unit 54, and the output unit 56 may be partially or entirely configured by hardware.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、請求の範囲に記載された発明とその均等の範囲に含まれる。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

10 認識装置
30 入力部
32 入力画像記憶部
34 様式データ記憶部
36 候補検出部
38 候補記憶部
40 文字認識辞書記憶部
42 認識部
44 知識辞書記憶部
46 照合部
48 照合結果記憶部
51 命令処理部
54 結果抽出部
56 出力部
110 ディスプレイ
112 キーボード
114 スキャナ
116 外部記憶装置
118 通信装置
120 コンピュータ
122 CPU
124 入出力制御部
126 記憶装置
128 バス
DESCRIPTION OF SYMBOLS 10 Recognition apparatus 30 Input part 32 Input image memory | storage part 34 Style data memory | storage part 36 Candidate detection part 38 Candidate memory | storage part 40 Character recognition dictionary memory | storage part 42 Recognition part 44 Knowledge dictionary memory | storage part 46 Collation part 48 Collation result memory | storage part 51 Command processing part 54 Result Extractor 56 Output Unit 110 Display 112 Keyboard 114 Scanner 116 External Storage Device 118 Communication Device 120 Computer 122 CPU
124 I / O controller 126 Storage device 128 Bus

Claims (8)

入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、
前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、
前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、
与えられた命令を実行する命令処理部と、
を備え、
前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、
前記照合部は、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を前記命令処理部に与える
認識装置。
A candidate detection unit that detects a character candidate that is a set of pixels estimated to include a character from the input image;
A recognition unit that recognizes each of the character candidates and generates at least one recognition candidate that is a candidate character of a recognition result;
Each of the at least one recognition candidate is collated with a knowledge dictionary obtained by modeling a character string to be recognized, and a collation result obtained by collating a character string estimated to be included in the input image with a knowledge dictionary is obtained. A verification unit to be generated;
An instruction processing unit for executing a given instruction;
With
The knowledge dictionary is a finite automaton, and either one of a real character code representing a character and a virtual character code designating an instruction is assigned to an edge,
The verification unit, when transitioning the state of the knowledge dictionary according to an edge to which the virtual character code is assigned, gives an instruction specified by the virtual character code assigned to the edge to the instruction processing unit.
前記照合部は、対応する文字列の尤もらしさを表すスコアを含む照合結果を生成し、
前記認識装置は、前記照合結果から前記スコアに基づき1つの照合結果を選択し、選択した照合結果により特定される文字列を抽出する結果抽出部をさらに備える
請求項1に記載の認識装置。
The matching unit generates a matching result including a score representing the likelihood of the corresponding character string,
The recognition apparatus according to claim 1, further comprising: a result extraction unit that selects one matching result based on the score from the matching result and extracts a character string specified by the selected matching result.
前記命令処理部が、指定された値を対応する照合結果のスコアに加算する加算命令を処理することを特徴とする
請求項2に記載の認識装置。
The recognition apparatus according to claim 2, wherein the instruction processing unit processes an addition instruction for adding a designated value to a score of a corresponding matching result.
前記命令処理部が、照合結果が関連付けられた位置の前後の文字間のスペースを確認し、指定された距離以下の場合には対応する照合結果を削除する間隔確認命令を処理することを特徴とする
請求項2に記載の認識装置。
The instruction processing unit checks a space between characters before and after a position associated with a collation result, and processes an interval confirmation command for deleting a corresponding collation result when the distance is equal to or less than a specified distance. The recognition device according to claim 2.
前記知識辞書は、決定性有限オートマトンであり、
前記照合部は、
第1の文字候補の照合結果に、照合により到達した前記決定性有限オートマトンの状態を示す番号を書き込み、
前記第1の文字候補に続く第2の文字候補を前記決定性有限オートマトンと照合する際、前記第1の文字候補の照合結果に書き込まれた番号に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合する
請求項2に記載の認識装置。
The knowledge dictionary is a deterministic finite automaton;
The collation unit
Write a number indicating the state of the deterministic finite automaton reached by collation in the collation result of the first character candidate,
When the second character candidate following the first character candidate is collated with the deterministic finite automaton, the second character candidate recognition candidate from the state indicated by the number written in the collation result of the first character candidate The recognition apparatus according to claim 2, wherein the second character candidate is collated by following an edge corresponding to the state transition by.
入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、
前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、
前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、
与えられた命令を実行する命令処理部と、
を備え、
前記知識辞書は、決定性有限オートマトンであって、文字コードがエッジに割り当てられ、
前記照合部は、第1の文字候補の照合結果に、照合により到達した前記決定性有限オートマトンの状態を示す番号を書き込み、前記第1の文字候補に続く第2の文字候補を前記決定性有限オートマトンと照合する際、前記第1の文字候補の照合結果に書き込まれた番号に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合し、第2の文字候補の照合結果を生成する
認識装置。
A candidate detection unit that detects a character candidate that is a set of pixels estimated to include a character from the input image;
A recognition unit that recognizes each of the character candidates and generates at least one recognition candidate that is a candidate character of a recognition result;
Each of the at least one recognition candidate is collated with a knowledge dictionary obtained by modeling a character string to be recognized, and a collation result obtained by collating a character string estimated to be included in the input image with a knowledge dictionary is obtained. A verification unit to be generated;
An instruction processing unit for executing a given instruction;
With
The knowledge dictionary is a deterministic finite automaton, character codes are assigned to edges,
The collation unit writes a number indicating the state of the deterministic finite automaton reached by collation to the collation result of the first character candidate, and sets the second character candidate following the first character candidate as the deterministic finite automaton. When collating, the second character candidate is collated by following the edge corresponding to the state transition by the recognition candidate of the second character candidate from the state indicated by the number written in the collation result of the first character candidate. A recognition device for generating a collation result of the second character candidate.
入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出ステップと、
前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識ステップと、
前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合ステップと、
与えられた命令を実行する命令処理ステップと、
を含み、
前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を含む仮想文字コードのいずれか一方がエッジに割り当てられ、
前記照合ステップでは、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードに含まれる命令を実行する
認識方法。
A candidate detection step of detecting a character candidate that is a set of pixels presumed to include a character from the input image;
A recognition step of recognizing each of the character candidates and generating at least one recognition candidate that is a candidate character of a recognition result;
Each of the at least one recognition candidate is collated with a knowledge dictionary obtained by modeling a character string to be recognized, and a collation result obtained by collating a character string estimated to be included in the input image with a knowledge dictionary is obtained. A matching step to generate,
An instruction processing step for executing a given instruction;
Including
The knowledge dictionary is a finite automaton, and one of a real character code representing a character and a virtual character code including an instruction is assigned to an edge,
In the collating step, when the state of the knowledge dictionary is changed according to an edge to which the virtual character code is assigned, a command included in the virtual character code assigned to the edge is executed.
コンピュータを認識装置として機能させるためのプログラムであって、
前記コンピュータに、
入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出ステップと、
前記文字候補のそれぞれを認識して、認識結果の候補の文字である表す少なくとも1つの認識候補を生成する認識ステップと、
前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合ステップと、
与えられた命令を実行する命令処理ステップと、
を実行させ、
前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、
前記照合ステップでは、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を実行させる
プログラム。
A program for causing a computer to function as a recognition device,
In the computer,
A candidate detection step of detecting a character candidate that is a set of pixels presumed to include a character from the input image;
A recognition step of recognizing each of said character candidates and generating at least one recognition candidate representing a candidate character of a recognition result;
Each of the at least one recognition candidate is collated with a knowledge dictionary obtained by modeling a character string to be recognized, and a collation result obtained by collating a character string estimated to be included in the input image with a knowledge dictionary is obtained. A matching step to generate,
An instruction processing step for executing a given instruction;
And execute
The knowledge dictionary is a finite automaton, and either one of a real character code representing a character and a virtual character code designating an instruction is assigned to an edge,
In the collation step, when the state of the knowledge dictionary is changed according to an edge to which the virtual character code is assigned, a program for executing an instruction specified by the virtual character code assigned to the edge.
JP2014044342A 2014-03-06 2014-03-06 Recognition device, recognition method and program Active JP6334209B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014044342A JP6334209B2 (en) 2014-03-06 2014-03-06 Recognition device, recognition method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014044342A JP6334209B2 (en) 2014-03-06 2014-03-06 Recognition device, recognition method and program

Publications (2)

Publication Number Publication Date
JP2015170130A true JP2015170130A (en) 2015-09-28
JP6334209B2 JP6334209B2 (en) 2018-05-30

Family

ID=54202818

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014044342A Active JP6334209B2 (en) 2014-03-06 2014-03-06 Recognition device, recognition method and program

Country Status (1)

Country Link
JP (1) JP6334209B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185681A (en) * 1996-01-08 1997-07-15 Hitachi Ltd Address reading method
JPH11143893A (en) * 1997-11-07 1999-05-28 Matsushita Electric Ind Co Ltd Word collating device
JP2000148906A (en) * 1998-11-10 2000-05-30 Hitachi Ltd Document recognition device and mail divider

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185681A (en) * 1996-01-08 1997-07-15 Hitachi Ltd Address reading method
JPH11143893A (en) * 1997-11-07 1999-05-28 Matsushita Electric Ind Co Ltd Word collating device
JP2000148906A (en) * 1998-11-10 2000-05-30 Hitachi Ltd Document recognition device and mail divider

Also Published As

Publication number Publication date
JP6334209B2 (en) 2018-05-30

Similar Documents

Publication Publication Date Title
TWI321294B (en) Method and device for determining at least one recognition candidate for a handwritten pattern
JP5125573B2 (en) Region extraction program, character recognition program, and character recognition device
CN110114776B (en) System and method for character recognition using a fully convolutional neural network
KR102293538B1 (en) Method and apparatus for recognising music symbols
JP6003705B2 (en) Information processing apparatus and information processing program
US10438097B2 (en) Recognition device, recognition method, and computer program product
JP2001175811A (en) Device and method for word rough classification, and recording medium with recorded control program thereof
CN112784581B (en) Text error correction method, device, medium and electronic equipment
JP2009539181A (en) Combiner for improving handwriting recognition
JP4991407B2 (en) Information processing apparatus, control program thereof, computer-readable recording medium storing the control program, and control method
JP2019204214A (en) Learning device, learning method, program and estimation device
JP5942361B2 (en) Image processing apparatus and image processing program
JP6320089B2 (en) Recognition device, recognition method and program
JP2009093305A (en) Business form recognition system
JP2009129253A (en) Pattern recognition apparatus, pattern recognition program and pattern recognition method
JP6334209B2 (en) Recognition device, recognition method and program
JP5238034B2 (en) Approximate collation device, approximate collation method, program, and recording medium
WO2016181458A1 (en) Recognition device, recognition method and program
JP2008186056A (en) Hand-written character input apparatus and hand-written character input program
JP2012098905A (en) Character recognition device, character recognition method and program
JP2010237909A (en) Knowledge correction program, knowledge correcting device and knowledge correction method
JP7322468B2 (en) Information processing device, information processing method and program
US20230005282A1 (en) Information processing apparatus, information processing method, computer program product, and recording medium
JP4936635B2 (en) Character string search device, character string search method, and program for causing computer to execute the method
JP2023002091A (en) Information processing system, method and program

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20151102

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160923

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170817

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170829

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171023

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180426

R150 Certificate of patent or registration of utility model

Ref document number: 6334209

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150