JP2014130510A - Method and device for recognizing character - Google Patents

Method and device for recognizing character Download PDF

Info

Publication number
JP2014130510A
JP2014130510A JP2012288382A JP2012288382A JP2014130510A JP 2014130510 A JP2014130510 A JP 2014130510A JP 2012288382 A JP2012288382 A JP 2012288382A JP 2012288382 A JP2012288382 A JP 2012288382A JP 2014130510 A JP2014130510 A JP 2014130510A
Authority
JP
Japan
Prior art keywords
character
segment
cost
route
node
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
JP2012288382A
Other languages
Japanese (ja)
Other versions
JP6166532B2 (en
Inventor
Masanori Yokota
政憲 横田
Masafumi Maeda
雅史 前田
Mayumi Ueda
真弓 植田
Shigeko Fumino
滋子 文野
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.)
Glory Ltd
Original Assignee
Glory Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glory Ltd filed Critical Glory Ltd
Priority to JP2012288382A priority Critical patent/JP6166532B2/en
Publication of JP2014130510A publication Critical patent/JP2014130510A/en
Application granted granted Critical
Publication of JP6166532B2 publication Critical patent/JP6166532B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To obtain the result of character recognition by segmenting individual characters from a handwritten string.SOLUTION: The result of character recognition is obtained by performing the steps of: obtaining a string image and dividing the string image into a plurality of basic segments on the basis of the outline thereof; converting the basic segments into character segments while generating character segments into which a plurality of basic segment are combined; calculating a character cost representing the degree of similarity between the character segment and the result of character recognition, and performing any one of a process of giving a connecting line cost to character segment having a possibility of being a connecting line in addition to the character cost and a process of giving a noise cost to a character segment having a possibility of being noise in addition to the character cost; searching for an optimal path for combining character segments on the basis of the character cost and one or both of connecting line cost and noise cost; and segmenting individual characters from the string on the basis of the character segment forming the searched optimal path.

Description

この発明は、手書きの文字列を撮像した文字列画像から各文字を切り出して文字認識結果を得る文字認識方法及び文字認識装置に関する。   The present invention relates to a character recognition method and a character recognition device that extract each character from a character string image obtained by imaging a handwritten character string and obtain a character recognition result.

従来、帳票を撮像した画像から帳票に記入された文字を自動的に文字認識する装置が利用されている。近年は枠内に文字を一文字ずつ記入する文字枠ではなく、1つの記入枠内に複数の文字を自由に記入できる帳票が増えている。このような帳票の記入枠内では、隣接する文字が互いに接続されるように、続けて書かれることも多い。文字認識を行う際には、各文字を接続する線は不要であり、各文字のみを切り出すことが望ましい。このため、続けて書かれた手書きの文字列から各文字を切り出すために、様々な技術が利用されている。   Conventionally, an apparatus for automatically recognizing characters entered in a form from an image obtained by capturing the form has been used. In recent years, there is an increasing number of forms in which a plurality of characters can be freely entered in one entry frame instead of a character frame in which characters are entered one by one in the frame. In such a form entry frame, it is often written continuously so that adjacent characters are connected to each other. When performing character recognition, a line connecting each character is not necessary, and it is desirable to cut out only each character. For this reason, in order to cut out each character from the handwritten character string written continuously, various techniques are utilized.

例えば、特許文献1では、隣接する文字を接続する続き線を抽出することにより、各文字を切り出す方法が開示されている。具体的には、文字列を形成する画素の中から横方向に長いパターンを抽出して、これが水平続き線であるか否かを判定する。そして、水平続き線である場合には、該水平続き線から文字列の輪郭を探索して垂直方向に分割する垂直分離線の位置を決定する。垂直分離線により一文字毎に分割した後、得られた文字がゼロである場合には続き線を消去することにより、各文字を切り出すものである。   For example, Patent Document 1 discloses a method of cutting out each character by extracting a continuous line connecting adjacent characters. Specifically, a pattern that is long in the horizontal direction is extracted from the pixels that form the character string, and it is determined whether or not this is a horizontal continuous line. If it is a horizontal continuous line, the contour of the character string is searched from the horizontal continuous line, and the position of the vertical separation line to be divided in the vertical direction is determined. After dividing each character by a vertical separation line, if the obtained character is zero, each character is cut out by erasing the continuous line.

また、特許文献2では、候補文字の組み合わせを求めることにより、各文字を切り出す方法が開示されている。具体的には、文字列を複数の部分に分割して、隣接する文字を接続する文字線を含む候補文字、文字線を含まない候補文字等、複数の候補文字を生成する。そして、各候補文字の組み合わせから候補文字ラティスを生成して、該候補文字ラティス上で、各候補文字の文字認識結果を評価する評価値に基づいて最適経路を探索する。そして、最適経路に基づいて各文字を切り出すものである。   Patent Document 2 discloses a method of cutting out each character by obtaining a combination of candidate characters. Specifically, the character string is divided into a plurality of portions, and a plurality of candidate characters such as a candidate character including a character line connecting adjacent characters and a candidate character not including a character line are generated. Then, a candidate character lattice is generated from the combination of each candidate character, and an optimum route is searched on the candidate character lattice based on an evaluation value for evaluating the character recognition result of each candidate character. Then, each character is cut out based on the optimum route.

また、非特許文献1では、文字列を、一文字よりも細かい基本セグメントに細かく分割した後、各文字を形成する基本セグメントの組合せを求めることにより、各文字を切り出す方法が開示されている。具体的には、文字列を細かく分割した基本セグメントの組み合わせをグラフ構造化して候補ラティスを生成する。そして、基本セグメントを組み合わせて構成される各候補文字の文字認識結果を評価しながら基本セグメントを組み合わせる最適経路を探索する。そして、最適経路に基づいて各文字を切り出すものである。   Non-Patent Document 1 discloses a method of cutting out each character by dividing a character string into basic segments finer than one character and then obtaining a combination of basic segments forming each character. Specifically, a candidate lattice is generated by forming a graph structure of combinations of basic segments obtained by finely dividing a character string. Then, an optimum route for combining the basic segments is searched for while evaluating the character recognition result of each candidate character configured by combining the basic segments. Then, each character is cut out based on the optimum route.

特許第3188580号公報Japanese Patent No. 3188580 特開2009−199102号公報JP 2009-199102 A

登内洋次郎著、「高精度オンライン枠なし文字認識技術」、東芝レビューVol.66、No.4、(2011)、p.56−57Yojiro Tonouchi, “High-precision online frameless character recognition technology”, Toshiba Review Vol. 66, no. 4, (2011), p. 56-57

しかしながら、上記従来技術によれば、手書きされた文字の状態等によっては各文字を正確に切り出せない場合があった。例えば、特許文献1に記載の方法では、隣接する文字をつなぐ続き線(以下では接続線と記載する)がかすれて書かれているために、接続線が接続線として認識されず、各文字を正確に切り出せない場合があった。具体的には、例えば接続線がかすれて途中で切断された状態で書かれていると、接続線が文字として認識され、文字「−(ハイフン)」として切り出される場合があった。   However, according to the above prior art, each character may not be cut out accurately depending on the state of the handwritten character. For example, in the method described in Patent Document 1, since a continuation line (hereinafter referred to as a connection line) connecting adjacent characters is faintly written, the connection line is not recognized as a connection line, and each character is In some cases, it could not be cut out accurately. Specifically, for example, if the connection line is written in a state where the connection line is faint and cut in the middle, the connection line may be recognized as a character and cut out as a character “-(hyphen)”.

また、特許文献2及び非特許文献1に記載の方法では、ラティス上で最適経路を探索するためにDPマッチング法(動的計画法(Dynamic Programming)によるマッチング手法)が利用され、各候補文字の文字認識結果に基づいて、最適経路の探索が行われる。例えば、候補文字が文字認識結果として得られた文字である可能性が高いほど小さい値を示す認識コストを利用する。そして、各候補文字の認識コストに基づいて、認識コストが最小となるように候補文字をつなぐ経路をたどってゆくことによって最適経路を探索する。言い換えれば、この手法では、各候補文字の認識コストが定まっていなければ最適経路を探索することができない。このため、文字「−(ハイフン)」が含まれる可能性のある文字列で、接続線とハイフンとが酷似しているために文字認識時に接続線であるのかハイフンであるのかを正確に判定できず、誤認識された状態で最適経路が探索されて、最終的に誤った文字認識結果が得られる場合がある。   In addition, in the methods described in Patent Document 2 and Non-Patent Document 1, a DP matching method (a matching method based on dynamic programming) is used to search for an optimum route on the lattice, and each candidate character is searched. Based on the character recognition result, the optimum route is searched. For example, a recognition cost indicating a smaller value is used as the candidate character is more likely to be a character obtained as a character recognition result. Then, based on the recognition cost of each candidate character, the optimum route is searched by following the route connecting the candidate characters so that the recognition cost is minimized. In other words, in this method, the optimum route cannot be searched unless the recognition cost of each candidate character is determined. For this reason, it is possible to accurately determine whether it is a connection line or a hyphen at the time of character recognition because the connection line and the hyphen are very similar in a character string that may contain the character “-(hyphen)”. In some cases, the optimum route is searched in a state of being erroneously recognized, and an erroneous character recognition result is finally obtained.

本発明は、上述した従来技術による問題点を解消するためになされたもので、文字列が接続線で接続された文字を含む場合でも、接続線と文字とを分割して各文字を正確に切り出して文字認識結果を得ることができる文字認識方法及び文字認識装置を提供することを目的とする。   The present invention has been made to solve the above-described problems caused by the prior art. Even when a character string includes characters connected by a connection line, the connection line and the character are divided to accurately identify each character. An object of the present invention is to provide a character recognition method and a character recognition device that can be cut out to obtain a character recognition result.

上述した課題を解決し、目的を達成するために、本発明は、手書きの文字列から各文字を切り出して認識する文字認識方法であって、前記文字列が含まれる文字列画像を取得する画像取得工程と、前記文字列画像の輪郭形状に基づいて前記文字列画像を複数の基本セグメントに分割する画像分割工程と、前記基本セグメントを文字セグメントとすると共に前記基本セグメントを複数組み合わせた文字セグメントを生成する文字セグメント生成工程と、生成された各文字セグメントと該文字セグメントを文字認識して得られた文字との類似度を示す文字コストを求めると共に、接続線の可能性がある文字セグメントに前記文字コストに加えて接続線コストを付与する処理及びノイズの可能性がある文字セグメントに前記文字コストに加えてノイズコストを付与する処理の少なくともいずれか一方を行うセグメント評価工程と、前記セグメント評価工程で得られた文字コストと、接続線コスト及びノイズコストの少なくともいずれか一方とに基づいて各文字セグメントを組み合わせる最適経路を探索する最適経路探索工程と、前記最適経路探索工程で探索された最適経路を形成する文字セグメントに基づいて前記文字列から各文字を切り出す文字切出工程とを含んだことを特徴とする。   In order to solve the above-described problems and achieve the object, the present invention is a character recognition method for recognizing and recognizing each character from a handwritten character string, and an image for acquiring a character string image including the character string An acquisition step, an image dividing step of dividing the character string image into a plurality of basic segments based on a contour shape of the character string image, and character segments obtained by combining the basic segments as character segments and combining the basic segments. A character segment generation step to be generated, a character cost indicating the similarity between each generated character segment and a character obtained by character recognition of the character segment, and a character segment having a possibility of a connection line In addition to the character cost, a process that gives a connection line cost in addition to the character cost and a character segment that may cause noise Optimal combination of character segments based on a segment evaluation process that performs at least one of the process of assigning costs, a character cost obtained in the segment evaluation process, and at least one of a connection line cost and a noise cost An optimum route searching step for searching for a route; and a character cutting step for cutting out each character from the character string based on the character segment forming the optimum route searched in the optimum route searching step. .

また、本発明は、上記発明において、前記最適経路探索工程で、最適経路であるか否かを評価する評価コストを算出する際に、接続線の可能性がある文字セグメントを通る経路では前記文字コスト及び前記接続線コストから2つの評価コストを算出して以降の経路探索に利用して、ノイズの可能性がある文字セグメントを通る経路では前記文字コスト及び前記ノイズコストから2つの評価コストを算出して以降の経路探索に利用することを特徴とする。   Further, in the above invention, the present invention provides the above-described invention, wherein, in the optimum route search step, when calculating an evaluation cost for evaluating whether or not the route is an optimum route, the character passes through a character segment that may be a connection line. Two evaluation costs are calculated from the cost and the connection line cost, and are used for a subsequent route search, and two evaluation costs are calculated from the character cost and the noise cost in a route passing through a character segment that may be noisy. And is used for the subsequent route search.

また、本発明は、上記発明において、前記最適経路探索工程では、文字として認識された前記文字セグメントと、隣接する文字セグメントとの接続状態に応じて、前記文字セグメントの文字コストにペナルティを付加することを特徴とする。   Further, according to the present invention, in the above-described invention, in the optimum route searching step, a penalty is added to the character cost of the character segment according to a connection state between the character segment recognized as a character and an adjacent character segment. It is characterized by that.

また、本発明は、上記発明において、前記最適経路探索工程では、最適経路であるか否かを評価する評価コストを、経路上で認識された文字の数に基づいて算出することを特徴とする。   In the above-mentioned invention, the present invention is characterized in that, in the optimum route searching step, an evaluation cost for evaluating whether or not the route is an optimum route is calculated based on the number of characters recognized on the route. .

また、本発明は、上記発明において、前記画像分割工程は、前記文字列画像から輪郭を抽出する輪郭抽出工程と、抽出した輪郭上にある画素を注目画素として該注目画素から所定距離だけ離れた前記輪郭上の2点とを結んだ線分の成す角度を前記注目画素の角度として算出する角度算出工程と、前記注目画素の角度が所定値以下である場合に切断開始点として特定する切断開始点特定工程と、前記切断開始点特定工程で特定された切断開始点と、前記輪郭上にある画素との距離を算出して、該距離の変化から極小値を示す画素を切断終点として特定する切断終点特定工程と、前記切断開始点と前記切断終点とを結ぶ切断線により前記文字列画像を切断して分割する工程とを含んだことを特徴とする。   Also, in the present invention according to the above-described invention, the image dividing step includes a contour extracting step of extracting a contour from the character string image, and a pixel on the extracted contour as a target pixel, and is separated from the target pixel by a predetermined distance. An angle calculating step of calculating an angle formed by a line segment connecting two points on the contour as an angle of the target pixel, and a cutting start specified as a cutting start point when the angle of the target pixel is equal to or less than a predetermined value The distance between the point specifying step, the cutting start point specified in the cutting start point specifying step, and the pixel on the contour is calculated, and the pixel showing the minimum value is specified as the cutting end point from the change in the distance A cutting end point specifying step, and a step of cutting and dividing the character string image by a cutting line connecting the cutting start point and the cutting end point.

また、本発明は、手書きの文字列から各文字を切り出して認識する文字認識装置であって、前記文字列が含まれる文字列画像を取得する入力画像取得部と、前記文字列画像の輪郭形状に基づいて前記文字列画像を複数の基本セグメントに分割する入力画像分割部と、前記基本セグメントを文字セグメントとすると共に前記基本セグメントを複数組み合わせた文字セグメントを生成するセグメント生成部と、生成された各文字セグメントと該文字セグメントを文字認識して得られた文字との類似度を示す文字コストを求めると共に、接続線である可能性がある文字セグメントに前記文字コストに加えて接続線コストを付与する処理及びノイズの可能性がある文字セグメントに前記文字コストに加えてノイズコストを付与する処理の少なくともいずれか一方を行うセグメント評価部と、前記セグメント評価部によって得られた文字コストと、接続線コスト及びノイズコストの少なくともいずれか一方とに基づいて各文字セグメントを組み合わせる最適経路を探索する最適経路探索部と、前記最適経路探索部によって探索された最適経路を形成する各文字セグメントに基づいて前記文字列から各文字を切り出す文字切出部とを備えることを特徴とする。   Further, the present invention is a character recognition device that cuts out and recognizes each character from a handwritten character string, and an input image acquisition unit that acquires a character string image including the character string; and an outline shape of the character string image An input image dividing unit that divides the character string image into a plurality of basic segments, and a segment generation unit that generates a character segment that is a combination of a plurality of the basic segments and the basic segment as a character segment, A character cost indicating the degree of similarity between each character segment and the character obtained by character recognition of the character segment is obtained, and a connection line cost is added to the character segment that may be a connection line in addition to the character cost. And at least a process of assigning a noise cost to a character segment with a possibility of noise in addition to the character cost. Optimal route search for searching for an optimum route for combining character segments based on a segment evaluation unit that performs one of the above, a character cost obtained by the segment evaluation unit, and at least one of a connection line cost and a noise cost And a character cutout unit that cuts out each character from the character string based on each character segment that forms the optimum route searched by the optimum route search unit.

本発明によれば、文字列を文字である可能性のある複数の文字セグメントに分割して、文字セグメントを組み合わせる最適経路を探索する際に、文字セグメントが接続線である可能性がある場合には、文字である場合と接続線である場合との両方の可能性を残した状態で最適経路を探索することができる。また、文字セグメントがノイズである可能性がある場合にも、同様に、文字である場合とノイズである場合との両方の可能性を残した状態で最適経路を探索することができる。これにより、文字セグメントが、文字、接続線及びノイズのいずれであるかを正確に判定して、文字列から各文字を切り出して、正確な文字認識結果を得ることができる。   According to the present invention, when a character string is likely to be a connection line when a character string is divided into a plurality of character segments that may be characters and an optimum path for combining the character segments is searched for. Can search for the optimum route with the possibility of being both a character and a connection line. Similarly, when there is a possibility that the character segment is noise, the optimum route can be searched in a state where both the case of being a character and the case of being a noise remain. As a result, it is possible to accurately determine whether the character segment is a character, a connection line, or noise, and cut out each character from the character string to obtain an accurate character recognition result.

また、本発明によれば、各文字セグメントを通過する最適経路を探索する際に、接続線又はノイズの可能性がある文字セグメントでは、文字である場合の文字コストと、接続線である場合の接続線コスト又はノイズである場合のノイズコストとを利用して、最適経路であるか否かを評価する評価コストを算出することができる。そして、これを中間コストとして保持した状態で、経路上で下流側にある文字セグメントを考慮して最適経路の探索を行うことができるので、文字セグメントが文字、接続線及びノイズのいずれであるかを正確に判定して、文字列から各文字を切り出して、正確な文字認識結果を得ることができる。   In addition, according to the present invention, when searching for the optimum path that passes through each character segment, in the character segment that may be a connection line or noise, the character cost in the case of a character and the case of a connection line By using the connection line cost or the noise cost in the case of noise, it is possible to calculate an evaluation cost for evaluating whether or not the route is optimal. And, with this being held as an intermediate cost, it is possible to search for the optimum route in consideration of the character segment downstream on the route, so whether the character segment is a character, a connection line, or noise Can be accurately determined, and each character can be cut out from the character string to obtain an accurate character recognition result.

また、本発明によれば、一文字を分割した部分領域が単独文字として誤認識されることを回避するために、隣接する文字セグメントと接続されている場合に文字コストにペナルティを加えて評価コストを算出することにより、各文字セグメントが一文字であるか一文字を分割した部分領域であるかを正確に判定することができる。   In addition, according to the present invention, in order to avoid a partial area obtained by dividing one character from being erroneously recognized as a single character, a penalty is added to the character cost when it is connected to an adjacent character segment, thereby reducing the evaluation cost. By calculating, it is possible to accurately determine whether each character segment is one character or a partial region obtained by dividing one character.

また、本発明によれば、例えば、最適経路であるか否かを各文字セグメントの文字コストの平均値で評価する場合に、経路上に含まれる文字数を考慮して経路探索を行うので、最適経路を正確に探索することができる。   Further, according to the present invention, for example, when evaluating whether or not the route is an optimal route by using the average character cost of each character segment, the route search is performed in consideration of the number of characters included in the route. The route can be searched accurately.

また、本発明によれば、文字列画像を基本セグメントに分割する際に、文字列画像の輪郭を形成する画素の中から筆跡の方向が変化した可能性のある切断開始点と該切断開始点に対応する切断終点とを特定して、切断開始点と切断終点とを結ぶ切断線により文字列画像を分割するので、文字列画像を文字又は文字を形成する部分領域に分割して、最適経路の探索を正確に行うことができる。   Further, according to the present invention, when the character string image is divided into basic segments, the cutting start point where the direction of the handwriting may have changed from the pixels forming the outline of the character string image, and the cutting start point Since the character string image is divided by the cutting line connecting the cutting start point and the cutting end point, the character string image is divided into partial areas that form characters or characters, and the optimum route is determined. Can be accurately searched.

図1は、本実施形態に係る文字認識装置の構成概略を説明するブロック図である。FIG. 1 is a block diagram illustrating a schematic configuration of a character recognition device according to the present embodiment. 図2は、文字列画像を基本セグメントに分割する方法を説明する図である。FIG. 2 is a diagram for explaining a method of dividing a character string image into basic segments. 図3は、文字列画像を基本セグメントに分割する切断線を構成する切断開始点及び切断終点について説明する図である。FIG. 3 is a diagram illustrating a cutting start point and a cutting end point that constitute a cutting line that divides a character string image into basic segments. 図4は、文字列画像を切断する切断線を集約する方法について説明する図である。FIG. 4 is a diagram illustrating a method for collecting cutting lines for cutting character string images. 図5は、文字列画像を基本セグメントに分割した例を示す図である。FIG. 5 is a diagram illustrating an example in which a character string image is divided into basic segments. 図6は、文字列画像から文字セグメントを生成して各ノードを結ぶ探索経路を設定する方法について説明する図である。FIG. 6 is a diagram for explaining a method of generating a character segment from a character string image and setting a search path connecting the nodes. 図7は、接続線を含む各文字セグメントのコストについて説明する図である。FIG. 7 is a diagram for explaining the cost of each character segment including a connection line. 図8は、最適経路の探索時に各ノードで保存される情報について説明する図である。FIG. 8 is a diagram for explaining information stored in each node when searching for an optimum route. 図9は、各文字セグメントのコストに基づいて最適経路を探索する方法について説明する図である。FIG. 9 is a diagram illustrating a method for searching for an optimum route based on the cost of each character segment. 図10は、最適経路として得られた経路をバックトレースする方法について説明する図である。FIG. 10 is a diagram for explaining a method of back-tracing the route obtained as the optimum route. 図11は、各文字セグメントのコストの平均値から最適経路を探索する方法を説明する図である。FIG. 11 is a diagram for explaining a method for searching for the optimum route from the average value of the cost of each character segment. 図12は、実施例2で処理対象とする文字列画像から文字セグメントを生成して、文字数を考慮した探索経路を設定する方法について説明する図である。FIG. 12 is a diagram for explaining a method for generating a character segment from a character string image to be processed in the second embodiment and setting a search path in consideration of the number of characters. 図13は、文字数を考慮した探索経路で最適経路を探索する方法について説明する図である。FIG. 13 is a diagram illustrating a method for searching for an optimum route using a search route in consideration of the number of characters. 図14は、最適経路として得られた経路のバックトレースを示す図である。FIG. 14 is a diagram showing a back trace of a route obtained as the optimum route. 図15は、実施例3で処理対象とする文字列画像について説明する図である。FIG. 15 is a diagram illustrating a character string image to be processed in the third embodiment. 図16は、図15に示す画像について実施例2に係る方法で最適経路を探索した結果を示す図である。FIG. 16 is a diagram illustrating a result of searching for an optimum route for the image illustrated in FIG. 15 by the method according to the second embodiment. 図17は、文字セグメントに付与するペナルティについて説明する図である。FIG. 17 is a diagram for explaining a penalty given to a character segment. 図18は、図15に示す画像についてペナルティを考慮して最適経路を探索した結果を示す図である。FIG. 18 is a diagram illustrating a result of searching for an optimum route for the image illustrated in FIG. 15 in consideration of a penalty. 図19は、ペナルティ及び局所的制約の有無により最適経路の探索結果が異なることを説明する図である。FIG. 19 is a diagram for explaining that the optimum route search result varies depending on whether there is a penalty or local restriction. 図20は、実施例3で処理対象とする別の文字列画像の例を示す図である。FIG. 20 is a diagram illustrating an example of another character string image to be processed in the third embodiment. 図21は、図20に示す文字列画像で設定される探索経路を示す図である。FIG. 21 is a diagram showing search paths set in the character string image shown in FIG. 図22は、図20に示す文字列画像から生成された各文字セグメントの文字認識結果及びコストを示す図である。FIG. 22 is a diagram showing the character recognition result and cost of each character segment generated from the character string image shown in FIG. 図23は、図20に示す領域D1で行われる経路探索を説明する図である。FIG. 23 is a diagram for explaining the route search performed in the region D1 shown in FIG. 図24は、図20に示す領域D2で行われる経路探索を説明する図である。FIG. 24 is a diagram for explaining the route search performed in the region D2 shown in FIG.

以下に添付図面を参照して、この発明に係る文字認識方法及び文字認識装置の好適な実施例について詳細に説明する。この発明に係る文字認識方法は、平仮名、カタカナ、漢字、数字、アルファベット等、各種の文字に適用可能であるが、以下では、数字を例に説明を行うこととする。   Exemplary embodiments of a character recognition method and a character recognition apparatus according to the present invention will be explained below in detail with reference to the accompanying drawings. The character recognition method according to the present invention can be applied to various characters such as hiragana, katakana, kanji, numbers, alphabets, etc., but the following description will be made taking numbers as an example.

図1は、本実施例に係る文字認識方法を実現する文字認識装置1の構成概略を示すブロック図である。文字認識装置1は、外部から入力される文字列画像を受けて、この文字列画像から文字認識した各文字を切り出して文字画像として外部へ出力したり、各文字を文字認識した結果を出力したりする機能を有している。   FIG. 1 is a block diagram illustrating a schematic configuration of a character recognition device 1 that implements the character recognition method according to the present embodiment. The character recognition device 1 receives a character string image input from the outside, cuts out each character recognized from the character string image and outputs it as a character image, or outputs a result of character recognition of each character. It has a function to do.

文字認識装置1は、入力画像取得部11と、入力画像分割部12と、セグメント生成部13と、セグメント評価部14と、最適経路探索部15と、認識結果出力部16とを有している。入力画像取得部11は外部から入力される文字列画像を受信する機能を有し、入力画像分割部12は入力画像取得部11で取得された文字列画像を最小単位の基本セグメントに分割する機能を有する。セグメント生成部13は、入力画像分割部12で分割された基本セグメントを文字セグメントとすると共に、複数の基本セグメントを組み合わせて文字セグメントを生成する機能を有する。セグメント評価部14は、セグメント生成部13で生成された各文字セグメントの文字認識を行って、各文字セグメントと文字認識結果との類似度を評価する文字コストを算出する機能を有する。最適経路探索部15は、文字セグメントの組み合わせとして設定された探索経路の中から最適経路を探索する機能を有する。最適経路探索部15によって探索された最適経路上にある各文字セグメントが、入力された文字列画像から切り出される各文字、すなわち、文字列に含まれる各文字の文字認識結果となる。認識結果出力部16は、文字切出部として機能して、最適経路探索部15によって探索された最適経路に基づいて、文字列画像から各文字が含まれる文字画像を切り出して外部へ出力したり、切り出した各文字画像の文字認識結果を出力したりする機能を有している。なお、文字認識装置1は、専用のハードウェア及びソフトウェアプログラムにより実現される態様であってもよいし、汎用のコンピュータ装置上で専用のソフトウェアプログラムを実行することにより実現される態様であっても構わない。   The character recognition device 1 includes an input image acquisition unit 11, an input image division unit 12, a segment generation unit 13, a segment evaluation unit 14, an optimum route search unit 15, and a recognition result output unit 16. . The input image acquiring unit 11 has a function of receiving a character string image input from the outside, and the input image dividing unit 12 is a function of dividing the character string image acquired by the input image acquiring unit 11 into basic segments of the minimum unit. Have The segment generation unit 13 has a function of generating a character segment by combining a plurality of basic segments while making the basic segment divided by the input image dividing unit 12 a character segment. The segment evaluation unit 14 has a function of performing character recognition of each character segment generated by the segment generation unit 13 and calculating a character cost for evaluating the similarity between each character segment and the character recognition result. The optimal route search unit 15 has a function of searching for an optimal route from search routes set as combinations of character segments. Each character segment on the optimum route searched by the optimum route search unit 15 becomes a character recognition result of each character cut out from the inputted character string image, that is, each character included in the character string. The recognition result output unit 16 functions as a character cutout unit, cuts out a character image including each character from the character string image based on the optimum route searched by the optimum route search unit 15, and outputs the character image to the outside. And a function of outputting a character recognition result of each extracted character image. The character recognition device 1 may be implemented by dedicated hardware and software programs, or may be implemented by executing dedicated software programs on a general-purpose computer device. I do not care.

以下では、入力画像取得部11によって取得された文字列画像を入力画像分割部12によって基本セグメントに分割する処理から、最適経路探索部15によって最適経路を探索して、文字列に含まれる各文字を文字認識した結果が得られるまでの処理の詳細について説明する。   In the following, from the process of dividing the character string image acquired by the input image acquisition unit 11 into basic segments by the input image dividing unit 12, the optimum route searching unit 15 searches for the optimum route, and each character included in the character string is searched. Details of the processing until the result of character recognition is obtained will be described.

次に、図2〜図5を参照しながら、入力された文字列画像を基本セグメントに分割する処理について説明する。図2は、文字列画像を基本セグメントに分割する切断線の起点となる切断開始点を決定する処理を説明する図である。   Next, a process of dividing the input character string image into basic segments will be described with reference to FIGS. FIG. 2 is a diagram illustrating processing for determining a cutting start point that is a starting point of a cutting line that divides a character string image into basic segments.

図2(a)は、入力画像取得部11によって取得された文字列画像を示している。この文字列画像では、3文字から成る文字列「200」が、隣接する文字を接続する接続線によって接続された状態で書かれている。具体的には、1文字目の文字「2」と2文字目の文字「0」の間、2文字目の文字「0」と3文字目の文字「0」の間が接続線によって接続されている。   FIG. 2A shows a character string image acquired by the input image acquisition unit 11. In this character string image, a character string “200” consisting of three characters is written in a state of being connected by a connection line connecting adjacent characters. Specifically, the first character “2” and the second character “0” are connected by a connecting line between the second character “0” and the third character “0”. ing.

入力画像分割部12は、この文字列画像から、図2(b)に示すように、輪郭を形成する画素のみを抽出する。そして、輪郭を形成する各画素位置で、その画素が切断開始点であるか否かを判定する。   As shown in FIG. 2B, the input image dividing unit 12 extracts only the pixels forming the contour from the character string image. Then, at each pixel position forming the contour, it is determined whether or not the pixel is a cutting start point.

図2(c)は、同図(b)に矢印で示した画素A1が切断開始点であるか否かを判定する処理を説明する図である。図2(c)では、各画素を円形状で示している。図2(c)に示すように、判定対象となる画素A1から所定距離だけ離れた位置にある輪郭上の2つの画素を、各々画素P1及び画素P2とする。そして、画素A1と画素P1を結ぶ線分と、画素A1と画素P2を結ぶ線分との間の角度(図2(b)に示す輪郭外側の角度)をθとする。そして、この角度θが所定角度以下である場合に、画素A1は切断開始点であると判定する。こうして、文字列の輪郭を形成する各画素位置で判定を行って、切断開始点となる画素を抽出すると、例えば、図2(d)に白丸で示すように、複数の切断開始点が抽出される。   FIG. 2C is a diagram for explaining processing for determining whether or not the pixel A1 indicated by the arrow in FIG. 2B is a cutting start point. In FIG. 2C, each pixel is shown in a circular shape. As shown in FIG. 2C, two pixels on the contour located at a predetermined distance from the pixel A1 to be determined are defined as a pixel P1 and a pixel P2, respectively. An angle between a line segment connecting the pixel A1 and the pixel P1 and a line segment connecting the pixel A1 and the pixel P2 (an angle outside the contour shown in FIG. 2B) is θ. When the angle θ is equal to or smaller than the predetermined angle, the pixel A1 is determined to be a cutting start point. Thus, when the determination is made at each pixel position forming the outline of the character string and the pixel that becomes the cutting start point is extracted, for example, a plurality of cutting start points are extracted as shown by white circles in FIG. The

図2(c)に示す角度θは、輪郭を形成する画素の接線方向の変化量を示している。すなわち、この角度θが小さいほど、この画素位置で輪郭が鋭角に曲がっていることを示す。例えば、一文字を書く間に筆跡の方向が変わる点、文字を書いた後に接続線を書くために筆跡の方向が変わる点、接続線を書いた後に文字を書くために筆跡の方向が変わる点等で、輪郭の成す角度が鋭角となる。全ての接続線を左右の文字から分割するため、角度θが所定角度以下である場合には、接続線とは無関係に一文字の中に含まれる画素を含めて、全てを切断開始点として抽出するものである。   The angle θ shown in FIG. 2C indicates the amount of change in the tangential direction of the pixels forming the contour. That is, as the angle θ is smaller, the contour is bent at an acute angle at the pixel position. For example, the direction of the handwriting changes while writing a character, the direction of the handwriting changes to write a connection line after writing the character, the direction of the handwriting changes to write a character after writing the connection line, etc. Thus, the angle formed by the contour becomes an acute angle. Since all connection lines are divided from the left and right characters, when the angle θ is equal to or smaller than the predetermined angle, all the pixels including the pixels included in one character are extracted as cutting start points regardless of the connection lines. Is.

入力画像分割部12は、切断開始点を抽出した後、この切断開始点に対応する切断終点を探索する。切断開始点と対応する切断終点とを結ぶ線分を切断線として、文字列画像が切断されて、切断後の各領域が基本セグメントとなる。図3は、切断開始点A1に対応する切断終点の探索方法を説明する図である。図3に矢印で示したように、切断開始点A1から、輪郭を形成する画素を順にたどりながら、各画素位置で切断開始点A1からの距離を求める。そして、求めた切断開始点A1からの距離をグラフ化した際に、距離が極小値をとる位置にある画素を切断終点として選択する。図3では、切断開始点を円形状、切断終点を矩形形状で示している。こうして、各切断開始点に対応する切断終点を探索した後、切断開始点と切断終点とを切断候補ペアとして、各切断候補ペアを評価する。   After extracting the cutting start point, the input image dividing unit 12 searches for a cutting end point corresponding to the cutting start point. The character string image is cut using the line segment connecting the cutting start point and the corresponding cutting end point as a cutting line, and each area after cutting becomes a basic segment. FIG. 3 is a diagram illustrating a method for searching for a cutting end point corresponding to the cutting start point A1. As indicated by arrows in FIG. 3, the distance from the cutting start point A1 is determined at each pixel position while sequentially tracing the pixels forming the contour from the cutting start point A1. Then, when the obtained distance from the cutting start point A1 is graphed, the pixel at the position where the distance takes the minimum value is selected as the cutting end point. In FIG. 3, the cutting start point is shown in a circular shape and the cutting end point is shown in a rectangular shape. Thus, after searching for a cutting end point corresponding to each cutting start point, each cutting candidate pair is evaluated with the cutting start point and cutting end point as a cutting candidate pair.

例えば、図3に示すように、切断候補ペアである切断開始点A1と切断終点a11とを線分で結んだときに、破線で示したように、文字列画像の輪郭の外側(図2(a)に示す文字列画像の黒画素以外の領域)を通る場合には、この切断候補ペアは文字列画像を切断するものではないと判定する。そして、画素a11を切断終点から除外する。これに対して、切断開始点A1と切断終点a12との切断候補ペアでは、これらを結ぶ線分が、文字列画像の輪郭から文字列画像内部のみを通っているので、この切断候補ペアは文字列画像を切断するのに適していると判定して、画素a12を切断終点として維持する。こうして、不要な切断終点が除外された後、図3に実線で示したように、各切断開始点(白丸)と対応する切断終点(白矩形)とを結ぶ切断線が設定される。   For example, as shown in FIG. 3, when a cutting start point A1 and a cutting end point a11, which are cutting candidate pairs, are connected by a line segment, as shown by a broken line, outside the outline of the character string image (FIG. 2 ( In the case of passing through a region other than black pixels of the character string image shown in a), it is determined that this cutting candidate pair does not cut the character string image. Then, the pixel a11 is excluded from the cutting end point. On the other hand, in the cutting candidate pair of the cutting start point A1 and the cutting end point a12, the line segment connecting them passes only from the outline of the character string image to the inside of the character string image. It is determined that it is suitable for cutting the row image, and the pixel a12 is maintained as the cutting end point. Thus, after unnecessary cutting end points are excluded, cutting lines connecting the respective cutting start points (white circles) and the corresponding cutting end points (white rectangles) are set as indicated by solid lines in FIG.

不要な切断終点を除いた後も、複数の切断線が近接して存在する場合や、複数の切断線が交差した状態で存在する場合があるので、これらを集約して、最終的な切断線を決定する。図4は、切断線を集約する方法を説明する図である。図4(a)に示す矩形領域Bを拡大したものが同図(b)であり、同図(c)は同図(b)に示す切断線を集約した結果を示している。なお、図4では、切断開始点(A2及びA3)を白丸で示し、切断終点(a21、a22、a23、a31、a32及びa33)を白矩形で示している。また、各切断開始点と対応する各切断終点とを結ぶ切断線c3〜c8を実線で示し、この切断線上に位置する画素を矩形で示している。   Even after removing unnecessary cutting end points, there may be multiple cutting lines in close proximity, or multiple cutting lines may exist in an intersecting state. To decide. FIG. 4 is a diagram illustrating a method for collecting cutting lines. FIG. 4B is an enlarged view of the rectangular area B shown in FIG. 4A, and FIG. 4C shows the result of the cutting lines shown in FIG. In FIG. 4, the cutting start points (A2 and A3) are indicated by white circles, and the cutting end points (a21, a22, a23, a31, a32 and a33) are indicated by white rectangles. In addition, cutting lines c3 to c8 connecting each cutting start point and each corresponding cutting end point are indicated by solid lines, and pixels located on the cutting lines are indicated by rectangles.

ここで、近接とは、切断候補ペアである切断開始点Hと切断終点Iによる線分を切断線HI、別の切断候補ペアである切断開始点Jと切断終点Kによる線分を切断線JKとした場合に、線分HJ及びIKの長さが所定値以下である場合、又は、線分HK及びIJの長さが所定値以下である場合を言う。これらの長さが予め設定された所定値以下である場合には、切断線HIとJKのうち、長い方の切断線が除外される。具体的には、例えば、図4(b)に示したように、切断候補ペアである切断開始点A3と切断終点a33とを結ぶ切断線c3と、切断開始点A3と切断終点a32とを結ぶ切断線c4とがあって、切断開始点A3が共通しており(距離ゼロ)、切断終点a32とa22との間が所定値以下の距離である場合に、2本の切断線c3及びc4は近接していると判定される。そして、2本の切断線c3及びc4のうち、長い方の切断線c3を除外するとの判定がなされて、画素a33が切断終点から除外される。なお、交差した切断線がある場合にも、同様に、長い方の切断線が除外される。   Here, the proximity refers to a line segment formed by the cutting start point H and the cutting end point I, which is a cutting candidate pair, as a cutting line HI, and a line segment formed by another cutting candidate pair, the cutting start point J and the cutting end point K, as a cutting line JK. In this case, the length of the line segments HJ and IK is equal to or less than a predetermined value, or the length of the line segments HK and IJ is equal to or less than the predetermined value. When these lengths are less than or equal to a predetermined value set in advance, the longer one of the cutting lines HI and JK is excluded. Specifically, for example, as shown in FIG. 4B, the cutting line c3 connecting the cutting start point A3 and the cutting end point a33, which are cutting candidate pairs, and the cutting start point A3 and the cutting end point a32 are connected. When there is a cutting line c4, the cutting start point A3 is common (distance zero), and the distance between the cutting end points a32 and a22 is a predetermined value or less, the two cutting lines c3 and c4 are Determined to be close. Then, it is determined that the longer one of the two cutting lines c3 and c4 is excluded, and the pixel a33 is excluded from the cutting end point. Similarly, when there are intersecting cutting lines, the longer cutting line is also excluded.

切断線の集約を行う際に、水平に近い切断線がある場合には、この切断線が優先して除外される。文字列が、横方向に並んだ文字によって形成されるものであり、各文字を切断する方向及び文字と接続線とを切断する方向はいずれも縦方向になることから、横方向の切断線を除外するものである。すなわち、文字列を形成する文字の並び方向と同一方向の切断線が除外される。例えば、図4(b)では、切断線c7とc8とが近接している。この場合、水平である切断線c7を除外するとの判定がなされて、画素a21が切断終点から除外される。また、同様に、交差する切断線c5及びc6のうち、水平である切断線c5を除外するとの判定がなされて、画素a31が切断終点から除外される。こうして切断線を集約した結果、図4(b)に示す6本の切断線c3〜c8が3本の切断線c4、c6及びc8に集約されて、同図(c)に示すように、領域Bの文字列画像が領域B1〜B4の4つの領域に分割されることになる。   When cutting lines are aggregated, if there is a cutting line close to the horizontal, this cutting line is preferentially excluded. The character string is formed by characters arranged in the horizontal direction, and since the direction of cutting each character and the direction of cutting the character and the connecting line are both vertical, the horizontal cutting line is Exclude it. That is, cutting lines in the same direction as the arrangement direction of characters forming the character string are excluded. For example, in FIG. 4B, the cutting lines c7 and c8 are close to each other. In this case, it is determined that the horizontal cutting line c7 is excluded, and the pixel a21 is excluded from the cutting end point. Similarly, it is determined that the horizontal cutting line c5 is excluded from the intersecting cutting lines c5 and c6, and the pixel a31 is excluded from the cutting end point. As a result of consolidating the cutting lines in this way, the six cutting lines c3 to c8 shown in FIG. 4B are collected into three cutting lines c4, c6 and c8, and as shown in FIG. The character string image of B is divided into four areas B1 to B4.

図5は、切断線によって基本セグメントに分割された文字列画像の例を示す図である。このように、入力画像分割部12によって文字列画像を分割する切断線が決定されると、例えば、図2(a)に示す文字列画像が、図5に示すようにB0〜B14の15の領域に分割される。このとき分割された各領域が基本セグメントとなる。   FIG. 5 is a diagram illustrating an example of a character string image divided into basic segments by a cutting line. In this way, when the cutting line for dividing the character string image is determined by the input image dividing unit 12, for example, the character string image shown in FIG. 2A is converted into 15 B0 to B14 as shown in FIG. Divided into regions. Each area divided at this time becomes a basic segment.

以下では、文字列から、該文字列を形成する各文字を切り出して文字認識結果を得る方法について詳細を説明する。図6は、文字列画像から文字セグメントを生成して各ノードを結ぶ探索経路を設定する方法について説明する図である。なお、図6〜図14では、説明を簡単にするため、2つの文字「0(ゼロ)」が接続線によって接続して書かれた場合を例に説明する。   In the following, a method for cutting out each character forming the character string from the character string and obtaining a character recognition result will be described in detail. FIG. 6 is a diagram for explaining a method of generating a character segment from a character string image and setting a search path connecting the nodes. 6 to 14, an example in which two characters “0 (zero)” are written by connecting with a connection line will be described for the sake of simplicity.

図6(a)は入力画像取得部11によって取得された文字列画像を示し、同図(b)はこの文字列画像が入力画像分割部12によって基本セグメントS1〜S3に分割された結果を示している。ここで、図6(b)に示すS0は、最適経路探索時の開始点を示す仮のセグメントである。また、図6(c)は、セグメント生成部13によって生成された文字セグメントに基づいて、最適経路探索部15によって設定された探索経路を示す図である。セグメント生成部13は、各基本セグメントを文字セグメントとすると共に、複数の基本セグメントを組み合わせて文字セグメントを生成する。すなわち、基本セグメントで取り得る組み合わせの全てを文字セグメントとする。例えば、図6(c)では、文字セグメントS1〜S3に加えて、S1及びS2を組み合わせたもの、S2及びS3を組み合わせたもの、S1〜S3全てを組み合わせたものが、それぞれ文字セグメントとされる。また、探索経路についても、同様に、各文字セグメントの組み合わせから取り得る全ての経路が探索経路として設定される。   6A shows a character string image acquired by the input image acquisition unit 11, and FIG. 6B shows a result of dividing the character string image into basic segments S1 to S3 by the input image dividing unit 12. ing. Here, S0 shown in FIG. 6B is a temporary segment indicating the starting point when searching for the optimum route. FIG. 6C is a diagram showing a search route set by the optimum route search unit 15 based on the character segment generated by the segment generation unit 13. The segment generation unit 13 sets each basic segment as a character segment and generates a character segment by combining a plurality of basic segments. That is, all combinations that can be taken in the basic segment are set as character segments. For example, in FIG. 6C, in addition to the character segments S1 to S3, a combination of S1 and S2, a combination of S2 and S3, and a combination of all S1 to S3 are set as character segments. . Similarly, for the search route, all routes that can be taken from combinations of character segments are set as the search route.

図6(c)に示したn0〜n3は、基本セグメントS0〜S3に対応するノードを示している。各ノードn0〜n3をつなぐ経路上に対応する各文字セグメントがあって、経路を右方向にたどってゆくことで文字セグメントの組合せが表現される。例えば、最適経路がノードn0からノードn1に至る経路であると判定された場合には、文字列画像に含まれる最初の文字が、この経路上にある文字セグメントS1であると判定されたことを示し、最適経路がノードn0からノードn2に至る経路であると判定された場合には、文字列画像に含まれる最初の文字が、この経路上にある、基本セグメントS1及びS2を組み合わせた文字セグメント(S1+S2)であると判定されたことを示す。   N0 to n3 illustrated in FIG. 6C indicate nodes corresponding to the basic segments S0 to S3. There is a corresponding character segment on the path connecting the nodes n0 to n3, and the character segment combination is expressed by following the path to the right. For example, when it is determined that the optimal route is a route from the node n0 to the node n1, it is determined that the first character included in the character string image is the character segment S1 on the route. In the case where it is determined that the optimum route is a route from the node n0 to the node n2, the first character included in the character string image is a character segment combining the basic segments S1 and S2 on the route. It is determined that it is determined that (S1 + S2).

こうして、文字列画像を分割した基本セグメントから文字セグメントを生成して、各文字セグメントに基づいて探索経路が設定される一方で、セグメント評価部14による文字セグメントの評価が行われる。具体的には、各文字セグメントの文字認識処理を行って、各文字セグメントと得られた文字認識結果との類似度を評価する評価値であるコストを算出して、これを文字コストとする。なお、文字コストは、文字セグメントが文字認識結果として得られた文字である可能性を評価する評価値であれば、その算出方法や内容は特に限定されず、点数、距離、確率等、様々な数値を利用することができる。以下では、文字コストが、文字認識結果と文字セグメントとが類似するほど(正しく文字認識された可能性が高いほど)小さい値を示す数値であるものとして説明を続ける。   Thus, a character segment is generated from the basic segment obtained by dividing the character string image, and a search path is set based on each character segment, while the segment evaluation unit 14 evaluates the character segment. Specifically, the character recognition process of each character segment is performed, a cost that is an evaluation value for evaluating the similarity between each character segment and the obtained character recognition result is calculated, and this is used as the character cost. Note that the character cost is not particularly limited as long as it is an evaluation value for evaluating the possibility that the character segment is a character obtained as a character recognition result, and there are various points such as points, distances, probabilities, etc. Numerical values can be used. In the following, the description will be continued assuming that the character cost is a numerical value indicating a smaller value as the character recognition result and the character segment are more similar (as the possibility of correct character recognition is higher).

図7は、セグメント評価部14によって得られた各文字セグメントのコストと、図6(c)に示す探索経路との関係を示す図である。本実施例では、最適経路を求めるためのコストが、経路上にある各文字セグメントのコストの和で定義され、探索経路上で取り得る経路のうち、コストの和が最小となる経路が最適経路となる。   FIG. 7 is a diagram showing the relationship between the cost of each character segment obtained by the segment evaluation unit 14 and the search path shown in FIG. In this embodiment, the cost for obtaining the optimum route is defined by the sum of the costs of each character segment on the route, and the route with the smallest sum of costs among the possible routes on the searched route is the optimum route. It becomes.

ここで、図7のノードn1からノードn2に至る経路上に示したように、文字セグメントS2は、コストの値が102の文字「−(ハイフン)」又はコストの値が10の接続線として取り扱われる。なお、以下では、文字コストと区別するために、接続線とした場合のコストを接続線コストと記載する。   Here, as shown on the path from the node n1 to the node n2 in FIG. 7, the character segment S2 is treated as a character “-(hyphen)” having a cost value of 102 or a connection line having a cost value of 10. It is. Hereinafter, in order to distinguish from the character cost, the cost in the case of the connection line is described as the connection line cost.

セグメント評価部14は、文字セグメントの文字認識結果として、例えば、文字「−(ハイフン)」や漢字の「一」のように、接続線が誤って文字認識された可能性がある結果が得られた場合には、この文字セグメントに、文字認識結果に基づく文字コストに加えて接続線としての接続線コストを付与する。本実施例では、接続線コストの値が10とされる。このように、文字セグメントがハイフン又は接続線のいずれかである場合には、文字認識の段階でいずれであるかを決定することなく、両方の可能性を残した状態で、処理を進める。   The segment evaluation unit 14 obtains a result that there is a possibility that the connection line has been erroneously recognized as a character recognition result of the character segment, such as the character “-(hyphen)” or the kanji “one”. In this case, a connection line cost as a connection line is given to this character segment in addition to the character cost based on the character recognition result. In this embodiment, the value of the connection line cost is 10. As described above, when the character segment is either a hyphen or a connection line, the processing is performed in a state where both possibilities remain without determining which one is the character recognition stage.

なお、接続線の他、ノイズが誤って文字認識された可能性がある場合にも、同様に、この文字セグメントには、文字コストに加えて、ノイズとしてのノイズコストが付与される。例えば、文字セグメントの大きさが所定の大きさ以下である場合に、この文字セグメントに、文字コストに加えてノイズとしてのノイズコストが付与される。なお、ノイズコストとして付与する値はノイズとされた文字セグメントの大きさによって変更される。例えば、本実施例では、ノイズの大きさにより、ノイズコストとして10〜40の値を付与する。   In addition to the connection line, when there is a possibility that noise is erroneously recognized, this character segment is similarly given a noise cost as noise in addition to the character cost. For example, when the size of the character segment is equal to or smaller than a predetermined size, a noise cost as noise is given to the character segment in addition to the character cost. Note that the value assigned as the noise cost is changed depending on the size of the character segment regarded as noise. For example, in this embodiment, a value of 10 to 40 is assigned as the noise cost depending on the magnitude of noise.

また、後の実施例で詳細を説明するが、文字セグメントの文字認識結果及び隣接する文字セグメントとの接続状態に応じて、ペナルティとしてコストを付加する場合もある。各コストの数値については、処理対象となる文字の種類や手書き文字に表れる傾向等々によって異なるため、予め、サンプルを準備して実験的に決定することが望ましい。例えば、処理対象とする帳票から多数のサンプルを取得して、本実施形態で説明する方法で正しい処理結果が得られるように実験的にコストの数値を決定する。これにより、その後は、決定した数値を利用して、文字列に含まれる各文字を正確に切り出して文字認識結果を得ることが可能となる。   Although details will be described in a later embodiment, a cost may be added as a penalty depending on a character recognition result of a character segment and a connection state with an adjacent character segment. Since the numerical value of each cost varies depending on the type of character to be processed, the tendency to appear in handwritten characters, and the like, it is desirable to prepare a sample in advance and determine it experimentally. For example, a large number of samples are acquired from a form to be processed, and the cost value is experimentally determined so that a correct processing result can be obtained by the method described in this embodiment. Thereby, thereafter, using the determined numerical value, it is possible to accurately extract each character included in the character string and obtain a character recognition result.

最適経路を探索するための探索経路及びコストが決定されると、最適経路探索部15により、最適経路の探索が開始される。図8は、最適経路の探索時に、各ノードで保存される情報を示している。図8に示す項目の「仮説」は、各文字セグメントの文字認識結果に基づいて、文字認識結果が文字である場合、接続線である場合、ノイズである場合の各々の仮定の下で情報を保存することを示している。また、「評価コスト」については、文字セグメントが文字である場合には文字の欄に、接続線である場合には接続線の欄に、ノイズである場合にはノイズの欄に、そのノードに至るまでの最小コストの和が保存される。そして、「前ノード」については、最小コストが得られた1つ前のノードの情報が保存される。以下、図7に示す探索経路で、図8に示す情報の保存を行いながら最適経路を探索する方法について、具体的に説明する。   When the search route and cost for searching for the optimum route are determined, the optimum route search unit 15 starts searching for the optimum route. FIG. 8 shows information stored in each node when searching for the optimum route. The “hypothesis” of the item shown in FIG. 8 is based on the character recognition result of each character segment, information is obtained under each assumption in the case where the character recognition result is a character, a connection line, or a noise. Indicates to save. For “evaluation cost”, if the character segment is a character, it is in the character column, if it is a connection line, it is in the connection line column, if it is noise, it is in the noise column, The sum of the minimum costs until is saved. For the “previous node”, the information of the previous node for which the minimum cost is obtained is stored. Hereinafter, a method for searching for the optimum route while storing the information shown in FIG. 8 using the searched route shown in FIG. 7 will be specifically described.

図9は、最適経路の探索方法を説明する図である。初期状態のノードn0では、左側からこのノードに至る経路が存在しないので、ノードn0に示したように、文字、接続線及びノイズの全てで評価コストが0(ゼロ)となり、前ノードに該当する情報も含まれない。   FIG. 9 is a diagram for explaining an optimum route searching method. In the node n0 in the initial state, there is no route from the left side to this node. Therefore, as shown in the node n0, the evaluation cost is 0 (zero) for all characters, connection lines, and noise, which corresponds to the previous node. No information is included.

ノードn1では、ノードn0からの経路だけであるから、この経路上にある文字セグメントS1の文字認識結果に基づいて情報が保存される。具体的には、ノードn1に示したように、文字セグメントS1が文字「0(ゼロ)」と認識されているため、文字のコスト欄に評価コストが保存される。保存される評価コストの値は、ノードn0の評価コストの値0(ゼロ)と文字セグメントS1の文字コストの値130の和として求められて「130」となる。また、前ノードの情報として、ノードn0を示す「n0」が保存される。   Since the node n1 has only the route from the node n0, information is stored based on the character recognition result of the character segment S1 on this route. Specifically, as shown in the node n1, since the character segment S1 is recognized as the character “0 (zero)”, the evaluation cost is stored in the character cost column. The stored evaluation cost value is obtained as the sum of the evaluation cost value 0 (zero) of the node n0 and the character cost value 130 of the character segment S1 to be “130”. Further, “n0” indicating the node n0 is stored as the information of the previous node.

次に、ノードn2では、ノードn1からの経路とノードn0からの経路がある。また、ノードn1からの経路には、文字セグメントS2が文字である場合の文字コストと接続線である場合の接続線コストの2つが存在している。   Next, in the node n2, there are a route from the node n1 and a route from the node n0. In the path from the node n1, there are two costs: a character cost when the character segment S2 is a character and a connection line cost when the character segment S2 is a connection line.

文字セグメントS2が、文字「−(ハイフン)」であると仮定すると、ノードn2に至る文字の評価コストは、ノードn1の評価コストの値130及び文字セグメントS2の文字コストの値102との和として求められて232となる。ノードn2では、ノードn0からの経路でも、文字セグメント(S1+S2)が、文字「5」として認識されているので、ここでも文字の評価コストが得られることになる。このときの評価コストは、ノードn0の評価コストの値0(ゼロ)及び文字セグメント(S1+S2)の文字コストの値170との和として求められて170となる。最適経路として、最小コストを示す経路を探索するため、このように文字に関する評価コストが複数得られる場合には、値の小さい方が選択される。よって、ここでは、ノードn1からの評価コストの値232とノードn0からの評価コストの値170とを比較して、値の小さいノードn0が選択される。この結果、ノードn2に示したように、文字の評価コストとして「170」、前ノード情報として「n0」が保存されることになる。   Assuming that the character segment S2 is the character “-(hyphen)”, the evaluation cost of the character reaching the node n2 is the sum of the evaluation cost value 130 of the node n1 and the character cost value 102 of the character segment S2. 232 is obtained. In the node n2, since the character segment (S1 + S2) is recognized as the character “5” even in the route from the node n0, the character evaluation cost is also obtained here. The evaluation cost at this time is 170 as the sum of the evaluation cost value 0 (zero) of the node n0 and the character cost value 170 of the character segment (S1 + S2). Since the route indicating the minimum cost is searched for as the optimum route, when a plurality of evaluation costs relating to characters are obtained in this way, the smaller value is selected. Therefore, here, the evaluation cost value 232 from the node n1 is compared with the evaluation cost value 170 from the node n0, and the node n0 having a smaller value is selected. As a result, as shown in the node n2, “170” is stored as the character evaluation cost and “n0” is stored as the previous node information.

また、ノードn1からの経路には、文字セグメントS2が接続線であると仮定した場合の接続線コストが存在する。このため、ノードn2に示したように、ノードn1の評価コストの値130と接続線コストの値10との和「140」が、接続線の評価コストとして保存される。そして、前ノードの情報として「n1」が保存される。   The path from the node n1 has a connection line cost when it is assumed that the character segment S2 is a connection line. Therefore, as shown in the node n2, the sum “140” of the evaluation cost value 130 of the node n1 and the connection line cost value 10 is stored as the evaluation cost of the connection line. Then, “n1” is stored as the previous node information.

このように、文字である場合と接続線である場合の両方のコストを有する文字セグメントS2については、両方のコストを利用して最適経路の探索が進められる。具体的には、経路上で文字セグメントS2の下流側にあるノードn2では、文字セグメントS2が文字である場合の文字コストから求めた文字の評価コストと、接続線である場合の接続線コストから求めた接続線の評価コストとの両方が、経路の中間位置にある中間コストとして維持された状態で、経路探索が進められる。   As described above, for the character segment S2 having the costs of both the case of the character and the case of the connection line, the search for the optimum route is advanced using both costs. Specifically, at the node n2 downstream of the character segment S2 on the path, from the character evaluation cost obtained from the character cost when the character segment S2 is a character and the connection line cost when it is a connection line The route search is performed in a state where both the obtained connection line evaluation cost and the intermediate cost at the intermediate position of the route are maintained.

なお、ここでは接続線の例を示したが、本実施例では、文字である場合の文字コストに加えて、接続線である場合の接続線コスト又はノイズである場合のノイズコストが付与された文字セグメントでは、文字コストと、接続線コスト又はノイズコストとを利用して、最適経路の探索が進められる。   In addition, although the example of the connection line was shown here, in this example, in addition to the character cost in the case of the character, the connection line cost in the case of the connection line or the noise cost in the case of the noise is given. In the character segment, the search for the optimum route proceeds using the character cost and the connection line cost or the noise cost.

次に、ノードn3では、ノードn0〜n2からの経路がある。ノードn0からの経路では、ノードn0の評価コストの値0(ゼロ)及び文字セグメント(S1+S2+S3)が文字「0(ゼロ)」として認識された文字コストの値250の和として求められて、文字の評価コストの値は250となる。同様に、ノードn1からの経路では、ノードn1の評価コストの値130及び文字セグメント(S2+S3)が文字「0(ゼロ)」として認識された際の文字コストの値156の和として求められて、文字の評価コストの値は286となる。   Next, in the node n3, there is a route from the nodes n0 to n2. In the route from the node n0, the evaluation cost value 0 (zero) of the node n0 and the character segment (S1 + S2 + S3) are obtained as the sum of the character cost value 250 recognized as the character “0 (zero)”, and the character The value of the evaluation cost is 250. Similarly, in the route from the node n1, the evaluation cost value 130 of the node n1 and the character cost value 156 when the character segment (S2 + S3) is recognized as the character “0 (zero)” are obtained. The value of the character evaluation cost is 286.

また、ノードn2からの経路では、ノードn2の文字の評価コストの値170及び文字セグメントS3が文字「0(ゼロ)」として認識された文字コストの値108との和として求められて、文字の評価コストの値は278となる。また、ノードn2からの経路には、文字セグメントS2を接続線とした場合の結果も含まれているので、これについても評価コストが計算される。この評価コストの値は、ノードn2の接続線の評価コストの値140及び文字セグメントS3の文字コストの値108の和として求められて248となる。   In the route from the node n2, the character evaluation cost value 170 of the node n2 and the character segment S3 are obtained as the sum of the character cost value 108 recognized as the character “0 (zero)”, and the character The value of the evaluation cost is 278. Further, since the path from the node n2 includes the result when the character segment S2 is a connection line, the evaluation cost is also calculated for this. This evaluation cost value is 248, which is obtained as the sum of the evaluation cost value 140 of the connection line of the node n2 and the character cost value 108 of the character segment S3.

なお、文字セグメントS3が文字「0(ゼロ)」として認識されているので、1つ前のセグメントである文字セグメントS2を接続線とする場合の結果も利用するが、文字セグメントS3が文字0(ゼロ)以外の文字と認識されている場合には、文字セグメントS2を接続線とする結果は利用しない。すなわち、後に続く文字セグメントが、接続線の後に続けて書かれることがない文字として認識された場合には、直前の文字セグメントを接続線とする結果は利用しない。   Since the character segment S3 is recognized as the character “0 (zero)”, the result obtained when the character segment S2 that is the previous segment is used as a connection line is also used. If the character is recognized as other than zero), the result using the character segment S2 as a connection line is not used. That is, when a subsequent character segment is recognized as a character that will not be written after the connection line, the result of using the immediately preceding character segment as the connection line is not used.

こうして、ノードn3の文字の評価コストでは、ノードn0からの評価コスト、ノードn1からの評価コスト、ノードn2で文字セグメントS2を文字とした場合の評価コスト、ノードn2で文字セグメントS2を接続線とした場合の評価コストの4つが求められるが、これらのうち、評価コストの値が最小値となる経路が選択される。この結果、ノードn2で文字セグメントS2を接続線とした場合の経路が選択されて、ノードn3に示したように、文字の評価コスト「248」、前ノード情報「n2」が保存される。   Thus, the evaluation cost of the character of the node n3 is the evaluation cost from the node n0, the evaluation cost from the node n1, the evaluation cost when the character segment S2 is a character at the node n2, and the character segment S2 as a connection line at the node n2. In this case, four of the evaluation costs are obtained, and among these, a route having a minimum evaluation cost value is selected. As a result, the path when the character segment S2 is the connection line at the node n2 is selected, and as shown in the node n3, the character evaluation cost “248” and the previous node information “n2” are stored.

最終ノードであるノードn3までの最小コストが確定すると、探索された経路をバックトレースする処理が行われる。図10は、図9に示すように最適経路の探索結果が得られた後、最適経路探索部15によって行われるバックトレースの内容を説明する図である。最終ノードまでの評価コストを算出した時点では最適経路を形成する各文字セグメントの具体的な文字認識結果は特定されておらず、このバックトレースの処理により、各文字セグメントの文字認識結果が特定される。まず、ノードn3の最小コスト248の前ノードはノードn2であるから、ノードn2へ戻る経路が選択される。   When the minimum cost to the node n3 which is the final node is determined, a process of back-tracing the searched route is performed. FIG. 10 is a diagram for explaining the contents of the backtrace performed by the optimum route search unit 15 after the optimum route search result is obtained as shown in FIG. When the evaluation cost to the final node is calculated, the specific character recognition result of each character segment that forms the optimal path is not specified, and the character recognition result of each character segment is specified by this backtrace process. The First, since the previous node of the minimum cost 248 of the node n3 is the node n2, the path returning to the node n2 is selected.

ノードn2には、文字及び接続線の2つの評価コストが存在する。文字セグメントS3の認識結果が文字「0(ゼロ)」なので、どちらも有効であり、より小さいコストの接続線の方が選択され、前ノードはノードn1となる。なお、このとき、例えば、文字セグメントS3が0(ゼロ)以外の文字であれば、その前に接続線が書かれることはないと判定されて、文字の方が選択され、前ノードはノードn0とされる。すなわち、本実施例に係る文字認識方法では、文字セグメントS2が文字であるか接続線であるかを決定することなく、両方のコストを維持した状態で最適経路の探索を進めて、経路下流側の文字セグメントS3の結果を考慮して文字セグメントS2の結果が最終決定される。   The node n2 has two evaluation costs for characters and connection lines. Since the recognition result of the character segment S3 is the character “0 (zero)”, both are valid, and the connection line with the lower cost is selected, and the previous node is the node n1. At this time, for example, if the character segment S3 is a character other than 0 (zero), it is determined that the connecting line is not written before the character segment S3, the character is selected, and the previous node is the node n0. It is said. That is, in the character recognition method according to the present embodiment, the search for the optimum route is performed in a state where both costs are maintained without determining whether the character segment S2 is a character or a connection line, and the downstream side of the route The result of the character segment S2 is finally determined in consideration of the result of the character segment S3.

ノードn1の前ノードはノードn0のみであるから、ノードn0が無条件に選択される。このようにして、ノードn3、n2、n1、n0とバックトレースして、最適経路及び各文字セグメントの文字認識結果が決定される。具体的には、決定された最適経路の経路上にある各文字セグメントの文字認識結果が、文字列を形成する各文字となる。図10の結果では、各文字が、文字「0(ゼロ)」、接続線、文字「0(ゼロ)」であると決定される。そして、この結果に基づいて、図6(a)に示す文字列を、2つの文字0(ゼロ)と、その間を接続する接続線とに分割することができる。また、接続線を除いて、図6(a)に示す文字列は、文字「0(ゼロ)」と文字「0(ゼロ)」であるとの文字認識結果を得ることができる。   Since the node before node n1 is only node n0, node n0 is selected unconditionally. In this manner, the optimal path and the character recognition result of each character segment are determined by back-tracing with the nodes n3, n2, n1, and n0. Specifically, the character recognition result of each character segment on the determined optimum route becomes each character forming the character string. In the result of FIG. 10, each character is determined to be the character “0 (zero)”, the connection line, and the character “0 (zero)”. Based on this result, the character string shown in FIG. 6A can be divided into two characters 0 (zero) and a connection line connecting them. Moreover, the character recognition result that the character string shown in FIG. 6A is the character “0 (zero)” and the character “0 (zero)” can be obtained except for the connection line.

なお、本実施例では、文字コストの値が小さいほど、各文字セグメントが得られた文字認識結果と類似しており、各経路での文字セグメントのコストの和を求めることによって、最適経路を探索可能である場合を示した。しかし、本実施形態がこれに限定されるものではない。例えば、経路を進むにしたがってコストが単調増加又は単調減少する場合には、本実施例と同様に、コストの和に基づいて同様の方法で経路探索を行うことが可能であるが、コストの値によっては、各文字セグメントのコストの積を確認しながら最適経路を探索することも可能である。具体的には、各文字セグメントの文字コストを、得られた文字認識結果が正しいことを示す確率で表せば、この確率の積に基づいて最適経路を探索することができる。   In this embodiment, the smaller the character cost value, the more similar to the character recognition result obtained for each character segment, and the optimum route is searched for by calculating the sum of the cost of the character segment in each route. Shown when possible. However, the present embodiment is not limited to this. For example, when the cost monotonously increases or decreases monotonically as the route is advanced, the route search can be performed by the same method based on the sum of the costs, as in this embodiment. Depending on the situation, it is possible to search for the optimum route while confirming the product of the cost of each character segment. Specifically, if the character cost of each character segment is expressed by a probability indicating that the obtained character recognition result is correct, the optimum path can be searched based on the product of the probabilities.

また、本実施例では、各ノードで前ノードを示す情報を保存しているが、バックトレースする際には、バックトレース元及びバックトレース先の各ノードのコストと、この経路上の文字セグメントのコストとを利用して、バックトレース先となる前ノードをサーチすることができる。よって、経路探索時に、前ノードを示す情報を保存項目に入れることは必須ではない。   In this embodiment, the information indicating the previous node is stored in each node. However, when back tracing is performed, the cost of each node of the back trace source and the back trace destination and the character segment on this path are stored. By using the cost, it is possible to search the previous node as the backtrace destination. Therefore, it is not essential to include information indicating the previous node in the storage item when searching for a route.

本実施例では、最適経路を探索する際の評価コストが各文字セグメントのコストの平均値で定義される場合について説明する。なお、実施例1の場合と同様に、各文字セグメントの文字コストは、値が小さいほど文字認識結果と文字セグメントとが類似することを示す。   In the present embodiment, a case will be described in which the evaluation cost for searching for the optimum route is defined by the average value of the cost of each character segment. As in the case of the first embodiment, the character cost of each character segment indicates that the smaller the value, the more similar the character recognition result and the character segment.

文字認識装置1の構成や文字列画像を基本セグメントに分割する方法については、実施例1と同じであるため説明を省略することとし、以下では、実施例1とは異なる処理内容について詳細を説明することとする。   Since the configuration of the character recognition device 1 and the method of dividing the character string image into basic segments are the same as those in the first embodiment, description thereof will be omitted. In the following, details of processing contents different from those in the first embodiment will be described. I decided to.

最適経路探索時の評価コストを、単純に各文字セグメントのコストの平均値として定義した場合には、途中にある中間ノードまでの最適経路が、文字列全体で見た場合の最適経路にならない場合がある。   If the evaluation cost when searching for the optimum route is simply defined as the average value of the cost of each character segment, the optimum route to the intermediate node in the middle is not the optimum route when viewed from the entire character string There is.

図11は、各文字セグメントの文字コストの平均値に基づいて最適経路を探索する例を示している。例えば、図6の場合と同様に、文字列が3つの基本セグメントS1〜S3に分割されて、これらの基本セグメントに対応して設定されたノードn0〜n3の間の経路が、図11(a)に示すように設定されたものとする。図11(a)に示す数値は、各文字セグメントの文字コストを示している。   FIG. 11 shows an example in which the optimum route is searched based on the average value of the character cost of each character segment. For example, as in the case of FIG. 6, the character string is divided into three basic segments S1 to S3, and a path between nodes n0 to n3 set corresponding to these basic segments is shown in FIG. ). The numerical value shown in FIG. 11A indicates the character cost of each character segment.

図11(a)に示す経路及び文字コストによれば、ノードn0−n1−n2−n3とたどる経路が最適経路となり、平均値で定義される最小コストは、同図(b)にノードn3の評価コストとして示したように、文字セグメントS1、S2及びS3の文字コストの平均値として、120(=(105+105+150)/3)と算出される。一方、ノードn0−n2−n3とたどった場合の経路では、最小コストが文字セグメント(S1+S2)と文字セグメントS3の文字コストの平均値として求められて125(=(100+150)/2)と算出され、最適経路ではないことが分かる。   According to the route and the character cost shown in FIG. 11A, the route that follows the nodes n0-n1-n2-n3 is the optimum route, and the minimum cost defined by the average value is shown in FIG. As shown as the evaluation cost, 120 (= (105 + 105 + 150) / 3) is calculated as the average value of the character costs of the character segments S1, S2 and S3. On the other hand, in the route in the case of following the node n0-n2-n3, the minimum cost is obtained as an average value of the character costs of the character segment (S1 + S2) and the character segment S3, and is calculated as 125 (= (100 + 150) / 2). It turns out that it is not the optimal route.

ところが、ノードn2までの評価コストを算出すると、ノードn0−n1−n2とたどった最適経路上で、文字セグメントS1及びS2の文字コストの平均値として105(=(105+105)/2)と算出されるのに対して、ノードn0−n2とたどった経路では文字セグメント(S1+S2)の文字コストから100となり、こちらの経路の方が評価コストの値が小さくなる。よって、単純に各経路でのコストの平均値を算出しながら、評価コストが最小値をとる経路をたどるだけでは最適経路を誤ることになる。   However, when the evaluation cost up to the node n2 is calculated, 105 (= (105 + 105) / 2) is calculated as the average value of the character costs of the character segments S1 and S2 on the optimum path traced to the nodes n0-n1-n2. On the other hand, in the route traced to the nodes n0-n2, the character cost of the character segment (S1 + S2) is 100, and this route has a smaller evaluation cost value. Therefore, simply calculating the average value of the costs for each route and simply following the route for which the evaluation cost has the minimum value results in an error in the optimum route.

このため、本実施例に係る文字認識方法では、認識した文字数を考慮してコストの平均値を算出することにより、最適経路の探索を行う。以下、本実施例に係る文字認識方法について具体的に説明する。   For this reason, in the character recognition method according to the present embodiment, the optimum route is searched by calculating the average cost in consideration of the number of recognized characters. Hereinafter, the character recognition method according to the present embodiment will be specifically described.

図12は、本実施例で処理対象とする文字列画像から文字セグメントを生成して、文字数を考慮した探索経路を設定する方法を説明する図である。説明を簡単にするため、2つの文字「0(ゼロ)」が接続線によって接続して書かれた場合を例に説明を続ける。   FIG. 12 is a diagram for explaining a method for generating a character segment from a character string image to be processed in the present embodiment and setting a search path in consideration of the number of characters. In order to simplify the description, the description will be continued by taking as an example a case where two characters “0 (zero)” are connected and connected.

図12(a)は入力画像取得部11によって取得された文字列画像を示し、同図(b)はこの文字列画像が入力画像分割部12によって基本セグメントS1〜S3に分割された結果を示している。そして、図12(c)は、セグメント生成部13によって生成された文字セグメントに基づいて、最適経路探索部15によって文字数を考慮して設定された探索経路を示している。このように、文字セグメントSx、文字数yに対応するノードをnxyとして、各ノードが2次元で配置される。   FIG. 12A shows a character string image acquired by the input image acquisition unit 11, and FIG. 12B shows a result of dividing the character string image into basic segments S1 to S3 by the input image dividing unit 12. ing. FIG. 12C shows a search route set by the optimum route search unit 15 in consideration of the number of characters based on the character segment generated by the segment generation unit 13. In this way, each node is arranged two-dimensionally, assuming that the node corresponding to the character segment Sx and the number of characters y is nxy.

図12(c)で、右方向に水平にたどる経路は、接続線やノイズ等、文字ではないと仮定した場合の経路である。文字セグメントが接続線やノイズとされた場合には、文字数が増えないので、右方向への水平な経路となる。これに対して、文字セグメントが文字とされた場合には、文字数が増えるため、右方向かつ下方向へ至る経路となる。例えば、ノードn11からの経路において、文字セグメントS2を接続線とした場合には、右方向へ水平にノードn21に至る経路となる。これに対して、文字セグメントS2を文字とした場合には、右方向かつ下方向にノードn22へ至る経路となる。   In FIG. 12C, the path that follows horizontally in the right direction is a path when it is assumed that it is not a character such as a connection line or noise. If the character segment is a connection line or noise, the number of characters does not increase, and therefore a horizontal path to the right is obtained. On the other hand, when the character segment is a character, the number of characters increases, and therefore, the route extends rightward and downward. For example, in the path from the node n11, when the character segment S2 is a connection line, the path reaches the node n21 horizontally in the right direction. On the other hand, when the character segment S2 is a character, the route reaches the node n22 rightward and downward.

次に、各文字セグメントのコストを用いて最適経路を探索する方法を具体的に説明する。図13は、図12(c)に示す探索経路上で、最適経路を探索する方法を説明する図である。初期状態のノードn00では、左側からn00に至る経路がないので、全ての評価コストが0(ゼロ)となり、前ノードに該当する情報も含まれない。   Next, a method for searching for the optimum route using the cost of each character segment will be specifically described. FIG. 13 is a diagram for explaining a method for searching for the optimum route on the searched route shown in FIG. In the initial state node n00, since there is no path from the left side to n00, all evaluation costs are 0 (zero), and information corresponding to the previous node is not included.

ノードn11では、n00からの経路しか存在しない。この経路上では、文字セグメントS1が文字「0(ゼロ)」と認識されて、文字コストの値が130である。よって、ノードn11では、文字の評価コストの欄に、文字コストの値「130」と、前ノードの情報「n00」とが保存される。   The node n11 has only a route from n00. On this path, the character segment S1 is recognized as the character “0 (zero)”, and the value of the character cost is 130. Therefore, in the node n11, the character cost value “130” and the previous node information “n00” are stored in the character evaluation cost column.

ノードn21では、ノードn11からの経路とノードn00からの経路が存在する。ノードn11からの経路では、文字セグメントS2が接続線とされており、接続線コストの値が10である。よって、ノードn21の接続線の評価コストとして、ノードn11の文字コストの値130と接続線コストの値10との和「140」が保存され、前ノードの情報として「n11」が保存される。また、ノードn00からの経路では、文字セグメント(S1+S2)が文字「5」として認識されて文字コストの値が170とされている。よって、ノードn21の文字の評価コストとして、ノードn00の評価コストの値0(ゼロ)と文字セグメント(S1+S2)の文字コストの値170との和「170」が保存され、前ノードの情報として「n00」が保存される。この結果、ノードn21では、接続線とされた文字セグメントS2を通る経路の評価コスト及び前ノード情報と、文字とされた文字セグメント(S1+S2)を通る経路の評価コスト及びノード情報との2つの情報が保存された状態となる。   In the node n21, there are a route from the node n11 and a route from the node n00. In the path from the node n11, the character segment S2 is a connection line, and the value of the connection line cost is 10. Therefore, the sum “140” of the character cost value 130 and the connection line cost value 10 of the node n11 is stored as the evaluation cost of the connection line of the node n21, and “n11” is stored as the previous node information. In the route from the node n00, the character segment (S1 + S2) is recognized as the character “5”, and the character cost value is set to 170. Therefore, the sum “170” of the evaluation cost value 0 (zero) of the node n00 and the character cost value 170 of the character segment (S1 + S2) is stored as the evaluation cost of the character of the node n21. n00 "is saved. As a result, in the node n21, two pieces of information, that is, the evaluation cost and the previous node information of the path passing through the character segment S2 that is the connection line, and the evaluation cost and node information of the path that passes through the character segment (S1 + S2) that is the character. Will be saved.

同様にn22、n31、n32及びn33について、最小コストとこの最小コストが得られるときの前ノードの情報とが保存される。全てのノードについて最小コストの計算を終えると、次に、最終ノードn31、n32及びn33で、最小コストの平均値が算出される。この結果、各経路での評価コストの値は、1文字のノードn31では247、2文字のノードn32では124、3文字のノードn33では147となり、最小値を示すn32への経路が最適経路であると判定される。   Similarly, for n22, n31, n32, and n33, the minimum cost and the information of the previous node when this minimum cost is obtained are stored. When the calculation of the minimum cost is completed for all the nodes, the average value of the minimum costs is then calculated at the final nodes n31, n32, and n33. As a result, the value of the evaluation cost for each path is 247 for the 1-character node n31, 124 for the 2-character node n32, and 147 for the 3-character node n33, and the path to n32 indicating the minimum value is the optimal path. It is determined that there is.

最終ノードをノードn32として最適経路が探索されると、最適経路をバックトレースする処理が行われる。最終ノードまでの評価コストを算出した時点では最適経路を形成する各文字セグメントの具体的な文字認識結果は特定されておらず、このバックトレースの処理により、各文字セグメントの文字認識結果が特定される。図14は、図13に示すように最適経路の探索結果が得られた後、最適経路探索部15によって行われるバックトレースの内容を説明する図である。まず、ノードn32の評価コストの値248の前ノードはノードn21であるから、ノードn21へ戻る経路が選択される。   When the optimum route is searched with the final node as the node n32, processing for back-tracing the optimum route is performed. When the evaluation cost to the final node is calculated, the specific character recognition result of each character segment that forms the optimal path is not specified, and the character recognition result of each character segment is specified by this backtrace process. The FIG. 14 is a diagram for explaining the contents of the backtrace performed by the optimum route search unit 15 after the optimum route search result is obtained as shown in FIG. First, since the previous node of the evaluation cost value 248 of the node n32 is the node n21, a route returning to the node n21 is selected.

ノードn21には、文字及び接続線の2つの評価コストが存在する。文字セグメントS3の認識結果が文字「0(ゼロ)」であるから、どちらも有効な結果であり、コストの値が小さい接続線の方が選択されて、ノードn11へ遡る経路が選択される。すなわち、このバックトレースの段階で、文字セグメントS2の文字認識結果が接続線であると決定される。なお、実施例1と同様に、例えば、文字セグメントS3が0(ゼロ)以外の文字である場合には、その前に接続線が書かれることはないと判定されて、文字の方が選択され、前ノードがノードn00とされる。   The node n21 has two evaluation costs for characters and connection lines. Since the recognition result of the character segment S3 is the character “0 (zero)”, both are effective results, and the connection line having the smaller cost value is selected, and the route going back to the node n11 is selected. That is, at the backtrace stage, it is determined that the character recognition result of the character segment S2 is a connection line. As in the first embodiment, for example, when the character segment S3 is a character other than 0 (zero), it is determined that no connection line is written before the character segment S3, and the character is selected. The previous node is assumed to be node n00.

ノードn11の前ノードはノードn00であるから、ノードn00が選択される。このようにして、ノードn32、n21、n11、n00とバックトレースされて最適経路及び各文字セグメントの文字認識結果が決定される。具体的には、決定された最適経路の経路上にある各文字セグメントの文字認識結果が、文字列を形成する各文字となる。図14の結果では、各文字が、文字「0(ゼロ)」、接続線、文字「0(ゼロ)」であると決定される。これにより、図12(a)に示す文字列を、2つの文字「0(ゼロ)」と、その間を接続する接続線とに正しく分割することができる。そして、文字列画像から各文字を含む文字画像を正確に切り出すことができる。また、接続線を除いて、図12(a)に示す文字列は、文字「0(ゼロ)」と文字「0(ゼロ)」であるとの文字認識結果を得ることができる   Since the node before node n11 is node n00, node n00 is selected. In this way, the backtracking is performed with the nodes n32, n21, n11, and n00, and the optimum path and the character recognition result of each character segment are determined. Specifically, the character recognition result of each character segment on the determined optimum route becomes each character forming the character string. In the result of FIG. 14, it is determined that each character is a character “0 (zero)”, a connection line, and a character “0 (zero)”. Thereby, the character string shown in FIG. 12A can be correctly divided into two characters “0 (zero)” and a connection line connecting between the two characters “0 (zero)”. A character image including each character can be accurately cut out from the character string image. Moreover, the character recognition result that the character string shown in FIG. 12A is the character “0 (zero)” and the character “0 (zero)” can be obtained except for the connection line.

本実施例では、実施例2に示す方法に加えて、ペナルティを利用する場合の例について説明する。なお、ここでも、実施例1及び2の場合と同様に、各文字セグメントのコストは、値が小さいほど文字認識結果と文字セグメントとが類似することを示すものとする。   In the present embodiment, an example in which a penalty is used in addition to the method shown in the second embodiment will be described. Here again, as in the case of the first and second embodiments, the cost of each character segment indicates that the smaller the value, the more similar the character recognition result and the character segment.

ペナルティとは、文字セグメントが所定条件を満たすときに、コストに付加する数値のことを言う。文字セグメント間で可能性の低い接触状態を含む経路では、評価コストにペナルティを付加して評価コストの値を上げる(評価を下げる)ことにより、誤った経路探索を防ぐために利用する。   A penalty is a numerical value added to a cost when a character segment satisfies a predetermined condition. In a route including a contact state that is unlikely between character segments, a penalty is added to the evaluation cost to increase the value of the evaluation cost (lower the evaluation), thereby preventing an erroneous route search.

評価コストに基づく評価を下げるため、コストが小さいほど良好な結果を示す場合にはコストが大きくなるようにペナルティが付加され、コストが大きいほど良好な結果を示す場合にはコストが小さくなるようにペナルティが付加される。実施例1及び2で、文字セグメントを接続線としたときの接続線コストの値10もペナルティの一種であるが、本実施例では、文字として認識された場合にもペナルティを付加する点が、実施例1及び2と異なっている。どのような場合にペナルティを付加するかについては後述する。   In order to lower the evaluation based on the evaluation cost, a penalty is added to increase the cost when the better result is shown as the cost is lower, and the cost is reduced when the better result is shown as the cost is higher. Penalties are added. In Examples 1 and 2, the value 10 of the connection line cost when the character segment is a connection line is also a kind of penalty. However, in this example, a penalty is added even when the character segment is recognized as a character. This is different from Examples 1 and 2. A case where a penalty is added will be described later.

また、本実施例では、局所的制約の効果についても説明する。局所的制約とは、実施例1及び2でも説明したように、接続線が書かれた後には数字の0(ゼロ)が書かれるといった内容を条件化したものである。具体的には、文字セグメントが文字0(ゼロ)以外の文字と認識された場合には、直前の文字セグメントは接続線ではないとの局所的制約を課して処理を行う。言い換えれば、文字セグメントを接続線として処理する場合には、直後の文字セグメントは文字0(ゼロ)でなければならない。以下、具体的な例をあげて説明する。   In the present embodiment, the effect of local restrictions will also be described. As described in the first and second embodiments, the local restriction is a condition in which the number 0 (zero) is written after the connection line is written. Specifically, when a character segment is recognized as a character other than the character 0 (zero), processing is performed with a local restriction that the immediately preceding character segment is not a connection line. In other words, when a character segment is processed as a connection line, the immediately following character segment must be character 0 (zero). Hereinafter, a specific example will be described.

まず、本実施例で処理対象とする画像について説明する。通常は、文字列を対象として、該文字列を形成する各文字を切り出すものであるが、本実施例では、説明を簡単にして、かつ、ペナルティ及び局所的制約の内容及び効果を容易に理解できるように、1文字を認識する場合を例に説明を続けることとする。   First, an image to be processed in the present embodiment will be described. Normally, each character that forms the character string is cut out from the character string, but in this embodiment, the explanation is simplified and the contents and effects of the penalty and local restrictions are easily understood. The description will be continued by taking the case of recognizing one character as an example.

図15は、本実施例で、文字認識装置1による処理対象とする文字「7」と、この文字を入力画像分割部12によって分割した結果を示す図である。図15(a)は入力画像と基本セグメントS1〜S3の関係を示し、同図(b)は基本セグメントS1〜S3を示している。   FIG. 15 is a diagram illustrating the character “7” to be processed by the character recognition device 1 and the result of dividing the character by the input image dividing unit 12 in this embodiment. FIG. 15A shows the relationship between the input image and the basic segments S1 to S3, and FIG. 15B shows the basic segments S1 to S3.

図16は、セグメント生成部13によって生成された文字セグメントに基づいて探索経路を設定して、この探索経路上で、実施例2に示した方法で最適経路を探索した結果を示す図である。各ノードn00〜n33で、最小コストを求めて前ノードの情報を保存する方法は、実施例2と同一であるため説明を省略するが、図16に示す探索結果では、ノードn33のコストが最小値を示し、最適経路がn00−n11−n22−n33となる。これにより、図15(a)に示す文字「7」から、文字「1」と、文字「−(ハイフン)」と、文字「1」との3つの文字が切り出されることになる。このように、処理対象とする文字列に、実施例2による方法では最適経路が誤って探索されるような文字が含まれる場合には、本実施例に示す方法により、最適経路を正しく探索することができる。   FIG. 16 is a diagram illustrating a result of searching for an optimum route by the method described in the second embodiment on the searched route by setting a searched route based on the character segment generated by the segment generating unit 13. The method for obtaining the minimum cost and storing the information of the previous node in each node n00 to n33 is the same as that in the second embodiment, and thus the description thereof is omitted. However, in the search result shown in FIG. 16, the cost of the node n33 is the minimum. The optimum route is n00-n11-n22-n33. As a result, from the character “7” shown in FIG. 15A, three characters of the character “1”, the character “− (hyphen)”, and the character “1” are cut out. As described above, when the character string to be processed includes characters for which the optimum route is erroneously searched in the method according to the second embodiment, the optimum route is correctly searched by the method shown in the present embodiment. be able to.

本実施例では、ペナルティを利用して最適経路を探索する。図17は、ペナルティの種類と、ペナルティとして文字コストに付加される値を示す図である。例えば、No.1は、文字セグメントが文字「−(ハイフン)」として認識されているのに、その左側が、左側にある直前の文字セグメントと接触している場合には、接続線が文字と誤認識されている可能性があるので、ペナルティとして文字コストに値50を付加するものである。No.2も同様に、接続線が文字として誤認識されている可能性があるので、ペナルティとして、文字コストに値50を付加することを示している。また、No.3及びNo.4は、文字セグメントが文字「1」として認識されているにも拘わらず、文字の上部又は下部が、他の文字セグメントと接触している場合には、文字を分割して得られた部分領域が文字と誤認識されている可能性があるので、ペナルティとして文字コストに値50を付加することを示している。   In this embodiment, an optimum route is searched using a penalty. FIG. 17 is a diagram illustrating types of penalties and values added to the character cost as penalties. For example, no. 1 is that if the character segment is recognized as the character “-(hyphen)” but the left side is in contact with the immediately preceding character segment on the left side, the connecting line is erroneously recognized as a character. Therefore, a value of 50 is added to the character cost as a penalty. No. Similarly, 2 indicates that the connection line may be misrecognized as a character, so that a value of 50 is added to the character cost as a penalty. No. 3 and no. 4 is a partial area obtained by dividing a character when the character segment is recognized as the character “1”, but the upper or lower portion of the character is in contact with another character segment. Indicates that the value 50 is added to the character cost as a penalty.

ペナルティのNo.5は、文字セグメントをノイズとした場合に、本実施例では、ノイズコストの値を50とすることを示している。また、No.6は、実施例1及び2でも示したように、文字セグメントを接続線とした場合に、接続線コストの値を10とすることを示している。No.5及びNo.6は、文字ではなく、ノイズや接続線とされた場合である。文字セグメントがノイズ又は接続線とされた場合には、例えば、図16のノードn11とn21との間に示した文字セグメントS2のように、文字認識結果の文字数は増えず、探索経路上で右方向に水平に経路をたどることになる。   Penalty No. 5 indicates that when the character segment is noise, the noise cost value is set to 50 in this embodiment. No. 6 indicates that the connection line cost value is set to 10 when the character segment is a connection line, as shown in the first and second embodiments. No. 5 and no. Reference numeral 6 denotes a case where noise and connection lines are used instead of characters. When the character segment is a noise or a connection line, the number of characters in the character recognition result does not increase as in the character segment S2 shown between the nodes n11 and n21 in FIG. Follow the path horizontally in the direction.

図18は、図17に示したペナルティを利用して、図16に示した最適経路の探索結果を修正した結果を示している。すなわち、本実施例に係るペナルティ及び局所的制約条件に基づく最適経路探索を行った結果である。   FIG. 18 shows a result of correcting the optimum route search result shown in FIG. 16 using the penalty shown in FIG. That is, it is a result of performing an optimum route search based on the penalty and local constraint conditions according to the present embodiment.

ノードn11からノードn22へ至る経路では、文字セグメントS2が文字「−(ハイフン)」とされている。図15(a)に示したように、この文字セグメントS2は、左側が文字セグメントS1と接触しているので、ペナルティNo.1が適用される。また、同様に、右側も文字セグメントS3と接触しているので、ペナルティNo.2が適用される。このため、図18で、ノードn11からノードn22へ至る経路上の文字セグメントS2の下部に示したように、ペナルティとしてP=100(=50×2)が文字コストに付加される。よって、ノードn22での文字の評価コストは、ノードn11の評価コストの値164と、文字セグメントS2の文字コストの値118と、ペナルティのコストの値100との和として算出されて382となる。   In the path from the node n11 to the node n22, the character segment S2 is a character “-(hyphen)”. As shown in FIG. 15A, the character segment S2 is in contact with the character segment S1 on the left side. 1 applies. Similarly, since the right side is also in contact with the character segment S3, the penalty No. 2 applies. Therefore, as shown in the lower part of the character segment S2 on the path from the node n11 to the node n22 in FIG. 18, P = 100 (= 50 × 2) is added to the character cost as a penalty. Therefore, the evaluation cost of the character at the node n22 is calculated as the sum of the evaluation cost value 164 of the node n11, the character cost value 118 of the character segment S2, and the penalty cost value 100, and becomes 382.

また、同様に、ノードn22からノードn33に至る経路では、文字セグメントS3が文字「1」とされているが、図15(a)に示したように、この文字セグメントS3は、上部で文字セグメントS2と接触しているので、ペナルティNo.3の条件が適用されて、コストにP=50が付加される。よって、ノードn33での文字コストは、ノードn22の評価コストの値382と、文字セグメントS3の文字コストの値100と、ペナルティの値50との和として算出されて532となる。そして、この経路上には3文字が存在するので、ノードn33での評価コストは、最終的に、177(=532/3)と算出される。ノードn11からノードn32に至る経路、ノードn21からノードn32に至る経路でも、同様に、ペナルティが適用され文字コストに所定の値が付加される。   Similarly, in the path from the node n22 to the node n33, the character segment S3 is the character “1”. As shown in FIG. 15A, the character segment S3 is the upper character segment. Since it is in contact with S2, penalty no. 3 is applied and P = 50 is added to the cost. Therefore, the character cost at the node n33 is calculated as the sum of the evaluation cost value 382 of the node n22, the character cost value 100 of the character segment S3, and the penalty value 50, which is 532. Since there are three characters on this route, the evaluation cost at the node n33 is finally calculated as 177 (= 532/3). Similarly, a penalty is applied to the path from the node n11 to the node n32 and the path from the node n21 to the node n32, and a predetermined value is added to the character cost.

また、図16及び図17で、ノードn21からノードn32へ至る経路に、局所的制約が適用された例を示している。ノードn21からノードn32へ至る経路上では、文字セグメントS3が文字「1」として認識されている。すなわち、文字「0(ゼロ)」として認識されていないことから、直前のノードn21には、接続線であってはならないという局所的制約が適用されることになる。図16及び図17では、局所的制約により絶たれた経路を×印で示している。この局所的制約により、ノードn21からノードn32へ至る経路では、直前のノードn21の文字セグメントS2を接続線とする結果(コスト124,前ノードをn11とする結果)を利用することができない。   16 and 17 show an example in which local restrictions are applied to the path from the node n21 to the node n32. On the path from the node n21 to the node n32, the character segment S3 is recognized as the character “1”. That is, since it is not recognized as the character “0 (zero)”, the local restriction that it should not be a connection line is applied to the immediately preceding node n21. In FIG. 16 and FIG. 17, a path cut off due to local restrictions is indicated by a cross. Due to this local restriction, in the path from the node n21 to the node n32, the result of using the character segment S2 of the immediately preceding node n21 as the connection line (result of the cost 124 and the previous node being n11) cannot be used.

このように、ペナルティ及び局所的制約を含めて最適経路を探索した結果、図18に示すように、ノードn31のコストが最小値を示す。そして、ノードn31からバックトレースを行って、最適経路がn00−n31であると決定される。そして、この経路上に存在する文字セグメント(S1+S2+S3)の内容から、図15(a)に示す文字を、1文字の「7」として正しく文字認識することができる。   As described above, as a result of searching for the optimum route including the penalty and the local constraint, the cost of the node n31 shows the minimum value as shown in FIG. Then, the back trace is performed from the node n31, and it is determined that the optimum route is n00-n31. Then, from the contents of the character segment (S1 + S2 + S3) existing on this route, the character shown in FIG. 15A can be correctly recognized as one character “7”.

図19は、図18に示す経路探索で局所的制約及びペナルティの有無により表れる探索結果の違いを説明する図である。図19(a)が、局所的制約及びペナルティが無い場合の結果であり、同図(b)が局所的制約及びペナルティが有る場合の結果を示している。図19(a)に示すように、局所的制約及びペナルティが無いと、図中No.1に示す経路が最適経路とされて、誤った文字認識結果が得られる。また、ここで、局所的制約条件を適用して、No.3の経路を除いても、誤ったNo.1の最適経路が維持される。これに対して、図19(b)に示すように、ペナルティ及び局所的制約の両方を適用すると、局所的制約によりNo.3の結果が除かれて、最適経路としてNo.5の経路が選択される。このように、制約条件及びペナルティの両方を適用することにより、最適経路を正確に探索することが可能となる。そして、正しい文字認識結果を得ることができる。   FIG. 19 is a diagram for explaining a difference in search results that appear depending on the presence or absence of local restrictions and penalties in the route search shown in FIG. FIG. 19A shows the results when there are no local constraints and penalties, and FIG. 19B shows the results when there are local constraints and penalties. As shown in FIG. 19A, if there are no local restrictions and penalties, no. The route shown in FIG. 1 is set as the optimum route, and an erroneous character recognition result is obtained. Also, here, applying local constraints, No. Even if the route 3 is removed, the wrong No. One optimal path is maintained. On the other hand, as shown in FIG. 19B, when both the penalty and the local constraint are applied, the No. 3 is removed, and the optimum route is No. 3. Five routes are selected. As described above, by applying both the constraint condition and the penalty, it is possible to accurately search the optimum route. And the correct character recognition result can be obtained.

図15〜図18では、説明を簡単にするため、一文字の場合を例に説明したが、本実施例に係る文字認識方法により、文字列を処理対象として各文字を正確に文字認識できることは言うまでもない。以下、複数の文字を含む文字列から、本実施例に係る文字認識方法によって、最適経路を探索した結果の例を示す。   15 to 18, the case of a single character has been described as an example for the sake of simplicity. Needless to say, the character recognition method according to the present embodiment can accurately recognize each character using a character string as a processing target. Yes. Hereinafter, an example of a result of searching for an optimum route from a character string including a plurality of characters by the character recognition method according to the present embodiment will be described.

図20〜図24は、本実施例で示した文字認識方法を適用した別の例を示す図である。図20は、文字認識装置1による処理対象となる文字列について説明する図である。図20(a)は、入力画像取得部11によって取得された文字列画像、同図(b)及び(c)はこの文字列画像が入力画像分割部12によって基本セグメントS1〜S6に分割された結果を示している。   20-24 is a figure which shows another example to which the character recognition method shown in the present Example is applied. FIG. 20 is a diagram for explaining a character string to be processed by the character recognition device 1. 20A shows a character string image acquired by the input image acquisition unit 11, and FIGS. 20B and 20C show that the character string image is divided into basic segments S1 to S6 by the input image dividing unit 12. FIG. Results are shown.

また、図21は、セグメント生成部13によって生成された各文字セグメントに基づいて、最適経路探索部15によって設定された探索経路を示している。このように、6つの基本セグメントに分割された場合には多数のノードと経路が設定されることになる。   FIG. 21 shows a search route set by the optimum route search unit 15 based on each character segment generated by the segment generation unit 13. As described above, when divided into six basic segments, a large number of nodes and paths are set.

図22は、セグメント評価部14によって得られた各文字セグメントの文字コストを示している。このように、セグメント生成部13によって、6つの基本セグメントから生成された21個の各文字セグメントについて、セグメント評価部14により文字コストが求められる。   FIG. 22 shows the character cost of each character segment obtained by the segment evaluation unit 14. As described above, the segment evaluation unit 14 calculates the character cost for each of the 21 character segments generated from the six basic segments by the segment generation unit 13.

そして、本実施例で上述したように、最適経路探索部15によって、最適経路を探索する処理が行われる。図23及び図24は、図21に示す経路上で最適経路を探索した際に得られる評価コスト及び前ノード情報の保存結果の一部を示す図である。図23は、図21の領域D1の結果を示し、図24は、図21の領域D2に含まれる結果の一部を示している。なお、図21に示す探索経路上で最適経路を探索する際には、上述したように、接続線又はノイズである可能性がある文字セグメントでは、文字コストに加えて、接続線コスト又はノイズコストを利用して評価コストを算出する。各文字セグメントの文字コストは図22に示した通りであるため、図23及び図24では、接続線又はノイズである可能性がある文字セグメントでは文字コストの表示を省略している。具体的には、文字セグメントが文字又は接続線であるとされた場合は(セグメントS3及びS5)接続線コストのみを示し、文字又はノイズであるとされた場合も(セグメントS2)ノイズコストのみを示している。   Then, as described above in the present embodiment, the optimum route searching unit 15 performs a process for searching for the optimum route. FIG. 23 and FIG. 24 are diagrams showing a part of the evaluation cost obtained when searching for the optimum route on the route shown in FIG. 21 and the result of storing the previous node information. FIG. 23 shows the result of the region D1 in FIG. 21, and FIG. 24 shows a part of the result included in the region D2 of FIG. When searching for the optimum route on the search route shown in FIG. 21, as described above, in a character segment that may be a connection line or noise, in addition to the character cost, the connection line cost or noise cost. The evaluation cost is calculated using Since the character cost of each character segment is as shown in FIG. 22, in FIG. 23 and FIG. 24, the display of the character cost is omitted in the character segment that may be a connection line or noise. Specifically, when the character segment is a character or a connection line (segments S3 and S5), only the connection line cost is shown, and even when the character segment is a character or noise (segment S2), only the noise cost is shown. Show.

例えば、図20(b)に示すように、文字セグメントS2は他の文字セグメントに比べて小さいため、文字セグメントS2には、セグメント評価部14によって、図22に示す文字コストに加えて、ノイズとしてのノイズコストが付与される。この結果、図23のノードn11からノードn21へ至る経路に示したように、文字セグメントS2がノイズコスト50のノイズとされて、ノードn21のノイズの評価コストが算出される。   For example, as shown in FIG. 20B, since the character segment S2 is smaller than the other character segments, the segment evaluation unit 14 adds noise to the character segment S2 in addition to the character cost shown in FIG. Noise cost. As a result, as shown in the path from the node n11 to the node n21 in FIG. 23, the character segment S2 is regarded as noise with the noise cost 50, and the noise evaluation cost of the node n21 is calculated.

このように、図22に示す各文字セグメントの文字コストを用いて、図21に示す全ての経路で評価コストを求めると、図21に示すようにノードn00−n31−n42−n52−n63へ至る経路が最適経路として求められる。このときの評価コストは、図24に示す値から、124(=371/3)となる。そして、最適経路をバックトレースして得られた結果に基づいて、文字列から、ノードn00からノードn31へ至る経路上の文字セグメント(S1+S2+S3)の文字「2」、ノードn31からノードn42へ至る経路上の文字セグメントS4の文字「0(ゼロ)」、ノードn42からノードn52へ至る経路上の文字セグメントS5の接続線、ノードn52からノードn63へ至る経路上の文字セグメントS6の文字「0(ゼロ)」が切り出されることになる。すなわち、図20(a)に示す文字列から、文字「2」、文字「0(ゼロ)」、接続線、文字「0(ゼロ)」が切り出される。そして、接続線を除いて、図20(a)に示す文字列は、文字「2」、文字「0(ゼロ)」及び文字「0(ゼロ)」であるとの文字認識結果を得ることができる。   As described above, when the evaluation cost is obtained for all the routes shown in FIG. 21 using the character cost of each character segment shown in FIG. 22, the node n00-n31-n42-n52-n63 is reached as shown in FIG. A route is determined as the optimum route. The evaluation cost at this time is 124 (= 371/3) from the value shown in FIG. Based on the result obtained by back-tracing the optimum route, the character “2” of the character segment (S1 + S2 + S3) on the route from the character string to the node n31 from the character string, and the route from the node n31 to the node n42 The character “0 (zero)” of the upper character segment S4, the connecting line of the character segment S5 on the path from the node n42 to the node n52, and the character “0 (zero) of the character segment S6 on the path from the node n52 to the node n63 ) ”Will be cut out. That is, the character “2”, the character “0 (zero)”, the connection line, and the character “0 (zero)” are cut out from the character string shown in FIG. Then, the character recognition result that the character string shown in FIG. 20A is the character “2”, the character “0 (zero)”, and the character “0 (zero)” can be obtained except for the connection line. it can.

上述してきたように、本実施形態によれば、接続線で接続された文字が文字列に含まれる場合でも、文字列を分割した基本セグメントから文字セグメントを生成して、各文字セグメントを結ぶ探索経路を設定して、各文字セグメントの文字コストに基づいて最適経路を探索する。このとき、文字又は文字以外(接続線やノイズ)である可能性がある文字セグメントは、両方の可能性を残した状態で最適経路を探索する処理を進めることができる。そして、得られた経路をバックトレースする処理を行って、探索方向下流側の文字セグメントの情報を利用しながら文字セグメントが文字又は文字以外のいずれであるのかを決定することができる。これにより、最適経路を正確に探索して、文字列から各文字を正確に切り出した文字認識結果を得ることができる。   As described above, according to the present embodiment, even when characters connected by connecting lines are included in a character string, a character segment is generated from a basic segment obtained by dividing the character string, and a search for connecting the character segments is performed. A route is set, and an optimum route is searched based on the character cost of each character segment. At this time, for a character segment that may be a character or a character other than a character (connection line or noise), it is possible to proceed with the process of searching for an optimum route with both possibilities remaining. Then, it is possible to determine whether the character segment is a character or a character other than the character while using the information of the character segment on the downstream side in the search direction by performing a back-trace process on the obtained route. As a result, it is possible to accurately search the optimum route and obtain a character recognition result obtained by accurately cutting out each character from the character string.

また、文字セグメントによる経路を設定する際に、文字数が増える方向と文字数が増えない方向の二次元で探索経路を設定することにより、文字数を考慮して各探索経路のコストを算出して、最適経路を正確に探索することができる。   In addition, when setting a route by character segment, the cost of each search route is calculated in consideration of the number of characters by setting the search route in two dimensions: the direction in which the number of characters increases and the direction in which the number of characters does not increase. The route can be searched accurately.

また、最適経路を探索する際に、文字セグメントの文字認識結果と、この文字セグメントの左右に隣接する各文字セグメントとの接触状態に応じてペナルティを付加することにより、最適経路を正確に探索することができる。   Further, when searching for the optimum route, the optimum route is accurately searched by adding a penalty according to the character recognition result of the character segment and the contact state between the character segment adjacent to the left and right of the character segment. be able to.

また、最適経路を探索する際に、例えば、接続線の後には文字「0(ゼロ)」が来るといった内容に基づいて局所的制約を設定することにより、あり得ない経路を除外して、最適経路の探索に係る負荷を低減すると共に、最適経路の探索を正確に行うことができる。   Also, when searching for the optimum route, for example, by setting a local constraint based on the content that the character “0 (zero)” comes after the connection line, the impossible route is excluded and the optimum route is excluded. The load related to the route search can be reduced and the optimum route can be searched accurately.

以上のように、本発明は、手書きされた文字列が接続線によって接続して書かれた文字を含む場合に、文字列から各文字を正確に切り出して文字認識するために有用な技術である。   As described above, the present invention is a useful technique for accurately recognizing characters by cutting out each character from the character string when the handwritten character string includes characters written by connecting with a connection line. .

1 文字認識装置
11 入力画像取得部
12 入力画像分割部
13 セグメント生成部
14 セグメント評価部
15 最適経路探索部
16 認識結果出力部
DESCRIPTION OF SYMBOLS 1 Character recognition apparatus 11 Input image acquisition part 12 Input image division | segmentation part 13 Segment generation part 14 Segment evaluation part 15 Optimal route search part 16 Recognition result output part

Claims (6)

手書きの文字列から各文字を切り出して認識する文字認識方法であって、
前記文字列が含まれる文字列画像を取得する画像取得工程と、
前記文字列画像の輪郭形状に基づいて前記文字列画像を複数の基本セグメントに分割する画像分割工程と、
前記基本セグメントを文字セグメントとすると共に前記基本セグメントを複数組み合わせた文字セグメントを生成する文字セグメント生成工程と、
生成された各文字セグメントと該文字セグメントを文字認識して得られた文字との類似度を示す文字コストを求めると共に、接続線の可能性がある文字セグメントに前記文字コストに加えて接続線コストを付与する処理及びノイズの可能性がある文字セグメントに前記文字コストに加えてノイズコストを付与する処理の少なくともいずれか一方を行うセグメント評価工程と、
前記セグメント評価工程で得られた文字コストと、接続線コスト及びノイズコストの少なくともいずれか一方とに基づいて各文字セグメントを組み合わせる最適経路を探索する最適経路探索工程と、
前記最適経路探索工程で探索された最適経路を形成する文字セグメントに基づいて前記文字列から各文字を切り出す文字切出工程と
を含んだことを特徴とする文字認識方法。
A character recognition method for recognizing and extracting each character from a handwritten character string,
An image acquisition step of acquiring a character string image including the character string;
An image dividing step of dividing the character string image into a plurality of basic segments based on a contour shape of the character string image;
A character segment generating step for generating a character segment in which the basic segment is a character segment and a plurality of the basic segments are combined;
A character cost indicating the degree of similarity between each generated character segment and a character obtained by character recognition of the character segment is obtained, and a connection line cost is added to the character segment that may be a connection line in addition to the character cost. A segment evaluation step of performing at least one of the process of giving noise cost in addition to the character cost to the character segment having the possibility of noise and the character segment,
An optimum route search step of searching for an optimum route for combining each character segment based on the character cost obtained in the segment evaluation step and at least one of a connection line cost and a noise cost;
And a character extracting step of extracting each character from the character string based on the character segment forming the optimal route searched in the optimal route searching step.
前記最適経路探索工程で、最適経路であるか否かを評価する評価コストを算出する際に、
接続線の可能性がある文字セグメントを通る経路では前記文字コスト及び前記接続線コストから2つの評価コストを算出して以降の経路探索に利用して、
ノイズの可能性がある文字セグメントを通る経路では前記文字コスト及び前記ノイズコストから2つの評価コストを算出して以降の経路探索に利用する
ことを特徴とする請求項1に記載の文字認識方法。
In calculating the evaluation cost for evaluating whether or not the optimum route in the optimum route searching step,
In the route through the character segment with the possibility of a connection line, two evaluation costs are calculated from the character cost and the connection line cost, and used for the subsequent route search,
2. The character recognition method according to claim 1, wherein two evaluation costs are calculated from the character cost and the noise cost in a route passing through a character segment having a possibility of noise and used for a subsequent route search.
前記最適経路探索工程では、文字として認識された前記文字セグメントと、隣接する文字セグメントとの接続状態に応じて、前記文字セグメントの文字コストにペナルティを付加することを特徴とする請求項1又は2に記載の文字認識方法。   3. The optimum route searching step adds a penalty to a character cost of the character segment according to a connection state between the character segment recognized as a character and an adjacent character segment. The character recognition method described in 1. 前記最適経路探索工程では、最適経路であるか否かを評価する評価コストを、経路上で認識された文字の数に基づいて算出することを特徴とする請求項1、2又は3に記載の文字認識方法。   The said optimal path | route search process calculates the evaluation cost which evaluates whether it is an optimal path | route based on the number of the characters recognized on the path | route, The Claim 1, 2, or 3 characterized by the above-mentioned. Character recognition method. 前記画像分割工程は、
前記文字列画像から輪郭を抽出する輪郭抽出工程と、
抽出した輪郭上にある画素を注目画素として該注目画素から所定距離だけ離れた前記輪郭上の2点とを結んだ線分の成す角度を前記注目画素の角度として算出する角度算出工程と、
前記注目画素の角度が所定値以下である場合に切断開始点として特定する切断開始点特定工程と、
前記切断開始点特定工程で特定された切断開始点と、前記輪郭上にある画素との距離を算出して、該距離の変化から極小値を示す画素を切断終点として特定する切断終点特定工程と、
前記切断開始点と前記切断終点とを結ぶ切断線により前記文字列画像を切断して分割する工程と
を含んだことを特徴とする請求項1〜4のいずれか1項に記載の文字認識方法。
The image dividing step includes
A contour extraction step of extracting a contour from the character string image;
An angle calculation step of calculating an angle formed by a line segment connecting two points on the contour separated from the target pixel by a predetermined distance as a pixel on the extracted contour as the target pixel;
A cutting start point specifying step for specifying a cutting start point when the angle of the target pixel is equal to or smaller than a predetermined value;
A cutting end point specifying step of calculating a distance between the cutting start point specified in the cutting start point specifying step and a pixel on the contour, and specifying a pixel indicating a minimum value from the change in the distance as a cutting end point; ,
The character recognition method according to claim 1, further comprising a step of cutting and dividing the character string image by a cutting line connecting the cutting start point and the cutting end point. .
手書きの文字列から各文字を切り出して認識する文字認識装置であって、
前記文字列が含まれる文字列画像を取得する入力画像取得部と、
前記文字列画像の輪郭形状に基づいて前記文字列画像を複数の基本セグメントに分割する入力画像分割部と、
前記基本セグメントを文字セグメントとすると共に前記基本セグメントを複数組み合わせた文字セグメントを生成するセグメント生成部と、
生成された各文字セグメントと該文字セグメントを文字認識して得られた文字との類似度を示す文字コストを求めると共に、接続線である可能性がある文字セグメントに前記文字コストに加えて接続線コストを付与する処理及びノイズの可能性がある文字セグメントに前記文字コストに加えてノイズコストを付与する処理の少なくともいずれか一方を行うセグメント評価部と、
前記セグメント評価部によって得られた文字コストと、接続線コスト及びノイズコストの少なくともいずれか一方とに基づいて各文字セグメントを組み合わせる最適経路を探索する最適経路探索部と、
前記最適経路探索部によって探索された最適経路を形成する各文字セグメントに基づいて前記文字列から各文字を切り出す文字切出部と
を備えることを特徴とする文字認識装置。
A character recognition device for recognizing and recognizing each character from a handwritten character string,
An input image acquisition unit for acquiring a character string image including the character string;
An input image dividing unit that divides the character string image into a plurality of basic segments based on a contour shape of the character string image;
A segment generation unit that generates a character segment in which the basic segment is a character segment and a plurality of the basic segments are combined;
A character cost indicating the degree of similarity between each generated character segment and a character obtained by character recognition of the character segment is obtained, and a connection line is added to the character segment that may be a connection line in addition to the character cost. A segment evaluation unit that performs at least one of a process of giving a cost and a process of giving a noise cost in addition to the character cost to a character segment that has a possibility of noise;
An optimum route search unit that searches for an optimum route that combines each character segment based on the character cost obtained by the segment evaluation unit and at least one of a connection line cost and a noise cost;
A character recognition device comprising: a character cutout unit that cuts out each character from the character string based on each character segment that forms the optimum route searched by the optimum route search unit.
JP2012288382A 2012-12-28 2012-12-28 Character recognition method and character recognition device Active JP6166532B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012288382A JP6166532B2 (en) 2012-12-28 2012-12-28 Character recognition method and character recognition device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012288382A JP6166532B2 (en) 2012-12-28 2012-12-28 Character recognition method and character recognition device

Publications (2)

Publication Number Publication Date
JP2014130510A true JP2014130510A (en) 2014-07-10
JP6166532B2 JP6166532B2 (en) 2017-07-19

Family

ID=51408838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012288382A Active JP6166532B2 (en) 2012-12-28 2012-12-28 Character recognition method and character recognition device

Country Status (1)

Country Link
JP (1) JP6166532B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092902A (en) * 2016-02-18 2017-08-25 富士通株式会社 The recognition methods of character string and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63175984A (en) * 1987-01-16 1988-07-20 Agency Of Ind Science & Technol Pattern recognition method
JPH06111070A (en) * 1992-09-30 1994-04-22 Toshiba Corp Character recognizing device
JPH07192094A (en) * 1993-11-17 1995-07-28 Fujitsu Ltd Character segmenting circuit and character segmenting method
JP2000322514A (en) * 1999-05-14 2000-11-24 Fujitsu Ltd Pattern extraction device and character segmentation device
JP2001184458A (en) * 1999-10-15 2001-07-06 Matsushita Electric Ind Co Ltd Device and method for character input and computer- readable recording medium
JP2001236466A (en) * 2000-02-22 2001-08-31 Sharp Corp Device and method for on-line handwritten character recognition, and recording medium stored with program implementing the same
US20090208107A1 (en) * 2008-02-19 2009-08-20 Fujitsu Limited Character recognition apparatus and character recognition method
JP2010061403A (en) * 2008-09-03 2010-03-18 Hitachi Computer Peripherals Co Ltd Character string recognition device, method, and program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63175984A (en) * 1987-01-16 1988-07-20 Agency Of Ind Science & Technol Pattern recognition method
JPH06111070A (en) * 1992-09-30 1994-04-22 Toshiba Corp Character recognizing device
JPH07192094A (en) * 1993-11-17 1995-07-28 Fujitsu Ltd Character segmenting circuit and character segmenting method
JP2000322514A (en) * 1999-05-14 2000-11-24 Fujitsu Ltd Pattern extraction device and character segmentation device
JP2001184458A (en) * 1999-10-15 2001-07-06 Matsushita Electric Ind Co Ltd Device and method for character input and computer- readable recording medium
JP2001236466A (en) * 2000-02-22 2001-08-31 Sharp Corp Device and method for on-line handwritten character recognition, and recording medium stored with program implementing the same
US20090208107A1 (en) * 2008-02-19 2009-08-20 Fujitsu Limited Character recognition apparatus and character recognition method
JP2009199102A (en) * 2008-02-19 2009-09-03 Fujitsu Ltd Character recognition program, character recognition device and character recognition method
JP2010061403A (en) * 2008-09-03 2010-03-18 Hitachi Computer Peripherals Co Ltd Character string recognition device, method, and program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
古川 直広 外3名: "星座認識による帳票識別方式", 電子情報通信学会技術研究報告 VOL.101 NO.423 HIP2001−16〜40 ヒューマン情, vol. 第101巻 第423号, JPN6016043262, 8 November 2001 (2001-11-08), JP, pages 85 - 92, ISSN: 0003437175 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092902A (en) * 2016-02-18 2017-08-25 富士通株式会社 The recognition methods of character string and system

Also Published As

Publication number Publication date
JP6166532B2 (en) 2017-07-19

Similar Documents

Publication Publication Date Title
Mahdavi et al. ICDAR 2019 CROHME+ TFD: Competition on recognition of handwritten mathematical expressions and typeset formula detection
JP5716328B2 (en) Information processing apparatus, information processing method, and information processing program
Rehman et al. Performance analysis of character segmentation approach for cursive script recognition on benchmark database
US8340429B2 (en) Searching document images
JPWO2008099664A1 (en) Vehicle number recognition device
JP2009199102A (en) Character recognition program, character recognition device and character recognition method
US9519404B2 (en) Image segmentation for data verification
Malik et al. An efficient segmentation technique for Urdu optical character recognizer (OCR)
Saba et al. Online versus offline Arabic script classification
Ayesh et al. A robust line segmentation algorithm for Arabic printed text with diacritics
Ramirez et al. Automatic recognition of square notation symbols in western plainchant manuscripts
Inkeaw et al. Recognition-based character segmentation for multi-level writing style
JP4686433B2 (en) Word recognition method and word recognition device
JP3216800B2 (en) Handwritten character recognition method
US20180189562A1 (en) Character recognition apparatus, character recognition method, and computer program product
JP6166532B2 (en) Character recognition method and character recognition device
Alahmadi VID2XML: Automatic Extraction of a Complete XML Data From Mobile Programming Screencasts
Ladwani et al. Novel approach to segmentation of handwritten Devnagari word
CN111310442B (en) Method for mining shape-word error correction corpus, error correction method, device and storage medium
CN114373178A (en) Picture character detection and identification method and system
CN114863574A (en) Handwritten signature recognition method, device, equipment, medium and program product
Moysset et al. On the evaluation of handwritten text line detection algorithms
JP5712415B2 (en) Form processing system and form processing method
JP4087191B2 (en) Image processing apparatus, image processing method, and image processing program
JP5039659B2 (en) Character recognition method and character recognition device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151118

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20161012

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161115

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170112

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170623

R150 Certificate of patent or registration of utility model

Ref document number: 6166532

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150