JPH06203202A - Image processor - Google Patents

Image processor

Info

Publication number
JPH06203202A
JPH06203202A JP4360273A JP36027392A JPH06203202A JP H06203202 A JPH06203202 A JP H06203202A JP 4360273 A JP4360273 A JP 4360273A JP 36027392 A JP36027392 A JP 36027392A JP H06203202 A JPH06203202 A JP H06203202A
Authority
JP
Japan
Prior art keywords
histogram
rectangular area
skew
column
skew angle
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
JP4360273A
Other languages
Japanese (ja)
Other versions
JP3303246B2 (en
Inventor
Koichi Ejiri
公一 江尻
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 JP36027392A priority Critical patent/JP3303246B2/en
Publication of JPH06203202A publication Critical patent/JPH06203202A/en
Application granted granted Critical
Publication of JP3303246B2 publication Critical patent/JP3303246B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To detect and correct a skew angle easily, stably, efficiently, and securely with a small arithmetic quantity and a small number of data. CONSTITUTION:A connection component extraction part 3 extracts connection components of a pattern while checking the continuity of specific pixels in an image and a rectangular area setting part 4 sets a rectangular area for the extracted connection components. A histogram calculation part 5 projects the coordinate values of the end points of the rectangular area in a specific direction within a range wherein the rectangular area is present in the image while assuming the range, thereby finding the histogram of the projection. A column detecting process part 6 detects the column of a document on the basis of the histogram of the projection and a skew angle detection part 7 detects the skew angle by using the rectangular area in the range limited from the end point of the detected column. When the skew angle is detected, a skew correction part 8 corrects the skew on the basis of the skew angle.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、文字認識などに利用さ
れ、読取った画像に対して切出し処理やスキュー検出,
補正処理等の処理を行なう画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is used for character recognition and the like, and performs clipping processing, skew detection, and
The present invention relates to an image processing apparatus that performs processing such as correction processing.

【0002】[0002]

【従来の技術】読取った文書画像から領域の切り出しを
行ない文書上の画像の種類や性質を自動判別したりする
OCR装置(光学文字認識装置)などの画像処理装置が
知られている。この種の装置では、領域の切り出しや文
字認識等が正しく行なわれるための前提として、画像が
傾きのない状態,すなわちスキューのない状態である必
要があり、スキューのある状態で読取られたときには、
スキューを補正する必要がある。
2. Description of the Related Art There is known an image processing apparatus such as an OCR apparatus (optical character recognition apparatus) which cuts out an area from a read document image and automatically determines the type and property of the image on the document. In this type of device, it is necessary for the image to be in a state without inclination, that is, a state without skew, as a premise for properly cutting out a region, recognizing characters, and the like.
Skew needs to be corrected.

【0003】従来では、スキューの検出,補正を行なう
のに種々の技術が提案され開発されてきた。その代表的
なものにフーリエ変換法がある。例えば、文献「電子通
信学会論文誌 Vol.J65-D(2),第298〜299頁」
(以下、従来例1と称す)には、全画面を画素単位で2
次元フーリエ変換しその絶対値のピークが文字行と直交
する方向に存在することを見出している。また、文献
「電子通信学会論文誌 Vol.J66-D(1),第111〜11
8頁」(以下、従来例2と称す)では、いくつかのスキ
ュー補正法が検討されており、その結果、回転と投影を
組み合わせた方法が提案されている。また、文献「電子
通信学会論文誌 Vol.J69-D(11),第1833〜1834
頁」(以下、従来例3と称す)においては、連結要素を
矩形で表現し、これを種々の方向に投影し、そのピーク
値をとることが提案されている。また、文献「IBM Tech
nical Disclosure Bullentin, Vol.28(8),(1986),第
3667頁」(以下、従来例4と称す)においては、微
分などで得た線要素を極座標空間に変換するHough変換
を施した後、極座標上で最大値を見つけるという方法を
利用している。文献「Machine Vision and Application
s,(1989),2;第141〜153頁」(以下、従来例5
と称す)においても、上記従来例4と同様の方法をとっ
ている。これに対し、文献「proceeding of SPSE 40th
Conference Symposium Hybrid Imaging System,第21
〜24頁」(以下、従来例6と称す)では、英語文書中
の文字の中央底点を基準と定義し、角度xの方向にこの
基準点を射影し、この最大値を持つ角度xをスキュー角
度としている。一方、文献「電子通信学会論文誌 D,Vol
J71-D(7),第1296〜1305頁 (1988)」(以下、
従来例7と称す)においては、文書画像中の水平線/垂
直線のランを利用したスキュー検出が提案されている。
また、文献「10th International Conference on Patte
rn Recognition, 1990(June),第8〜13頁」(以下、
従来例8と称す)においては、連結成分抽出後にHough
変換と連結成分の傾斜角度別頻度分布をとり、この最大
値を与える角度によってスキューの検出を試みている。
Conventionally, various techniques have been proposed and developed for detecting and correcting skew. A typical example is the Fourier transform method. For example, the document “The Institute of Electronics and Communication Engineers, Vol.J65-D (2), pp. 298-299”.
(Hereinafter, referred to as Conventional Example 1)
Dimensional Fourier transform is performed and it is found that the peak of the absolute value exists in the direction orthogonal to the character line. In addition, the document “The Institute of Electronics and Communication Engineers, Vol.J66-D (1), Nos.
In "Page 8" (hereinafter referred to as Conventional Example 2), several skew correction methods have been studied, and as a result, a method combining rotation and projection has been proposed. In addition, the document “Journal of the Institute of Electronics and Communication Engineers, Vol. J69-D (11), No. 1833-1834.
In "page" (hereinafter referred to as "conventional example 3"), it is proposed that the connecting element is represented by a rectangle, this is projected in various directions, and the peak value thereof is taken. In addition, the document "IBM Tech
nical Disclosure Bullentin, Vol. 28 (8), (1986), p. 3667 ”(hereinafter referred to as Conventional Example 4), after the Hough transform for transforming the line element obtained by differentiation into polar coordinate space. , The method of finding the maximum value on polar coordinates is used. Reference `` Machine Vision and Application
s, (1989), 2; pp. 141-153 "(hereinafter, conventional example 5
(Also referred to as “)”, the same method as in the above-mentioned conventional example 4 is adopted. In contrast, the document "proceeding of SPSE 40th
Conference Symposium Hybrid Imaging System, 21st
~ 24 pages "(hereinafter referred to as Conventional Example 6), the central bottom point of characters in an English document is defined as a reference, and this reference point is projected in the direction of the angle x, and the angle x having this maximum value is determined. The skew angle is used. On the other hand, the document “The Institute of Electronics and Communication Engineers, D, Vol
J71-D (7), pp. 1296-1305 (1988) "(hereinafter,
In the prior art example 7), skew detection using runs of horizontal lines / vertical lines in a document image is proposed.
In addition, the document “10th International Conference on Patte
rn Recognition, 1990 (June), pp. 8-13 "(hereinafter,
In conventional example 8), Hough is performed after the connected component is extracted.
The skew is detected based on the angle that gives the maximum value by taking the frequency distribution of the transformation and the connected component according to the inclination angle.

【0004】[0004]

【発明が解決しようとする課題】このように、従来にお
いて、種々のスキュー検出,補正の仕方が提案されてい
るが、現状では、これらのいずれも満足する結果が得ら
れていない。すなわち、従来例1では、行間隔が一定と
いう制約条件があり、また、フーリエ変換を用いるた
め、演算量が多いという欠点があった。また、従来例
2,従来例3では、演算量が多く、また、その精度が最
初の回転変換の最小回転ステップに依存するという問題
があった。また、文字行が画面内のどこにあるかもわか
らない場合が多いので、この方法を自動的に適用するの
は難かしいという欠点があった。また、従来例4,従来
例5では、演算量が多く、また、検出精度が低いという
欠点があった。また、従来例6は、高精度ではあるが、
異なる行間隔のコラムが同一ペ−ジに存在するときは必
ずしも正しい結果を与えず、また、行の方向が不明の場
合も問題があった。また、従来例7では、文字行が少な
過ぎたり、行の間隔が空き過ぎている場合に、検出が困
難になるという欠点があった。また、従来例8の方法
は、従来の各種方法の中で最も実用性が高いが、原画像
が多段組みの場合には、傾斜角度を誤まって検出する可
能性があるのみならず、Hough変換が文字以外の印刷画
像に適用される場合、ノイズの影響を受け易く、これを
排除する特別な処理が必要となるなどの欠点があった。
As described above, various methods of skew detection and correction have been conventionally proposed, but at present, no satisfactory results are obtained. That is, in Conventional Example 1, there is a constraint that the line spacing is constant, and since Fourier transform is used, there is a drawback that the amount of calculation is large. Further, in Conventional Example 2 and Conventional Example 3, there was a problem that the amount of calculation was large and the accuracy depended on the minimum rotation step of the first rotation conversion. In addition, it is difficult to automatically apply this method because it is often not known where the character line is on the screen. Further, in the conventional example 4 and the conventional example 5, there are drawbacks that the amount of calculation is large and the detection accuracy is low. Further, although the conventional example 6 has high accuracy,
When columns with different row intervals are present on the same page, correct results are not always given, and there is a problem when the direction of rows is unknown. Further, in Conventional Example 7, there is a drawback that detection becomes difficult when there are too few character lines or when the line spacing is too large. In addition, the method of Conventional Example 8 is the most practical among the various conventional methods, but when the original image has a multi-column structure, not only may the inclination angle be erroneously detected, but the Hough When the conversion is applied to a print image other than characters, there is a drawback that it is easily affected by noise and a special process for eliminating this is required.

【0005】本発明は、上述した従来の欠点を克服し、
少ない演算量,データ数でスキュー角の検出,補正を容
易にかつ安定して効率良く確実に行なうことの可能な画
像処理装置を提供することを目的としている。さらに本
発明では、対象とする文書画像が縦書きであるか、ある
いは横書きの文書を90度回転して読み取らせたかどう
かにかかわらず、そのスキュー角を正しく求めることの
可能な画像処理装置を提供することを目的としている。
The present invention overcomes the above-mentioned conventional drawbacks,
An object of the present invention is to provide an image processing apparatus capable of easily, stably, efficiently, and reliably performing skew angle detection and correction with a small amount of calculation and the number of data. Further, the present invention provides an image processing apparatus capable of correctly obtaining the skew angle regardless of whether the target document image is vertically written or a horizontally written document is read by being rotated by 90 degrees. The purpose is to do.

【0006】[0006]

【課題を解決するための手段および作用】上記目的を達
成するために、請求項1,請求項2記載の発明は、所定
の文書画像において所定画素の連結成分に対して矩形領
域を設定する矩形領域設定手段と、文書画像中の前記連
結成分に対してそれぞれ矩形領域を設定した後、文書画
像内で矩形領域の存在する範囲を想定しながら該範囲内
で矩形領域の端点の座標値を所定方向に射影し、該射影
のヒストグラムを求めるヒストグラム算出手段と、前記
射影のヒストグラムのピーク値を求め、該ピーク値に基
づき文書の欄(コラム)を検出するコラム検出手段とを
備えていることを特徴としている。これにより、文書画
像が多段組の場合でも、文書画像中の欄(コラム)を信
頼性良く確実に検出することができる。
In order to achieve the above object, the invention according to claims 1 and 2 is a rectangle for setting a rectangular area for a connected component of a predetermined pixel in a predetermined document image. After setting a rectangular area for each of the connected components in the document image and the area setting means, assuming the range in which the rectangular area exists in the document image, the coordinate value of the end point of the rectangular area is determined within the range. A histogram calculation means for projecting in a direction to obtain a histogram of the projection; and a column detection means for determining a peak value of the projection histogram and detecting a column of the document based on the peak value. It has a feature. As a result, even when the document image has a multi-column structure, the column in the document image can be reliably and reliably detected.

【0007】また、請求項3,請求項4記載の発明は、
射影のヒストグラムのピーク値がコラムの端点として検
出されたときに、該コラムの端点からある制限された範
囲内の矩形領域のみを用いてスキュー角を求めるスキュ
ー角検出手段をさらに備えていることを特徴としてい
る。これにより、文書画像が多段組の場合でも、スキュ
ー角を少ない演算量,計算コストで容易にかつ安定して
確実に検出することができる。
The inventions according to claims 3 and 4 are:
When the peak value of the projection histogram is detected as the end point of the column, a skew angle detection means for determining the skew angle using only a rectangular area within a limited range from the end point of the column is further provided. It has a feature. As a result, even if the document images are in multiple columns, the skew angle can be detected easily, stably and reliably with a small amount of calculation and calculation cost.

【0008】また、請求項5記載の発明は、前記スキュ
ー角に基づき、矩形領域に対して所定の演算処理を施し
て、画像をスキューの方向と逆方向に見かけ上スキュー
角分だけ回転処理を施したように見せるスキュー補正を
行なうことを特徴としている。これにより、文書画像が
多段組の場合でも、スキュー補正を少ない演算量,計算
コストで、容易にかつ安定して効率良く確実に行なうこ
とができる。
According to a fifth aspect of the present invention, a predetermined arithmetic process is performed on the rectangular area based on the skew angle, and the image is rotated in the direction opposite to the skew direction by an apparent skew angle. The feature is that skew correction is performed to make it look as if it was applied. As a result, even if the document images are in multiple columns, skew correction can be performed easily, stably, efficiently and surely with a small amount of calculation and calculation cost.

【0009】また、請求項6記載の発明は、矩形領域の
端点の座標値の所定方向へのヒストグラムに基づき、各
注目頻度値と該注目頻度値に隣接する頻度値との双方を
利用して真のピーク値を求めることを特徴としている。
これにより、偽ピーク値を取り除くことができる。
Further, according to the invention of claim 6, both the frequency values of interest and the frequency values adjacent to the frequency value of interest are utilized based on the histogram of the coordinate values of the end points of the rectangular area in the predetermined direction. It is characterized by finding the true peak value.
Thereby, the false peak value can be removed.

【0010】また、請求項7記載の発明は、文書画像中
の矩形に対する座標値の数を可変に設定可能であって、
文書画像の半分程度まで読み取り走査した段階で矩形の
数が座標値の数に満たない場合には、それまで読み込ま
れた矩形の数を、参照のための矩形の座標値の数と決定
し、バッファメモリに蓄える。この蓄えられた座標値と
新たに読込まれた矩形の座標値とを比較し、矩形領域の
射影演算を実行するようになっていることを特徴として
いる。これにより、原稿の中に文字行が少ないような場
合には、より迅速にかつ効率良くヒストグラムを求める
ことができる。
According to the seventh aspect of the invention, the number of coordinate values for the rectangle in the document image can be variably set,
If the number of rectangles is less than the number of coordinate values at the stage of reading and scanning up to about half of the document image, determine the number of rectangles read so far as the number of rectangle coordinate values for reference, Store in buffer memory. It is characterized in that the stored coordinate value is compared with the coordinate value of the newly read rectangle to execute the projection calculation of the rectangular area. As a result, when there are few character lines in the document, the histogram can be obtained more quickly and efficiently.

【0011】また、請求項8記載の発明は、スキュー角
度の算出に際して、矩形の射影ヒストグラムのピーク値
の信頼性を、ヒストグラムの統計量から判定し、ある信
頼度を付してスキュー角度を決定するようになっている
ことを特徴としている。これにより、検出されたスキュ
ー角がどの程度の信頼性を有しているかを客観的に判断
することができる。
According to the present invention, in calculating the skew angle, the reliability of the peak value of the rectangular projection histogram is determined from the statistical amount of the histogram, and the skew angle is determined with a certain reliability. The feature is that it is designed to do. This makes it possible to objectively judge how reliable the detected skew angle is.

【0012】[0012]

【実施例】以下、本発明の一実施例を図面に基づいて説
明する。図1は本発明に係る画像処理装置の一実施例の
構成図である。図1を参照すると、本実施例の画像処理
装置は、処理対象となる原画像に2値化処理を施す2値
化処理部1と、2値化画像に所定の倍率変換を施す倍率
変換部2と、倍率変換後の画像において所定画素の連結
性を調べながらパターンの連結成分を抽出する連結成分
抽出部3と、連結成分抽出部3により抽出された連結成
分に対して矩形領域を設定する矩形領域設定部4と、画
像中の各連結成分に対してそれぞれ矩形領域を設定した
後、画像内で矩形領域の存在する範囲を想定しながら該
範囲内で矩形領域の端点の座標値を所定方向にそれぞれ
射影し、射影のヒストグラムを求めるヒストグラム算出
部5と、ヒストグラム算出部5で求めた射影のヒストグ
ラムに基づき、文書の欄(コラム)を検出するコラム検
出処理部6と、コラム検出処理部6でコラムが検出され
たときに、該コラムの端点からある制限された範囲内の
矩形領域を用いてスキュー角を検出するスキュー角検出
部7と、スキュー角が検出されたとき、該スキュー角に
基づいてスキューを補正するスキュー補正部8とを有し
ている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. 1 is a block diagram of an embodiment of an image processing apparatus according to the present invention. Referring to FIG. 1, an image processing apparatus according to the present exemplary embodiment includes a binarization processing unit 1 that performs a binarization process on an original image to be processed, and a magnification conversion unit that performs a predetermined magnification conversion on the binarized image. 2, a connected component extraction unit 3 that extracts a connected component of a pattern while checking the connectedness of a predetermined pixel in the image after the magnification conversion, and a rectangular area is set for the connected component extracted by the connected component extraction unit 3. After the rectangular area is set for each connected component in the image, the rectangular area setting unit 4 assumes a range in which the rectangular area exists in the image, and determines the coordinate value of the end point of the rectangular area within the range. Histogram calculation unit 5 for projecting in each direction to obtain a histogram of projections, column detection processing unit 6 for detecting columns of documents based on the projection histogram obtained by histogram calculation unit 5, and column detection processing unit When a column is detected in, the skew angle detection unit 7 that detects a skew angle using a rectangular area within a limited range from the end point of the column, and when the skew angle is detected, the skew angle is detected. The skew correction unit 8 corrects the skew based on the above.

【0013】ここで、スキュー角検出部17は、上記制
限された範囲内に存在する矩形領域の組において、各矩
形領域の1つの座標を種々の方位に投影したヒストグラ
ム(並び)を求め、このヒストグラム(並び)の最大と
なる角度をスキュー角として検出するようになってい
る。
Here, the skew angle detection unit 17 obtains a histogram (arrangement) in which one coordinate of each rectangular area is projected in various directions in a set of rectangular areas existing within the limited range, and The maximum angle of the histogram (arrangement) is detected as the skew angle.

【0014】また、スキュー補正部8は、スキュー角検
出部7において、スキュー角が検出された後、連結要素
を囲む矩形領域に対して、所定の数学的演算によって、
上記スキュー角だけ傾いて上記矩形領域に内接する矩形
を求め、これをスキュー補正された矩形とみなすように
なっている。しかる後、必要に応じて、このスキュー補
正された矩形の端点を表わす座標値に例えばアフィン変
換等の回転処理を施して回転補正を行なうことができ
る。
After the skew angle is detected by the skew angle detecting unit 7, the skew correcting unit 8 performs a predetermined mathematical operation on a rectangular area surrounding the connecting element,
A rectangle inclining by the skew angle and inscribed in the rectangular area is obtained, and this rectangle is regarded as a skew-corrected rectangle. Thereafter, if necessary, the rotation-correction can be performed by performing rotation processing such as affine transformation on the coordinate values representing the end points of the rectangle whose skew has been corrected.

【0015】次にこのような構成の画像処理装置の処理
動作を図2のフローチャートを用いて説明する。例えば
文書原稿をイメージスキャナなどの読取装置で読取ると
き、原稿送り機構などの調整等が完全でないような場
合、文書原稿は傾いて読取られ、その読取文書画像は一
般に理想状態から所定の傾き角度でスキューしている。
本実施例の画像処理装置では、先づ、読取られた文書画
像に対して2値化処理部1において2値化処理を施し、
これを黒と白の画素からなる2値画像に変換する(ステ
ップS1)。なお、通例、文書原稿等に対する読取密度
は、1インチ当り200乃至400ドット(dpi)で
ある。また、2値画像では、通常、印刷部分が“1”
(黒)、白地部分が“0”(白)で表わされる。
Next, the processing operation of the image processing apparatus having such a configuration will be described with reference to the flowchart of FIG. For example, when the document original is read by a reading device such as an image scanner and the adjustment of the original feeding mechanism is not complete, the document original is read at an inclination, and the read document image is generally read at a predetermined inclination angle from the ideal state. It's skewed.
In the image processing apparatus of this embodiment, first, the read document image is binarized by the binarization processing unit 1.
This is converted into a binary image composed of black and white pixels (step S1). Note that the reading density of a document or the like is usually 200 to 400 dots (dpi) per inch. Also, in a binary image, the printed part is usually "1".
(Black) and white background portions are represented by "0" (white).

【0016】ところで、200乃至400dpiの読取
密度は文字認識や画像処理には適した密度であるが、領
域識別の目的には多過ぎる。そのため、倍率変換部2で
は、2値画像を例えば縦横1/8に縮小する(ステップ
S2)。すなわち、2値画像をOR論理あるいはサンプ
リング手法によって、水平方向,垂直方向の両方向に1
/8に縮小し、その解像度を1/8にする。なお、この
例では、縮小率を1/8にしたが、他の縮小率で縮小す
ることもできる。但し、縮小率1/8はバイト単位の処
理で容易に実現できるので、処理速度の面からも有利で
ある。
The reading density of 200 to 400 dpi is suitable for character recognition and image processing, but is too large for the purpose of area identification. Therefore, the magnification conversion unit 2 reduces the binary image to, for example, 1/8 in length and width (step S2). That is, the binary image is set to 1 in both the horizontal and vertical directions by the OR logic or the sampling method.
It is reduced to / 8 and its resolution is reduced to ⅛. In this example, the reduction rate is set to 1/8, but it is also possible to reduce at another reduction rate. However, the reduction rate of ⅛ can be easily realized by processing in units of bytes, which is also advantageous in terms of processing speed.

【0017】このようにして、2値画像を縮小した後、
この縮小画像上で、黒画素の連結性を調べながら、パタ
ーンの連結成分を抽出する(ステップS3)。この処理
には既知の種々の方法を用いることができるが、本実施
例においては、黒ランの連結性を調べ、黒ランの連結成
分に同一識別子を付し、同一識別子の中で座標値の最大
/最小値を求める。この座標値が1つの連結成分を囲む
矩形領域の対角点の座標となる。従って、この対角点の
座標値により、1つの連結成分に対して1つの矩形領域
を設定することができる(ステップS4)。このように
して、縮小画像上で、各連結成分に対してそれぞれ矩形
領域を設定した後、本実施例では、文書画像が多段組の
欄(コラム)を含む場合を考慮して、この縮小画像内で
矩形領域の存在する範囲を想定しながら、該範囲内で矩
形領域の端点の座標値を所定方向に射影し、この射影の
ヒストグラムを求める(ステップS5)。この処理につ
いていより具体的に説明すると、連結成分を表現する矩
形領域は例えば、後述のように図6に符号Aとして示さ
れている。本実施例では矩形領域を対角線上の2つの端
点で特定するようにしており、従って図6の例では矩形
領域は、2つの端点の座標値,すなわち(Xu,Yu)
と(Xd,Yd)とで表わされる。この例の場合、ステ
ップS5では、上記範囲内で矩形の2つの端点のうちの
一方の端点の座標値,例えば(Xu,Yu)を垂直方向
(X座標軸)および/または水平方向(Y座標軸)に投
影し、この射影のヒストグラムを求める。しかる後、こ
の射影のヒストグラムのピーク値をとる座標値を文書の
欄(コラム)の端点として検出する(ステップS6)。
After reducing the binary image in this way,
On this reduced image, the connected components of the pattern are extracted while checking the connectedness of the black pixels (step S3). Although various known methods can be used for this processing, in the present embodiment, the connectivity of the black runs is examined, the connected components of the black runs are given the same identifiers, and the coordinate values of the coordinate values are included in the same identifiers. Find maximum / minimum values. This coordinate value becomes the coordinate of the diagonal point of the rectangular area surrounding one connected component. Therefore, one rectangular area can be set for one connected component based on the coordinate values of the diagonal points (step S4). In this way, after the rectangular area is set for each connected component on the reduced image, the reduced image is considered in the present embodiment in consideration of the case where the document image includes a multi-column group (column). While assuming the range in which the rectangular region exists, the coordinate values of the end points of the rectangular region are projected in the predetermined direction in the range, and a histogram of this projection is obtained (step S5). This processing will be described more specifically. A rectangular area expressing a connected component is shown as a symbol A in FIG. 6 as described later, for example. In this embodiment, the rectangular area is specified by the two end points on the diagonal line. Therefore, in the example of FIG. 6, the rectangular area has the coordinate values of the two end points, that is, (Xu, Yu).
And (Xd, Yd). In the case of this example, in step S5, the coordinate value of one of the two endpoints of the rectangle within the above range, for example (Xu, Yu), is set in the vertical direction (X coordinate axis) and / or the horizontal direction (Y coordinate axis). , And obtain the histogram of this projection. After that, the coordinate value taking the peak value of the histogram of this projection is detected as the end point of the document column (step S6).

【0018】一般に、傾いて読取られた文書画像は、図
3に示すように、連結成分を示す矩形領域が大きくなる
と同時に、その並び方もずれている。ここで、矩形領域
は図4に示すように、ある場合は文字に対して設定さ
れ、ある場合は単語に対して設定され、またある場合は
複数の単語に対して設定される。矩形領域の行方向の長
さは1行の1/3以下が望ましい。いずれにしても、こ
れらの矩形領域はほぼ同一の直線上に並んでいるはずで
あるから、多くの組み合わせについて積算すれば、最大
の頻度がスキューの角度を表わすはずである。
In general, as shown in FIG. 3, in a document image read by being inclined, a rectangular area showing a connected component becomes large, and at the same time, its arrangement is also shifted. Here, as shown in FIG. 4, a rectangular area is set for a character in some cases, a word in some cases, and a plurality of words in other cases. The length of the rectangular area in the row direction is preferably 1/3 or less of one row. In any case, since these rectangular areas should be arranged on substantially the same straight line, the maximum frequency should represent the angle of skew when integrated for many combinations.

【0019】次表には文書画像が多段組の欄(コラム)
を含むような場合に、多段組の各欄(コラム)の端点を
検出する処理,スキュー角を求める処理の具体例として
模擬コードを用いたプログラムリストが示されている。
In the following table, the document image is a multi-column column.
In the case of including, the program list using the simulated code is shown as a specific example of the process of detecting the end points of each column of the multi-column set and the process of obtaining the skew angle.

【0020】[0020]

【表1】 [Table 1]

【0021】表1のプログラムリストにおいて、Buff S
izeは本プログラムで参照する座標値の数(バッファサ
イズ)であり、例えば“200”と仮定される。また、
Column widthは対象とする文書画像の中で考えられうる
最小の段の幅であり、例えば原稿幅の1/5と仮定され
る。また、模擬コード中の行番号“003”と“00
6”行とにおけるfind column(Column start)は、欄
(コラム)の端点(この例ではコラムの始まり)を見つ
ける命令であり、この命令によって文書中の段組領域の
左端のx座標“Column start”を見つけることができ
る。すなわち、このfind columnによって、読み取られ
た最新の矩形領域の座標値“Buff Size”個の中で、垂
直方向の射影のヒストグラム(実際のプログラムでは水
平方向の射影のヒストグラムも同時に計算)がピーク値
を示す値を段の端点(この例では段の左端)とみなすこ
とができる。
In the program list of Table 1, Buff S
ize is the number of coordinate values (buffer size) referred to in this program, and is assumed to be “200”, for example. Also,
Column The width is the width of the smallest possible step in the target document image, and is assumed to be ⅕ of the document width, for example. In addition, line numbers “003” and “00” in the simulated code
Find at 6 "line column (Column start) is an instruction to find the end point of the column (in this example, the start of the column), and this instruction causes the x-coordinate “Column” of the left end of the column area in the document. You can find "start", ie this find The coordinate value “Buff of the latest rectangular area read by column Of the “Size”, the vertical projection histogram (in the actual program, the horizontal projection histogram is also calculated at the same time) can be regarded as the peak value of the column (in this example, the left edge of the column). it can.

【0022】なお、原稿の中に文字行が少ないときは、
予め設定したBuff Sizeに矩形の数が足りないことがあ
る。このような場合にも適用させるため、Buff Sizeを
以下のように可変とすることもできる。すなわち、も
し、所定の大きさの画像(通常はA4またはレターサイ
ズ)の半分まで読み取り走査をしても、Buff Sizeがフ
ルにならない場合は、これまで読み込まれた矩形の数を
Buff Sizeと決定し、以後の処理を実行する。これによ
り、原稿の中に文字行が少ないような場合には、より迅
速にかつ効率良くヒストグラムを求めることができる。
When there are few character lines in the manuscript,
Preset Buff Size may not have enough rectangles. In order to apply it in such a case, Buff The size can be made variable as follows. In other words, if you scan up to half of the image of a predetermined size (usually A4 or letter size), the Buff If Size is not full, set the number of rectangles read so far.
Buff The size is determined, and the subsequent processing is executed. As a result, when there are few character lines in the document, the histogram can be obtained more quickly and efficiently.

【0023】図5(a)は文書画像の矩形表現を示す図
であり、図5(b)は図5(a)の文書画像中の矩形の
2つの端点のうちの一方の端点の座標(この例では矩形
の左上端点の座標値)(図5(a)には図示せず)を垂
直方向(X座標軸)に射影したヒストグラムの一例を示
す図である。図5(a)の例では、文書画像が多段組と
なっており、複数(3つ)のコラムC1,C2,C3を
有している。この場合、図5(a)の文書画像中の矩形
の左上端点の座標を垂直方向,すなわちX座標軸に射影
すると、そのヒストグラムは、図5(b)に示すよう
に、主に4つのピーク値P1,P2,P3,P4が検出
され、このピーク値P1,P2,P3,P4で示す位置
を段の端点,すなわちコラムの端点とみなすことができ
る。換言すれば、これによって、多段組の複数の欄(コ
ラム)C1,C2,C3,より詳しくは、各コラムの幅
Column widthを検出することができる。また、行番号
“006”のsize checkは、読み取られた矩形領域のサ
イズをチェックして、大き過ぎたり、小さ過ぎるものを
計測の対象からはずす命令である。さらに模擬コード中
の行番号“012”は、検出された段組のうちの1つの
段,すなわち1つの欄(コラム)の範囲内の矩形領域の
みを取り出すための条件を与えている。これにより、コ
ラムの端点Column start(図5(a),(b)の例で
は、例えばコラムC1の左端P1)から幅Column width
(コラムC1の範囲内)分の矩形領域のみをスキュ−検
出に必要な上記制限された範囲として取り出すことがで
きる。また、行番号“016”のhist slope[angle]
は、上記のように取り出した所定範囲内で、後述のよう
に所定の条件に合致する矩形領域の組について、その傾
斜角angleについてのヒストグラムをとったものであ
り、このヒストグラムに所定の演算を加えた結果の最大
値を与える傾斜角がスキュー角“a”となる。
FIG. 5 (a) is a diagram showing a rectangular representation of a document image, and FIG. 5 (b) is a coordinate of one of the two end points of the rectangle in the document image of FIG. 5 (a) ( FIG. 6 is a diagram showing an example of a histogram obtained by projecting the coordinate value of the upper left end point of the rectangle (not shown in FIG. 5A) in the vertical direction (X coordinate axis) in this example. In the example of FIG. 5A, the document image is a multi-column set, and has a plurality (three) of columns C1, C2, C3. In this case, when the coordinates of the upper left end point of the rectangle in the document image of FIG. 5A are projected in the vertical direction, that is, the X coordinate axis, the histogram mainly has four peak values as shown in FIG. 5B. P1, P2, P3 and P4 are detected, and the positions indicated by the peak values P1, P2, P3 and P4 can be regarded as the end points of the column, that is, the end points of the column. In other words, this allows a plurality of columns (columns) C1, C2, C3 of the multi-column set, more specifically, the width of each column.
Column The width can be detected. In addition, size of line number “006” check is an instruction that checks the size of the read rectangular area and removes too large or too small objects from the measurement target. Further, the line number "012" in the simulated code gives a condition for taking out only one of the detected columns, that is, a rectangular area within the range of one column. This allows the endpoint of the column, Column In the example of start (FIGS. 5A and 5B, for example, the width Column from the left end P1 of the column C1) width
Only the rectangular area (within the range of column C1) can be taken out as the above-mentioned limited range necessary for skew detection. Also, the hist at line number “016” slope [angle]
Is a histogram of the inclination angle angle of a set of rectangular areas that meet a predetermined condition as described below within the predetermined range extracted as described above, and a predetermined calculation is performed on this histogram. The skew angle that gives the maximum value of the added result is the skew angle “a”.

【0024】なお、矩形領域の傾斜角angleは、この矩
形領域の対角線と水平線とのなす角度として定義するこ
とができる。
The inclination angle angle of the rectangular area can be defined as the angle formed by the diagonal line and the horizontal line of the rectangular area.

【0025】ここで、上記プログラムをより詳しく説明
すると、傾斜角は、次のように計測される。すなわち、
新たに読み込まれた矩形の座標値は、それ以前に読み込
まれた座標値の中の最新の“Buff Size”個のデータと
比較され、以下の条件に合致する矩形領域のみ傾斜角が
計測される。すなわち、対象となる矩形領域は、その対
角線の長辺または短辺に対する傾き角度が所定の角度
(本実施例では、90度〜0度の範囲内の所定の角度,
例えば分割数が5の場合には±18度以下であることを
条件とする。これ以上スキューすることは極めてまれな
ので、上記所定の角度以上の場合には、この矩形領域の
傾斜角については無視する。また、矩形領域のサイズが
大き過ぎたり小さ過ぎるものは対象から除外する。サイ
ズが小さいものはノイズの可能性が大きく、また、大き
過ぎるものは図形の可能性が大きいので、これらの矩形
領域の傾斜角については無視する。また、対象となる矩
形領域は、隣接する矩形領域と近づきすぎていないと同
時に離れすぎていないことを条件とする。近すぎている
とその矩形領域における傾斜角を正しく検出することが
できない。また、離れすぎていると、隣のコラムにまた
がる可能性がある。異なるコラムは同一の行間隔とは限
らないので、同一コラム内で計測する。
Here, the above-mentioned program will be described in more detail. The tilt angle is measured as follows. That is,
The coordinate value of the newly read rectangle is the latest "Buff" in the previously read coordinate values. The “angle” is compared with the “Size” data, and the inclination angle is measured only in the rectangular area that meets the following conditions: That is, the rectangular area of interest has a predetermined inclination angle with respect to the long side or the short side of the diagonal line. In this embodiment, a predetermined angle within the range of 90 degrees to 0 degrees,
For example, when the number of divisions is 5, the condition is ± 18 degrees or less. Since skewing is extremely rare, if the angle is equal to or larger than the predetermined angle, the inclination angle of this rectangular area is ignored. Also, if the size of the rectangular area is too large or too small, it is excluded from the target. A small size has a high possibility of noise, and a too large size has a high possibility of a figure. Therefore, the inclination angles of these rectangular regions are ignored. In addition, the condition is that the target rectangular area is neither too close to the adjacent rectangular area nor at the same time too far away. If it is too close, the tilt angle in the rectangular area cannot be detected correctly. Also, if they are too far apart, they may straddle the next column. Different columns do not always have the same row spacing, so measure within the same column.

【0026】このように、本実施例では、制限された所
定範囲内で上記の条件を満たす矩形領域からのみ、その
各矩形領域の1つの端点の座標(例えば、各矩形領域の
左上端点の座標(X,Y))を種々の方位に投影したヒ
ストグラム(並び)を求め、このヒストグラムが最大と
なる角度をスキュー角“a”として求める(ステップS
7)。
As described above, in the present embodiment, the coordinates of one end point of each rectangular area (for example, the coordinates of the upper left end point of each rectangular area) are limited to the rectangular areas satisfying the above conditions within the limited predetermined range. A histogram (arrangement) obtained by projecting (X, Y)) in various directions is obtained, and an angle at which this histogram is maximum is obtained as a skew angle “a” (step S
7).

【0027】スキュー角“a”は、ある信頼度をともな
って決定される。すなわち、ヒストグラムのピーク値と
その前後の頻度の合計値が、ヒストグラム全体の平均値
に比べ、その標準偏差値の2倍以上離れていれば、高い
信頼度とともにaを決定する。もし、その差が1倍程度
なら信頼度はやや低い。もし、その差が十分大きくなけ
れば信頼性が無いものとして、「スキュー検出不能」と
する。このように信頼度を付してスキュー角度を決定す
ることにより、検出されたスキュー角“a”が度の程度
の信頼性を有しているかを客観的に判断することができ
る。
The skew angle "a" is determined with a certain degree of reliability. That is, if the sum of the peak value of the histogram and the frequencies before and after it is more than twice the standard deviation value as compared with the average value of the entire histogram, a is determined with high reliability. If the difference is about 1 times, the reliability is a little low. If the difference is not large enough, it is regarded as unreliable and "skew cannot be detected". By thus determining the skew angle with reliability, it is possible to objectively judge whether the detected skew angle “a” has reliability of a degree.

【0028】このようにしてスキュー角“a”が求めら
れた後、スキュー補正部7では、このスキュー角“a”
に基づき、各矩形領域に対してスキュー補正を行なう
(ステップS8)。図6は図4に示すように設定された
各矩形領域のうちの1つの矩形領域の拡大図であり、図
6からわかるように、この矩形領域Aは、連結画像に対
して大き目に設定されている。本来スキューのない状態
で定義される矩形領域をIとすると、図6から次の関係
式が成り立つ。
After the skew angle "a" is obtained in this way, the skew correction unit 7 determines the skew angle "a".
Based on the above, skew correction is performed on each rectangular area (step S8). FIG. 6 is an enlarged view of one rectangular area of the rectangular areas set as shown in FIG. 4, and as can be seen from FIG. 6, this rectangular area A is set larger than the connected image. ing. Letting I be a rectangular region that is originally defined in the absence of skew, the following relational expression holds from FIG.

【0029】[0029]

【数1】 [Equation 1]

【0030】なお、上式は、スキュー角“a”が正の場
合の関係式であり、スキュー角“a”が負の場合には、
次の関係式となる。
The above equation is a relational expression when the skew angle "a" is positive, and when the skew angle "a" is negative,
It becomes the following relational expression.

【0031】[0031]

【数2】 [Equation 2]

【0032】本実施例においては、各矩形領域に対する
スキュー補正は、スキュー角“a”が求められたとき
に、上記数1または数2に基づいて矩形領域に角度
“a”の傾きで内接する矩形を求め、もし必要があれ
ば、各矩形領域に対して求められた内接する矩形に対し
(この矩形の全座標に対し)アフィン変換を行なうこと
でなされる。なお、上記数1および数2において、W,
Hはそれぞれ外接長方形の幅,高さであり、これらは次
式により定義される。
In the present embodiment, the skew correction for each rectangular area is inscribed in the rectangular area at the inclination of the angle "a" based on the above equation 1 or 2, when the skew angle "a" is obtained. This is done by finding a rectangle and, if necessary, performing an affine transformation on the inscribed rectangle found for each rectangle area (for all coordinates of this rectangle). In the above formulas 1 and 2, W,
H is the width and height of the circumscribed rectangle, respectively, and these are defined by the following equations.

【0033】[0033]

【数3】W=|Xd−Xu| H=|Yd−Yu|## EQU3 ## W = | Xd-Xu | H = | Yd-Yu |

【0034】次に、実際の読取画像に対して本実施例の
矩形領域の設定処理,スキュー角検出処理,スキューの
補正処理を適用した場合に得られる結果について説明す
る。図7は、ランドスケープに印字された原画をポート
レート方向に(すなわち90度回転した方向に)、か
つ、歪んで(スキューして)読取ったC−言語のプログ
ラム原稿画像から前述した仕方で連結パターンを抽出
し、直結画像単位で矩形表現した結果を示している。す
なわちランドスケープ方向に印刷された文書画像を本発
明を適用したシステムにより、90度回転したポートレ
ート方向に読取り、前述の連結成分の抽出処理,矩形領
域の設定処理を実行した結果を示している。図7の矩形
表現結果に対して、表1に示した処理を行なった結果、
図8に示すように水平方向Hへの傾斜角の射影ヒストグ
ラムを得ることができ、また、図9に示すように、垂直
方向Vへの傾斜角の射影ヒストグラムを得ることができ
た。このとき、それぞれのヒストグラムのピーク値が同
一の値“−1.6度”をもっていることがわかる。この
値をスキュー値“a”と置く。
Next, the results obtained when the rectangular area setting processing, skew angle detection processing, and skew correction processing of this embodiment are applied to an actual read image will be described. FIG. 7 is a connection pattern in the above-described manner from a C-language program original image obtained by reading an original image printed on a landscape in a portrait direction (that is, in a direction rotated by 90 degrees) and being distorted (skewed). Is extracted, and the result is expressed by a rectangle in units of directly connected images. In other words, the document image printed in the landscape direction is read by the system to which the present invention is applied in the portrait direction rotated by 90 degrees, and the above-described connected component extraction processing and rectangular area setting processing are executed. As a result of performing the processing shown in Table 1 on the rectangular representation result of FIG. 7,
As shown in FIG. 8, a projection histogram of the tilt angle in the horizontal direction H can be obtained, and as shown in FIG. 9, a projection histogram of the tilt angle in the vertical direction V can be obtained. At this time, it can be seen that the peak values of the respective histograms have the same value "-1.6 degrees". This value is set as the skew value “a”.

【0035】ヒストグラムのピーク値は以下のように評
価される。すなわち、先づ、ヒストグラムのピーク値を
例えば隣合う3つの値の合計値によって評価する。な
お、隣合う値の合計値によって評価するのは、以下のた
めである。すなわち、近接する矩形は水平座標値または
垂直座標値のいずれか一方が類似した値をもつことが多
い。ところで、このシステムでは解像度を8分の1に落
しているので、必然的に近接する矩形の端点の座標値が
同一である確率が高くなる(量子化効果)。従って、ヒ
ストグラム上に0度のシャープなピークが生じ易く、こ
のためピークを除く必要があるためである。また、ヒス
トグラムのピーク値がその周囲と比較してどれ程突出し
ているかを判断し、突出が大きいほど安定なピークとみ
なす。また、第1ピークと第2ピークが隣接していれば
安定なピークとみなす。図8,図9のヒストグラムで
は、垂直,水平方向ともスキュー角が−1.6度を示し
ているが、垂直方向のピークの方がより鮮明である。図
10は、検出されたスキュー角をもとに、図7の各矩形
領域に対し、スキュー角の傾きで内接する矩形を求め、
この矩形に対し、スキュー角分だけ回転処理(アフィン
変換)を施した結果を示す図である。図10からスキュ
ーが正しく補正されたことがわかる。
The peak value of the histogram is evaluated as follows. That is, first, the peak value of the histogram is evaluated, for example, by the total value of three adjacent values. The reason for evaluating the total value of adjacent values is as follows. That is, adjacent rectangles often have similar horizontal or vertical coordinate values. By the way, since the resolution is reduced to 1/8 in this system, the probability that the coordinate values of the end points of adjacent rectangles are necessarily the same increases (quantization effect). Therefore, a sharp peak of 0 degree is likely to occur on the histogram, and it is necessary to remove the peak. Further, it is judged how much the peak value of the histogram is protruding compared with its surroundings, and the larger the protruding value is, the more stable the peak is considered. If the first peak and the second peak are adjacent to each other, it is considered as a stable peak. In the histograms of FIGS. 8 and 9, the skew angle is −1.6 degrees both in the vertical and horizontal directions, but the peak in the vertical direction is clearer. FIG. 10 shows a rectangle inscribed in each of the rectangular regions of FIG. 7 at the skew angle inclination based on the detected skew angle.
It is a figure which shows the result of having performed the rotation process (affine transformation) by the skew angle with respect to this rectangle. It can be seen from FIG. 10 that the skew has been corrected correctly.

【0036】また、本実施例のスキュー補正処理は、ス
キュー補正のなされるべき対象が全て連結画像を単位と
した矩形で表現されているので、原画に対してのスキュ
ー補正ではなく、矩形表現結果に対してのスキュー補正
である。図10は、矩形表現結果に対してのスキュー補
正によって全ての画像に対して十分満足する結果を得る
ことができ、この処理が安定したものであることを示し
ている。
Further, in the skew correction processing of the present embodiment, since all the objects to be skew-corrected are represented by rectangles with the connected image as a unit, the result of rectangle representation is not the skew correction for the original image. Is a skew correction for. FIG. 10 shows that the skew correction for the rectangular representation result makes it possible to obtain a sufficiently satisfactory result for all images, and this processing is stable.

【0037】また、原画に対してのスキュー補正ではな
く、制限された範囲内の所定の条件を満たす矩形表現結
果に対してスキュー補正を行なうことで、従来に比べて
演算量,計算コストを著しく低減することができる。
Further, not the skew correction for the original image but the skew correction for the rectangular expression result satisfying the predetermined condition within the limited range, so that the calculation amount and the calculation cost are remarkably increased as compared with the conventional case. It can be reduced.

【0038】すなわち、この種の画像処理において重要
な評価項目は、演算量,計算コスト,検出精度および結
果の安定性である。現実の文書画像に適用すると、行の
間隔が不揃いであったり、図形の占める割合が大きかっ
たり、あるいは地肌などの画像ノイズが大きいといった
問題を含んでおり、従来の画像処理では、上記の各評価
項目を満足する結果を得ることは困難であった。これに
対し、本実施例の画像処理装置では、50枚の印刷文書
画像に適用し、これら全てにおいて上記各評価項目を満
足する良好な結果を得ることができた。特に、文書画像
が多段組を含む場合に、従来例8と比べて良好な安定し
た正しいスキュ−補正を正しく行なうことができた。ま
た、従来例8に比べてノイズ等の影響の少ない極めて良
好な安定したスキュー補正結果を得ることができた。
That is, important evaluation items in this type of image processing are the amount of calculation, the calculation cost, the detection accuracy, and the stability of the result. When applied to a real document image, it contains problems such as uneven line spacing, a large proportion of figures, and large image noise such as the background. It was difficult to obtain results that satisfied the items. On the other hand, in the image processing apparatus of the present embodiment, it was applied to 50 printed document images, and good results satisfying the above evaluation items could be obtained in all of them. In particular, when the document image includes a multi-column set, good and stable skew correction can be correctly performed as compared with the conventional example 8. Further, it was possible to obtain a very good and stable skew correction result with less influence of noise and the like as compared with the conventional example 8.

【0039】なお、演算量,計算コストに着目すると、
本実施例の演算量,計算コストは対象となるデータサン
プルの数に依存する。次表には本実施例の方式と従来の
方式(FFT、従来例8)とのそれぞれにおける処理
を、利用するサンプルの数で比較している。なお、次表
では、角度分解能が0.2゜、演算方向がx,y両方
向、最小画素単位が8×8画素、原画解像度が300d
pi,A4の条件となっており、FFTは従来のフーリ
エ変換法によるものを示している。
When focusing on the calculation amount and the calculation cost,
The calculation amount and calculation cost of this embodiment depend on the number of target data samples. The following table compares the processing in each of the method of this embodiment and the conventional method (FFT, conventional example 8) by the number of samples to be used. In the following table, the angular resolution is 0.2 °, the calculation direction is in both x and y directions, the minimum pixel unit is 8 × 8 pixels, and the original image resolution is 300d.
The conditions are pi and A4, and FFT is based on the conventional Fourier transform method.

【0040】[0040]

【表2】 [Table 2]

【0041】表2からもわかるように、本実施例の画像
処理装置では、従来最良とされていた従来例8に比べて
も対象データ数が1/5〜1/10程度で済み、この結
果、演算量,計算コストを大幅に低減することができ
た。また、従来例8に比べてノイズ等の影響の少ない極
めて良好な安定したスキュー補正結果を得ることができ
た。
As can be seen from Table 2, in the image processing apparatus of this embodiment, the number of target data is about 1/5 to 1/10 as compared with the conventional example 8 which has been considered to be the best in the past, and as a result, , The calculation amount and the calculation cost could be reduced significantly. Further, it was possible to obtain a very good and stable skew correction result with less influence of noise and the like as compared with the conventional example 8.

【0042】このように、本実施例では、多段組を含む
文書画像の中の文字列に着目して矩形領域の設定並びに
コラム検出を行ない、この際にコラムの端点(例えば左
端)からある制限された範囲内(図5の例では1つのコ
ラムC1の範囲内)だけでの矩形領域に基づきスキュー
角の検出を行ない、検出されたスキュー角から、各文字
を囲む矩形の領域を、元の画像情報を使うことなく、矩
形の表現に対してのみで補正することにより、極めて安
定した良好なスキュー補正結果を少ない演算量,計算コ
ストで得ることができる。
As described above, in this embodiment, the rectangular area is set and the column is detected by paying attention to the character string in the document image including the multi-column set, and at this time, there is a certain limit from the end point (for example, the left end) of the column. The skew angle is detected based on the rectangular area only within the defined range (in the range of one column C1 in the example of FIG. 5), and the rectangular area surrounding each character is converted into the original area from the detected skew angle. By correcting only the rectangular representation without using image information, a very stable and good skew correction result can be obtained with a small amount of calculation and calculation cost.

【0043】[0043]

【発明の効果】以上に説明したように請求項1,請求項
2記載の発明によれば、文書画像中の前記連結成分に対
してそれぞれ矩形領域を設定した後、文書画像内で矩形
領域の存在する範囲を想定しながら該範囲内で矩形領域
の端点の座標値の所定方向への射影をとり、該射影のヒ
ストグラムを求め、前記射影のヒストグラムのピーク値
に基づき文書の欄(コラム)を検出するようになってい
るので、文書画像が多段組の場合でも、文書画像中の欄
(コラム)を信頼性良く確実に検出することができる。
As described above, according to the first and second aspects of the present invention, after the rectangular area is set for each of the connected components in the document image, the rectangular area is set in the document image. While assuming the existing range, the projection of the coordinate values of the end points of the rectangular region in the predetermined direction is taken within the range, the histogram of the projection is obtained, and the document column (column) is calculated based on the peak value of the projection histogram. Since the detection is performed, even when the document image has a multi-column structure, it is possible to reliably and reliably detect a column in the document image.

【0044】また、請求項3,請求項4記載の発明によ
れば、射影のヒストグラムのピーク値がコラムの端点と
して検出されたときに、該コラムの端点からある制限さ
れた範囲内の矩形領域のみを用いてスキュー角を求める
ようになっているので、文書画像が多段組の場合でも、
スキュー角を少ない演算量,計算コストで容易にかつ安
定して確実に検出することができる。
According to the third and fourth aspects of the invention, when the peak value of the projection histogram is detected as the end point of the column, a rectangular area within a limited range from the end point of the column. Even if the document image is multi-column, the skew angle is calculated using only
The skew angle can be detected easily, stably and reliably with a small amount of calculation and calculation cost.

【0045】また、請求項5記載の発明によれば、上記
スキュー角に基づき、矩形領域に対してスキューの方向
と逆方向に傾いて内接する矩形を構成し、見かけ上回転
処理と同等な処理を施してスキューの補正を行なうよう
になっているので、文書画像が多段組の場合でも、スキ
ュー補正を少ない演算量,計算コストで、容易にかつ安
定して効率良く確実に行なうことができる。
According to the fifth aspect of the invention, based on the skew angle, a rectangle that inscribes inclines in a direction opposite to the direction of the skew with respect to the rectangular area is formed, and the processing is apparently equivalent to the rotation processing. Since the skew is corrected by performing the correction, the skew can be corrected easily, stably, efficiently and surely with a small amount of calculation and a calculation cost even when the document image has a multi-column structure.

【0046】また、請求項6記載の発明によれば、矩形
領域の端点の座標値の所定方向へのヒストグラムに基づ
き、各注目頻度値と該注目頻度値に隣接する頻度値との
双方を利用して真のピーク値を求めるので、偽ピークを
除くことができる。
According to the sixth aspect of the present invention, both the attention frequency value and the frequency value adjacent to the attention frequency value are used based on the histogram of the coordinate values of the end points of the rectangular area in the predetermined direction. Then, the true peak value is obtained to eliminate the false peak.

【0047】また、請求項7記載の発明によれば、ヒス
トグラム算出手段は、文書画像中の矩形に対する座標値
の数を可変に設定可能であって、文書画像の半分程度ま
で読み取り走査した段階で矩形の数が前記座標値の数に
満たない場合には、それまで読み込まれた矩形の数を参
照用の座標値の数と決定し、矩形領域の射影演算を実行
するようになっているので、原稿の中に文字行が少ない
ような場合には、より迅速にかつ効率良くヒストグラム
を求めることができる。
According to the seventh aspect of the invention, the histogram calculation means can set the number of coordinate values for the rectangle in the document image variably, and at the stage of reading and scanning up to about half of the document image. If the number of rectangles is less than the number of coordinate values, the number of rectangles read so far is determined as the number of coordinate values for reference, and the projection operation of the rectangular area is executed. If there are few character lines in the manuscript, the histogram can be obtained more quickly and efficiently.

【0048】また、請求項8記載の発明によれば、スキ
ュー角検出手段は、スキュー角度の算出に際して、矩形
の射影ヒストグラムのピーク値の信頼性を、ヒストグラ
ムの統計量から判定し、ある信頼度を付してスキュー角
度を決定するようになっているので、検出されたスキュ
ー角がどの程度の信頼性を有しているかを客観的に判断
することができる。
According to the eighth aspect of the invention, the skew angle detecting means determines the reliability of the peak value of the rectangular projection histogram from the statistical amount of the histogram when calculating the skew angle, and determines the certain reliability. Since the skew angle is determined by adding, the degree of reliability of the detected skew angle can be objectively determined.

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

【図1】本発明に係る画像処理装置の一実施例の構成図
である。
FIG. 1 is a configuration diagram of an embodiment of an image processing apparatus according to the present invention.

【図2】図1の画像処理装置の処理動作を説明するため
のフローチャートである。
FIG. 2 is a flowchart for explaining a processing operation of the image processing apparatus of FIG.

【図3】スキューして読み取られた文書画像に対する矩
形表現の一例を示す図である。
FIG. 3 is a diagram showing an example of a rectangular representation for a document image read by skewing.

【図4】スキューした文字行に対する矩形表現の一例を
示す図である。
FIG. 4 is a diagram showing an example of a rectangular representation for a skewed character line.

【図5】(a)は文書画像の矩形表現の一例を示す図,
(b)は(a)の文書画像中の画素を垂直方向に射影し
たヒストグラムの一例を示す図である。
FIG. 5A is a diagram showing an example of a rectangular representation of a document image,
(B) is a diagram showing an example of a histogram in which pixels in the document image of (a) are projected in the vertical direction.

【図6】図4に示す各矩形のうちの1つの矩形の拡大図
である。
FIG. 6 is an enlarged view of one of the rectangles shown in FIG.

【図7】ランドスケープ方向に印刷されたスキューのあ
るC−言語のプログラム原稿画像を90度回転したポー
トレート方向に読み取り、連結画像単位で矩形処理した
例を示す図である。
FIG. 7 is a diagram showing an example in which a skewed C-language program original image printed in the landscape direction is read in the portrait direction rotated by 90 degrees and subjected to rectangular processing in units of connected images.

【図8】スキュー角を検出するために図7の各矩形の傾
斜角を水平方向に投影した結果のヒストグラムを示す図
である。
8 is a diagram showing a histogram of the result of horizontally projecting the inclination angle of each rectangle in FIG. 7 to detect the skew angle.

【図9】スキュー角を検出するために図7の各矩形の端
点の一方の座標値を垂直方向に投影した結果のヒストグ
ラムを示す図である。
9 is a diagram showing a histogram of a result of vertically projecting one coordinate value of one end point of each rectangle of FIG. 7 in order to detect a skew angle.

【図10】図8,図9のヒストグラムからスキュー角を
算出し、図7の画像に対しスキューを補正した結果を示
す図である。
10 is a diagram showing a result of calculating a skew angle from the histograms of FIGS. 8 and 9 and correcting the skew for the image of FIG. 7.

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

1 2値化処理部 2 倍率変換部 3 連結成分抽出部 4 矩形領域設定部 5 ヒストグラム算出部 6 検出処理部 8 スキュー補正部 9 スキュー角検出部 1 Binarization processing unit 2 Magnification conversion unit 3 Connected component extraction unit 4 Rectangular area setting unit 5 Histogram calculation unit 6 Detection processing unit 8 Skew correction unit 9 Skew angle detection unit

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 所定の文書画像において所定画素の連結
成分に対して矩形領域を設定する矩形領域設定手段と、
文書画像中の前記連結成分に対してそれぞれ矩形領域を
設定した後、文書画像内で矩形領域の存在する範囲を想
定しながら該範囲内で矩形領域の端点の座標値の所定方
向への射影をとり、該射影のヒストグラムを求めるヒス
トグラム算出手段と、前記射影のヒストグラムのピーク
値を求め、該ピーク値に基づき文書の欄(コラム)を検
出するコラム検出手段とを備えていることを特徴とする
画像処理装置。
1. A rectangular area setting means for setting a rectangular area for a connected component of a predetermined pixel in a predetermined document image,
After setting a rectangular area for each of the connected components in the document image, assuming the range in which the rectangular area exists in the document image, project the coordinate values of the end points of the rectangular area in the range in a predetermined direction. Further, it is provided with a histogram calculating means for obtaining the histogram of the projection and a column detecting means for obtaining a peak value of the histogram of the projection and detecting a column of the document based on the peak value. Image processing device.
【請求項2】 請求項1記載の画像処理装置において、
前記コラム検出手段は、前記射影のヒストグラムのピー
ク値をコラムの端点として検出するようになっているこ
とを特徴とする画像処理装置。
2. The image processing apparatus according to claim 1,
An image processing apparatus, wherein the column detecting means is adapted to detect a peak value of the projection histogram as an end point of a column.
【請求項3】 請求項1または請求項2記載の画像処理
装置において、射影のヒストグラムのピーク値がコラム
の端点として検出されたときに、該コラムの端点からあ
る制限された範囲内の矩形領域のみを用いてスキュー角
を求めるスキュー角検出手段をさらに備えていることを
特徴とする画像処理装置。
3. The image processing apparatus according to claim 1, wherein when a peak value of a projection histogram is detected as an end point of a column, a rectangular area within a limited range from the end point of the column. An image processing apparatus further comprising a skew angle detection unit that obtains a skew angle by using only the above.
【請求項4】 請求項3記載の画像処理装置において、
前記スキュー角検出手段は、前記制限された範囲内に存
在する矩形領域の組において、各矩形領域の端点の座標
を種々の方位に投影したヒストグラム(並び)を求め、
該ヒストグラムのピ−ク値が最大となる角度をスキュー
角として検出するようになっていることを特徴とする画
像処理装置。
4. The image processing device according to claim 3,
The skew angle detection means obtains a histogram (arrangement) in which the coordinates of the end points of each rectangular region are projected in various directions in a set of rectangular regions existing within the limited range,
An image processing apparatus, wherein an angle at which the peak value of the histogram is maximum is detected as a skew angle.
【請求項5】 請求項3記載の画像処理装置において、
前記スキュー角に基づき、スキューの方向と逆方向に、
連結領域を表わす矩形の座標値に所定の演算を加え、前
記矩形領域に前記スキュー角だけ傾いて内接する新たな
矩形を求めることにより、見かけ上、正規なスキュー補
正を行なうことを特徴とする画像処理装置。
5. The image processing apparatus according to claim 3,
Based on the skew angle, in the direction opposite to the skew direction,
An image characterized by performing a normal skew correction by apparently performing a normal skew correction by applying a predetermined operation to the coordinate values of the rectangles representing the connected regions to obtain a new rectangle that is inscribed in the rectangular region at the skew angle. Processing equipment.
【請求項6】 請求項1記載の画像処理装置において、
前記矩形領域の端点の座標値の所定方向へのヒストグラ
ムに基づき、各注目頻度値と該注目頻度値に隣接する頻
度値との双方を利用して真のピーク値を求めることを特
徴とする画像処理装置。
6. The image processing apparatus according to claim 1,
An image characterized in that a true peak value is obtained using both each attention frequency value and a frequency value adjacent to the attention frequency value based on a histogram of the coordinate values of the end points of the rectangular area in a predetermined direction. Processing equipment.
【請求項7】 請求項1記載の画像処理装置において、
前記ヒストグラム算出手段は、文書画像中の矩形に対す
る座標値の数を可変に設定可能であって、文書画像の半
分程度まで読み取り走査した段階で矩形の数が前記座標
値の数に満たない場合には、それまでに読み込まれた矩
形の数を参照用の座標値の数と決定し、矩形領域の射影
演算を実行するようになっていることを特徴とする画像
処理装置。
7. The image processing apparatus according to claim 1,
The histogram calculation means can variably set the number of coordinate values for rectangles in the document image, and when the number of rectangles is less than the number of coordinate values at the stage of reading and scanning up to about half of the document image. The image processing apparatus is characterized in that the number of rectangles read so far is determined as the number of coordinate values for reference, and a projection operation of a rectangular area is executed.
【請求項8】 請求項3記載の画像処理装置において、
前記スキュー角検出手段は、スキュー角度の算出に際し
て、矩形の射影ヒストグラムのピーク値の信頼性を、ヒ
ストグラムの統計量から判定し、ある信頼度を付してス
キュー角度を決定するようになっていることを特徴とす
る画像処理装置。
8. The image processing apparatus according to claim 3,
When calculating the skew angle, the skew angle detecting means determines the reliability of the peak value of the rectangular projection histogram from the statistical amount of the histogram, and determines the skew angle with a certain degree of reliability. An image processing device characterized by the above.
JP36027392A 1992-12-28 1992-12-28 Image processing device Expired - Lifetime JP3303246B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP36027392A JP3303246B2 (en) 1992-12-28 1992-12-28 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP36027392A JP3303246B2 (en) 1992-12-28 1992-12-28 Image processing device

Publications (2)

Publication Number Publication Date
JPH06203202A true JPH06203202A (en) 1994-07-22
JP3303246B2 JP3303246B2 (en) 2002-07-15

Family

ID=18468682

Family Applications (1)

Application Number Title Priority Date Filing Date
JP36027392A Expired - Lifetime JP3303246B2 (en) 1992-12-28 1992-12-28 Image processing device

Country Status (1)

Country Link
JP (1) JP3303246B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07105310A (en) * 1993-10-05 1995-04-21 Ricoh Co Ltd Method for detecting tilt of picture and method for processing table
JP2002541598A (en) * 1999-04-08 2002-12-03 リットン・システムズ・インコーポレーテッド Correction of rotation and identification of duplicate images by Fourier transform correlation
JP2002373341A (en) * 2001-06-15 2002-12-26 Ricoh Co Ltd Device and method for detecting half-tone dot meshing area, program and storage medium
US7016552B2 (en) 2000-09-07 2006-03-21 Fuji Xerox Co., Ltd. Image processing device, image processing method, and recording medium storing image processing program
US7667876B2 (en) 2004-03-03 2010-02-23 Ricoh Company, Ltd. Generating a normalized image from an original image
JP2011003181A (en) * 2009-06-17 2011-01-06 Kyocera Mita Corp Original inclination angle detection method and original inclination angle detection device
US11102375B2 (en) 2018-10-31 2021-08-24 Ricoh Company, Ltd. Sheet reading apparatus for detecting the shadow of a conveyed sheet to determine an inclination

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07105310A (en) * 1993-10-05 1995-04-21 Ricoh Co Ltd Method for detecting tilt of picture and method for processing table
JP2002541598A (en) * 1999-04-08 2002-12-03 リットン・システムズ・インコーポレーテッド Correction of rotation and identification of duplicate images by Fourier transform correlation
US7016552B2 (en) 2000-09-07 2006-03-21 Fuji Xerox Co., Ltd. Image processing device, image processing method, and recording medium storing image processing program
JP2002373341A (en) * 2001-06-15 2002-12-26 Ricoh Co Ltd Device and method for detecting half-tone dot meshing area, program and storage medium
US7667876B2 (en) 2004-03-03 2010-02-23 Ricoh Company, Ltd. Generating a normalized image from an original image
JP2011003181A (en) * 2009-06-17 2011-01-06 Kyocera Mita Corp Original inclination angle detection method and original inclination angle detection device
US11102375B2 (en) 2018-10-31 2021-08-24 Ricoh Company, Ltd. Sheet reading apparatus for detecting the shadow of a conveyed sheet to determine an inclination

Also Published As

Publication number Publication date
JP3303246B2 (en) 2002-07-15

Similar Documents

Publication Publication Date Title
US5410611A (en) Method for identifying word bounding boxes in text
US5539841A (en) Method for comparing image sections to determine similarity therebetween
JP3308032B2 (en) Skew correction method, skew angle detection method, skew correction device, and skew angle detection device
US8144989B2 (en) Methods and systems for identifying text orientation in a digital image
US8023741B2 (en) Methods and systems for detecting numerals in a digital image
JPH11219407A (en) Document image recognizing device and storage medium for document image recognizing program
US8208725B2 (en) Methods and systems for identifying text orientation in a digital image
US20020051575A1 (en) Method and apparatus for recognizing text in an image sequence of scene imagery
US8331670B2 (en) Method of detection document alteration by comparing characters using shape features of characters
US6798906B1 (en) Image processing apparatus and method including line segment data extraction
WO2014160433A2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
US20120274991A1 (en) System and method for document orientation detection
JPH03201866A (en) Decision of picture skew angle from data including data of compressed form
EP2270746A2 (en) Method for detecting alterations in printed document using image comparison analyses
US9959475B2 (en) Table data recovering in case of image distortion
Kapoor et al. A new algorithm for skew detection and correction
US9288362B2 (en) Technique for skew detection of printed arabic documents
JPH0737103A (en) Inclination angle detection device
US6771842B1 (en) Document image skew detection method
JP2008217833A (en) Document image recognition system and storage medium for document image recognition program
US6683983B1 (en) Document-inclination detector
CN115619656A (en) Digital file deviation rectifying method and system
JPH06203202A (en) Image processor
CN112419207A (en) Image correction method, device and system
Lehal et al. A range free skew detection technique for digitized Gurmukhi script documents

Legal Events

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

Free format text: PAYMENT UNTIL: 20080510

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090510

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100510

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110510

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120510

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20120510

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130510

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

Year of fee payment: 11