WO2016181458A1 - 認識装置、認識方法およびプログラム - Google Patents

認識装置、認識方法およびプログラム Download PDF

Info

Publication number
WO2016181458A1
WO2016181458A1 PCT/JP2015/063482 JP2015063482W WO2016181458A1 WO 2016181458 A1 WO2016181458 A1 WO 2016181458A1 JP 2015063482 W JP2015063482 W JP 2015063482W WO 2016181458 A1 WO2016181458 A1 WO 2016181458A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
candidate
recognition
unit
collation
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.)
Ceased
Application number
PCT/JP2015/063482
Other languages
English (en)
French (fr)
Inventor
鈴木 智久
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 PCT/JP2015/063482 priority Critical patent/WO2016181458A1/ja
Priority to CN201580078064.6A priority patent/CN107533651B/zh
Publication of WO2016181458A1 publication Critical patent/WO2016181458A1/ja
Priority to US15/709,774 priority patent/US10515297B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/768Arrangements for image or video recognition or understanding using pattern recognition or machine learning using context analysis, e.g. recognition aided by known co-occurring patterns
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/26Techniques for post-processing, e.g. correcting the recognition result
    • G06V30/262Techniques for post-processing, e.g. correcting the recognition result using context analysis, e.g. lexical, syntactic or semantic context
    • G06V30/268Lexical context
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters

Definitions

  • Embodiments described herein relate generally to a recognition apparatus, a recognition method, and a program.
  • a method of 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.
  • 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.
  • 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).
  • the problem to be solved by the present invention is to perform character recognition using a knowledge dictionary and execute processing different from the collation processing in synchronization with the collation processing.
  • the recognition apparatus 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 a character code and a virtual character code designating an instruction is assigned to an edge, and the collation unit is configured to change the state of the knowledge dictionary according to the edge to which the virtual character code is assigned. Case of transition, giving the specified instruction by the virtual character code allocated to the edge to the instruction processing unit.
  • FIG. 1 is a diagram illustrating a configuration of a recognition device 10 according to the embodiment.
  • FIG. 2 is a flowchart showing processing of the recognition apparatus 10 according to the embodiment.
  • FIG. 3 is a diagram illustrating an example of an input image.
  • FIG. 4 is a diagram showing the configuration of style data.
  • FIG. 5 is a diagram illustrating a process for generating a series of character candidates from an input image.
  • FIG. 6 is a diagram showing the structure of fragment data.
  • FIG. 7 is a diagram illustrating an example of a fragment number.
  • FIG. 8 is a diagram illustrating a configuration of character candidate data.
  • FIG. 9 is a diagram illustrating an example of character candidate numbers.
  • FIG. 10 is a diagram illustrating an example of the start point number and end point number of a character candidate.
  • FIG. 10 is a diagram illustrating an example of the start point number and end point number of a character candidate.
  • FIG. 11 is a diagram illustrating an example of a character candidate matrix.
  • FIG. 12 is a diagram showing the configuration of the character recognition dictionary.
  • FIG. 13 is a diagram showing the configuration of recognition candidate sequences.
  • FIG. 14 is a diagram illustrating a configuration of the knowledge dictionary.
  • FIG. 15 is a diagram illustrating an example of a code encoding method.
  • FIG. 16 is a diagram illustrating an example of instruction data.
  • FIG. 17 is a diagram illustrating a configuration of the collation result data.
  • FIG. 18 is a flowchart showing the matching process.
  • FIG. 19 is a flowchart showing the knowledge dictionary search process.
  • FIG. 20 is a diagram illustrating an example of the flow of data access in the knowledge dictionary search process.
  • FIG. 21 is a flowchart showing instruction execution processing.
  • FIG. 22 is a diagram illustrating an example of the flow of data access in the instruction execution process.
  • FIG. 23 is a diagram showing how to check the space between characters.
  • FIG. 24 is a flowchart showing the result extraction process.
  • FIG. 25 is a diagram illustrating an example of data referred to in the result extraction and a character code stacked on the stack.
  • FIG. 26 is a diagram illustrating a hardware configuration of the recognition apparatus 10 according to the embodiment.
  • FIG. 1 is a diagram illustrating a configuration of a recognition device 10 according to the embodiment.
  • 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.
  • 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.
  • 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.
  • the form data storage unit 34 stores form data for specifying an area in which a character string in the input image is described.
  • 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.
  • the candidate storage unit 38 stores character candidates. Furthermore, the candidate memory
  • 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.
  • 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.
  • the knowledge dictionary storage unit 44 stores a knowledge dictionary obtained by modeling a character string to be recognized.
  • the knowledge dictionary is a deterministic finite automaton that models a character string to be recognized.
  • one of a real character code representing a character and a virtual character code designating a command is assigned to the edge.
  • 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.
  • 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.
  • the collation part 46 produces
  • the matching unit 46 writes the generated matching result in the matching result storage unit 48.
  • the collation unit 46 gives the instruction specified by the virtual character code assigned to the edge to the instruction processing unit 51.
  • the collation result storage unit 48 stores the collation result generated by the collation 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.
  • the instruction processing unit 51 executes the instruction given from the collation unit 46.
  • 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.
  • 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.
  • the output unit 56 outputs the character string extracted by the result extraction unit 54 to the outside.
  • FIG. 2 is a flowchart showing processing of the recognition apparatus 10 according to the embodiment.
  • the recognition apparatus 10 inputs an input image.
  • step S2 the recognition apparatus 10 detects a character candidate that is a set of pixels estimated 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.
  • 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.
  • 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.
  • 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.
  • step S6 the recognition device 10 outputs a character string as a recognition result.
  • FIG. 3 is a diagram showing an example of the input image.
  • 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.
  • 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.
  • FIG. 4 is a diagram showing the structure of style data.
  • the form data storage unit 34 stores form data created in advance.
  • the form 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.
  • 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.
  • Each entry box record includes information indicating the position of the corresponding entry box in the input image.
  • 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.
  • FIG. 5 is a diagram showing 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.
  • FIG. 6 is a diagram showing the structure of fragment data.
  • the candidate storage unit 38 stores fragment data representing a fragment.
  • 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.
  • Each fragment record includes information indicating the position of the corresponding fragment and a binary image indicating the shape of the fragment.
  • 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.
  • 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).
  • FIG. 7 is a diagram showing an example of the 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.
  • FIG. 8 is a diagram showing the 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).
  • the candidate storage unit 38 stores character candidate data representing character candidates.
  • 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.
  • 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).
  • 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.
  • FIG. 9 is a diagram showing 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.
  • FIG. 10 is a diagram showing an example of the start point number and end point number of the 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.
  • the fragment number for the first fragment is called the start point number of the character candidate
  • the value obtained by adding 1 to the fragment number for the last fragment is called the end point number of the character candidate.
  • 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.
  • FIG. 11 is a diagram illustrating an example of a character candidate matrix.
  • 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.
  • FIG. 12 shows the structure 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • FIG. 14 is a diagram showing the structure of the knowledge dictionary.
  • the knowledge dictionary storage unit 44 stores a knowledge dictionary created in advance by a designer or the like.
  • the knowledge dictionary is a deterministic finite automaton that models a character string to be recognized.
  • a knowledge dictionary that is a deterministic finite automaton is also referred to as DFA ⁇ .
  • 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.
  • 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.
  • 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.
  • the acceptance status flag indicates whether or not the status is an acceptance status. 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.
  • Each edge record corresponds to each edge included in DFA ⁇ on a one-to-one basis.
  • Each edge record includes a transition destination state number and a code.
  • the state number of the transition destination represents a state number that identifies the state of the transition destination by the edge. Note that the state having a state number of 0 is a start state.
  • the code represents the input symbol that causes the transition represented by the edge.
  • the code stores a real character code representing a character or a virtual character code designating an instruction.
  • a transition from one state to another state occurs according to the edge by a character code representing a recognition candidate character.
  • 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.
  • FIG. 15 is a diagram illustrating an example of a code encoding method.
  • 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.
  • 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.
  • the instruction code # 0 of 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.
  • 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.
  • FIG. 17 is a diagram showing the structure 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.
  • the collation result storage unit 48 stores collation 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 verification results represents the number of verification 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. *
  • 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 degree of similarity associated with each of the recognition candidates from the top recognition candidate to the recognition candidate 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.
  • 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.
  • 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.
  • 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.
  • step S12 the collation unit 46 generates a new collation result in association with the position number 0.
  • 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.
  • the matching unit 46 sets the number of matching results associated with the position number 0 to 1.
  • step S14 the collation unit 46 substitutes 0 for a variable Pst representing the position number.
  • 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.
  • the collation unit 46 advances the process to step S16.
  • step S16 the collation unit 46 determines whether an edge to which the virtual character code is assigned exists at the 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.
  • step S17 the collation unit 46 narrows down the collation results associated with Pst from the highest rank to the Nprth. That is, the matching unit 46 deletes the matching result whose score is lower than the Nprth.
  • step S18 the matching unit 46 executes knowledge dictionary search processing using the knowledge dictionary for each matching result associated with Pst.
  • the collation part 46 can produce
  • the knowledge dictionary search process will be described later with reference to FIGS. 19 and 20.
  • step S19 the collation unit 46 adds 1 to Pst.
  • the collation part 46 will return a process to step S15, after complete
  • step S15 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.
  • 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
  • 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.
  • step S31 the collation unit 46 refers to the collation result data and lists all the collation results associated with Pst.
  • the collation unit 46 refers to the character candidate records in the character candidate data array, and lists all the character candidates having Pst as the starting point position in the character candidate data array.
  • the collation 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.
  • step S34 the collation unit 46 executes 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).
  • character candidate Cc the character candidate corresponding to the character candidate record to be processed in this loop processing.
  • 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.
  • the collation unit 46 executes 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).
  • the recognition candidate corresponding to the recognition candidate entry to be processed in this loop processing is referred to as “recognition candidate Cr”.
  • the collation unit 46 executes the processing of step S37 to step S46 for each of all the collation results associated with Pst listed in step S31 (loop between step S36 and step S47). processing).
  • the verification result to be processed in this loop process is referred to as “matching result Mp”.
  • 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.
  • DFA ⁇ knowledge dictionary
  • 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.
  • the collation unit 46 executes 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).
  • edge record Er the edge record to be processed in this loop processing.
  • 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.
  • step S41 the collation unit 46 generates a new collation result Mn in association with the end position of the character candidate record of the character candidate Cc, and writes it in the collation result data.
  • 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.
  • 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.
  • 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.
  • 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.
  • step S46 the collation unit 46, after completing the processing of step S40 to step S45 for all edge records, exits the loop and advances the processing to step S47.
  • step S47 when the collation unit 46 finishes the processes of steps S37 to S46 for all the collation results associated with Pst, the collation unit 46 exits the loop and advances the process to step S48.
  • step S48 the collation unit 46 exits from the loop and proceeds to step S49 after completing the processes in steps S36 to S47 for all the recognition candidate entries corresponding to the character candidate Cc.
  • step S49 the collation unit 46 exits the loop and ends this flow after completing the processing of step S34 to step S48 for all the character candidate records.
  • 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.
  • 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.
  • step S51 the collation unit 46 refers to the collation result data and lists all the collation results associated with Pst.
  • the collation unit 46 performs the processing of Step S53 to Step S61 for each of all the collation results associated with Pst listed in Step S51 (the loop between Step S52 and Step S62). processing).
  • the verification result to be processed in this loop process is referred to as “matching result Mp”.
  • step S53 the collation unit 46 refers to the knowledge dictionary (DFA ⁇ ) and lists state records corresponding to the state number ⁇ set in the collation result Mp to be processed.
  • DFA ⁇ knowledge dictionary
  • 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.
  • 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).
  • edge record Er the edge record to be processed in this loop processing.
  • 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.
  • step S57 the collation unit 46 generates a new collation result Mn in association with Pst and writes it in the collation result data.
  • 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.
  • 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 ⁇ in the new collation result Mn.
  • the collation part 46 can change a state according to the edge to which the virtual character code was allocated.
  • step S60 the collation unit 46 calls the command processing unit 51, gives the command code specified by the virtual character code, and executes the command.
  • 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.
  • the instruction processing unit 51 adds the value specified by the argument to the corresponding matching result score.
  • 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.
  • 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.
  • step S61 the collation unit 46 exits from the loop and proceeds to step S62 after completing the process of steps S56 to S60 for all edge records.
  • step S62 the collation unit 46 exits the loop and terminates the present flow after completing the processing of step S53 to step S61 for all collation results associated with Pst.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • step S77 the result extraction unit 54 empties the stack that is a FILO (First In Last Out) memory.
  • FILO First In Last Out
  • step S78 it is determined whether the code of the collation result indicated by p and m is -1.
  • 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.
  • 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.
  • step S80 the result extraction unit 54 returns the process to step S78, and until the code stored in the collation result indicated by p and m becomes ⁇ 1, the result extraction unit 54 returns to step S78. 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.
  • step S78 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.
  • 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.
  • step S83 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.
  • the result extraction unit 54 ends the processing of this flow.
  • the recognition device 10 can perform character recognition using the knowledge dictionary and execute processing different from the collation processing in synchronization with the collation processing.
  • FIG. 26 is a diagram illustrating a hardware configuration of the recognition apparatus 10 according to the embodiment.
  • the recognition device 10 can be realized by a general computer system capable of executing a program.
  • 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.
  • 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.
  • 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.
  • 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.
  • the storage device 126 includes a ROM, a RAM, a hard disk drive, or the like.
  • 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.
  • the program executed by the recognition apparatus 10 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.
  • the program executed by the recognition apparatus 10 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).
  • the CPU processor
  • the CPU 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.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Character Discrimination (AREA)

Abstract

 照合処理に同期させて照合処理とは異なる処理を実行する。入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、与えられた命令を実行する命令処理部を備え、知識辞書は、有限オートマトンであって文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、照合部は、仮想文字コードが割り当てられたエッジに従って知識辞書の状態を遷移させる場合、当該エッジに割り当てられた仮想文字コードにより指定された命令を命令処理部に与える。

Description

認識装置、認識方法およびプログラム
 本発明の実施形態は、認識装置、認識方法およびプログラムに関する。
 文字認識における知識処理を行う方法として、認識対象の文字列をモデル化して知識辞書に格納し、モデルに合致する文字列を知識辞書の結果とする方法が知られている。例えば、照合したい単語を登録した単語辞書部と単語辞書部に登録された単語を受理する有限オートマトンを有する単語照合部を備え、有限オートマトンが受理した単語を知識処理の結果として出力するシステムが知られている(例えば、特許文献1参照)。また、文脈自由文法で記述した地名表記と文字認識候補を照合することで知識処理を行う技術が知られている(例えば、特許文献2参照)。
特開平11-143893号公報 特許第4006176号公報
 しかしながら、従来の技術では、文字列と文字列との間のスペースを検出し、スペースの検出結果を照合のスコアに反映させる等の知識処理とは異なる処理を、知識処理と同期させて実行させることが困難であった。
 本発明が解決しようとする課題は、知識辞書を用いて文字認識をするとともに、照合処理に同期させて照合処理とは異なる処理を実行することにある。
 実施形態に係る認識装置は、入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、与えられた命令を実行する命令処理部と、を備え、前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、前記照合部は、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を前記命令処理部に与える。
図1は、実施形態に係る認識装置10の構成を示す図である。 図2は、実施形態に係る認識装置10の処理を示すフロー図である。 図3は、入力画像の一例を示す図である。 図4は、様式データの構成を示す図である。 図5は、入力画像から一連の文字候補を生成する処理を示す図である。 図6は、断片データの構成を示す図である。 図7は、断片番号の一例を示す図である。 図8は、文字候補データの構成を示す図である。 図9は、文字候補番号の一例を示す図である。 図10は、文字候補の始点番号および終点番号の一例を示す図である。 図11は、文字候補マトリクスの一例を示す図である。 図12は、文字認識辞書の構成を示す図である。 図13は、認識候補の配列の構成を示す図である。 図14は、知識辞書の構成を示す図である。 図15は、コードの符号化方法の一例を示す図である。 図16は、命令データの一例を示す図である。 図17は、照合結果データの構成を示す図である。 図18は、照合処理を示すフロー図である。 図19は、知識辞書探索処理を示すフロー図である。 図20は、知識辞書探索処理でのデータのアクセスの流れの一例を示す図である。 図21は、命令実行処理を示すフロー図である。 図22は、命令実行処理でのデータのアクセスの流れの一例を示す図である。 図23は、文字間のスペースの確認の様子を示す図である。 図24は、結果抽出の処理の流れを示すフロー図である。 図25は、結果抽出において参照されるデータとスタック上に積まれる文字コードの一例を示す図である。 図26は、実施形態に係る認識装置10のハードウェア構成を示す図である。
 図1は、実施形態に係る認識装置10の構成を示す図である。認識装置10は、例えばスキャナ等により読み取られた入力画像に含まれる文字列を認識し、認識した文字列を出力する。
 認識装置10は、入力部30と、入力画像記憶部32と、様式データ記憶部34と、候補検出部36と、候補記憶部38と、文字認識辞書記憶部40と、認識部42と、知識辞書記憶部44と、照合部46と、照合結果記憶部48と、命令処理部51と、結果抽出部54と、出力部56を備える。
 入力部30は、スキャナ等により取り込まれた入力画像を入力する。入力部30は、ネットワーク等を介して他のコンピュータから入力画像を入力してもよい。入力画像記憶部32は、入力部30により入力された入力画像を記憶する。
 様式データ記憶部34は、入力画像における文字列が記載された領域を特定する様式データを記憶する。
 候補検出部36は、様式データ記憶部34に記憶された様式データに基づいて、入力画像から、文字候補を検出する。それぞれの文字候補は、1つの文字を含むと推測される画素の集合である。候補検出部36は、検出した文字候補を候補記憶部38に書き込む。
 候補記憶部38は、文字候補を記憶する。さらに、候補記憶部38は、文字候補のそれぞれに対応させて、その文字候補の認識結果の候補の文字である認識候補を記憶する。
 文字認識辞書記憶部40は、文字認識辞書を記憶する。文字認識辞書は、認識対象の画像と、予め登録された文字のそれぞれとの類似度を算出するための情報を格納する。
 認識部42は、文字認識辞書記憶部40に記憶された文字認識辞書に基づいて、候補記憶部38に記憶された文字候補のそれぞれを認識する。そして、認識部42は、1つの文字候補に対して、認識結果の候補の文字である表す少なくとも1つの認識候補を生成する。認識部42は、生成した少なくとも1つの認識候補を、文字候補に対応付けて候補記憶部38に書き込む。
 知識辞書記憶部44は、認識対象の文字列をモデル化した知識辞書を記憶する。本実施形態においては、知識辞書は、認識対象の文字列をモデル化した決定性有限オートマトンである。知識辞書は、エッジに、文字を表す実文字コードおよび、命令を指定する仮想文字コードのいずれか一方が割り当てられている。
 照合部46は、少なくとも1つの認識候補のそれぞれを知識辞書と照合して、入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する。この過程において、照合部46は、認識候補が割り当てられたエッジに従って知識辞書の状態を順次に遷移させることにより、照合を行う。また、照合部46は、対応する文字列の尤もらしさを表すスコアを含む照合結果を生成する。そして、照合部46は、生成した照合結果を照合結果記憶部48に書き込む。
 さらに、照合部46は、仮想文字コードが割り当てられたエッジに従って知識辞書の状態を遷移させる場合、当該エッジに割り当てられた仮想文字コードにより指定された命令を命令処理部51に与える。
 照合結果記憶部48は、照合部46により生成された照合結果を記憶する。照合結果記憶部48は、文字候補の認識候補を並べて得られる文字列を先頭から知識辞書と照合していく過程における開始時点、途中段階および完了時点での照合結果を記憶する。なお、照合部46は、照合の途中段階において、記憶領域を節約することを目的として、スコアの低い照合結果を削除してもよい。
 命令処理部51は、照合部46から与えられた命令を実行する。命令処理部51は、一例として、スコアに指定された値を加算する処理または文字間のスペースを確認する処理等を実行する。
 結果抽出部54は、照合部46による照合および命令処理部51による処理が全て完了した後において、照合結果記憶部48に記憶された照合結果からスコアに基づき1個以上の照合結果を選択し、選択した1個以上の照合結果により特定される文字列を抽出する。結果抽出部54は、一例として、スコアが最も良い照合結果により特定される文字列を抽出する。
 出力部56は、結果抽出部54により抽出された文字列を外部へと出力する。
 図2は、実施形態に係る認識装置10の処理を示すフロー図である。まず、ステップS1において、認識装置10は、入力画像を入力する。
 続いて、ステップS2において、認識装置10は、入力画像から、1つの文字を含むと推測される画素の集合である文字候補を検出する。続いて、ステップS3において、認識装置10は、文字認識辞書に基づいて、文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する。
 続いて、ステップS4において、認識装置10は、少なくとも1つの認識候補のそれぞれを知識辞書と照合して、入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する。これとともに、ステップS4において、認識装置10は、仮想文字コードが割り当てられたエッジに従って知識辞書の状態を遷移させる場合、当該エッジに割り当てられた仮想文字コードにより指定された命令を実行する。
 続いて、ステップS5において、認識装置10は、照合処理が全て完了した後において、照合結果からスコアに基づき1つの照合結果を選択し、選択した照合結果により特定される文字列を抽出し、認識結果の文字列とする。文字候補の個数が0個の場合、すなわち入力画像上に文字が含まれない場合、ステップS5において選択すべき照合結果が生成されないが、この場合は認識結果の文字列を空文字列とする。最後に、ステップS6において、認識装置10は、認識結果の文字列を出力する。
 図3は、入力画像の一例を示す図である。本実施形態において、入力画像は、図3に示すように、商品を発注するための注文書をスキャナ等により取り込んで得られた画像データである。入力画像の予め定められた記入枠の内側には、発注者の名前が記入されている。本実施形態において、認識装置10は、予め定められた記入枠の内側に記入された日本語の名前の文字列を認識し、認識した文字列を表すテキストデータを出力する。
 図4は、様式データの構成を示す図である。様式データ記憶部34は、予め作成された様式データを記憶する。
 様式データは、図4に示すように、入力画像に含まれる記入枠の個数を示す値と、記入枠の個数分の記入枠レコードを格納する配列を含む。本例において、配列の最初のエントリのインデックスは、0である。すなわち、配列は、0オリジンである。なお、本実施形態で用いる他の配列も、特別の記載が無い限り0オリジンである。記入枠レコードのそれぞれは、入力画像に含まれるそれぞれの記入枠に一対一で対応する。
 それぞれの記入枠レコードは、入力画像内における、対応する記入枠の位置を示す情報を含む。本例において、記入枠の位置を示す情報は、対応する記入枠の左右の端のX座標(横方向の座標)および上下の端のY座標(縦方向の座標)である。
 図5は、入力画像から一連の文字候補を生成する処理を示す図である。候補検出部36は、記入枠レコードに示された情報に基づいて記入枠の領域を特定し(例えば図5中の点線で囲まれた領域)、特定した領域から部分領域画像を抽出する。続いて、候補検出部36は、抽出した部分領域画像を二値化して二値画像を生成する。続いて、候補検出部36は、二値画像上で黒画素の連結成分を抽出し、それぞれの連結成分に対してラベリングを行う。ラベリングしたそれぞれの連結成分は、文字を構成する要素であり、断片と呼ぶ。続いて、候補検出部36は、連続して並んだ1個以上の断片を組み合わせて、文字候補を生成する。文字候補は、1個の文字を表していると推測される画素の集合である。
 図6は、断片データの構成を示す図である。候補記憶部38は、断片を表す断片データを記憶する。断片データは、図6に示すように、断片の個数を示す値と、断片の個数分の断片レコードを格納する配列を含む。断片レコードのそれぞれは、それぞれの断片と一対一で対応する。
 それぞれの断片レコードは、対応する断片の位置を示す情報と、断片の形状を示す二値画像を含む。本例において、断片の位置を示す情報は、対応する断片の左右の端のX座標および上下の端のY座標であり、当該断片の外接矩形を示す。断片の形状を示す二値画像は、当該断片の外接矩形内で当該連結成分上の画素を黒画素とし、残りを白画素とした画像である。
 候補検出部36は、それぞれの断片について、中心のX座標と、中心のY座標を算出する。中心のX座標は、左右の端のX座標の平均値である。中心のY座標は、上下の端のY座標の平均値である。そして、候補検出部36は、配列内の複数の断片レコードを、中心のX座標の昇順に整列する。これにより、候補検出部36は、配列内の複数の断片レコードを、記入枠における文字記入方向(本例では左から右に向かう方向)に整列することができる。
 図7は、断片番号の一例を示す図である。それぞれの断片レコードは、配列のインデックスにより識別される。断片レコードを文字記入方向に整列した後のインデックスを、断片番号と呼ぶ。従って、それぞれの断片には、図7に示すように断片番号が対応付けられる。
 図8は、文字候補データの構成を示す図である。候補検出部36は、連続して並んだ1個以上の断片を組み合わせて、文字候補を生成する。この過程において、候補検出部36は、外接の矩形の横幅Lが予め定められた長さ(Lmax)以下となる全てのパターンで1個以上の断片を組み合わせて、文字候補を生成する。
 候補記憶部38は、文字候補を表す文字候補データを記憶する。文字候補データは、図8に示すように、生成した文字候補の個数を示す値と、文字候補マトリクス(詳細後述)と、文字候補の個数分の文字候補レコードを格納する配列を含む。文字候補レコードのそれぞれは、それぞれの文字候補と一対一で対応する。
 それぞれの文字候補レコードは、対応する文字候補の位置を示す情報と、対応する文字候補の始点番号および終点番号(詳細後述)と、文字候補の形状を示す二値画像と、認識候補エントリを含む認識候補の配列(詳細後述)を含む。本例において、文字候補の位置を示す情報は、対応する文字候補の左右の端のX座標および上下の端のY座標であり、二値画像上での当該文字候補の外接矩形を示す。文字候補の形状を示す二値画像は、当該文字候補の外接矩形内で当該文字候補上の画素を黒画素とし、残りを白画素とした画像である。認識候補エントリは、認識部42により値が設定され、候補検出部36では値は設定されない。
 図9は、文字候補番号の一例を示す図である。それぞれの文字候補レコードは、配列のインデックスにより識別される。文字候補レコードのインデックスを、文字候補番号と呼ぶ。従って、それぞれの文字候補には、図9に示すように文字候補番号が対応付けられる。
 図10は、文字候補の始点番号および終点番号の一例を示す図である。文字候補は、連続して並んだ1個以上の断片を組み合わせて生成される。このため文字候補は、元となった1個以上の断片の並びのうちの先頭の断片に対する断片番号と、最後の断片に対する断片番号に1を加算した値とのセットで、一意に識別することができる。
 本実施形態では、先頭の断片に対する断片番号を、その文字候補の始点番号と呼び、最後の断片に対する断片番号に1を加算した値を、その文字候補の終点番号と呼ぶ。従って、それぞれの文字候補には、図10に示すように、始点番号および終点番号が対応付けられる。なお、始点番号および終点番号は、文字候補の区切り位置を表すことから、始点番号および終点番号の両者をまとめて位置番号とも呼ぶ。
 図11は、文字候補マトリクスの一例を示す図である。文字候補マトリクスは、図11に示すように、始点番号を第1インデックス、終点番号を第2インデックスとする文字候補番号の二次元配列である。文字候補マトリクスは、文字候補レコードの生成の開始前に、全てのエントリを-1に設定することで初期化される。そして、候補検出部36は、文字候補を作成する毎に、文字候補マトリクスの対応するエントリに文字候補番号を書き込む。
 図12は、文字認識辞書の構成を示す図である。文字認識辞書記憶部40は、予め作成された文字認識辞書を記憶する。文字認識辞書は、図12に示すように、辞書エントリの個数を示す値と、辞書エントリを格納する配列を含む。
 それぞれの辞書エントリは、文字コードと、予め定められたDsub個の基底ベクトルを含む。基底ベクトルは、文字コードに対応する文字を表す部分空間の特徴ベクトルである。特徴ベクトルは、一例として、対応する文字の二値画像を縦方向および横方向に予め任意に定めた個数で分割し、分割した領域のそれぞれの黒画素の個数の比率を求め、求めた一連の比率を特徴ベクトルの要素とすることで算出される。
 図13は、認識候補の配列の構成を示す図である。文字候補レコードに格納される認識候補の配列は、図13に示すように、予め定められたNcand個の認識候補エントリを含む。それぞれの認識候補エントリは、文字コードと、類似度を含む。
 認識部42は、文字候補のそれぞれに対して文字認識をして、認識結果の候補の文字である少なくとも1つの認識候補を生成する。本実施形態においては、認識部42は、それぞれの文字候補レコードに対して、予め定められたNcand個の認識候補エントリを生成して、認識候補の配列に書き込む。
 より具体的には、認識部42は、対応する文字候補レコードに含まれる二値画像から特徴ベクトルを抽出し、文字認識辞書のそれぞれの辞書エントリに格納された基底ベクトルと部分空間法により照合して類似度を算出する。認識部42は、類似度が上位Ncand個の辞書エントリのそれぞれについて、その辞書エントリに格納された文字コードを抽出し、抽出した文字コードと算出した類似度を含む認識候補エントリを生成する。そして、認識部42は、生成したNcand個の認識候補エントリを対応する文字候補レコードの認識候補の配列に書き込む。さらに、認識部42は、それぞれの文字候補レコードの認識候補の配列に含まれる認識候補エントリを、類似度の降順で整列する。
 図14は、知識辞書の構成を示す図である。知識辞書記憶部44は、設計者等が予め作成した知識辞書を記憶する。
 本実施形態において、知識辞書は、認識対象の文字列をモデル化した決定性有限オートマトンである。本実施形態では、決定性有限オートマトンである知識辞書を、DFAαとも呼ぶ。DFAαは、例えば、設計者が認識対象の文字列を正規表現で記述し、その正規表現を決定性有限オートマトンに変換することで生成される。正規表現から非決定性有限オートマトンまたは決定性有限オートマトンを生成する方法、非決定性有限オートマトンから決定性有限オートマトンを生成する方法は、例えば、A.V.エイホ,R.セシィ,J.D.ウルマン著、原田健一訳、コンパイラI,初版 1986、pp.134-172等に記載されている。
 DFAαは、図14に示すように、状態数を示す値と、状態の数分の状態レコードを格納する状態配列と、エッジの数分のエッジレコードを格納するエッジ配列を含む。
 それぞれの状態レコードは、DFAαに含まれるそれぞれの状態と一対一に対応し、状態は状態レコードの番号すなわち状態番号で一意に識別される。なお、状態配列は0オリジンであり、従って状態番号が0の状態は開始状態である。それぞれの状態レコードは、受理状態フラグと、エッジ配列内のエッジレコードへのポインタと、エッジレコードの要素数を含む。
 受理状態フラグは、当該状態が受理状態であるか否かを示す。受理状態フラグは、一例として、1の場合に受理状態であることを示し、0の場合に受理状態ではないことを示す。
 エッジレコードへのポインタは、エッジ配列内における、当該状態から出て行くエッジの集合の格納位置を示す。エッジレコードの要素数は、当該状態から出て行くエッジの個数を表す。エッジレコードへのポインタおよび要素数により、当該状態から出て行く全てのエッジに対応するエッジレコードを特定することができる。
 それぞれのエッジレコードは、DFAαに含まれるそれぞれのエッジと一対一に対応する。それぞれのエッジレコードは、遷移先の状態番号と、コードを含む。
 遷移先の状態番号は、当該エッジによる遷移先の状態を特定する状態番号を表す。なお、状態番号が0の状態は、開始状態である。
 コードは、当該エッジにより表される遷移を起こす入力記号を表す。本実施形態においては、コードには、文字を表す実文字コードまたは、命令を指定する仮想文字コードが格納される。DFAαでは、エッジに実文字コードが割り当てられている場合には、認識候補の文字を表す文字コードにより、そのエッジに従ってある状態から他の状態への遷移が起きる。また、DFAαでは、エッジに仮想文字コードが割り当てられている場合には、認識候補の文字に関わらず、そのエッジに従ってある状態から他の状態へと遷移が起きるとともに、仮想文字コードにより指定された命令コードが出力される。
 図15は、コードの符号化方法の一例を示す図である。知識辞書のエッジレコードに含まれるコードは、一例として、先頭のビットが符号ビットを表し、2番目のビットが実文字コードか仮想文字コードかの区別を表す。例えば、2番目のビットが0の場合には、実文字コードを表し、2番目のビットが1の場合には仮想文字コードを表し、当該コードにより後述の命令コードが指定される。
 図16は、命令データの一例を示す図である。命令処理部51は、コマンドインタプリタを実行し、仮想文字コードにより指定された命令コードを解釈して、命令コードで定義された処理を実行する。命令データは、例えば、文字列の配列で定義され、仮想文字コードの上位2ビットを0で置き換えた番号を配列の要素の番号とすることで指定される。例えば、図16の命令コード#0は「ADD_SCORE 300」と文字列で記述されており、後述するスコアに指定された値300を加算する加算命令である。また、例えば、図16の命令コード#1は「CHEK_SPACE 5mm」と文字列で記述されており、文字間のスペースが5mm以上であるかを確認する間隔確認命令である。
 図17は、照合結果データの構成を示す図である。照合部46は、文字候補に含まれる認識候補のそれぞれを、先頭から順次に知識辞書と照合して、入力画像の記入枠内に記載されていると推測される文字列と知識辞書を照合して得られる照合結果を生成する。そして、照合部46は、生成した照合結果を、照合結果記憶部48に書き込む。
 照合結果記憶部48は、照合結果データを記憶する。照合結果データは、それぞれの位置番号毎に、照合結果の個数と、照合結果の配列含む。
 照合結果の個数は、当該位置番号に関連付けられた照合結果の個数を表す。照合結果の配列は、当該位置番号に関連付けられた照合結果を格納する。それぞれの照合結果は、状態番号αと、スコアと、コードと、位置番号および照合結果の番号のペア含む。また、それぞれの照合結果は、格納先の配列が関連付けられた位置番号および、格納先の配列内での配列要素としての番号のペアで一意に識別される。以降では、照合結果の格納先の配列が関連付けられた位置番号を「照合結果が関連付けられた位置番号」、照合結果の格納先の配列内での配列要素としての番号を「照合結果の番号」と呼称する。 
 状態番号αは、知識辞書(DFAα)の状態を表す。すなわち、状態番号αは、先頭の認識候補から当該位置の認識候補までのそれぞれの文字に応じて、DFAαを開始状態から順次に遷移させた場合に到達する状態を示す。
 スコアは、先頭の認識候補から当該位置の認識候補までのそれぞれに対応付けられた類似度を累積した値を表す。すなわち、スコアは、先頭の認識候補から当該位置の認識候補までの文字列の尤もらしさを表す。コードは、当該位置の認識候補の文字を表す文字コードである。
 位置番号および照合結果の番号のペアは、先頭から当該位置まで1個ずつ文字候補をたどりながら文字候補の認識候補を入力記号としてDFAαを遷移させながら照合結果を生成していく過程における、直前の照合結果が関連付けられた位置番号および、直前の照合結果の番号を表す。位置番号および照合結果の番号のペアは、結果抽出部54が認識結果の文字列を抽出する際に参照される。
 図18は、照合処理を示すフロー図である。図2のステップS4に示した照合処理の詳細について図18を参照して説明する。
 まず、ステップS11において、照合部46は、照合結果データを初期化する。具体的には、照合部46は、照合結果データの全ての位置番号について、照合結果の個数を0に設定するとともに、照合結果の配列を空にする。
 続いて、ステップS12において、照合部46は、位置番号0に関連付けて、新たな1つの照合結果を生成する。新たな1つの照合結果は、状態番号αが0に、スコアが0に、位置番号および照合結果の番号が-1に、コードが-1に設定される。続いて、ステップS13において、照合部46は、位置番号0に関連付けられた照合結果の個数を1に設定する。続いて、ステップS14において、照合部46は、位置番号を表す変数Pstに0を代入する。
 続いて、ステップS15において、照合部46は、Pstが、Pstmax以下であるか否かを判断する。Pstmaxは、最後の位置番号Pedから1を減じた値である。照合部46は、PstがPstmax以下である場合(ステップS15の真)、処理をステップS16に進める。
 ステップS16において、照合部46は、対応する状態から出て行くエッジに、仮想文字コードが割り当てられたエッジが存在するかを判断する。そして、照合部46は、仮想文字コードが割り当てられたエッジが存在する場合には、状態を遷移させるとともに、仮想文字コードにより指定された命令コードを命令処理部51に与えて、命令を実行させる。なお、命令の実行処理の詳細については、図21および図22を参照して後述する。
 続いて、ステップS17において、照合部46は、Pstに関連付けられた照合結果を、スコアが最上位からNpr番目までに絞り込む。すなわち、照合部46は、スコアがNpr番目より低い照合結果を削除する。
 続いて、ステップS18において、照合部46は、Pstに関連付けられたそれぞれの照合結果に対して、知識辞書を用いて知識辞書探索処理を実行する。これにより、照合部46は、Pstより後ろの位置番号に関連付けた新たな照合結果を生成することができる。なお、知識辞書探索処理については、図19および図20を参照して後述する。
 続いて、ステップS19において、照合部46は、Pstに1を加算する。照合部46は、ステップS19を終了すると、処理をステップS15に戻す。そして、照合部46は、PstがPstmaxを超えるまで、ステップS16からステップS19の処理を繰り返す。
 PstがPstmax以下ではなくなった場合(ステップS15の偽)、照合部46は、処理をステップS20に進める。ステップS20において、照合部46は、最後の位置番号Pedに関連付けられたそれぞれの照合結果について、ステップS16と同様の処理を実行する。そして、照合部46は、ステップS20の処理を終えると、本フローを終了する。
 図19は、知識辞書探索処理を示すフローチャートである。図20は、知識辞書探索処理でのデータアクセスの流れの一例を示す。
 図19および図20を参照しながら、図18のステップS18の知識辞書探索処理を説明する。まず、ステップS31において、照合部46は、照合結果データを参照し、Pstに関連付けられた全ての照合結果を列挙する。
 続いて、ステップS32において、照合部46は、文字候補データの配列内の文字候補レコードを参照し、Pstを始点位置とする全ての文字候補を、文字候補データの配列内の列挙する。照合部46は、文字候補マトリクスにおける始点番号がPstに一致する全てのエントリを走査し、-1以外の文字候補の番号を収集することで、Pstを始点位置とする全ての文字候補を列挙することができる。
 続いて、照合部46は、ステップS32で列挙した全ての文字候補レコードのそれぞれに対して、ステップS34~ステップS48の処理を実行する(ステップS33とステップS49との間のループ処理)。以降ではこのループ処理における処理対象の文字候補レコードに対応する文字候補を「文字候補Cc」と称する。
 ステップS34において、照合部46は、文字候補Ccに対応する文字候補レコードの認識候補の配列を参照し、当該文字候補の全ての認識候補エントリを列挙する。
 続いて、照合部46は、ステップS34で列挙した全ての認識候補エントリのそれぞれに対して、ステップS36~ステップS47の処理を実行する(ステップS35とステップS48との間のループ処理)。以降ではこのループ処理における処理対象の認識候補エントリに対応する認識候補を「認識候補Cr」と称する。
 続いて、照合部46は、ステップS31で列挙した、Pstに関連付けられた全ての照合結果のそれぞれに対して、ステップS37~ステップS46の処理を実行する(ステップS36とステップS47との間のループ処理)。以降ではこのループ処理における処理対象の照合結果を「照合結果Mp」と称する。
 ステップS37において、照合部46は、知識辞書(DFAα)を参照して、処理対象の照合結果Mpに含まれる状態番号αに対応する状態レコードを列挙する。
 続いて、ステップS38において、照合部46は、ステップS37で列挙した状態レコードに含まれるエッジレコードへのポインタおよびエッジレコードの要素数により、状態番号αの状態から出て行くエッジを表すエッジレコードの格納された範囲を特定することで、状態番号αの状態から出て行くエッジを表す全てのエッジレコードを列挙する。
 続いて、照合部46は、ステップS38で列挙した全てのエッジレコードのそれぞれに対して、ステップS40~ステップS45の処理を実行する(ステップS39とステップS46との間のループ処理)。以降ではこのループ処理における処理対象のエッジレコードを「エッジレコードEr」と称する。
 ステップS40において、照合部46は、認識候補Crの認識候補エントリに設定された文字コードと、エッジレコードErに設定された文字コードとが一致するか否かを判断する。一致しない場合(ステップS40のNo)、照合部46は、次のエッジレコードに処理を移し、ステップS40からの処理を繰り返す。一致する場合(ステップS40のYes)、照合部46は、処理をステップS41に進める。
 ステップS41において、照合部46は、文字候補Ccの文字候補レコードの終点位置に関連付けて新しい照合結果Mnを生成して、照合結果データに書き込む。
 続いて、ステップS42において、照合部46は、新しい照合結果Mnに状態番号αにとして、エッジレコードErに設定された状態番号(遷移先の状態番号)を設定する。
 続いて、ステップS43において、照合部46は、新しい照合結果Mnにコードとして、認識候補Crの認識候補エントリに設定された文字コードを設定する。
 続いて、ステップS44において、照合部46は、新しい照合結果Mnに位置番号として、照合結果Mpが関連付けられた位置番号Pstを設定する。また、照合部46は、新しい照合結果Mnに照合結果の番号として、処理対象の照合結果Mpの番号を格納する。
 続いて、ステップS45において、照合部46は、新しい照合結果Mnにスコアとして、処理対象の照合結果Mpに格納されたスコアと、認識候補Crの認識候補エントリに格納された類似度加算した値を設定する。
 ステップS46において、照合部46は、全てのエッジレコードについて、ステップS40~ステップS45の処理を終えると、ループを抜けて処理をステップS47に進める。
 ステップS47において、照合部46は、Pstに関連付けられた全ての照合結果について、ステップS37~ステップS46の処理を終えると、ループを抜けて処理をステップS48に進める。
 ステップS48において、照合部46は、文字候補Ccに対応する全ての認識候補エントリについて、ステップS36~ステップS47の処理を終えると、ループを抜けて処理をステップS49に進める。
 そして、ステップS49において、照合部46は、全ての文字候補レコードについて、ステップS34~ステップS48の処理を終えると、ループを抜けて、本フローを終了する。
 このように照合部46は、第1の文字候補の照合結果に、照合により到達した知識辞書(DFAα)の状態を示す番号(状態番号α)を書き込む。そして、照合部46は、第1の文字候補に続く第2の文字候補を知識辞書(DFAα)と照合する際、第1の文字候補の照合結果に書き込まれた番号(状態番号α)に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合する。
 図21は、命令実行処理を示すフローチャートである。図22は、命令実行処理でのデータの流れを示す。図23は、文字間のスペースの確認の様子を示す図である。
 図21および図22を参照しながら、図18のステップS16の命令実行処理を説明する。まず、ステップS51において、照合部46は、照合結果データを参照し、Pstに関連付けられた全ての照合結果を列挙する。
 続いて、照合部46は、ステップS51で列挙した、Pstに関連付けられた全ての照合結果のそれぞれに対して、ステップS53~ステップS61の処理を実行する(ステップS52とステップS62との間のループ処理)。以降ではこのループ処理における処理対象の照合結果を「照合結果Mp」と称する。
 ステップS53において、照合部46は、知識辞書(DFAα)を参照して、処理対象の照合結果Mpに設定された状態番号αに対応する状態レコードを列挙する。
 続いて、ステップS54において、照合部46は、ステップS53で列挙した状態レコードに設定されたエッジレコードへのポインタおよびエッジレコードの要素数を参照して、状態番号αの状態から出て行くエッジを表す全てのエッジレコードを列挙する。
 続いて、照合部46は、ステップS54で列挙した全てのエッジレコードのそれぞれに対して、ステップS56~ステップS60の処理を実行する(ステップS55とステップS61との間のループ処理)。以降ではこのループ処理における処理対象のエッジレコードを「エッジレコードEr」と称する。
 ステップS56において、照合部46は、エッジレコードErのコードが、仮想文字コードであるか否かを判断する。照合部46は、一例として、コードの先頭から2ビット目を検出して、仮想文字コードであるか否かを判断する。仮想文字コードではない場合(ステップS56のNo)、照合部46は、次のエッジレコードに処理を移し、ステップS56からの処理を繰り返す。仮想文字コードである場合(ステップS56のYes)、照合部46は、処理をステップS57に進める。
 ステップS57において、照合部46は、Pstに関連付けて新しい照合結果Mnを生成して、照合結果データに書き込む。
 続いて、ステップS58において、照合部46は、新しい照合結果Mnに状態番号αとして、エッジレコードErに設定された状態番号(遷移先の状態番号)を設定する。
 続いて、ステップS59において、照合部46は、新しい照合結果Mnに状態番号α以外の要素(スコア、コード、位置番号および照合結果の番号)として、照合結果Mpの対応する値を複写する。これにより、照合部46は、仮想文字コードが割り当てられたエッジに従って、状態を遷移させることができる。
 続いて、ステップS60において、照合部46は、命令処理部51を呼び出して、仮想文字コードにより指定された命令コードを与えて、命令を実行させる。命令処理部51は、コマンドインタプリタを実装しており、与えられた命令コードを解釈して、当該命令コードで定義された処理を実行する。
 例えば、命令処理部51は、加算命令「ADD_SCORE」が与えられた場合には、引数で指定された値を対応する照合結果のスコアに加算する。これにより、命令処理部51は、予め定められた条件の場合にスコアに重みを加えて、文字列の尤もらしさの評価を操作することができる。
 また、例えば、図21のステップS60において位置番号Pstに関連付けられた照合結果Mpの処理中に、仮想文字コードにより間隔確認命令「CHECK_SPACE」を含む命令コードが実行された場合、図23に示すように、命令処理部51は、位置番号Pstの直前の断片と直後の断片の間隔を確認することで、位置番号Mpの前後の文字間のスペースを確認する。そして、命令処理部51は、間隔が指定された距離以下の場合には、照合結果Mpを削除する。これにより、命令処理部51は、例えば、性と名との間の区切りのスペースを確認し、予め定められた距離より長いスペースが検出されない場合に照合結果を削除することができる。
 続いて、ステップS61において、照合部46は、全てのエッジレコードについて、ステップS56~ステップS60の処理を終えると、ループを抜けて処理をステップS62に進める。
 ステップS62において、照合部46は、Pstに関連付けられた全ての照合結果について、ステップS53~ステップS61の処理を終えると、ループを抜けて、本フローを終了する。
 このように照合部46は、第1の文字候補の照合結果に、照合により到達した知識辞書(DFAα)の状態を示す番号(状態番号α)を書き込む。そして、照合部46は、第1の文字候補に続く第2の文字候補を知識辞書(DFAα)と照合する際、第1の文字候補の照合結果に書き込まれた番号(状態番号α)に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合し、第2の文字候補の照合結果を生成する。
 さらに、照合部46は、仮想文字コードが割り当てられたエッジが検出された場合には、そのエッジに従って状態を遷移させるとともに、仮想文字コードにより指定された命令コードを命令処理部51に与えて、命令を実行させることができる。
 図24は、結果抽出部で行われる文字列の抽出の処理の流れを示すフロー図である。図25は、結果抽出において参照されるデータとスタック上に積まれる文字コードの様子を示す図である。
 図2のステップS5に示した結果抽出は結果抽出部54で行われる。以降では、結果抽出の詳細について図24および図25を参照して説明する。まず、ステップS70において結果抽出部54は、文字候補の個数が0であるか否か確認し、文字候補の個数が0の場合はステップS84において認識結果の文字列を空文字列として本フローを終了する。文字候補の個数が0でない場合は、ステップS71において、結果抽出部54は、最後の位置番号Pedに関連付けられた全ての照合結果を列挙した上でステップS72以降の処理を実行する。
 続いて、ステップS72において、結果抽出部54は、ステップS71において列挙した照合結果のそれぞれについて、知識辞書(DFAα)から状態番号αに対応する状態レコードを取得して、受理状態フラグを確認する。
 続いて、ステップS73において、結果抽出部54は、状態番号αに対応する状態が受理状態の照合結果があるかを判断する。以降では、状態番号αに対応する状態が受理状態の照合結果を「DFAαで受理状態の照合結果」と称する。DFAαで受理状態の照合結果がある場合には(ステップS73のYes)、ステップS74において、結果抽出部54は、DFAαで受理状態の照合結果のうち、スコアが最大の照合結果を照合結果Mxとして選択する。DFAαで受理状態の照合結果が無い場合には(ステップS73のNo)、ステップS75において、結果抽出部54は、列挙した全ての照合結果のうち、スコアが最大の照合結果を照合結果Mxとして選択する。
 ステップS74またはステップS75の処理に続いて、ステップS76において、結果抽出部54は、位置番号を表す変数pに、選択した照合結果Mxが関連付けられた位置番号pxを代入する。また、結果抽出部54は、照合結果の番号を表す変数mに、選択した照合結果Mxの番号mxを代入する。
 続いて、ステップS77において、結果抽出部54は、FILO(First In Last Out)メモリであるスタックを空にする。
 続いて、ステップS78において、pとmとが指す照合結果のコードが-1であるかを判断する。pとmとが指す照合結果のコードが-1ではない場合(ステップS78の偽)、結果抽出部54は、処理をステップS79に進める。
 ステップS79において、結果抽出部54は、pとmとが指す照合結果に格納されているコードをスタックに積む。続いて、ステップS80において、結果抽出部54は、pにpとmとが指す照合結果に格納された位置番号を、mにpとmとが指す照合結果に格納された照合結果の番号を代入する。
 そして、結果抽出部54は、ステップS80の処理を終えると、処理をステップS78に戻して、pとmとが指す照合結果に格納されたコードが-1となるまで、ステップS79とステップS80の処理を繰り返す。これにより、結果抽出部54は、図25に示すように、文字列の末尾から順に文字コードを選択して、スタックに積み上げていくことができる。
 pとmとが指す照合結果のコードが-1である場合(ステップS78の真)、すなわち、位置番号が0に関連付けられた照合結果を指す場合には、結果抽出部54は、処理をステップS81に進める。ステップS81において、結果抽出部54は、メモリに格納された認識結果の文字列を空文字列に初期化する。
 続いて、ステップS82において、スタックが空であるかを判断する。スタックが空ではない場合(ステップS82の偽)、結果抽出部54は、ステップS83において、スタックのトップからコードを1つ取り出して、メモリに格納された認識結果の文字列の末尾に追加する。
 ステップS83の処理を終えると、結果抽出部54は、処理をステップS82に戻して、スタックが空になるまで、ステップS83の処理を繰り返す。これにより、結果抽出部54は、文字列の先頭から末尾までを生成することができる。
 そして、結果抽出部54は、スタックが空となった場合(ステップS82の真)、本フローの処理を終了する。
 以上のように、本実施形態に係る認識装置10は、知識辞書を用いて文字認識をするとともに、照合処理に同期させて照合処理とは異なる処理を実行することができる。
 図26は、実施形態に係る認識装置10のハードウェア構成を示す図である。
 認識装置10は、プログラムを実行可能な一般的なコンピュータシステムにより実現することができる。認識装置10は、一例として、ディスプレイ110と、キーボード112と、スキャナ114と、外部記憶装置116と、通信装置118と、コンピュータ120備える。
 ディスプレイ110は、表示装置であり、認識した文字列等を表示する。キーボード112は、入力装置であり、ユーザからの操作を受け付けて情報を入力する。スキャナ114は、用紙等に記載された情報を読み取って入力画像等を取得する。外部記憶装置116は、ハードディスクドライブまたは光ディスクドライブ等であり、各種の情報を記憶する。通信装置118は、インターネット等を介して外部のコンピュータ等と情報を入出力し、例えば入力画像を外部から取得したり、文字列を外部へと出力したりする。
 コンピュータ120は、一例として、CPU122と、入出力制御部124と、記憶装置126有する。CPU122、入出力制御部124および記憶装置126は、バス128により接続される。
 CPU122は、プログラムを実行して認識装置10の全体の制御をする。入出力制御部124は、ディスプレイ110、キーボード112、スキャナ114、外部記憶装置116および通信装置118等とのインターフェイスである。また、入出力制御部124は、バス128を介したデータ転送等も制御する。
 記憶装置126は、ROM、RAMまたはハードディスクドライブ等を含む。記憶装置126では、同一のアドレス空間により、ROM、RAMまたはハードディスクドライブ等の何れのデバイスに対してもアクセスが可能である。記憶装置126は、プログラム、入力画像、様式データ、辞書データ(文字認識辞書および知識辞書)、作業データ(文字候補および照合結果)、および、命令データ等を記憶する。これらのデータは、記憶装置を構成する何れのデバイス(ROM、RAMおよびハードディスクドライブ)に記憶されていてもよい。また、これらのデータは、一部または全部が、外部記憶装置116、または、通信装置118を介してアクセスされるサーバ等に記憶されていてもよい。
 本実施形態の認識装置10で実行されるプログラムは、インストール可能な形式又は実行可能な形式のファイルでCD-ROM、フレキシブルディスク(FD)、CD-R、DVD等のコンピュータで読み取り可能な記録媒体に記録されて提供される。また、本実施形態の認識装置10で実行されるプログラムを、インターネット等のネットワークに接続されたコンピュータ上に格納し、ネットワーク経由でダウンロードさせることにより提供するように構成してもよい。また、本実施形態の認識装置10で実行されるプログラムをインターネット等のネットワーク経由で提供または配布するように構成してもよい。
 本実施形態の認識装置10で実行されるプログラムは、上述した各部(入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56)を含むモジュール構成となっており、実際のハードウェアとしてはCPU(プロセッサ)が上記記憶媒体からプログラムを読み出して実行することにより上記各部が主記憶装置上にロードされ、入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56が記憶装置126上に生成されるようになっている。なお、入力部30、候補検出部36、認識部42、照合部46、命令処理部51、結果抽出部54および出力部56は、一部または全部がハードウェアで構成されていてもよい。
 本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、請求の範囲に記載された発明とその均等の範囲に含まれる。

Claims (8)

  1.  入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、
     前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、
     前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、
     与えられた命令を実行する命令処理部と、
     を備え、
     前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、
     前記照合部は、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を前記命令処理部に与える
     認識装置。
  2.  前記照合部は、対応する文字列の尤もらしさを表すスコアを含む照合結果を生成し、
     前記認識装置は、前記照合結果から前記スコアに基づき1つの照合結果を選択し、選択した照合結果により特定される文字列を抽出する結果抽出部をさらに備える
     請求項1に記載の認識装置。
  3.  前記命令処理部が、指定された値を対応する照合結果のスコアに加算する加算命令を処理することを特徴とする
     請求項2に記載の認識装置。
  4.  前記命令処理部が、照合結果が関連付けられた位置の前後の文字間のスペースを確認し、指定された距離以下の場合には対応する照合結果を削除する間隔確認命令を処理することを特徴とする
     請求項2に記載の認識装置。
  5.  前記知識辞書は、決定性有限オートマトンであり、
     前記照合部は、
     第1の文字候補の照合結果に、照合により到達した前記決定性有限オートマトンの状態を示す番号を書き込み、
     前記第1の文字候補に続く第2の文字候補を前記決定性有限オートマトンと照合する際、前記第1の文字候補の照合結果に書き込まれた番号に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合する
     請求項2に記載の認識装置。
  6.  入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出部と、
     前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識部と、
     前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合部と、
     与えられた命令を実行する命令処理部と、
     を備え、
     前記知識辞書は、決定性有限オートマトンであって、文字コードがエッジに割り当てられ、
     前記照合部は、第1の文字候補の照合結果に、照合により到達した前記決定性有限オートマトンの状態を示す番号を書き込み、前記第1の文字候補に続く第2の文字候補を前記決定性有限オートマトンと照合する際、前記第1の文字候補の照合結果に書き込まれた番号に示される状態から第2の文字候補の認識候補による状態遷移に対応するエッジを辿ることで第2の文字候補を照合し、第2の文字候補の照合結果を生成する
     認識装置。
  7.  入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出ステップと、
     前記文字候補のそれぞれを認識して、認識結果の候補の文字である少なくとも1つの認識候補を生成する認識ステップと、
     前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合ステップと、
     与えられた命令を実行する命令処理ステップと、
     を含み、
     前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を含む仮想文字コードのいずれか一方がエッジに割り当てられ、
     前記照合ステップでは、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードに含まれる命令を実行する
     認識方法。
  8.  コンピュータを認識装置として機能させるためのプログラムであって、
     前記コンピュータに、
     入力画像から、文字を含むと推測される画素の集合である文字候補を検出する候補検出ステップと、
     前記文字候補のそれぞれを認識して、認識結果の候補の文字である表す少なくとも1つの認識候補を生成する認識ステップと、
     前記少なくとも1つの認識候補のそれぞれを、認識対象の文字列をモデル化した知識辞書と照合して、前記入力画像に含まれると推測される文字列と知識辞書を照合して得られる照合結果を生成する照合ステップと、
     与えられた命令を実行する命令処理ステップと、
     を実行させ、
     前記知識辞書は、有限オートマトンであって、文字を表す実文字コードおよび命令を指定する仮想文字コードのいずれか一方がエッジに割り当てられ、
     前記照合ステップでは、前記仮想文字コードが割り当てられたエッジに従って前記知識辞書の状態を遷移させる場合、当該エッジに割り当てられた前記仮想文字コードにより指定された命令を実行させる
     プログラム。
PCT/JP2015/063482 2015-05-11 2015-05-11 認識装置、認識方法およびプログラム Ceased WO2016181458A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/JP2015/063482 WO2016181458A1 (ja) 2015-05-11 2015-05-11 認識装置、認識方法およびプログラム
CN201580078064.6A CN107533651B (zh) 2015-05-11 2015-05-11 识别装置、识别方法及计算机可读取的记录介质
US15/709,774 US10515297B2 (en) 2015-05-11 2017-09-20 Recognition device, recognition method, and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2015/063482 WO2016181458A1 (ja) 2015-05-11 2015-05-11 認識装置、認識方法およびプログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/709,774 Continuation US10515297B2 (en) 2015-05-11 2017-09-20 Recognition device, recognition method, and computer program product

Publications (1)

Publication Number Publication Date
WO2016181458A1 true WO2016181458A1 (ja) 2016-11-17

Family

ID=57248963

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2015/063482 Ceased WO2016181458A1 (ja) 2015-05-11 2015-05-11 認識装置、認識方法およびプログラム

Country Status (3)

Country Link
US (1) US10515297B2 (ja)
CN (1) CN107533651B (ja)
WO (1) WO2016181458A1 (ja)

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS636176A (ja) 1986-06-27 1988-01-12 旭化成株式会社 ポリアミド系合成繊維用処理剤
US6246794B1 (en) 1995-12-13 2001-06-12 Hitachi, Ltd. Method of reading characters and method of reading postal addresses
JP3313272B2 (ja) 1996-01-08 2002-08-12 株式会社日立製作所 住所読み取り方法および識別関数重みベクトル生成方法
JP3452774B2 (ja) * 1997-10-16 2003-09-29 富士通株式会社 文字認識方法
JPH11143893A (ja) 1997-11-07 1999-05-28 Matsushita Electric Ind Co Ltd 単語照合装置
JP2000148906A (ja) 1998-11-10 2000-05-30 Hitachi Ltd 文書認識装置および郵便区分機
JP4006176B2 (ja) 2000-10-04 2007-11-14 日立オムロンターミナルソリューションズ株式会社 文字列認識装置
US7046848B1 (en) * 2001-08-22 2006-05-16 Olcott Peter L Method and system for recognizing machine generated character glyphs and icons in graphic images
JP4183527B2 (ja) * 2003-02-24 2008-11-19 日立オムロンターミナルソリューションズ株式会社 帳票定義データ作成方法および帳票処理装置
US8560475B2 (en) * 2004-09-10 2013-10-15 Cavium, Inc. Content search mechanism that uses a deterministic finite automata (DFA) graph, a DFA state machine, and a walker process
WO2008117454A1 (ja) * 2007-03-27 2008-10-02 Fujitsu Limited 情報検索プログラム、該プログラムを記録した記録媒体、情報検索装置、および情報検索方法
CN101911067A (zh) * 2008-01-08 2010-12-08 三菱电机株式会社 信息过滤系统、信息过滤方法以及信息过滤程序
JP5647919B2 (ja) * 2011-03-07 2015-01-07 株式会社Nttドコモ 文字認識装置、文字認識方法、文字認識システム、および文字認識プログラム
US8725749B2 (en) * 2012-07-24 2014-05-13 Hewlett-Packard Development Company, L.P. Matching regular expressions including word boundary symbols
CN103729452B (zh) * 2013-12-31 2017-05-10 杭州华为数字技术有限公司 一种规则匹配方法及装置
US9852217B2 (en) * 2014-08-26 2017-12-26 Codota Dot Com Ltd. Searching and ranking of code in videos

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KATSUMI MARUKAWA ET AL.: "An Error Correction Algorithm for Handwritten Kanji Address Recognition", TRANSACTIONS OF INFORMATION PROCESSING SOCIETY OF JAPAN, vol. 35, no. 6, 15 June 1994 (1994-06-15), pages 1101 - 1110 *

Also Published As

Publication number Publication date
US10515297B2 (en) 2019-12-24
US20180012111A1 (en) 2018-01-11
CN107533651A (zh) 2018-01-02
CN107533651B (zh) 2021-05-04

Similar Documents

Publication Publication Date Title
CN110178139B (zh) 使用具有注意力机制的全卷积神经网络的字符识别的系统和方法
TWI321294B (en) Method and device for determining at least one recognition candidate for a handwritten pattern
JP5125573B2 (ja) 領域抽出プログラム、文字認識プログラム、および文字認識装置
JP5647919B2 (ja) 文字認識装置、文字認識方法、文字認識システム、および文字認識プログラム
KR102293538B1 (ko) 음악 심볼들을 인식하기 위한 방법 및 장치
JP2001175811A (ja) 単語大分類装置及びその単語大分類方法並びにその制御プログラムを記録した記録媒体
JP2730665B2 (ja) 文字認識装置および方法
US10438097B2 (en) Recognition device, recognition method, and computer program product
JP2008310772A (ja) 情報処理装置、その制御プログラムおよび該制御プログラムを記録したコンピュータ読み取り可能な記録媒体、ならびに制御方法
JP7322468B2 (ja) 情報処理装置、情報処理方法及びプログラム
JP5942361B2 (ja) 画像処理装置及び画像処理プログラム
JP6320089B2 (ja) 認識装置、認識方法およびプログラム
JP2019204214A (ja) 学習装置、学習方法、プログラム及び推定装置
JP5252596B2 (ja) 文字認識装置、文字認識方法及びプログラム
JP6334209B2 (ja) 認識装置、認識方法およびプログラム
CN102138141B (zh) 近似比对装置、近似比对方法、程序及记录介质
US12406512B2 (en) Information processing apparatus, information processing method, computer program product, and recording medium
CN107533651B (zh) 识别装置、识别方法及计算机可读取的记录介质
JP2010237909A (ja) 知識補正プログラム、知識補正装置および知識補正方法
JP2007048272A (ja) 文字列検索装置およびプログラム
US20020126903A1 (en) Word recognizing apparatus for dynamically generating feature amount of word and method thereof
CN115605920B (zh) 信息处理装置、信息处理方法及记录介质
JP7693410B2 (ja) 情報処理システム、方法及びプログラム
KR102962083B1 (ko) 라벨 이미지를 이용한 ocr 기반 상품 정보 결정 방법 및 시스템
US20260051190A1 (en) Information processing apparatus, information processing method, and recording medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15891784

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15891784

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP