JP3187894B2 - Document image tilt detection method - Google Patents

Document image tilt detection method

Info

Publication number
JP3187894B2
JP3187894B2 JP32995591A JP32995591A JP3187894B2 JP 3187894 B2 JP3187894 B2 JP 3187894B2 JP 32995591 A JP32995591 A JP 32995591A JP 32995591 A JP32995591 A JP 32995591A JP 3187894 B2 JP3187894 B2 JP 3187894B2
Authority
JP
Japan
Prior art keywords
image
circumscribed rectangle
character string
inclination
reference value
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.)
Expired - Fee Related
Application number
JP32995591A
Other languages
Japanese (ja)
Other versions
JPH0535914A (en
Inventor
高志 齋藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP32995591A priority Critical patent/JP3187894B2/en
Publication of JPH0535914A publication Critical patent/JPH0535914A/en
Application granted granted Critical
Publication of JP3187894B2 publication Critical patent/JP3187894B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、文書画像の傾きを検出
する文書画像傾き検出方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention detects the inclination of a document image.
The present invention relates to a method of detecting a document image inclination.

【0002】[0002]

【従来の技術】従来、画像の傾きを検出する方法とし
て、文書画像に対して2次元フーリエ変換処理を行うこ
とによって画像の傾きを検出する方法(情報処理学会第
22回全国大会、pp677−678)、あるいは画像
を複数の帯状領域に分割し、各領域内における周辺分布
を求め、周辺分布間の位相のずれから画像の傾きを検出
する方法がある(電子通信学会論文誌、1983年 V
ol.J66−D No.1 pp.111〜11
8)。
2. Description of the Related Art Conventionally, as a method of detecting the inclination of an image, a method of detecting the inclination of an image by performing a two-dimensional Fourier transform process on a document image (22nd National Convention of Information Processing Society, pp. 677-678). ), Or a method of dividing an image into a plurality of band-like regions, finding peripheral distributions in each region, and detecting an image inclination from a phase shift between the peripheral distributions (Transactions of the Institute of Electronics, Information and Communication Engineers, 1983 V).
ol. J66-D No. 1 pp. 111-11
8).

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記し
た方法は、何れも画像全体に対する処理を行うことによ
って画像の傾きを求めているので処理データ量が多くな
るという欠点があった。本発明の目的は、文字列領域
文書画像の傾きを求めることにより、処理量を軽減し
文書画像傾き検出方法を提供することにある。
However, each of the above-mentioned methods has a drawback that the amount of data to be processed increases because the inclination of the image is obtained by performing processing on the entire image. An object of the present invention, by obtaining the inclination of the character string region or <br/> et document image is to provide a document image tilt detection method reduces the amount of processing.

【0004】[0004]

【課題を解決するための手段】前記目的を達成するため
に、請求項1記載の発明では、2値化された文書画像
(以下、原画像)の傾きを検出する文書画像傾き検出方
法であって、前記原画像を縮小し、該縮小された画像か
ら文字列領域を抽出し、該文字列領域に対応する、原画
像上の文字列領域内の黒画素連結成分の外接矩形につい
て、各外接矩形の高さのヒストグラムを作成し、最も高
い値をとる外接矩形の高さを基準値とし、該基準値に対
して所定の閾値以上大きい外接矩形を基準値に変換し、
該基準値に変換された外接矩形の位置および前記基準値
への変換対象外の外接矩形の位置を基に文書画像の傾き
を検出することを特徴としている。
To achieve the above object, according to the first aspect of the present invention, a binarized document image is provided.
(Hereinafter referred to as “original image”)
Reducing the original image and determining whether the reduced image
A character string region from the original image corresponding to the character string region.
About the circumscribed rectangle of the black pixel connected component in the character string area on the image
Create a histogram of the height of each circumscribed rectangle,
The height of the circumscribed rectangle that takes the maximum value is used as the reference value, and
To convert a circumscribed rectangle larger than a predetermined threshold into a reference value,
The position of the circumscribed rectangle converted to the reference value and the reference value
Of the document image based on the position of the circumscribed rectangle not to be converted to
Is detected .

【0005】[0005]

【作用】スキャナ等の画像入力部によって文書を2値画
像として取り込み、入力された画像から文字列領域を抽
出するために、画像縮小部において入力画像を縮小す
る。ブロック生成、分類部は、縮小された画像の文字列
方向にぼかし処理を施すことによってブロックを抽出
し、ブロックの大きさから図、写真、文字列領域に分類
し、さらにブロック生成、分類部は、文字列領域として
抽出された領域中から、横の長さが縦の長さの3倍以上
の領域を選択する。傾き検出部は、選択された領域中の
各外接矩形の中心点からの最もずれの小さい直線を最小
二乗近似法を用いて算出し、算出された直線の傾きが文
字列の傾きとなる。
A document is captured as a binary image by an image input unit such as a scanner, and the input image is reduced by an image reduction unit in order to extract a character string area from the input image. The block generation and classification unit extracts a block by performing a blurring process in a character string direction of the reduced image, classifies the block into a figure, a photograph, and a character string region based on the size of the block. Then, an area whose horizontal length is three times or more the vertical length is selected from the areas extracted as the character string areas . The inclination detection unit calculates a straight line having the smallest deviation from the center point of each circumscribed rectangle in the selected area by using the least squares approximation method, and the inclination of the calculated straight line becomes the inclination of the character string.

【0006】[0006]

【実施例】以下、本発明の一実施例を図面を用いて具体
的に説明する。図1は、本発明の実施例のブロック構成
図であり、101は、スキャナ等の文書画像を読み取っ
て入力する画像入力部、102は、入力された画像を縮
小する画像縮小部、103は、縮小画像からブロックを
抽出し、抽出されたブロックを写真、文字列領域に分類
するブロック生成、分類部、104は、画像の傾き検出
部、105は、入力画像、縮小画像、ブロックデータ等
のデータを記憶するデータ記憶部、106は、各部を制
御する制御部である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be specifically described below with reference to the drawings. FIG. 1 is a block configuration diagram of an embodiment of the present invention. Reference numeral 101 denotes an image input unit that reads and inputs a document image such as a scanner; 102, an image reduction unit that reduces an input image; A block generation unit that extracts blocks from the reduced image and classifies the extracted blocks into a photograph and a character string area ; a classification unit; 104, an image inclination detection unit; 105, an input image, a reduced image, block data, and other data Is a control unit that controls each unit.

【0007】図2は、本発明の処理フローチャートを示
したものである。ステップ201において、スキャナ等
の画像入力部101によって文書を2値画像として取り
込む。次いで、入力された画像から文字列領域を抽出す
るために、画像縮小部102において入力画像を縮小す
る。この画像の縮小は、上下左右の文字列の黒画素が接
触しない程度に縦横に画像を縮小するものである(ステ
ップ202)。ブロック生成、分類部103は、縮小さ
れた画像の文字列方向にぼかし処理を施すことによって
ブロックを抽出し、ブロックの大きさから図、写真、
字列領域に分類する。
FIG. 2 shows a processing flowchart of the present invention. In step 201, a document is captured as a binary image by an image input unit 101 such as a scanner. Next, in order to extract a character string region from the input image, the image reduction unit 102 reduces the input image. This image reduction is to reduce the image vertically and horizontally so that the black pixels of the upper, lower, left and right character strings do not touch (step 202). The block generation / classification unit 103 extracts a block by performing a blurring process in a character string direction of the reduced image, and extracts a diagram, a photograph, and a sentence from the size of the block.
Classify into character string area .

【0008】なお、ここで、ぼかし処理とは、画像のラ
ンレングスデータに対して、長い白ランで区切られた
黒ランと短い白ランのつながりを一つの範囲(ランの集
合)とする処理であり、このぼかし処理されたランの
が上下に連結しているものをブロックという。
[0008] Here, the blur processing means that the run-length data of an image is separated by a long white run .
Black orchid and a short white orchid ties one of the range (run of the collector
), And a collection of the blurred runs
A block that is connected vertically is called a block.

【0009】ブロック生成、分類部103は、さらに
字列領域として抽出された領域中から、横の長さが縦の
長さの3倍以上の領域を選択する(ステップ204)。
このように複数の文字が含まれる領域を選出することに
より、多くの黒画素連結成分が計算対象となり、従って
傾き検出の精度を上げることができる。
The block generation / classification unit 103 further outputs a sentence
From the regions extracted as character string regions , a region having a horizontal length that is at least three times the vertical length is selected (step 204).
By selecting an area including a plurality of characters as described above, many black pixel connected components are to be calculated, and therefore, the accuracy of tilt detection can be improved.

【0010】図3は、横の長さが縦の長さの3倍以上の
文字列領域301を示し、302から308は、黒画素
連結成分の外接矩形である。なお、この黒画素は縮小画
像上での画素ではなく、入力された原画像(2値の文書
画像)の画素である。つまり、外接矩形302から30
8は、抽出された文字列領域に対応する、原画像上の文
字列領域301内の黒画素連結成分の外接矩形である。
FIG. 3 shows that the horizontal length is three times or more the vertical length.
A character string area 301 is shown, and 302 to 308 are circumscribed rectangles of black pixel connected components. Note that this black pixel is not a pixel on the reduced image, but the input original image ( binary document
Image ). That is, the circumscribed rectangles 302 to 30
8 is a sentence on the original image corresponding to the extracted character string area
The circumscribed rectangle of the black pixel connected component in the character string area 301.

【0011】傾き検出部104は、求められた各外接矩
形の中心点(外接矩形302の中心点を310とする)
からの最もずれの小さい直線を最小二乗近似法を用いて
算出し、算出された直線の傾きが求めるべき文字列の傾
きとなる。なお、直線を算出するとき、各中心点に対し
て、外接矩形の面積に比例した重み付けを行う。
The inclination detecting unit 104 calculates the center point of each circumscribed rectangle (the center point of the circumscribed rectangle 302 is 310).
Is calculated using the least squares approximation method, and the slope of the calculated straight line is the slope of the character string to be obtained. When calculating the straight line, each center point is weighted in proportion to the area of the circumscribed rectangle.

【0012】すなわち、y(x)=a+bxとしたと
き、J=Σmi{y(xi)−fi}*2においてJを
最小にするようにa,bを決定する。ここで、各中心点
を(xi,fi)の座標で表わし、各外接矩形の面積を
miで表す。また、*2は2乗を表す。図3の309
は、このようにして算出された直線である。そして、以
上の処理をいくつかの文字列領域について行い、傾き検
出部104は、傾きの平均値をとることによって文書
像の傾きを求める(ステップ205)。
That is, when y (x) = a + bx, a and b are determined so as to minimize J at J = {mi {y (xi) -fi} * 2. Here, each center point is represented by coordinates (xi, fi), and the area of each circumscribed rectangle is represented by mi. * 2 represents a square. 309 in FIG.
Is a straight line calculated in this way. Then, the above processing is performed for some character string regions , and the inclination detection unit 104 obtains the inclination of the document image by taking the average of the inclinations (step 205).

【0013】〈実施例2〉英文書等アルファベット中心
の文字列においては、“d”,“l”等、上に伸びた文
字、“g”,“y”等、下に伸びた文字、さらには大文
字があり、上記した実施例のように外接矩形の中心点の
並びから画像の傾きを求めると、誤差が大きくなる。そ
こで、本実施例2では、外接矩形の大きさ、位置にばら
つきがある英文の文字列においても正しく文書画像の傾
きを検出する方法に係るものである。
<Embodiment 2> In a character string centered on the alphabet such as an English document, characters extending upward such as "d" and "l", characters extending downward such as "g" and "y", and There is a capital letter, and when the inclination of the image is obtained from the arrangement of the center points of the circumscribed rectangle as in the above-described embodiment, the error increases. Therefore, the second embodiment relates to a method for correctly detecting the inclination of a document image even in an English character string having a variation in the size and position of a circumscribed rectangle.

【0014】図4は、外接矩形の大きさ、位置にばらつ
きがある英文文字列の具体例を示す図である。本実施例
の傾き検出部104では、このような外接矩形の高さの
ヒストグラムを作成し(図5)、頻度の最も高い外接矩
形を基準の大きさとする。そして、この基準値に対して
閾値以上大きい(つまり高い)外接矩形については、そ
の上部を削る。すなわち、図6において、601は、原
画像の黒画素連結成分の外接矩形であり、図5のヒスト
グラムで求められた外接矩形の高さの基準値が603で
あるとき、外接矩形601の高さは、基準値に変換され
て外接矩形602になる。
FIG. 4 is a diagram showing a specific example of an English character string in which the size and position of the circumscribed rectangle vary. The inclination detection unit 104 of the present embodiment creates a histogram of the height of such a circumscribed rectangle (FIG. 5), and sets the circumscribed rectangle having the highest frequency as the reference size. Then, the upper part of the circumscribed rectangle larger than the reference value by a threshold value or more (that is, higher) is cut off. That is, in FIG. 6, reference numeral 601 denotes a circumscribed rectangle of a black pixel connected component of the original image. When the reference value of the height of the circumscribed rectangle obtained from the histogram of FIG. Is converted to a reference value to become a circumscribed rectangle 602.

【0015】図4の例では、外接矩形402、403、
405が基準値より大きい外接矩形であるとすると、そ
の高さが図6の602のように変換処理される。そし
て、変換後の外接矩形に対して、前述した実施例と同様
にして、各外接矩形の中心点からの最もずれの小さい直
線を最小二乗近似法を用いて算出することにより、文字
列の傾きを求める。
In the example of FIG. 4, circumscribed rectangles 402, 403,
Assuming that 405 is a circumscribed rectangle larger than the reference value, the height is converted as indicated by 602 in FIG. Then, for the converted circumscribed rectangle, a straight line with the smallest deviation from the center point of each circumscribed rectangle is calculated using the least squares approximation method in the same manner as in the above-described embodiment, thereby obtaining the inclination of the character string. Ask for.

【0016】なお、他の実施例としては、図5のヒスト
グラムで求められた外接矩形の高さの基準値よりも非常
に小さい外接矩形404、411は、ピリオドやカンマ
等である場合が多く、文字矩形の並びから少しずれてい
るので、これらの矩形を傾き検出の処理対象外にするこ
とによって、誤差を小さくすることができる。
As another embodiment, the circumscribed rectangles 404 and 411 that are much smaller than the reference value of the height of the circumscribed rectangle obtained from the histogram of FIG. 5 are often periods, commas, or the like. Since there is a slight deviation from the arrangement of the character rectangles, errors can be reduced by excluding these rectangles from the processing for tilt detection.

【0017】更に、上記基準値よりも非常に小さい外接
矩形の内、ブロックの最右翼にある小さい外接矩形のみ
を処理対象外にするように、実施例を変更することがで
きる。すなわち、図4において、外接矩形404は、基
準値よりも非常に小さい外接矩形であるが、ピリオドや
カンマ等ではなく、文字の一部である。このような外接
矩形は、文字“i”,“j”などに現われるが、外接矩
形404を除いた場合、外接矩形405が下方よりであ
るので、誤差が生じる。従って、ピリオドやカンマであ
る確率が高いブロックの最右翼の小さい外接矩形のみ
を、傾き検出の処理対象外にする。
Further, among the circumscribed rectangles much smaller than the reference value, the embodiment can be modified so that only the small circumscribed rectangle on the rightmost wing of the block is excluded from the processing. That is, in FIG. 4, the circumscribed rectangle 404 is a circumscribed rectangle much smaller than the reference value, but is not a period or a comma, but a part of a character. Such a circumscribed rectangle appears in characters “i”, “j”, etc., but when the circumscribed rectangle 404 is excluded, an error occurs because the circumscribed rectangle 405 is below. Therefore, only the small circumscribed rectangle of the rightmost wing of a block having a high probability of being a period or a comma is excluded from the inclination detection processing.

【0018】更に、フォントや文字サイズによっては大
文字と小文字の高さに閾値ほど大きな差がない場合があ
る。このような場合においてもサイズのずれは誤差とな
って表れるので、ブロックの先頭文字に相当する最左翼
の外接矩形については、大文字である確率が高いから、
必ず基準の高さに変換処理するように、更に実施例を変
更することも可能である。
Further, the height of uppercase and lowercase letters may not be as large as the threshold depending on the font and character size. Even in such a case, since the size deviation appears as an error, the circumscribed rectangle of the leftmost wing corresponding to the first character of the block is likely to be an uppercase letter,
The embodiment can be further modified so that the conversion processing is always performed to the reference height.

【0019】[0019]

【発明の効果】以上、説明したように、本発明によれ
ば、文字列領域から文書画像の傾きを求めているので、
従来の方法に比べて処理量が大幅に軽減される。また、
外接矩形の大きさ、位置のばらつきに対処した処理を行
っているので、英文書においても画像の傾きを正しく検
出することができる。
As described above, according to the present invention, the inclination of the document image is obtained from the character string area .
Processing amount as compared with conventional methods Ru is greatly reduced. Also,
Performs processing to cope with variations in the size and position of the circumscribed rectangle.
Therefore, the inclination of the image can be correctly detected even in an English document.

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

【図1】本発明の実施例のブロック構成図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】本発明の処理フローチャートを示したものであ
る。
FIG. 2 shows a processing flowchart of the present invention.

【図3】横の長さが縦の長さの3倍以上の文字列領域
示す図である。
FIG. 3 is a diagram illustrating a character string region whose horizontal length is three times or more the vertical length.

【図4】外接矩形の大きさ、位置にばらつきがある英文
文字列の例を示す図である。
FIG. 4 is a diagram showing an example of an English character string in which the size and position of a circumscribed rectangle vary.

【図5】外接矩形の高さのヒストグラムを示す図であ
る。
FIG. 5 is a diagram illustrating a height histogram of a circumscribed rectangle;

【図6】原画像の外接矩形の大きさを基準値に変換する
図である。
FIG. 6 is a diagram for converting the size of a circumscribed rectangle of an original image into a reference value.

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

101 画像入力部 102 画像縮小部 103 ブロック生成、分類部 104 傾き検出部 105 データ記憶部 106 制御部 Reference Signs List 101 Image input unit 102 Image reduction unit 103 Block generation and classification unit 104 Tilt detection unit 105 Data storage unit 106 Control unit

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 2値化された文書画像(以下、原画像)
の傾きを検出する文書画像傾き検出方法であって、前記
原画像を縮小し、該縮小された画像から文字列領域を抽
出し、該文字列領域に対応する、原画像上の文字列領域
内の黒画素連結成分の外接矩形について、各外接矩形の
高さのヒストグラムを作成し、最も高い値をとる外接矩
形の高さを基準値とし、該基準値に対して所定の閾値以
上大きい外接矩形を基準値に変換し、該基準値に変換さ
れた外接矩形の位置および前記基準値への変換対象外の
外接矩形の位置を基に文書画像の傾きを検出することを
特徴とする文書画像傾き検出方法。
1. A binarized document image (hereinafter referred to as an original image)
A document image inclination detecting method for detecting the inclination of the original image, wherein the original image is reduced, a character string area is extracted from the reduced image, and a character string area on the original image corresponding to the character string area is extracted. For the circumscribed rectangle of the black pixel connected component, a histogram of the height of each circumscribed rectangle is created, and the height of the circumscribed rectangle having the highest value is set as a reference value. Is converted to a reference value, and the inclination of the document image is detected based on the position of the circumscribed rectangle converted to the reference value and the position of the circumscribed rectangle not to be converted to the reference value. Detection method.
JP32995591A 1991-05-02 1991-11-19 Document image tilt detection method Expired - Fee Related JP3187894B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32995591A JP3187894B2 (en) 1991-05-02 1991-11-19 Document image tilt detection method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP12834191 1991-05-02
JP3-128341 1991-05-02
JP32995591A JP3187894B2 (en) 1991-05-02 1991-11-19 Document image tilt detection method

Publications (2)

Publication Number Publication Date
JPH0535914A JPH0535914A (en) 1993-02-12
JP3187894B2 true JP3187894B2 (en) 2001-07-16

Family

ID=26464037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32995591A Expired - Fee Related JP3187894B2 (en) 1991-05-02 1991-11-19 Document image tilt detection method

Country Status (1)

Country Link
JP (1) JP3187894B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3338537B2 (en) * 1993-12-27 2002-10-28 株式会社リコー Image tilt detector
JP4741977B2 (en) * 2006-05-23 2011-08-10 キヤノン株式会社 Handwritten character processing apparatus and handwritten character processing method
US8228522B2 (en) * 2007-01-29 2012-07-24 Kabushiki Kaisha Toshiba Document data management apparatus to manage document data read and digitized by an image reading apparatus and a technique to improve reliability of various processing using document data

Also Published As

Publication number Publication date
JPH0535914A (en) 1993-02-12

Similar Documents

Publication Publication Date Title
US6754385B2 (en) Ruled line extracting apparatus for extracting ruled line from normal document image and method thereof
US8155445B2 (en) Image processing apparatus, method, and processing program for image inversion with tree structure
US6798906B1 (en) Image processing apparatus and method including line segment data extraction
JP4100885B2 (en) Form recognition apparatus, method, program, and storage medium
JP3411472B2 (en) Pattern extraction device
JP2000207489A (en) Character extracting method and device and record medium
JP4011646B2 (en) Line detection method and character recognition device
JP3187894B2 (en) Document image tilt detection method
EP1296283A2 (en) Half-tone dot elimination method and system thereof
JPH06214983A (en) Method and device for converting document picture to logical structuring document
JP3187895B2 (en) Character area extraction method
JPH0256688A (en) Character segmenting device
US11288536B2 (en) Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
JPH0721817B2 (en) Document image processing method
KR20000025647A (en) Method for processing image using shading algorithm
Aparna et al. A complete OCR system development of Tamil magazine documents
JP4409713B2 (en) Document image recognition apparatus and recording medium
JP2002109470A (en) Image recognition device, image recognition method, and computer readable recording medium stored with image recognition program
JP4194309B2 (en) Document direction estimation method and document direction estimation program
JP3086277B2 (en) Document image processing device
JPH0679348B2 (en) Line cutting method
KR100334624B1 (en) Clustering based document image segmentation method
JP2715930B2 (en) Line detection method
KR100317653B1 (en) An feature extraction method on recognition of large-set printed characters
JP2022019253A (en) Information processing apparatus, information processing method, and program

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees