JPH05314309A - Character string direction discriminating method - Google Patents

Character string direction discriminating method

Info

Publication number
JPH05314309A
JPH05314309A JP4120263A JP12026392A JPH05314309A JP H05314309 A JPH05314309 A JP H05314309A JP 4120263 A JP4120263 A JP 4120263A JP 12026392 A JP12026392 A JP 12026392A JP H05314309 A JPH05314309 A JP H05314309A
Authority
JP
Japan
Prior art keywords
character string
connected components
document
equal
reduced image
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
JP4120263A
Other languages
Japanese (ja)
Other versions
JP3220226B2 (en
Inventor
Takashi Saito
高志 齋藤
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP12026392A priority Critical patent/JP3220226B2/en
Publication of JPH05314309A publication Critical patent/JPH05314309A/en
Application granted granted Critical
Publication of JP3220226B2 publication Critical patent/JP3220226B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

(57)【要約】 【目的】 少ない処理量で文書の文字列方向(縦書き・
横書きの別)を自動判別する。 【構成】 文書の縮小画像を生成し(203)、縮小画
像上の文字列候補の連結成分を抽出する(203〜20
4)。細長い縦長連結成分と横長連結成分のそれぞれの
個数を集計し(205)、その個数が十分である場合
は、個数の比較により文字列方向を判定する(20
6)。個数が不十分である場合は、連結成分を縦方向と
横方向の文字列へ統合し、統合した連結成分の隣接する
ものとの距離の非ヒストグラムを方向別に作成する(2
07)。各方向のヒストグラム上の最大頻度の距離を比
較して文字列方向を判定するが、それが不確かな場合に
は最大頻度とその周辺の頻度の総計の比較によって文字
列方向を判定する(208)。
(57) [Summary] [Purpose] Character string direction of a document (vertical writing
Horizontal writing) is automatically determined. [Structure] A reduced image of a document is generated (203), and connected components of character string candidates on the reduced image are extracted (203 to 20).
4). The numbers of the slender vertically connected components and the horizontally connected components are totaled (205), and if the numbers are sufficient, the character string direction is determined by comparing the numbers (20).
6). If the number is insufficient, the connected components are combined into character strings in the vertical and horizontal directions, and a non-histogram of the distance between adjacent connected components is created for each direction (2
07). The distance of the maximum frequency in each direction is compared to determine the character string direction. If it is uncertain, the character string direction is determined by comparing the maximum frequency with the total frequency around it (208). ..

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、文書画像を扱う装置も
しくはシステムにおいて、文書の2値画像から文字列の
方向あるいは文書の縦書き・横書きの別を自動的に判別
する方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for automatically discriminating a direction of a character string or vertical writing / horizontal writing of a document from a binary image of the document in an apparatus or system for handling a document image.

【0002】[0002]

【従来の技術】縦書きまたは横書き書式の文書を処理す
るOCR等のシステムにおいて、文書画像から文字列と
文章領域の抽出を行なう場合、まず文書画像から文字列
を構成する微小な候補領域をまず抽出し、これを統合す
ることによって文章領域を抽出する方法が一般的に採用
されるが、候補領域の統合のために文字列の方向、つま
り文書の縦書き・横書きの別を知る必要がなる。
2. Description of the Related Art In a system such as an OCR which processes a vertically or horizontally written document, when a character string and a text area are extracted from a document image, first, a small candidate area that constitutes the character string is first formed from the document image. The method of extracting the text area by extracting and integrating it is generally adopted, but it is necessary to know the direction of the character string, that is, the vertical writing / horizontal writing of the document, in order to integrate the candidate areas. ..

【0003】この方向の自動判別に関しては、次の方法
が知られている。
The following method is known for automatic determination of this direction.

【0004】(a)特開平3−44788号公報に述べ
られていように、文書画像をいくつかのブロックに分割
し、ブロック内で黒画素の周辺分布をとり、その周期性
から文字列方向を判断する方法。
(A) As described in Japanese Patent Laid-Open No. 3-44788, a document image is divided into several blocks, a black pixel peripheral distribution is taken in each block, and the character string direction is determined from its periodicity. How to judge.

【0005】(b)通信学会PRU研究会報告89−1
14「多様なレイアウト構造、構成要素を持つ文書の領
域分割」に述べられているように、各連結成分につい
て、最も近接したもの同士の距離を縦方向、横方向それ
ぞれについて調べ、その距離の総和が小さいほうの方向
を文字列方向とする方法。
(B) Report of the PSU Research Group of the Communication Society of Japan 89-1
14 As described in “Division of Documents with Various Layout Structures and Components”, the distance between the closest components of each connected component is checked in the vertical and horizontal directions, and the sum of the distances is checked. A method in which the direction with the smaller is the string direction.

【0006】[0006]

【発明が解決しようとする課題】前記(a)方法は、周
辺分布を用いるため文書の傾きに弱く、また写真領域等
の文字領域以外の部分や、文字領域であっても本文とレ
イアウトの異なる部分(タイトル等)の影響によって処
理が不可能な場合がある。
The method (a) uses the marginal distribution and thus is weak against the inclination of the document, and has a layout different from the text even in a portion other than the text area such as a photograph area or in the text area. Processing may not be possible due to the influence of the part (title, etc.).

【0007】前記(b)方法は、文書画像上の全ての連
結成分について、近接した連結成分を縦横方向に検索し
なければならないため、処理量が非常に大きい。また、
予め連結成分の大きさ等の属性より文字とそれ以外のも
のに分別することによって、文書上の文字以外の部分の
影響を排除できるが、しかし近接した連結成分間の距離
の総和を利用するため、本文に近接してタイトルやペー
ジ番号等が存在すると、その影響がでる。
The method (b) requires an extremely large amount of processing because it is necessary to search for adjacent connected components in the vertical and horizontal directions for all the connected components on the document image. Also,
The effect of non-character parts on the document can be eliminated by separating the characters and other objects from the attributes such as the size of the connected components in advance, but the total distance between adjacent connected components is used. , If there is a title, page number, etc. close to the text, that effect will occur.

【0008】本発明は、従来方法の弱点に鑑み、少ない
処理量で文書の文字列方向を確実に判別するための新し
い方法を提供しようとするものである。
In view of the weak points of the conventional method, the present invention aims to provide a new method for surely determining the character string direction of a document with a small processing amount.

【0009】[0009]

【課題を解決するための手段】請求項1の発明の方法
は、文書の2値画像の縮小画像を生成し、該縮小画像よ
り文字列候補としての黒画素の連結成分を抽出する。そ
して、該連結成分の中で縦横比または縦横比がある閾値
を超える縦長の連結成分の個数と横長の連結成分の個数
とを比較することにより、文字列方向あるいは縦書き/
横書きの別を判定する、というものである。
According to the method of the present invention, a reduced image of a binary image of a document is generated, and a connected component of black pixels as a character string candidate is extracted from the reduced image. Then, by comparing the number of vertically connected components whose aspect ratio or aspect ratio exceeds a certain threshold among the connected components and the number of horizontally connected components, the character string direction or vertical writing / writing
It is to judge whether to write horizontally.

【0010】請求項2の発明の方法は、文書の2値画像
の縮小画像を生成し、該縮小画像より文字列候補として
の黒画素の連結成分を抽出し、該連結成分の中で縦横比
または横縦比ががある第1の閾値以上の縦長の連結成分
及び横長の連結成分のそれぞれの個数を調べる。そし
て、該縦長連結成分の個数または該横長連結成分の個数
が第2の閾値を超える場合は、それぞの個数の比較によ
って文字列方向を判定する。しかし、該縦長連結成分の
個数及び該横長連結成分の個数がそれぞれ該第2の閾値
以下である場合は、該文字列候補としての連結成分を縦
方向及び横方向の文字列へそれぞれ統合する処理を行な
い、長さに対する高さの比がある第3の閾値以下の文字
列に統合された連結成分の隣合うものの距離のヒストグ
ラムを縦方向及び横方向について別々に生成し、該各方
向のヒストグラムの最頻値に対応する距離を比較するこ
とによって文字列方向を判定する、というものである。
According to a second aspect of the present invention, a reduced image of a binary image of a document is generated, a connected component of black pixels as a character string candidate is extracted from the reduced image, and an aspect ratio among the connected components is extracted. Alternatively, the number of each of vertically long connected components and horizontally long connected components having an aspect ratio equal to or larger than a first threshold is checked. When the number of the vertically long connected components or the number of the horizontally long connected components exceeds the second threshold value, the character string direction is determined by comparing the respective numbers. However, when the number of the vertically long connected components and the number of the horizontally long connected components are each less than or equal to the second threshold value, a process of integrating the connected components as the character string candidates into the vertical and horizontal character strings, respectively. And generating a histogram of distances between adjacent ones of connected components integrated in a character string having a height to length ratio less than or equal to a third threshold value separately in the vertical direction and the horizontal direction, and The character string direction is determined by comparing the distances corresponding to the modal values of.

【0011】請求項3の発明の方法は、請求項2の発明
の方法と同様に、各方向のヒストグラムを生成した場合
に、各方向のヒストグラムにおいて最大頻度と該最大頻
度に対応する距離の周辺の距離の頻度との総計を求め
る。そして、各方向の該総計の比がある第4の閾値以下
のときには、請求項2の発明の方法と同様に最大頻度に
対応する距離の比較によって文字列方向を判定するが、
そうでない場合には該総計の比較によって文字列方向を
判定する、というものである。
According to the method of the third aspect of the present invention, in the same manner as the method of the second aspect of the present invention, when the histogram of each direction is generated, the maximum frequency in the histogram of each direction and the vicinity of the distance corresponding to the maximum frequency are generated. Find the total with the distance frequency of. Then, when the ratio of the total in each direction is less than or equal to a fourth threshold value, the character string direction is determined by comparing the distances corresponding to the maximum frequency as in the method of the invention of claim 2.
If not, the direction of the character string is determined by comparing the totals.

【0012】[0012]

【作用】請求項1の発明によれば、文書の2値画像を縮
小し、その縮小画像上の文字列候補としての連結成分を
抽出する。一般的な文字間隔の文書の場合、適当な縮小
率の縮小画像上では文字間は融合するが、しかし行間は
融合しないため、横書き文書の場合には横縦比が大きな
横長の連結成分が多く出現するのに対し、縦書き文書の
場合には縦横比が大きな縦長の連結成分が多く出現す
る。しかして、請求項1の発明によれば、このような横
長と縦長の連結成分の個数を比較し、その個数が多い方
向を文字列方向として判別することができるのである。
According to the first aspect of the invention, the binary image of the document is reduced, and the connected components as the character string candidates on the reduced image are extracted. In the case of a document with a general character spacing, characters are fused on a reduced image with an appropriate reduction ratio, but line spacing is not fused, so in a horizontal writing document, there are many horizontally-oriented connected components with a large aspect ratio. In contrast, in the case of a vertically written document, many vertically long connected components with a large aspect ratio appear. Therefore, according to the invention of claim 1, it is possible to determine the direction in which the number is large as the character string direction by comparing the numbers of such horizontally-long and vertically-long connected components.

【0013】そして、周辺分布を利用する方法でないの
で、本質的に文書の傾きに強く、また、文字列候補とし
て不適当な連結成分は、その大きさ等の特徴によって容
易に排除できるので、写真領域や、タイトル等の本文と
レイアウトが大きく異なる領域が存在しても、その影響
を排除して本文の文字列方向を判別できる。
Since the method using the marginal distribution is not used, the connected component which is inherently strong in the inclination of the document and which is unsuitable as a character string candidate can be easily excluded due to its size and the like. Even if there is an area or an area such as a title whose layout is largely different from that of the body, the influence of the area can be eliminated and the direction of the character string of the body can be determined.

【0014】請求項1の発明と同様の文字列方向判別を
圧縮前の文字画像を直接対象にして行なおうとするなら
ば、遥かに多数の連結成分を抽出し、それを縦方向と横
方向に統合ないし融合する処理をする必要があろう。請
求項1の発明によれば、1回の縮小処理を行なうだけ
で、方向判別の処理の対象となる連結成分の個数が大幅
に減り、その統合なしい融合の処理も不要となり、しか
も縮小処理は単純な論理和演算等によって達成できるか
ら、少ない処理量で単時間に文字列方向判別を行なうこ
とができる。
If the character string direction discrimination similar to that of the first aspect of the present invention is to be performed directly on the character image before compression, a far larger number of connected components are extracted, and these are extracted in the vertical and horizontal directions. It will be necessary to perform processing that integrates or fuses with. According to the invention of claim 1, the number of connected components to be subjected to the direction discrimination processing is significantly reduced by performing the reduction processing only once, and the integration processing without the integration becomes unnecessary. Can be achieved by a simple logical sum operation or the like, so that the character string direction can be determined in a single time with a small amount of processing.

【0015】ワープロ作成文書のように文字間距離が長
い文書の場合、それを縮小した画像上においても文字が
融合せず孤立したままとなるため、縦横比または横縦比
が閾値以上の連結成分の個数が非常に少なくなる結果、
縦長連結成分と横長連結成分の個数比較によったのでは
文字列方向の判定結果が不正確になることがある。
In the case of a document with a long character distance such as a word processing document, the characters are not fused and remain isolated even on a reduced image, so that the aspect ratio or the connected component whose aspect ratio is greater than or equal to the threshold value. As a result, the number of
If the number of vertically connected components and the number of horizontally connected components are compared, the determination result in the character string direction may be incorrect.

【0016】請求項2の発明によれば、このような文書
の場合に、連結成分を縦方向及び横方向の文字列へ統合
し、その際に隣接した連結成分間の距離のヒストグラム
を生成する。通常、文字間隔は行間隔(文字列間隔)よ
り小さいため、横書き文書であるならば横方向ヒストグ
ラム上の最大頻度の距離は縦方向ヒストグラム上の最大
頻度の距離に比べ小さくなり、縦書き文書の場合は逆の
関係になるのが普通である。したがって、請求項2の発
明によれば、各方向のヒストグラム上で最大頻度となっ
た距離を比較することにより、ワープロ作成文書のよう
な文字間隔が比較的大きな文書に対しても、文字列方向
を的確に判定できる。
According to the invention of claim 2, in the case of such a document, the connected components are integrated into the character strings in the vertical direction and the horizontal direction, and at that time, a histogram of the distance between adjacent connected components is generated. .. Normally, the character spacing is smaller than the line spacing (character string spacing), so if the document is a horizontal writing document, the maximum frequency distance on the horizontal histogram is smaller than the maximum frequency distance on the vertical histogram. The usual case is the opposite. Therefore, according to the second aspect of the present invention, by comparing the distance having the maximum frequency on the histogram in each direction, even in the case of a document having a relatively large character spacing such as a word processing document, the character string direction Can be accurately determined.

【0017】請求項3の発明によれば、請求項2の発明
においてヒストグラムの最大頻度とその周辺の頻度の総
計を各方向について求め、その比が大きい場合には、頻
度総計が大きい方向を文字列方向と判定する。このよう
にすることによって、ヒストグラムの最大頻度の信用性
が不十分になる場合、つまり距離の分散が大きくなるよ
うな文書や全体の頻度が下がるような文書に対しても、
文字列方向を確実に判別できる。
According to the invention of claim 3, in the invention of claim 2, the total of the maximum frequency of the histogram and the frequency around it is obtained for each direction, and when the ratio is large, the direction in which the total frequency is large is set to the character. Judge in the column direction. By doing this, even if the maximum frequency of the histogram becomes unreliable, that is, even for a document with a large distance distribution or a document with a low overall frequency,
The character string direction can be reliably determined.

【0018】また請求項2または3の発明は、文字列方
向判定のために文字列統合を行なった場合でも、その文
字列データをそのまま文章領域統合に利用できるため、
全体としての処理量は増加せず、領域識別処理との整合
性が優れている。また、請求項2または3の発明にあっ
ても、請求項1の発明と同様に、文書の傾きに強く、ま
た写真領域や本文とレイアウトの違うタイトルなどの領
域が存在しても影響を排除できることは明らかである。
Further, according to the invention of claim 2 or 3, even when the character strings are integrated to determine the direction of the character string, the character string data can be directly used for the text area integration.
The processing amount as a whole does not increase, and the consistency with the area identification processing is excellent. Also, in the invention of claim 2 or 3, as in the invention of claim 1, the influence is eliminated even if there is an area such as a photo area or a title whose layout is different from the text area, such as a title area. It is clear that you can do it.

【0019】[0019]

【実施例】図1は本発明の一実施例に係る処理システム
のブロック図、図2はその処理フローを示すフローチャ
ートである。
1 is a block diagram of a processing system according to an embodiment of the present invention, and FIG. 2 is a flow chart showing the processing flow thereof.

【0020】図1において、101は文書の2値画像を
入力するスキャナ等の画像入力部、102はこの入力画
像の縮小処理を行なって縮小画像を生成する画像縮小
部、103はこの縮小画像から黒画素の連結成分を抽出
する連結成分抽出部、104は抽出された連結成分の情
報より文字列方向(文書の縦書き/横書きの別)を判別
する処理を行なう縦横判別部、105は連結成分を文字
列へ統合し、この文字列をコラム等のまとまりのある文
章領域に統合する処理を行なう文字領域統合部、106
は入力画像、その縮小画像、抽出した連結成分の情報等
の各種データを記憶するためのデータ記憶部、107は
前記各部を制御する制御部、108はデータ通信路であ
る。
In FIG. 1, 101 is an image input unit such as a scanner for inputting a binary image of a document, 102 is an image reducing unit for reducing the input image to generate a reduced image, and 103 is the reduced image. A connected component extraction unit that extracts a connected component of black pixels, 104 is a vertical / horizontal determination unit that performs a process of determining a character string direction (document vertical writing / horizontal writing) based on the extracted connected component information, and 105 is a connected component Is integrated into a character string and the character area is integrated into a coherent text area such as a column.
Is a data storage unit for storing various data such as an input image, a reduced image thereof, information of extracted connected components, 107 is a control unit for controlling each unit, and 108 is a data communication path.

【0021】以下、図2に示した処理フローに沿って処
理内容を説明する。
The processing contents will be described below along the processing flow shown in FIG.

【0022】まず、画像入力部101によって処理しよ
うとする文書の2値画像を入力し、データ記憶部106
に格納する(ステップ201)。次に、画像縮小部10
2によって、入力画像を縦方向及び横方向に同じ縮小率
で縮小した画像を、データ記憶部106上に生成する
(ステップ202)。
First, the image input unit 101 inputs a binary image of a document to be processed, and the data storage unit 106
(Step 201). Next, the image reduction unit 10
An image obtained by reducing the input image in the vertical direction and the horizontal direction at the same reduction rate by 2 is generated in the data storage unit 106 (step 202).

【0023】この縮小率は、縮小によって同一行の文字
が融合することはあっても、異なる行の文字が融合しな
い程度に選ぶ。例えば、文書画像を400dpiで入力
した場合、8×8画素を1画素に縮小する。縮小方法は
論理和縮小とし、8×8画素を1画素に縮小する場合で
れば、8×8画素中の1画素でも黒でれば縮小画素を黒
とする。ただし、他の縮小方法を用いることも可能であ
る。
The reduction ratio is selected so that characters on the same line may be merged by the reduction, but characters on different lines may not be merged. For example, when a document image is input at 400 dpi, 8 × 8 pixels are reduced to 1 pixel. The reduction method is OR reduction, and in the case of reducing 8 × 8 pixels to 1 pixel, if even one pixel in 8 × 8 pixels is black, the reduced pixel is black. However, other reduction methods can be used.

【0024】次に連結成分抽出部103において、縮小
画像上の黒画素の連結成分を抽出し、その外接矩形の頂
点座標等の情報をデータ記憶部106に格納する(ステ
ップ203)。ただし、この段階で抽出された連結成分
の中には文字列候補となり得ないものも含まれている。
次に、縦横判別部104による処理(ステップ204〜
209)が行なわれる。ただし、ステップ207におけ
る連結成分の文字列への統合処理とステップ209の処
理は文字領域統合部105により行なわれる。まず、ス
テップ203で抽出された連結成分の情報を参照し、連
結成分を文字列候補と、文字以外(図や写真)の候補に
分類する(ステップ204)。この分類のための特徴と
しては、例えば連結成分の大きさ、大きさ及び縦横比ま
たは横縦比を用いることができる。これから後の処理
は、文字列候補としての連結成分を対象とする。ステッ
プ203,204の処理を合体し、この条件チェックを
行ないつつ文字列候補となり得る連結成分だけを初めか
ら抽出するようにしてもよい。
Next, the connected component extraction unit 103 extracts the connected components of the black pixels on the reduced image, and stores information such as the vertex coordinates of the circumscribed rectangle in the data storage unit 106 (step 203). However, some of the connected components extracted at this stage may not be character string candidates.
Next, the processing by the vertical / horizontal discriminating unit 104 (step 204 to
209) is performed. However, the process of integrating the connected component into the character string in step 207 and the process of step 209 are performed by the character area integrating unit 105. First, referring to the information on the connected components extracted in step 203, the connected components are classified into character string candidates and candidates other than characters (drawings or photographs) (step 204). As the characteristics for this classification, for example, the size, size, and aspect ratio or aspect ratio of the connected component can be used. Subsequent processing targets the connected component as a character string candidate. It is also possible to combine the processes of steps 203 and 204 and perform the condition check while extracting only the connected components that can be character string candidates from the beginning.

【0025】次に、文字列候補としての連結成分の縦横
比及び横縦比と閾値th1(例えば3)とをそれぞれ比
較し、縦横比が当該閾値th1以上である縦長の連結成
分の個数と、横縦比が当該閾値th1以上である横長の
連結成分の個数を計数する(ステップ205)。
Next, the aspect ratios and aspect ratios of the connected components as character string candidates are compared with the threshold value th1 (for example, 3), and the number of vertically connected components whose aspect ratio is equal to or greater than the threshold value th1 and The number of horizontally long connected components whose aspect ratio is greater than or equal to the threshold value th1 is counted (step 205).

【0026】例えば400dpiで、8×8画素を1画
素に論理和縮小する場合、一般的な文書の縮小画像上で
は、同じ文字列中の文字間は融合する(句読点間は融合
しない)が、行間は融合しない。したがって、各連結成
分は行(文字列)方向に細長い形状となるので、細長い
連結成分だけを集計し、その中の縦長のものの個数と横
長のものの個数を比較することによって、文字列(行)
方向を判別することができる。
For example, in the case of 400 dpi, when 8 × 8 pixels are logically reduced to 1 pixel, on the reduced image of a general document, the characters in the same character string are fused (the punctuation marks are not fused), but Lines do not merge. Therefore, each connected component has an elongated shape in the row (character string) direction, so by summing up only the elongated connected components and comparing the number of vertically long ones and the number of horizontally long ones, the character string (row)
The direction can be determined.

【0027】ステップ206は、この判定を行なう処理
ステップである。すなわち、ステップ205で求められ
た各方向の連結成分の個数を比較し、縦長の連結成分の
個数が横長の連結成分の個数より多いときは、文字列方
向を縦方向と判定し、その逆の関係であるときは文字列
方向を横方向と判定する。
Step 206 is a processing step for making this determination. That is, the number of connected components in each direction obtained in step 205 is compared, and if the number of vertically connected components is greater than the number of horizontally connected components, the character string direction is determined to be the vertical direction, and vice versa. If there is a relationship, the character string direction is determined to be the horizontal direction.

【0028】しかし、処理対象文書がワープロ作成文書
のように文字間距離が長いものであった場合、縮小画像
においても文字が融合せず孤立したままとなるため、縦
横比または横縦比が閾値以上の連結成分の個数が非常に
少なくなる。このような場合、上記のような縦長連結成
分と横長連結成分の個数比較により文字列方向を判定す
ることは無理である。
However, when the document to be processed has a long character-to-character distance, such as a word-processor-created document, the characters are not merged and remain isolated even in the reduced image. Therefore, the aspect ratio or the aspect ratio is equal to or greater than the threshold value. The number of connected components of is very small. In such a case, it is impossible to determine the character string direction by comparing the numbers of the vertically long connected components and the horizontally long connected components as described above.

【0029】そこでステップ206においては、まずス
テップ205で求められた各方向の連結成分の個数をあ
る閾値th2と比較し、縦長連結成分と横長連結成分の
個数が共に閾値th2以下の場合には、上記の個数比較
による文字列方向判定を行なわない。この場合はステッ
プ207以下で文字列方向を判定する。しかし、縦長ま
たは横長の連結成分の一方でも、その個数が閾値th2
を超えるときに、ステップ206において上記の個数比
較により文字列方向を判定する。この場合は、文字列方
向判別は終了し、処理209へ進む。
Therefore, in step 206, first, the number of connected components in each direction obtained in step 205 is compared with a certain threshold value th2, and if both the number of vertically long connected components and horizontally long connected components are less than or equal to the threshold value th2, The character string direction determination based on the above number comparison is not performed. In this case, the character string direction is determined in step 207 and the subsequent steps. However, even if one of the vertically or horizontally long connected components has the threshold value th2.
When it exceeds, the character string direction is determined by the above number comparison in step 206. In this case, the character string direction determination ends, and the process proceeds to step 209.

【0030】ステップ206で文字列方向を判別できな
かった場合、ステップ207において、文字列候補とし
ての連結成分を、縦方向の文字列(行)及び横方向の文
字列(行)へそれぞれ統合する処理を行なう。この文字
列への統合は、前記「多様なレイアウト構造、構成要素
を持つ文書の領域分割」にも述べられているように、文
字列方向(この段階では文字列方向は確定していなので
仮の方向)に近接する連結成分を同一文字列に属するも
のとする処理である。この統合の際、近接する連結成分
間の距離を集計し、距離のヒストグラムを各方向につい
て作成する。
If the character string direction cannot be determined in step 206, the connected components as character string candidates are integrated into the vertical character string (row) and the horizontal character string (row) in step 207. Perform processing. This integration into a character string is performed in the character string direction (as the character string direction is fixed at this stage, as described in "Division of Documents Having Various Layout Structures and Components"). This is a process in which connected components that are close to each other belong to the same character string. At the time of this integration, the distances between adjacent connected components are aggregated and a distance histogram is created for each direction.

【0031】図3は、この処理の説明のための図であ
る。図3の(A)は統合前の様子を示しており、301
〜315は文字列候補連結成分の外接矩形である。図3
の(B)は縦方向文字列への統合後の様子を示し、32
1〜323は統合により得られた文字列(行)である。
(C)は横方向文字列への統合後の様子を示し、331
〜333は文字列(行)である。
FIG. 3 is a diagram for explaining this processing. FIG. 3 (A) shows a state before the integration.
˜315 are circumscribed rectangles of the character string candidate connected components. Figure 3
(B) shows the state after integration into the vertical character string.
1 to 323 are character strings (rows) obtained by the integration.
(C) shows a state after integration into a horizontal character string.
˜333 are character strings (rows).

【0032】縦方向統合の際に(B)に符号324で示
したような距離のヒストグラムを作成し、また横方向統
合の際に(C)に符号334で示したような距離のヒス
トグラムを作成する。ただし、ヒストグラム作成にあた
っては、統合の結果得られた文字列(行)の高さ(縦方
向文字列のときは横の長さ)が、その長さ(縦方向文字
列のときは縦の長さ)に比べて大き過ぎるときは(前者
の後者に対する比がある閾値th3を超えるとき)、そ
の文字列は正しい統合が行なわれていないと判断し、そ
の連結成分間距離はヒストグラム作成に用いない。例え
ば図3(B)に示された文字列321は、ヒストグラム
作成の対象外とする。
At the time of vertical integration, a histogram of distances as shown by reference numeral 324 is created in (B), and at the time of horizontal integration, a histogram of distances as shown by reference numeral 334 is created in (C). To do. However, when creating a histogram, the height (horizontal length in the case of a vertical character string) of the character string (row) obtained as a result of the integration is the vertical length in the case of a vertical character string. Is too large (when the ratio of the former to the latter exceeds a certain threshold th3), it is determined that the character strings are not correctly integrated, and the distance between the connected components is not used for histogram creation. .. For example, the character string 321 shown in FIG. 3B is excluded from the histogram creation target.

【0033】次のステップ208においては、ステップ
207で作成された縦方向と横方向のヒストグラムの最
大頻度となった距離を比較し、その距離が小さいほうの
方向を文字列方向と判定する。これは、一般に文字間距
離が行間距離より小さいからである。
In the next step 208, the distances having the maximum frequencies of the histograms in the vertical and horizontal directions created in step 207 are compared, and the direction with the smaller distance is determined to be the character string direction. This is because the distance between characters is generally smaller than the distance between lines.

【0034】しかし、ステップ207の統合は仮の文字
列方向について統合であるため、行間の変化などにより
距離の分散が大きくなったり、あるいは図3(B)に示
した文字列321のように集計対象から外される連結成
分が多くなって全体の度数が下がって、ヒストグラムの
最大頻度の信用性が欠ける場合がある。例えば、文字列
方向が横方向の文書において、縦方向について図4
(A)に示すようなヒストグラムが得られ、横方向につ
いて図4(B)に示すようなヒストグラムが得られた場
合、縦方向の最大頻度401に対応する距離のほうが、
横方向の最大頻度402に対応する距離よりも小さい。
この場合、最大頻度の距離の比較によれば、文字列方向
を縦方向と誤判定してしまう。
However, since the integration in step 207 is integration in the direction of the tentative character string, the dispersion of the distance becomes large due to the change between the lines, or the totalization is performed as the character string 321 shown in FIG. 3B. In some cases, the maximum frequency of the histogram is not reliable because the number of connected components that are excluded from the target increases and the total frequency decreases. For example, in a document whose character string direction is the horizontal direction, FIG.
When the histogram shown in FIG. 4A is obtained and the histogram shown in FIG. 4B is obtained in the horizontal direction, the distance corresponding to the maximum frequency 401 in the vertical direction is
It is smaller than the distance corresponding to the maximum frequency 402 in the lateral direction.
In this case, the character string direction is erroneously determined to be the vertical direction by comparing the distances with the maximum frequency.

【0035】このような誤判定を避けるため、ステップ
208においては、最大頻度とその両隣の頻度の総計
(一般的には最大頻度の周辺の頻度の総計)を各方向に
ついて求め、その比がある閾値th4を超えるときは、
頻度総計が大きい方向を文字列の方向と判定する。その
比が閾値th4以下のときは、最大頻度の距離の小さい
ほうを文字列方向とする。例えば図4(A)に符号40
3で示した頻度総計と図4(B)に符号404で示した
頻度総計の比が閾値th4を超えたときは、頻度総計の
大きな横方向を文字列方向とする。
In order to avoid such an erroneous determination, in step 208, the total of the maximum frequency and the frequencies on both sides of the maximum frequency (generally, the total frequency around the maximum frequency) is obtained for each direction, and there is a ratio thereof. When the threshold value th4 is exceeded,
The direction in which the total frequency is large is determined to be the direction of the character string. When the ratio is less than or equal to the threshold value th4, the one having the smaller maximum frequency distance is set to the character string direction. For example, reference numeral 40 in FIG.
When the ratio of the total frequency indicated by 3 and the total frequency indicated by reference numeral 404 in FIG. 4B exceeds the threshold th4, the larger horizontal direction of the total frequency is set to the character string direction.

【0036】ステップ206で文字列方向が判別された
場合、ステップ209において、文字列候補連結成分を
判別した方向の文字列に統合してステップ210に進
む。ステップ208で文字列方向が判別された場合は、
すでに文字列統合は済んでいるので、直ちにステップ2
10に進む。ステップ210は文字領域統合部105の
処理であって、文字列をコラムなどの、まとまりのある
文章領域へ統合する。このような統合は、特開平3−1
28340号公報に述べられているような方法によれば
よい。
When the character string direction is determined in step 206, the character string candidate connected component is integrated into the character string in the determined direction in step 209 and the process proceeds to step 210. If the character string direction is determined in step 208,
Since the string integration has already been completed, immediately proceed to step 2
Go to 10. Step 210 is processing of the character area integration unit 105, which integrates a character string into a cohesive text area such as a column. Such integration is disclosed in Japanese Patent Laid-Open No. 3-1
The method described in Japanese Patent No. 28340 may be used.

【0037】[0037]

【発明の効果】以上の説明から明らかなように、請求項
1の発明によれば、少ない処理量で文書の文字列方向を
判別可能となり、また文書の傾きや、写真領域、タイト
ル等の本文とレイアウトが大きく異なる領域の影響を受
けにくくなる。
As is apparent from the above description, according to the invention of claim 1, the character string direction of a document can be determined with a small processing amount, and the inclination of the document, the text area of the photograph area, the title, etc. can be determined. It becomes difficult to be affected by the area where the layout greatly differs.

【0038】請求項2または3の発明によれば、ワープ
ロ作成文書のような文字間隔が大きい文書などに対して
も、文字列方向を的確に判別することが可能となり、ま
た文字列方向の判別のための文字列統合の結果を文字列
データとして文章領域統合に利用できるため、領域識別
処理との整合性に優れ、また全体としての処理量も削減
できる。
According to the second or third aspect of the present invention, it is possible to accurately determine the character string direction even for a document having a large character spacing such as a document created by a word processor, and to determine the character string direction. Since the result of the character string integration for can be used as the character string data for the text area integration, the consistency with the area identification processing is excellent, and the processing amount as a whole can be reduced.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例に係る処理システムのブロッ
ク構成を示す。
FIG. 1 shows a block configuration of a processing system according to an embodiment of the present invention.

【図2】処理の概略フローを示す。FIG. 2 shows a schematic flow of processing.

【図3】(A)連結成分の抽出例を示す。 (B)縦方向の文字列への抽出結果を示す。 (C)横方向の文字列への抽出結果を示す。FIG. 3A shows an example of extraction of connected components. (B) shows the extraction result to the character string in the vertical direction. (C) shows the result of extraction into a character string in the horizontal direction.

【図4】(A)縦方向に関する距離のヒストグラムの例
を示す。 (B)横方向に関する距離のヒストグラムの例を示す。
FIG. 4A shows an example of a histogram of distance in the vertical direction. (B) An example of a histogram of the distance in the horizontal direction is shown.

【符号の説明】[Explanation of symbols]

101 画像入力部 102 画像縮小部 103 連結成分抽出部 104 縦横判別部 105 文字領域統合部 106 データ記憶部 107 制御部 108 データ通信路 301〜315 連結成分の外接矩形 321〜323 縦方向統合文字列 331〜333 横方向統合文字列 Reference Signs List 101 image input unit 102 image reduction unit 103 connected component extraction unit 104 vertical / horizontal discrimination unit 105 character region integration unit 106 data storage unit 107 control unit 108 data communication path 301 to 315 circumscribed rectangle of connected components 321 to 323 vertical integrated character string 331 ~ 333 Horizontal integrated character string

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 文書の2値画像の縮小画像を生成し、該
縮小画像より文字列候補としての黒画素の連結成分を抽
出し、該連結成分の中で縦横比または横縦比がある閾値
を超える縦長の連結成分の個数と横長の連結成分の個数
とを比較することにより、該文書の文字列方向を判定す
る文字列方向判別方法。
1. A threshold value having an aspect ratio or an aspect ratio among the connected components, which generates a reduced image of a binary image of a document, extracts a connected component of black pixels as a character string candidate from the reduced image. A character string direction discriminating method for discriminating the character string direction of the document by comparing the number of vertically long connected components exceeding the number of horizontally long connected components.
【請求項2】 文書の2値画像の縮小画像を生成し、該
縮小画像より文字列候補としての黒画素の連結成分を抽
出し、該連結成分の中で縦横比または横縦比ががある第
1の閾値以上の縦長の連結成分及び横長の連結成分のそ
れぞれの個数を調べ、 該縦長連結成分の個数または該横長連結成分の個数が第
2の閾値を超える場合には、それぞの個数の比較によっ
て該文書の文字列方向を判定し、 該縦長連結成分の個数及び該横長連結成分の個数がそれ
ぞれ該第2の閾値以下である場合には、該文字列候補と
しての連結成分を縦方向及び横方向の文字列へそれぞれ
統合する処理を行ない、長さに対する高さの比がある第
3の閾値以下の文字列に統合された連結成分の隣合うも
のの距離のヒストグラムを縦方向及び横方向について別
々に生成し、該各方向のヒストグラムの最大頻度に対応
する距離を比較することによって該文書の文字列方向を
判定する文字列方向判別方法。
2. A reduced image of a binary image of a document is generated, a connected component of black pixels as a character string candidate is extracted from the reduced image, and the connected component has an aspect ratio or an aspect ratio. The number of each of the vertically long connected components and the horizontally long connected components equal to or larger than the first threshold is checked, and if the number of the vertically connected components or the horizontally connected components exceeds the second threshold, the number of each The character string direction of the document is determined by comparing, and if the number of the vertically long connected components and the number of the horizontally long connected components are respectively less than or equal to the second threshold value, the connected components as the character string candidates are vertically A process of integrating the character strings in the horizontal direction and the horizontal direction is performed, and a histogram of distances between adjacent ones of the connected components integrated in the character string having a ratio of height to length less than or equal to a third threshold is displayed in the vertical direction and the horizontal direction. Generated separately for each direction Character string direction determining method determines the character string direction of the document by comparing the distance corresponding to the maximum frequency of the histogram of direction.
【請求項3】 文書の2値画像の縮小画像を生成し、該
縮小画像より文字列候補としての黒画素の連結成分を抽
出し、該連結成分の中で縦横比または横縦比ががある第
1の閾値以上の縦長の連結成分及び横長の連結成分のそ
れぞれの個数を調べ、 該縦長連結成分の個数または該横長連結成分の個数が第
2の閾値を超える場合には、それぞの個数の比較によっ
て該文書の文字列方向を判定し、 該縦長連結成分の個数及び該横長連結成分の個数がそれ
ぞれ該第2の閾値以下である場合には、該文字列候補と
しての連結成分を縦方向及び横方向の文字列へそれぞれ
統合する処理を行ない、長さに対する高さの比がある第
3の閾値以下の文字列に統合された連結成分の隣合うも
のの距離のヒストグラムを縦方向及び横方向について別
々に生成し、該各方向のヒストグラムにおいて最大頻度
と該最大頻度に対応する距離の周辺の距離の頻度との総
計を求め、各方向の該総計の比がある第4の閾値以下の
ときには最大頻度に対応する距離の比較によって、そう
でないときには該総計の比較によって、該文書の文字列
を判定することを特徴とする文字列方向判別方法。
3. A reduced image of a binary image of a document is generated, a connected component of black pixels as a character string candidate is extracted from the reduced image, and the connected component has an aspect ratio or an aspect ratio. The number of each of the vertically long connected components and the horizontally long connected components equal to or larger than the first threshold is checked, and if the number of the vertically connected components or the horizontally connected components exceeds the second threshold, the number of each The character string direction of the document is determined by comparing, and if the number of the vertically long connected components and the number of the horizontally long connected components are respectively less than or equal to the second threshold value, the connected components as the character string candidates are vertically A process of integrating the character strings in the horizontal direction and the horizontal direction is performed, and a histogram of distances between adjacent ones of the connected components integrated in the character string having a ratio of height to length less than or equal to a third threshold is displayed in the vertical direction and the horizontal direction. Generated separately for each direction In the histogram of the directions, the sum of the maximum frequency and the frequency of distances around the distance corresponding to the maximum frequency is calculated, and when the ratio of the total in each direction is less than or equal to a fourth threshold value, the distances corresponding to the maximum frequency are compared. If not, the character string direction determining method is characterized by determining the character string of the document by comparing the total amount.
JP12026392A 1992-05-13 1992-05-13 Character string direction determination method Expired - Lifetime JP3220226B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12026392A JP3220226B2 (en) 1992-05-13 1992-05-13 Character string direction determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12026392A JP3220226B2 (en) 1992-05-13 1992-05-13 Character string direction determination method

Publications (2)

Publication Number Publication Date
JPH05314309A true JPH05314309A (en) 1993-11-26
JP3220226B2 JP3220226B2 (en) 2001-10-22

Family

ID=14781885

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12026392A Expired - Lifetime JP3220226B2 (en) 1992-05-13 1992-05-13 Character string direction determination method

Country Status (1)

Country Link
JP (1) JP3220226B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006260274A (en) * 2005-03-17 2006-09-28 Ricoh Co Ltd Character direction identification device, image forming apparatus, program, storage medium, and character direction identification method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006260274A (en) * 2005-03-17 2006-09-28 Ricoh Co Ltd Character direction identification device, image forming apparatus, program, storage medium, and character direction identification method

Also Published As

Publication number Publication date
JP3220226B2 (en) 2001-10-22

Similar Documents

Publication Publication Date Title
US8059868B2 (en) License plate recognition apparatus, license plate recognition method, and computer-readable storage medium
EP0854434B1 (en) Ruled line extracting apparatus for extracting ruled line from normal document image and method thereof
US6574375B1 (en) Method for detecting inverted text images on a digital scanning device
CN101957919B (en) Character recognition method based on image local feature retrieval
CN101453575A (en) Video subtitle information extracting method
US5502777A (en) Method and apparatus for recognizing table and figure having many lateral and longitudinal lines
CN114463767A (en) Credit card identification method, device, computer equipment and storage medium
CN102779276B (en) Text image recognition method and device
JP3411472B2 (en) Pattern extraction device
JP3285686B2 (en) Area division method
JP2006338578A (en) Character recognition device
CN113408532A (en) Medicine label number identification method based on multi-feature extraction
JP3220226B2 (en) Character string direction determination method
JP3835652B2 (en) Method for determining Japanese / English of document image and recording medium
JP3476595B2 (en) Image area division method and image binarization method
JPH06187489A (en) Character recognizing device
KR102742277B1 (en) Method to extract units of Manchu characters and system
JP2001236467A (en) Pattern recognition method and apparatus, and recording medium storing pattern recognition program
JP2995818B2 (en) Character extraction method
JP2993533B2 (en) Information processing device and character recognition device
JPH11242716A (en) Image processing method and recording medium
JPH10214308A (en) Character identification method
JP4079333B2 (en) Method for determining Japanese / English of document image and recording medium
JPH06259597A (en) Document image processing method, character recognition system, and document image processor
JPH06139406A (en) Character segmenting method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080810

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20080810

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090810

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090810

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20110810

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20110810

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20120810

Year of fee payment: 11

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120810

Year of fee payment: 11