JPH07105310A - Method for detecting tilt of picture and method for processing table - Google Patents
Method for detecting tilt of picture and method for processing tableInfo
- Publication number
- JPH07105310A JPH07105310A JP5248914A JP24891493A JPH07105310A JP H07105310 A JPH07105310 A JP H07105310A JP 5248914 A JP5248914 A JP 5248914A JP 24891493 A JP24891493 A JP 24891493A JP H07105310 A JPH07105310 A JP H07105310A
- Authority
- JP
- Japan
- Prior art keywords
- rectangle
- integrated
- black
- inclination
- 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
Links
- 238000000034 method Methods 0.000 title claims description 62
- 238000001514 detection method Methods 0.000 claims abstract description 20
- 238000003672 processing method Methods 0.000 claims description 2
- 230000010354 integration Effects 0.000 abstract description 32
- 239000000284 extract Substances 0.000 abstract description 14
- 238000000605 extraction Methods 0.000 description 26
- 238000010586 diagram Methods 0.000 description 14
- 235000020281 long black Nutrition 0.000 description 8
- 230000003247 decreasing effect Effects 0.000 description 3
- 230000000630 rising effect Effects 0.000 description 3
- 238000003702 image correction Methods 0.000 description 2
- 230000008719 thickening Effects 0.000 description 2
- 241000321384 Gymnadenia rhellicani Species 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005562 fading Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- Character Input (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、イメージスキャナ等の
画像入力機器によって入力した文書もしくは帳票(これ
らを本明細書では文書類と総称する)の画像の処理に係
り、特に、罫線を含む文書類の画像の傾きの検出及び画
像中の表領域の処理に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the processing of images of a document or a form (these are collectively referred to as documents in this specification) input by an image input device such as an image scanner, and more particularly to a document including ruled lines. The present invention relates to detection of inclination of an image of a document and processing of a table area in the image.
【0002】[0002]
【従来の技術】文字認識装置において文書類の画像を処
理する場合、入力された画像が傾いていると認識率等に
悪い影響がある。複写機やファクシミリ装置、スキャナ
等の画像入力装置一般においても、入力画像の傾きは好
ましくない。2. Description of the Related Art When an image of a document is processed in a character recognition device, if the input image is tilted, the recognition rate and the like are adversely affected. Even in a general image input device such as a copying machine, a facsimile device, and a scanner, the inclination of the input image is not preferable.
【0003】入力した文書画像の傾きを検出する方法と
して、文書画像より文字塊ブロックを抽出し、文字塊ブ
ロック間の配置関係や中心等の特徴から、傾きを求める
方法が知られている(特開平3−62284号)。As a method of detecting the inclination of an input document image, a method is known in which character block blocks are extracted from the document image and the inclination is obtained from the arrangement relationship between the character block blocks and the characteristics such as the center. Kaihei 3-62284).
【0004】[0004]
【発明が解決しようとする課題】しかし、特開平3−6
2284号の方法は、文字塊を抽出できること、つまり
入力画像中に文字が存在することが前提である。このた
め、罫線のフォーマットデータのみからなる画像の傾き
を検出することができない。However, Japanese Unexamined Patent Publication (Kokai) No. 3-6.
The method of No. 2284 is based on the premise that a character block can be extracted, that is, a character exists in the input image. For this reason, it is not possible to detect the inclination of the image formed only of the ruled line format data.
【0005】よって本発明の目的は、罫線を含む入力画
像の傾きを、それに文字が含まれているか否かを問わず
に、検出することができる画像傾き検出方法を提供する
ことにある。本発明のもう一つの目的は、傾いて入力さ
れた画像上の表中の文字を正確に認識できる表処理方法
を提供することにある。Therefore, it is an object of the present invention to provide an image inclination detecting method capable of detecting the inclination of an input image including ruled lines regardless of whether or not it contains characters. Another object of the present invention is to provide a table processing method capable of accurately recognizing a character in a table on an image that is tilted and input.
【0006】[0006]
【課題を解決するための手段】上記目的を達成するため
に、請求項1の発明は、入力画像上の一定値以上の長さ
の黒ランを抽出し、抽出した黒ランで予め定められた距
離内にある黒ランを、それら全てを包含する矩形に統合
し、この黒ランの統合の際に統合される黒ランの相互の
位置関係によって入力画像の傾きの方向を判定すること
を特徴とするものである。In order to achieve the above-mentioned object, the invention of claim 1 extracts a black run having a length equal to or more than a certain value on an input image, and is predetermined by the extracted black run. A feature is that black runs within a distance are integrated into a rectangle that includes all of them, and the direction of the inclination of the input image is determined by the mutual positional relationship of the black runs that are integrated when the black runs are integrated. To do.
【0007】請求項2の発明は、入力画像上の一定値以
上の長さの黒ランを抽出し、抽出した黒ランで予め定め
られた距離内にある黒ランを、それら全てを包含する矩
形に統合し、黒ランを統合した矩形で予め定められた距
離内にあるものを、それら全てを包含する罫線矩形に統
合し、前記矩形の統合の際に統合される矩形の相互の位
置関係によって、入力画像の傾きの方向を判定すること
を特徴とするものである。According to a second aspect of the present invention, a black run having a length equal to or longer than a certain value on the input image is extracted, and a black run within a predetermined distance by the extracted black run is included in the rectangle. , Which are within a predetermined distance of the black run, and which are within a predetermined distance, are integrated into a ruled line rectangle that includes all of them, and depending on the mutual positional relationship of the rectangles that are integrated when the rectangles are integrated. The feature is that the direction of inclination of the input image is determined.
【0008】請求項3の発明は、入力画像上の一定値以
上の長さの黒ランを抽出し、抽出した黒ランで予め定め
られた距離内にある黒ランを、それら全てを包含する矩
形に統合し、黒ランを統合した矩形で予め定められた距
離内にあるものを、それら全てを包含する罫線矩形に統
合し、前記黒ランの統合の際に統合される黒ランの相互
の位置関係、及び、前記矩形の統合の際に統合される矩
形の相互の位置関係によって、入力画像の傾きの方向を
判定することを特徴とするものである。According to a third aspect of the present invention, a black run having a length equal to or larger than a certain value on the input image is extracted, and a black run within a predetermined distance by the extracted black run is included in a rectangle including all the black runs. , The black run integrated rectangles within a predetermined distance are integrated into a ruled line rectangle that includes all of them, and the positions of the black runs are integrated with each other when the black run is integrated. The inclination direction of the input image is determined based on the relationship and the mutual positional relationship of the rectangles that are integrated when the rectangles are integrated.
【0009】請求項4の発明は、請求項1または3の発
明の方法において、統合される黒ランの始点及び終点の
座標の大小比較によって傾き方向を判定することを特徴
とするものである。According to a fourth aspect of the present invention, in the method of the first or third aspect, the inclination direction is determined by comparing the coordinates of the start point and the end point of the integrated black run.
【0010】請求項5の発明は、請求項2または3の発
明の方法において、統合される矩形の始点及び終点の座
標の大小比較によって傾きの方向を判定することを特徴
とするものである。According to a fifth aspect of the present invention, in the method of the second or third aspect, the direction of the inclination is determined by comparing the coordinates of the start point and the end point of the integrated rectangle.
【0011】請求項6の発明は、請求項1,3または4
の発明の方法において、統合される黒ランの複数ペアに
ついて、各ペア毎に傾き方向の判定を行ない、傾きの方
向毎にその判定回数を計数し、計数した判定回数の多い
ほうの傾きの方向を黒ランによる傾き方向の判定結果と
することを特徴とするものである。The invention of claim 6 is the invention of claim 1, 3 or 4.
In the method of the invention, for a plurality of pairs of black runs to be integrated, the inclination direction is determined for each pair, the number of determinations is counted for each inclination direction, and the inclination direction with the greater number of determinations is counted. Is the result of the determination of the tilt direction by the black run.
【0012】請求項7の発明は、請求項6の発明の方法
において、傾きの判定を、最も長い一つの矩形の範囲に
関して行なうことを特徴とするものである。According to a seventh aspect of the invention, in the method of the sixth aspect of the invention, the inclination is determined with respect to one longest rectangular range.
【0013】請求項8の発明は、請求項2,3または5
の発明の方法において、統合される矩形の複数ペアにつ
いて、各ペア毎に傾き方向の判定を行ない、傾きの方向
毎にその判定回数を計数し、計数した判定回数の多いほ
うの傾きの方向を矩形による傾き方向の判定結果とする
ことを特徴とするものである。The invention of claim 8 is the invention of claim 2, 3 or 5.
In the method of the invention, for a plurality of pairs of integrated rectangles, the inclination direction is determined for each pair, the number of determinations is counted for each inclination direction, and the inclination direction with the larger number of determinations is determined. It is characterized in that the result of the determination of the inclination direction by a rectangle is used.
【0014】請求項9の発明は、請求項8の発明の方法
において、傾きの判定を、最も長い一つの罫線矩形の範
囲に関して行なうことを特徴とするものである。According to a ninth aspect of the present invention, in the method of the eighth aspect, the inclination is determined with respect to one longest ruled line rectangle.
【0015】請求項10の発明は、請求項2または3の
発明の方法において、罫線矩形の内部の黒画素数を該罫
線矩形の長手方向のサイズで除した値を、該罫線矩形の
短手方向のサイズより減算し、該減算後のサイズと該罫
線矩形の長手方向のサイズとから、入力画像の傾き角度
を求めることを特徴とするものである。According to a tenth aspect of the present invention, in the method of the second or third aspect, a value obtained by dividing the number of black pixels inside the ruled line rectangle by the size of the ruled line rectangle in the longitudinal direction is the width of the ruled line rectangle. It is characterized in that it is subtracted from the size in the direction and the tilt angle of the input image is obtained from the size after the subtraction and the size in the longitudinal direction of the ruled line rectangle.
【0016】請求項11の発明は、請求項1の発明の方
法において、矩形の内部の黒画素数を該矩形の長手方向
のサイズで除した値を、該矩形の短手方向のサイズより
減算し、該減算後のサイズと該矩形の長手方向のサイズ
とから、入力画像の傾き角度を求めることを特徴とする
ものである。According to the invention of claim 11, in the method of claim 1, the value obtained by dividing the number of black pixels in the rectangle by the size of the rectangle in the longitudinal direction is subtracted from the size of the rectangle in the lateral direction. Then, the inclination angle of the input image is obtained from the size after the subtraction and the size in the longitudinal direction of the rectangle.
【0017】請求項12の発明は、入力画像の傾きの方
向を請求項1乃至9のいずれか1項の発明の方法によっ
て検出するとともに、該入力画像の傾きの角度を請求項
10または11の発明の方法によって検出し、該検出し
た傾きの方向及び角度に基づいて該入力画像の傾きを補
正した画像を作成し、該傾き補正画像より罫線の矩形を
抽出し、該抽出した罫線の矩形の座標より表の枠を認識
し、該認識した枠の内部の文字画像を該傾き補正画像よ
り切り出して文字認識をすることを特徴とするものであ
る。According to a twelfth aspect of the present invention, the inclination direction of the input image is detected by the method according to any one of the first to ninth aspects, and the inclination angle of the input image is detected according to the tenth or eleventh aspect. An image in which the inclination of the input image is corrected based on the detected direction and angle of the detected inclination is created by the method of the invention, a ruled line rectangle is extracted from the tilt corrected image, and the extracted ruled line rectangle is extracted. It is characterized in that the frame of the table is recognized from the coordinates, and the character image inside the recognized frame is cut out from the tilt correction image for character recognition.
【0018】[0018]
【作用】請求項1乃至11の各項の発明の方法によれ
ば、入力画像上の罫線を基準として、画像の傾き方向を
検出でき、さらに請求項10または11の発明の方法に
よれば、入力画像の傾きの角度も検出できる。このよう
に、入力画像上に罫線が存在すれば、入力画像の傾きを
的確に検出することができるため、例えば、文字が存在
しない表のみの帳票等でも、その画像の傾き検出が可能
となる。According to the method of the invention of each of claims 1 to 11, the tilt direction of the image can be detected with reference to the ruled line on the input image. Further, according to the method of the invention of claim 10 or 11, The angle of inclination of the input image can also be detected. In this way, if there is a ruled line on the input image, the inclination of the input image can be accurately detected. Therefore, for example, even with a form such as a table without characters, the inclination of the image can be detected. .
【0019】請求項1または2の発明の方法は、黒ラン
の統合の際に統合される黒ランの位置関係、または黒ラ
ンの統合矩形の統合の際に統合される矩形の位置関係に
基づいて画像の傾きを検出するが、黒ランの矩形統合
や、その矩形の統合処理は表処理で一般に必要な処理ス
テップであるため、表処理に適用するのに無駄のない合
理的な方法である。The method according to the first or second aspect of the invention is based on the positional relationship of the black runs that are integrated when the black runs are integrated, or the positional relationship of the rectangles that are integrated when the integrated rectangles of the black runs are integrated. The inclination of the image is detected by using this method, but the black run rectangle integration and the rectangle integration processing are generally necessary processing steps in table processing, and are therefore rational methods that are not wasted in applying to table processing. .
【0020】請求項3の発明の方法によれば、罫線を構
成する黒ランの位置関係に加えて、罫線を構成する黒ラ
ンの統合矩形の位置関係を利用して、傾き方向判定に利
用する。したがって、黒ランの位置関係のみを利用した
方法に比べ、より正確な傾き方向検出が可能である。According to the method of the third aspect of the present invention, in addition to the positional relationship of the black runs forming the ruled line, the positional relationship of the integrated rectangles of the black runs forming the ruled line is utilized for the tilt direction determination. . Therefore, it is possible to detect the tilt direction more accurately as compared with the method using only the positional relationship of the black runs.
【0021】請求項4または5の発明の方法によれば、
黒ランまたは矩形の始点及び終点の座標の大小関係に基
づき、極めて単純なルールで傾き方向を判定することが
できる。According to the method of the invention of claim 4 or 5,
Based on the magnitude relationship between the coordinates of the start point and the end point of the black run or the rectangle, the tilt direction can be determined by an extremely simple rule.
【0022】請求項6または8の発明の方法によれば、
罫線を構成する黒ランまたは黒ラン統合矩形の複数のペ
アの位置関係に基づいて傾き方向を判定するため、ノイ
ズによる影響などを回避し、安定確実に傾き方向を検出
できる。According to the method of the invention of claim 6 or 8,
Since the tilt direction is determined based on the positional relationship of a plurality of pairs of black runs or black run integrated rectangles that form the ruled line, it is possible to avoid the influence of noise and detect the tilt direction in a stable and reliable manner.
【0023】請求項7または9の発明によれば、入力画
像上の最も長い罫線を基準として傾き方向を判定するこ
とになるため、正確な判定結果を得られる。また、一つ
の罫線の範囲のみに着目するので、全ての罫線を対象す
る場合に比べ処理の負担を軽減できる。According to the invention of claim 7 or 9, since the inclination direction is determined with reference to the longest ruled line on the input image, an accurate determination result can be obtained. Further, since attention is paid only to the range of one ruled line, the processing load can be reduced as compared with the case where all ruled lines are targeted.
【0024】請求項10または11の発明の方法によれ
ば、入力画像の傾きによる黒ラン統合矩形またはその統
合矩形の太りを考慮して、入力画像の傾き角度を精度よ
く検出することができる。According to the method of the tenth or eleventh aspect of the present invention, the inclination angle of the input image can be accurately detected in consideration of the black run integrated rectangle or the thickening of the integrated rectangle due to the inclination of the input image.
【0025】請求項12の発明によれば、入力画像の傾
きを検出して、入力画像の傾きを補正してから罫線を抽
出して表の枠を認識し、枠内の文字画像を傾き補正画像
から切り出すので、傾いて入力された画像上の表中の文
字を正確に認識することができる。According to the twelfth aspect of the present invention, the inclination of the input image is detected, the inclination of the input image is corrected, the ruled lines are extracted, the frame of the table is recognized, and the character image in the frame is corrected for inclination. Since the image is cut out from the image, it is possible to accurately recognize the characters in the table on the image that are tilted and input.
【0026】[0026]
【実施例】以下、本発明の実施例について図面を用い説
明する。Embodiments of the present invention will be described below with reference to the drawings.
【0027】<実施例1>図1は、本実施例を説明する
ためのブロック図である。図1において、2値画像入力
部(イメージスキャナ等)101によって、罫線を含む
文書類の画像が読み取られ2値イメージデータとして入
力される。入力画像の2値イメージデータは、2値イメ
ージメモリ102に格納される。<First Embodiment> FIG. 1 is a block diagram for explaining the present embodiment. In FIG. 1, an image of a document including ruled lines is read by a binary image input unit (image scanner or the like) 101 and input as binary image data. The binary image data of the input image is stored in the binary image memory 102.
【0028】黒ラン抽出部103は、2値イメージメモ
リ102内の2値イメージデータをスキャンし、主走査
方向または副走査方向に一定値以上の長さを持つ黒ラン
を抽出する。そして、抽出した黒ランのデータ(始点、
終点の座標)を黒ランメモリ104に格納する。The black run extraction unit 103 scans the binary image data in the binary image memory 102 and extracts a black run having a length of a certain value or more in the main scanning direction or the sub scanning direction. Then, the extracted black run data (starting point,
The coordinates of the end point) are stored in the black run memory 104.
【0029】矩形統合部105において、黒ランメモリ
104内の黒ランデータを参照し、主走査方向または副
走査方向に長い黒ランに対して、予め定められた距離の
範囲内にある黒ランを、それらを全て包含する矩形に統
合する処理を行ない、黒ランの統合矩形のデータ(頂点
座標等)を矩形メモリ106に格納する。また、統合す
る1対の黒ランのデータ(始点、終点の座標)を矩形メ
モリ106の特定領域へ格納する。In the rectangular integration unit 105, the black run data in the black run memory 104 is referred to, and black runs within a predetermined distance range with respect to a long black run in the main scanning direction or the sub-scanning direction. Then, a process of integrating them into a rectangle including all of them is performed, and the data of the integrated rectangle of the black run (vertex coordinates, etc.) is stored in the rectangle memory 106. Further, a pair of integrated black run data (start point and end point coordinates) is stored in a specific area of the rectangular memory 106.
【0030】傾き検出部107は、矩形統合部による黒
ランの統合処理中に、統合される黒ランのペアのデータ
を矩形メモリ106内の特定領域より受け取って、統合
される黒ランのペアの相互の位置関係を調べることによ
って、2値画像入力部101に対する相対的な入力画像
の傾きの方向を判定する。この傾き方向の判定方法の例
を次に示す。The inclination detecting unit 107 receives the data of the black run pair to be integrated from a specific area in the rectangular memory 106 during the black run integrating process by the rectangle integrating unit, and detects the data of the black run pair to be integrated. By examining the mutual positional relationship, the direction of inclination of the input image relative to the binary image input unit 101 is determined. An example of the method of determining the tilt direction will be described below.
【0031】(例1)主走査方向罫線に着目した方法 主走査方向の黒ランの統合の際に、図2に示すように、
統合される主走査方向の長い2本の黒ランLH1,LH
2の始点または終点のX座標を比較する。図2(a)に
示すように、上側の黒ランLH1の始点のX座標(xs
1)と下側の黒ランLH2の始点のX座標(xs2)との
関係が xs1<xs2 ならば「右下がり」と判定し、また
図2(b)に示すように 黒ランLH1の終点のX座標
(xe1)と黒ランLH2の終点のX座標(xe2)が xe
1>xe2 ならば「右上がり」と判定する。そのいずれで
もない場合には、傾きなしと判定する。Example 1 Method Focusing on Ruled Lines in the Main Scanning Direction When integrating black runs in the main scanning direction, as shown in FIG.
Two long black runs LH1 and LH that are integrated in the main scanning direction
Compare the X coordinates of the start or end points of 2. As shown in FIG. 2A, the X coordinate (xs of the start point of the upper black run LH1
If the relationship between 1) and the X coordinate (xs2) of the starting point of the lower black run LH2 is xs1 <xs2, it is determined as “downward right”, and as shown in FIG. X coordinate (xe1) and X coordinate (xe2) of the end point of black run LH2 are xe
If 1> xe2, it is determined to be "upward". If none of these, it is determined that there is no inclination.
【0032】なお、この判定を、統合される黒ランの複
数ペアについて行ない、例えば、各ペアの判定結果の多
数決により最終的な判定結果を決めてもよい。あるい
は、右下がり、右上がりのそれぞれの判定回数をカウン
トし、所定値に先に到達した傾き方向を最終的な判定結
果としてもよい。Note that this determination may be performed on a plurality of pairs of black runs to be integrated, and the final determination result may be determined by, for example, the majority of the determination results of each pair. Alternatively, it is also possible to count the number of times of each of the downward sloping and upward sloping determinations and use the tilt direction that has reached the predetermined value first as the final determination result.
【0033】(例2)副走査方向罫線に着目した方法 副走査方向の黒ランの統合の際に、図3に示すように、
統合される副走査方向の長い2本の黒ランLV1,LV
2の始点または終点のY座標を比較する。図3(a)に
示すように、右側の黒ランLV1の始点のY座標(Ys
1)と下側の黒ランLV2の始点のY座標(Ys2)との
関係が Ys1<Ys2 ならば「右下がり」と判定し、また
図3(b)に示すように、黒ランLV1の終点のY座標
(Ye1)と黒ランLV2の終点のY座標(Ye2)が、
Ye1>Ye2 ならば「右上がり」と判定する。そのいず
れでもない場合には、傾きなしと判定する。(Example 2) Method Focusing on Ruled Lines in Sub-scanning Direction When integrating black runs in the sub-scanning direction, as shown in FIG.
Two long black runs LV1 and LV integrated in the sub-scanning direction
Compare the Y coordinates of the start or end points of 2. As shown in FIG. 3A, the Y coordinate of the start point of the right black run LV1 (Ys
If the relationship between 1) and the Y coordinate (Ys2) of the starting point of the lower black run LV2 is Ys1 <Ys2, it is determined to be “downward right”, and as shown in FIG. 3B, the end point of the black run LV1. Y coordinate of (Ye1) and the Y coordinate of the end point of the black run LV2 (Ye2) are
If Ye1> Ye2, it is determined as “upward to the right”. If none of these, it is determined that there is no inclination.
【0034】なお、この判定を、統合される黒ランの複
数ペアについて行ない、例えば、各ペアの判定結果の多
数決により最終的な判定結果を決めてもよい。あるい
は、右下がり、右上がりのそれぞれの判定回数をカウン
トし、所定値に先に到達した傾き方向を最終的な判定結
果としてもよい。Note that this determination may be performed on a plurality of pairs of black runs to be integrated, and the final determination result may be determined by, for example, a majority of the determination results of each pair. Alternatively, it is also possible to count the number of times of each of the downward sloping and upward sloping determinations and use the tilt direction that has reached the predetermined value first as the final determination result.
【0035】また、主走査方向の黒ランの統合矩形と副
走査方向の黒ランの統合矩形の両方が得られる場合に、
主、副各走査方向の黒ランによる傾き判定の結果が一致
した場合に判定結果を有効とし、不一致の場合に判定不
能とする等の方法を採ることもできる。あるいは、主、
副走査各方向の判定結果の確からしさを求めておき、各
方向の判定結果が不一致のときには、確からしさの高い
方の判定結果を最終判定結果とする等の方法をとること
ができる。When both the integrated rectangle of black runs in the main scanning direction and the integrated rectangle of black runs in the sub-scanning direction are obtained,
It is also possible to adopt a method in which the determination result is validated when the results of the inclination determination by the black runs in the main and sub scanning directions match, and when the results do not match, the determination cannot be performed. Or Lord,
Probability of the determination result in each sub-scanning direction is obtained, and when the determination results in each direction do not match, the determination result with the higher probability is used as the final determination result.
【0036】<実施例2>図4は、本実施例を説明する
ためのブロック図である。図4において、2値画像入力
部(イメージスキャナ等)401によって、罫線を含む
文書類の画像が読み取られ2値イメージデータとして2
値イメージメモリ402に格納される。<Embodiment 2> FIG. 4 is a block diagram for explaining the present embodiment. In FIG. 4, an image of a document including ruled lines is read by a binary image input unit (image scanner or the like) 401, and binary image data is converted into binary image data.
It is stored in the value image memory 402.
【0037】黒ラン抽出部403は、2値イメージメモ
リ402内の2値イメージデータをスキャンし、主走査
方向または副走査方向に一定値以上の長さを持つ黒ラン
を抽出する。そして、抽出した黒ランのデータ(始点、
終点の座標)を黒ランメモリ404に格納する。The black run extraction unit 403 scans the binary image data in the binary image memory 402 and extracts a black run having a length of a certain value or more in the main scanning direction or the sub scanning direction. Then, the extracted black run data (starting point,
The coordinates of the end point) are stored in the black run memory 404.
【0038】矩形統合部405において、黒ランメモリ
404内の黒ランデータを参照し、主走査方向または副
走査方向に長い黒ランに対して、予め定められた距離の
範囲内にある黒ランを、それらを全て包含する矩形に統
合する処理を行ない、黒ランの統合矩形のデータ(頂点
座標等)を矩形メモリ406に格納する。In the rectangular integration section 405, the black run data in the black run memory 404 is referred to, and black runs within a predetermined distance range with respect to a long black run in the main scanning direction or the sub-scanning direction. Then, a process of integrating them into a rectangle including all of them is performed, and data of the integrated rectangle of the black run (vertex coordinates, etc.) is stored in the rectangle memory 406.
【0039】このような主、副各走査方向の黒ランの統
合処理によって、罫線を構成する黒ランの殆どを統合す
ることができる。しかし、イメージスキャナ等で入力し
た文書類の画像では、罫線の交差、罫線のかすれ等によ
って、罫線の切れが生じることが少なからずある。By such a black run integration process in the main and sub scanning directions, most of the black runs forming the ruled line can be integrated. However, in images of documents input by an image scanner or the like, ruled lines are often broken due to ruled line intersections, ruled line fading, and the like.
【0040】このような切れを補正して本来の罫線を抽
出するため、罫線矩形抽出部407において、矩形メモ
リ406内の主走査方向黒ランの統合矩形及び副走査方
向黒ランの統合矩形のそれぞれに対して、罫線矩形統合
を行なう。すなわち、主走査方向の長い黒ランの統合矩
形について、予め定められた距離の範囲内にある矩形
を、それら全て包含する矩形(主走査方向罫線矩形)に
統合する。同様に、副走査方向に長い黒ランの統合矩形
について、予め定められた距離の範囲内にある矩形を、
それら全てを包含する矩形(副走査方向罫線矩形)に統
合する。そして、抽出した罫線矩形のデータ(頂点座標
等)を罫線矩形メモリ408に格納する。また、統合す
る矩形のデータ(頂点座標等)を、罫線矩形メモリ40
8の特定領域に格納する。In order to correct such breaks and extract the original ruled lines, in the ruled line rectangle extraction unit 407, the integrated rectangle of the main scanning direction black run and the integrated rectangle of the sub scanning direction black run in the rectangular memory 406 are respectively extracted. For this, ruled line rectangle integration is performed. That is, regarding the integrated rectangle of long black runs in the main scanning direction, the rectangles within the range of the predetermined distance are integrated into a rectangle that includes all of them (main scanning direction ruled line rectangle). Similarly, for a black run integrated rectangle that is long in the sub-scanning direction, a rectangle within a range of a predetermined distance is
It is integrated into a rectangle that includes all of them (ruled line rectangle in the sub-scanning direction). Then, the extracted ruled line rectangle data (vertex coordinates, etc.) is stored in the ruled line rectangle memory 408. In addition, the data of the rectangle to be integrated (vertex coordinates, etc.) is stored in the ruled line rectangle memory 40.
8 specific areas.
【0041】傾き検出部409において、矩形統合部4
04及び罫線矩抽出部407の統合処理の際に、黒ラン
メモリ404内のデータ及び罫線矩形メモリ408内の
特定領域のデータを参照し、統合された黒ランのペアの
位置関係及び統合された矩形のペアの位置関係を調べる
ことによって、2値画像入力部401に対する相対的な
入力画像の傾きの方向を判定する。この傾き方向の判定
方法の例を次に示す。In the inclination detection unit 409, the rectangle integration unit 4
04 and the ruled line quadrature extraction unit 407, the data in the black run memory 404 and the data in the specific area in the ruled line rectangle memory 408 are referred to, and the positional relationship of the integrated black run pairs and the integrated data are combined. By examining the positional relationship of the pair of rectangles, the direction of inclination of the input image relative to the binary image input unit 401 is determined. An example of the method of determining the tilt direction will be described below.
【0042】(例1)主走査方向罫線に着目した方法 主走査方向の長い黒ランの矩形統合の際、統合される黒
ランのペアについて、前記実施例1におけると同様に、
上側の黒ランの始点または終点のX座標と下側の黒ラン
の始点または終点のX座標との大小関係により、傾きの
方向を判定する(図2参照)。(Example 1) Method Focusing on Ruled Lines in the Main Scanning Direction When a rectangular black run having a long main scanning direction is integrated, a pair of black runs to be integrated is the same as in the first embodiment.
The inclination direction is determined based on the magnitude relationship between the X coordinate of the start point or the end point of the upper black run and the X coordinate of the start point or the end point of the lower black run (see FIG. 2).
【0043】また、主走査方向の罫線矩形統合の際に、
図5に示すように、統合される1対の矩形(黒ランの統
合矩形)RH1,RH2それぞれの始点または終点のX
座標の大小関係により、傾きの方向を判定する。上側の
矩形RH1の始点(左上頂点)のX座標(Xs1)と下
側の矩形RH2の始点のX座標(Xs2)が、図5
(a)に示すように、Xs1<Xs2の関係のときに
は、傾きの方向を「右下がり」と判定する。また、図5
(b)に示すように、矩形RH1の終点(右下頂点)の
X座標(xe1)と矩形RH2の終点のX座標(xe2)
が、Xe1>Xe2の関係のときには、傾きの方向を
「右上がり」と判定する。以上のいずれの関係でもない
ときには、傾きなしと判定する。When the ruled line rectangles in the main scanning direction are integrated,
As shown in FIG. 5, the X of the start point or the end point of each of a pair of integrated rectangles (integrated rectangle of black run) RH1, RH2
The direction of the tilt is determined based on the magnitude relationship of the coordinates. The X coordinate (Xs1) of the start point (upper left apex) of the upper rectangle RH1 and the X coordinate (Xs2) of the start point of the lower rectangle RH2 are shown in FIG.
As shown in (a), when the relationship of Xs1 <Xs2 is satisfied, the tilt direction is determined to be “downward right”. Also, FIG.
As shown in (b), the X coordinate (xe1) of the end point (lower right vertex) of the rectangle RH1 and the X coordinate (xe2) of the end point of the rectangle RH2.
However, when Xe1> Xe2, the tilt direction is determined to be “upward to the right”. When none of the above relationships is satisfied, it is determined that there is no inclination.
【0044】そして、黒ランによる判定結果と、矩形に
よる判定結果とが一致した場合に、その判定結果を最終
的な判定結果とする。Then, when the determination result by the black run and the determination result by the rectangle match, the determination result is set as the final determination result.
【0045】なお、矩形による判定を統合される矩形の
複数ペアについて行ない、例えば、各ペアの判定結果の
多数決を判定結果としてもよい。あるいは、右下がり、
右上がりのそれぞれの判定回数をカウントし、所定値に
先に到達した傾き方向を判定結果としてもよい。It should be noted that the determination by the rectangle may be performed for a plurality of pairs of integrated rectangles, and for example, the majority result of the determination results of each pair may be used as the determination result. Or right down,
It is also possible to count the number of times of each upward rising determination and use the inclination direction that has reached the predetermined value first as the determination result.
【0046】(例2)副走査方向罫線に着目した方法 副走査方向の長い黒ランの矩形統合の際、統合される黒
ランのペアについて、前記実施例1におけると同様に、
右側の黒ランの始点のY座標と左側の黒ランの始点のY
座標との大小関係により、傾きの方向を判定する(図3
参照)。(Example 2) Method Focusing on Ruled Lines in Sub-scanning Direction When a long black run in the sub-scanning direction is integrated into a rectangle, the black run pairs to be integrated are the same as in the first embodiment.
Y coordinate of the starting point of the black run on the right side and Y of the starting point of the black run on the left side
The tilt direction is determined based on the magnitude relationship with the coordinates (Fig. 3
reference).
【0047】また、副走査方向の罫線矩形統合の際に、
図6に示すように、統合される1対の矩形(黒ランの統
合矩形)RV1,RV2それぞれの始点または終点のY
座標の大小関係により、傾きの方向を判定する。右側の
矩形RV1の始点(右上頂点)のY座標(Ys1)と左
側の矩形RV2の始点のY座標(Ys2)が、図6
(a)に示すように、Ys1<Ys2の関係のときに
は、傾きの方向を「右下がり」と判定する。また、図6
(b)に示すように、矩形RV1の終点(左下頂点)の
Y座標(Ye1)と矩形RV2の終点のY座標(Ye2)
が、Ye1>Ye2の関係のときには、傾きの方向を
「右上がり」と判定する。以上のいずれの関係でもない
ときには、傾きなしと判定する。When integrating ruled line rectangles in the sub-scanning direction,
As shown in FIG. 6, Y of the start point or the end point of each of a pair of integrated rectangles (integrated rectangles of black runs) RV1 and RV2.
The direction of the tilt is determined based on the magnitude relationship of the coordinates. The Y coordinate (Ys1) of the starting point (upper right apex) of the right rectangle RV1 and the Y coordinate (Ys2) of the starting point of the left rectangle RV2 are shown in FIG.
As shown in (a), when the relationship of Ys1 <Ys2 is satisfied, the tilt direction is determined to be “downward right”. In addition, FIG.
As shown in (b), the Y coordinate (Ye1) of the end point (lower left apex) of the rectangle RV1 and the Y coordinate (Ye2) of the end point of the rectangle RV2.
However, when the relation of Ye1> Ye2 is satisfied, the direction of the inclination is determined as “upward to the right”. When none of the above relationships is satisfied, it is determined that there is no inclination.
【0048】そして、黒ランによる判定結果と、矩形に
よる判定結果とが一致した場合に、その判定結果を最終
的な判定結果とする。Then, when the determination result by the black run and the determination result by the rectangle match, the determination result is set as the final determination result.
【0049】なお、矩形による判定を統合される矩形の
複数ペアについて行ない、例えば、各ペアの判定結果の
多数決を判定結果としてもよい。あるいは、右下がり、
右上がりのそれぞれの判定回数をカウントし、所定値に
先に到達した傾き方向を判定結果としてもよい。It should be noted that the determination by the rectangle may be performed for a plurality of pairs of integrated rectangles, and for example, the majority result of the determination results of each pair may be used as the determination result. Or right down,
It is also possible to count the number of times of each upward rising determination and use the inclination direction that has reached the predetermined value first as the determination result.
【0050】また、主走査方向罫線と副走査方向罫線の
両方が得られる場合に、主、副各走査方向の罫線に着目
した傾き判定の結果が一致した場合に判定結果を有効と
し、不一致の場合に判定不能とする等の方法を採ること
もできる。あるいは、主、副走査各方向の判定結果の確
からしさを求めておき、各方向の判定結果が不一致のと
きには、確からしさの高い方の判定結果を最終判定結果
とする等の方法をとることもできる。When both the main-scanning direction ruled line and the sub-scanning direction ruled line are obtained, when the result of the tilt determination focusing on the ruled lines in the main scanning direction and the sub-scanning direction matches, the determination result is validated, and there is no mismatch. In such a case, it is possible to adopt a method such as making the determination impossible. Alternatively, it is also possible to determine the certainty of the determination result in each of the main and sub-scanning directions, and when the determination results in each direction do not match, the determination result with the higher certainty is used as the final determination result. it can.
【0051】<実施例3>図7は、本実施例を説明する
ためのブロック図である。図7において、2値画像入力
部(イメージスキャナ等)701によって、罫線を含む
文書類の画像が読み取られ2値イメージデータとして入
力される。入力画像の2値イメージデータは、2値イメ
ージメモリ702に格納される。<Third Embodiment> FIG. 7 is a block diagram for explaining the present embodiment. In FIG. 7, images of documents including ruled lines are read by a binary image input unit (image scanner or the like) 701 and input as binary image data. The binary image data of the input image is stored in the binary image memory 702.
【0052】黒ラン抽出部703は、2値イメージメモ
リ702内の2値イメージデータをスキャンし、主走査
方向または副走査方向に一定値以上の長さを持つ黒ラン
を抽出する。そして、抽出した黒ランのデータ(始点、
終点の座標)を黒ランメモリ704に格納する。The black run extraction unit 703 scans the binary image data in the binary image memory 702 and extracts a black run having a length of a certain value or more in the main scanning direction or the sub scanning direction. Then, the extracted black run data (starting point,
The coordinates of the end point) are stored in the black run memory 704.
【0053】矩形統合部705において、黒ランメモリ
704内の黒ランデータを参照し、主走査方向または副
走査方向に長い黒ランに対して、予め定められた距離の
範囲内にある黒ランを、それらを全て包含する矩形に統
合する処理を行ない、黒ランの統合矩形のデータ(頂点
座標等)を矩形メモリ706に格納する。また、統合す
る1対の黒ランのデータ(始点、終点の座標)を矩形メ
モリ706の特定領域へ格納する。In the rectangular integration section 705, the black run data in the black run memory 704 is referred to, and black runs within a predetermined distance range with respect to a long black run in the main scanning direction or the sub-scanning direction. Then, a process of integrating them into a rectangle including all of them is performed, and the data of the integrated rectangle of the black run (vertex coordinates, etc.) is stored in the rectangle memory 706. In addition, a pair of integrated black run data (coordinates of start point and end point) is stored in a specific area of the rectangular memory 706.
【0054】傾き条件判定部部708は、矩形メモリ7
06内の矩形のデータを参照し、主走査方向及び副走査
方向の統合矩形中で最も長い矩形を抽出する。その矩形
を、本実施例では、最も精度の高い罫線、あるいは文書
類上の表を代表する罫線とみなして、以下に述べるよう
な方法で傾きを判定する。The inclination condition determining unit 708 is configured to detect the rectangular memory 7
The longest rectangle is extracted from the integrated rectangles in the main scanning direction and the sub-scanning direction by referring to the rectangle data in 06. In the present embodiment, the rectangle is regarded as the most accurate ruled line or a ruled line representing a table on documents, and the inclination is determined by the method described below.
【0055】まず、最も長い矩形として抽出したの範囲
内について、黒ラン抽出部703で黒ラン抽出を再度実
行し、ここで抽出された黒ランについて矩形統合部70
5で矩形統合を実行する。First, the black run extraction unit 703 executes black run extraction again within the range extracted as the longest rectangle, and the rectangle integration unit 70 for the black run extracted here.
In step 5, rectangle integration is executed.
【0056】この矩形統合処理中に、傾き条件判定部7
08において、矩形メモリ706の特定領域より統合さ
れる黒ランのペアのデータを読み込み、傾き条件に関す
る判定を行なう。この判定条件の例を次に示す。During this rectangle integration processing, the tilt condition determination unit 7
At 08, the data of the black run pair to be integrated is read from the specific area of the rectangular memory 706, and the determination regarding the inclination condition is performed. An example of this determination condition is shown below.
【0057】(1)注目している矩形が主走査方向の黒
ランの統合矩形(主走査方向罫線)の場合 図2に示すように、統合される黒ランLH1,LH2の
始点または終点のX座標を比較する。図2(a)に示す
ように、上側の黒ランLH1の始点のX座標(xs1)と
下側の黒ランLH2の始点のX座標(xs2)との関係が
xs1<xs2ならば「右下がり」の条件に合致すると判
定する。また、図2(b)に示すように、黒ランLH
1,LH2の終点のX座標(xe1,xe2)が、 xe1>
xe2 ならば「右上がり」の条件に合致すると判定す
る。(1) When the rectangle of interest is an integrated rectangle of black runs in the main scanning direction (ruled line in the main scanning direction) As shown in FIG. 2, the start or end points X of the integrated black runs LH1 and LH2 are X. Compare the coordinates. As shown in FIG. 2A, if the relationship between the X coordinate (xs1) of the starting point of the upper black run LH1 and the X coordinate (xs2) of the starting point of the lower black run LH2 is xs1 <xs2, then “down right It is determined that the above condition is met. In addition, as shown in FIG. 2B, the black run LH
1, the X coordinate of the end point of LH2 (xe1, xe2) is xe1>
If xe2, it is determined that the condition of "upward to the right" is met.
【0058】(2)注目している矩形が副走査方向の黒
ランの統合矩形(副走査方向罫線)の場合 図3に示すように、統合される黒ランLV1,LV2の
始点または終点のY座標を比較する。図3(a)に示す
ように、右側の黒ランLV1の始点のY座標(Ys1)と
下側の黒ランLV2の始点のY座標(Ys2)との関係が
Ys1<Ys2ならば「右下がり」の条件に合致すると判
定する。また、それぞれの終点のY座標(Ye1,Ye2)
が、図3(b)に示すように、 Ye1>Ye2 ならば「右
上がり」の条件に合致すると判定する。(2) When the rectangle of interest is an integrated rectangle of black runs in the sub-scanning direction (ruled line in the sub-scanning direction) As shown in FIG. 3, the start or end point Y of the integrated black runs LV1, LV2 is Y. Compare the coordinates. As shown in FIG. 3A, if the relationship between the Y coordinate (Ys1) of the starting point of the right black run LV1 and the Y coordinate (Ys2) of the starting point of the lower black run LV2 is Ys1 <Ys2, then “down right It is determined that the above condition is met. Also, the Y coordinate of each end point (Ye1, Ye2)
However, as shown in FIG. 3B, if Ye1> Ye2, it is determined that the condition of "upward to the right" is met.
【0059】そして、傾き条件判定部708は、「右上
がり」条件に合致したときには条件合致回数メモリ70
9(初期値は0)の値を1だけ増加させ、「右下がり」
条件に合致したときは条件合致回数メモリ709の値を
1だけ減少させる。いずれの条件にも合致しない場合に
は、条件合致回数メモリ709の値を更新しない。Then, the tilt condition determining unit 708 determines that the condition matching number memory 70 is satisfied when the “upward right” condition is met.
Increase the value of 9 (initial value is 0) by 1 to "fall right"
When the condition is met, the value of the condition match frequency memory 709 is decreased by 1. If none of the conditions is met, the value in the condition match count memory 709 is not updated.
【0060】注目した矩形に関する上記の判定が完了す
ると、傾き検出部710において、条件合致回数メモリ
709の値が正値で、絶対値が3を超えるときは、傾き
方向を「右上がり」と判定する。傾き条件合致回数メモ
リ709の値が負値で、絶対値が3を超えるときには、
傾き方向を「右下がり」と判定する。また、その値が±
3の範囲内のときは、「傾きなし」と判定する。なお、
±3の範囲内で「傾きなし」としたのは、入力画像上の
ノイズの影響を考慮したものである。When the above-mentioned determination regarding the noted rectangle is completed, when the value of the condition matching number memory 709 is a positive value and the absolute value exceeds 3 in the inclination detection unit 710, the inclination direction is determined to be "upward to the right". To do. When the value of the slope condition matching count memory 709 is a negative value and the absolute value exceeds 3,
The tilt direction is determined to be “downward right”. The value is ±
If it is within the range of 3, it is determined that there is no inclination. In addition,
The reason why “no inclination” is set within the range of ± 3 is to consider the influence of noise on the input image.
【0061】<実施例4>図8は、本実施例を説明する
ためのブロック図である。図8において、2値画像入力
部(イメージスキャナ等)801によって、罫線を含む
文書類の画像が読み取られ、その2値イメージデータが
2値イメージメモリ802に格納される。<Embodiment 4> FIG. 8 is a block diagram for explaining the present embodiment. In FIG. 8, images of documents including ruled lines are read by a binary image input unit (image scanner or the like) 801, and the binary image data is stored in a binary image memory 802.
【0062】黒ラン抽出部803は、2値イメージメモ
リ802内の2値イメージデータをスキャンし、主走査
方向または副走査方向に一定値以上の長さを持つ黒ラン
を抽出し、抽出した黒ランのデータ(始点、終点の座
標)を黒ランメモリ804に格納する。The black run extraction unit 803 scans the binary image data in the binary image memory 802, extracts a black run having a length of a certain value or more in the main scanning direction or the sub scanning direction, and extracts the extracted black. The run data (coordinates of the start point and the end point) are stored in the black run memory 804.
【0063】矩形統合部805において、黒ランメモリ
804内の黒ランデータを参照し、主走査方向または副
走査方向に長い黒ランに対して、予め定められた距離の
範囲内にある黒ランを、それらを全て包含する矩形に統
合する処理を行ない、黒ランの統合矩形のデータ(頂点
座標等)を矩形メモリ806に格納する。罫線矩形抽出
部807において、矩形メモリ806内の矩形データを
参照し、主走査方向の長い黒ランの統合矩形について、
予め定められた距離の範囲内にある矩形を、それら全て
包含する矩形(主走査方向罫線矩形)に統合する。同様
に、副走査方向に長い黒ランの統合矩形について、予め
定められた距離の範囲内にある矩形を、それら全てを包
含する矩形(副走査方向罫線矩形)に統合する。そし
て、抽出した罫線矩形のデータ(頂点座標等)を罫線矩
形メモリ808に格納する。The rectangular integration section 805 refers to the black run data in the black run memory 804, and finds black runs within a predetermined distance range with respect to a long black run in the main scanning direction or the sub scanning direction. Then, a process of integrating them into a rectangle including all of them is performed, and the data of the integrated rectangle of the black run (vertex coordinates, etc.) is stored in the rectangle memory 806. In the ruled line rectangle extraction unit 807, the rectangular data in the rectangular memory 806 is referred to and the integrated rectangle of the black run in the main scanning direction is
Rectangles within a predetermined distance range are integrated into a rectangle that includes them (main scanning direction ruled line rectangle). Similarly, regarding the integrated rectangle of the black runs long in the sub-scanning direction, the rectangles within the range of the predetermined distance are integrated into a rectangle including all of them (a sub-scanning direction ruled line rectangle). Then, the extracted ruled line rectangle data (vertex coordinates, etc.) is stored in the ruled line rectangle memory 808.
【0064】傾き条件判定部部809は、罫線矩形メモ
リ706内のデータを参照し、主走査方向及び副走査方
向の罫線矩形中で最も長い矩形を抽出する。その矩形
を、本実施例では、最も精度の高い罫線、あるいは文書
類上の表を代表する罫線とみなして、以下に述べるよう
な方法で傾きを判定する。The inclination condition determination unit 809 refers to the data in the ruled line rectangle memory 706 and extracts the longest rectangle out of the ruled line rectangles in the main scanning direction and the sub scanning direction. In the present embodiment, the rectangle is regarded as the most accurate ruled line or a ruled line representing a table on documents, and the inclination is determined by the method described below.
【0065】まず、抽出した最も長い罫線矩形の範囲内
について、黒ラン抽出部803で黒ラン抽出を再度実行
し、ここで抽出された黒ランについて矩形統合部805
で矩形統合を実行し、その矩形の統合を罫線矩形抽出部
807で実行する。First, the black run extraction unit 803 executes black run extraction again within the range of the longest extracted ruled line rectangle, and the rectangular integration unit 805 for the black runs extracted here.
Then, the rectangle integration is performed, and the ruled line extraction unit 807 performs the integration of the rectangle.
【0066】矩形統合部805による黒ランの統合処理
中に、傾き条件判定部809は、統合される黒ランのペ
アについて傾き条件に関する判定を行なう。この判定条
件の例を次に示す。During the black run integration process by the rectangle integration unit 805, the inclination condition determination unit 809 makes an inclination condition determination for the pair of integrated black runs. An example of this determination condition is shown below.
【0067】(1)主走査方向の罫線矩形が処理の対象
であるとき 図2に示すように、統合される黒ランLH1,LH2の
始点または終点のX座標を比較する。図2(a)に示す
ように、上側の黒ランLH1の始点のX座標(xs1)と
下側の黒ランLH2の始点のX座標(xs2)との関係が
xs1<xs2ならば「右下がり」の条件に合致すると
判定する。また、図2(b)に示すように、それぞれの
終点のX座標(Xe1,Xe2)が、 xe1>xe2 ならば
「右上がり」の条件に合致すると判定する。(1) When the ruled line rectangle in the main scanning direction is the object of processing As shown in FIG. 2, the X coordinates of the start points or end points of the integrated black runs LH1, LH2 are compared. As shown in FIG. 2 (a), if the relationship between the X coordinate (xs1) of the starting point of the upper black run LH1 and the X coordinate (xs2) of the starting point of the lower black run LH2 is xs1 <xs2, then “down right It is determined that the above condition is met. Further, as shown in FIG. 2B, if the X coordinate (Xe1, Xe2) of each end point is xe1> xe2, it is determined that the condition of "upward rising" is met.
【0068】(2)副走査方向の罫線矩形が処理の対象
であるとき 図3に示すように、統合される黒ランLV1,LV2の
始点または終点のY座標を比較する。図3(a)に示す
ように、右側の黒ランLV1の始点のY座標(Ys1)と
下側の黒ランLV2の始点のY座標(Ys2)との関係が
Ys1<Ys2ならば「右下がり」の条件に合致すると判
定する。また、図3(b)に示すように、それぞれの終
点のY座標(Ye1,Ye2)が、 Ye1>Ye2 ならば「右
上がり」の条件に合致すると判定する。(2) When the ruled line rectangle in the sub-scanning direction is the object of processing As shown in FIG. 3, the Y coordinates of the start points or end points of the integrated black runs LV1, LV2 are compared. As shown in FIG. 3A, if the relationship between the Y coordinate (Ys1) of the starting point of the right black run LV1 and the Y coordinate (Ys2) of the starting point of the lower black run LV2 is Ys1 <Ys2, then “down right It is determined that the above condition is met. Further, as shown in FIG. 3B, if the Y coordinates (Ye1, Ye2) of the respective end points are Ye1> Ye2, it is determined that the condition of "increasing to the right" is met.
【0069】そして、傾き条件判定部809は、統合さ
れる黒ランのペアが「右上がり」条件に合致したときに
は条件合致回数メモリ810(初期値は0)の値を1だ
け増加させ、「右下がり」条件に合致したときは条件合
致回数メモリ810の値を1だけ減少させる。いずれの
条件にも合致しない場合には、条件合致回数メモリ81
0の値を更新しない。Then, the inclination condition judging unit 809 increments the value of the condition-matching frequency memory 810 (initial value is 0) by 1 when the pair of black runs to be integrated meets the condition of "increasing to the right", and outputs "right". When the "falling" condition is met, the value of the condition matching frequency memory 810 is decreased by one. If none of the conditions is met, the condition match count memory 81
Do not update the value of 0.
【0070】また、罫線矩形抽出部807による罫線統
合処理中に、傾き条件判定部809は、統合される矩形
のペアについて傾き条件に関する判定を行なう。この判
定条件の例を次に示す。Further, during the ruled line integration processing by the ruled line rectangle extraction unit 807, the tilt condition determination unit 809 determines the tilt condition for the pair of integrated rectangles. An example of this determination condition is shown below.
【0071】(1)主走査方向罫線が処理対象であると
き 図5に示すように、統合される1対の矩形(黒ランの統
合矩形)RH1,RH2それぞれの始点または終点のX
座標の大小関係により傾きの方向を判定する。上側の矩
形RH1の始点(左上頂点)のX座標(Xs1)と下側
の矩形RH2の始点のX座標(Xs2)が、図5(a)
に示すように、Xs1<Xs2の関係のときに傾きの方
向を「右下がり」と判定する。また、図5(b)に示す
ように、それぞれの終点のX座標(Xe1,Xe2)が、X
e1>Xe2の関係のときには、傾きの方向を「右上が
り」と判定する。(1) When a ruled line in the main scanning direction is a processing target As shown in FIG. 5, a pair of rectangles (integrated rectangles of black runs) RH1 and RH2 to be integrated are set to the start or end points X.
The direction of inclination is determined based on the magnitude relationship of the coordinates. The X coordinate (Xs1) of the starting point (upper left apex) of the upper rectangle RH1 and the X coordinate (Xs2) of the starting point of the lower rectangle RH2 are shown in FIG.
As shown in, when the relationship of Xs1 <Xs2 is satisfied, the tilt direction is determined to be “downward right”. Further, as shown in FIG. 5B, the X coordinate (Xe1, Xe2) of each end point is X.
In the case of the relationship of e1> Xe2, it is determined that the tilt direction is “upward to the right”.
【0072】そして、傾き条件判定部809は、統合さ
れる矩形のペアが「右上がり」条件に合致したときには
条件合致回数メモリ810(初期値は0)の値を1だけ
増加させ、「右下がり」条件に合致したときは条件合致
回数メモリ810の値を1だけ減少させる。いずれの条
件にも合致しない場合には、条件合致回数メモリ810
の値を更新しない。Then, the tilt condition determining unit 809 increases the value of the condition match count memory 810 (initial value is 0) by 1 when the integrated rectangular pair meets the condition of "increasing to the right", and "decreases to the right". When the condition is met, the value of the condition match number memory 810 is decreased by 1. If none of the conditions are met, the condition match count memory 810
Do not update the value of.
【0073】このようしにて、注目した罫線矩形に関す
る統合処理が終了した段階で、傾き検出部811は、条
件合致回数メモリ810の値が正値で絶対値が5を超え
るときは、傾き方向を「右上がり」と判定する。傾き条
件合致回数メモリ810の値が負値で、絶対値が5を超
えるときには、傾き方向を「右下がり」と判定する。ま
た、その値が±5の範囲内のときは、「傾きなし」と判
定する。なお、±5の範囲内で「傾きなし」としたの
は、入力画像上のノイズの影響を考慮したものである。In this way, at the stage where the integration process for the noticed ruled line rectangle is completed, if the value of the condition match count memory 810 is a positive value and the absolute value exceeds 5, the tilt detecting section 811 determines the tilt direction. Is determined to be “upward to the right”. When the value in the tilt condition matching count memory 810 is a negative value and the absolute value exceeds 5, the tilt direction is determined to be “downward right”. Further, when the value is within the range of ± 5, it is determined that “no inclination”. It should be noted that the reason why “no inclination” is set within the range of ± 5 is to consider the influence of noise on the input image.
【0074】なお、本実施例では、最も長い罫線矩形を
選び、それを代表として、黒ラン抽出、その統合、罫線
矩形統合を改めて行ない、その際に条件判定を行なうこ
とによって傾き方向を検出したが、全ての罫線を対象と
して同様の条件判定を行なって傾きを検出することもで
きることは当然である。In this embodiment, the longest ruled line rectangle is selected, and the black run extraction, its integration, and the ruled line rectangle integration are performed again as a representative, and the inclination direction is detected by performing the condition determination at that time. However, it goes without saying that the inclination can be detected by performing the same condition determination on all ruled lines.
【0075】すなわち、矩形統合部805による黒ラン
統合処理中に、傾き条件判定部809で、すべての統合
される黒ランのペアに関して前述の如き条件判定を行な
い、その結果に応じて条件合致回数メモリ810の更新
を行なう。また、罫線矩形抽出部807による矩形統合
中に、全ての統合される矩形のペアに関して前述の如き
条件判定を行ない、その結果に応じて条件合致回数メモ
リ810の更新を行なう。そして、以上の処理を完了し
た段階での条件合致回数メモリ810の値によって、傾
き検出部811において前述の如き傾き方向の判定を行
なう。That is, during the black run integration process by the rectangle integration unit 805, the inclination condition determination unit 809 performs the above-described condition determination for all the pairs of black runs to be integrated, and the number of times the conditions are matched according to the result. The memory 810 is updated. Further, during the rectangle integration by the ruled line rectangle extraction unit 807, the condition determination as described above is performed for all pairs of the integrated rectangles, and the condition matching frequency memory 810 is updated according to the result. Then, the tilt detection unit 811 determines the tilt direction as described above based on the value of the condition matching frequency memory 810 at the stage when the above processing is completed.
【0076】<実施例5>前記各実施例では傾きの方向
だけを検出したが、本実施例では傾きの角度も検出す
る。<Embodiment 5> In each of the above-described embodiments, only the tilt direction is detected, but in this embodiment, the tilt angle is also detected.
【0077】図9は、本実施例の説明のためのブロック
図である。ここに示すシステム構成は前記実施例4に類
似しており、傾きの方向の検出に関しては前記実施例4
と同様である。ただし、前記実施例1,2または3と同
様の方法で傾きの方向を検出してもよい(実施例1また
は3の場合には、黒ランの統合矩形を罫線矩形として扱
う)。FIG. 9 is a block diagram for explaining the present embodiment. The system configuration shown here is similar to that of the fourth embodiment, and the detection of the direction of the tilt is performed in the fourth embodiment.
Is the same as. However, the inclination direction may be detected by the same method as in the first, second, or third embodiment (in the case of the first or third embodiment, the integrated rectangle of black runs is treated as a ruled line rectangle).
【0078】前記実施例4と全く同様に、2値画像入力
部901によって文書類の2値イメージデータを2値イ
メージメモリ902に入力し、そのイメージ上の主走査
方向及び副走査方向に長い黒ランを黒ラン抽出部903
で抽出し、そのデータを黒ランメモリ906に格納す
る。矩形統合部905で黒ランを矩形に統合し、そのデ
ータを矩形メモリ906に格納する。罫線矩形抽出部9
07で、その矩形の統合をして罫線矩形を抽出し、その
データを罫線矩形メモリ908に格納する。傾き条件判
定部909で最大長の罫線矩形を抽出する。そして、そ
の罫線矩形の範囲について、黒ラン抽出、黒ラン統合、
罫線矩形抽出を実行し、傾き条件判定部909で、黒ラ
ンのペア及び矩形のペアに関する傾きの条件の判定を行
なって条件合致回数メモリ910を更新する。そして、
傾き検出部911で、条件合致回数メモリ910の値よ
り傾きの方向を判定する。Just as in the fourth embodiment, the binary image input unit 901 inputs the binary image data of a document into the binary image memory 902, and the black on the image in the main scanning direction and the sub scanning direction is long. Orchid black orchid extraction unit 903
And stores the data in the black run memory 906. The rectangular integration unit 905 integrates the black runs into rectangles, and stores the data in the rectangle memory 906. Ruled line rectangle extraction unit 9
At 07, the rectangles are integrated to extract a ruled line rectangle, and the data is stored in the ruled line rectangle memory 908. The tilt condition determination unit 909 extracts the maximum length ruled line rectangle. Then, for the range of the ruled line rectangle, black run extraction, black run integration,
The ruled line rectangle extraction is executed, and the inclination condition determination unit 909 determines the inclination condition for the black run pair and the rectangular pair, and updates the condition matching number memory 910. And
The tilt detection unit 911 determines the tilt direction from the value in the condition matching count memory 910.
【0079】さて、以上のような傾き方向の検出のため
の動作と並行して、本実施例では次に述べるような傾き
角度検出のための処理を行なう。図10は、その処理の
説明図である。In parallel with the above-described operation for detecting the tilt direction, the following processing for tilt angle detection is performed in this embodiment. FIG. 10 is an explanatory diagram of the processing.
【0080】黒ラン抽出部903において、注目した罫
線矩形の範囲内の2値イメージをスキャンして黒ランを
抽出する際に、当該罫線矩形の内部の黒画素数(pixe
l)を求め、その値を黒画素数メモリ913に格納す
る。なお、この黒画素数(pixel)を、罫線矩形に包含
される黒ランのデータ(黒ランメモリ904内)より求
めてもよい。When the black run extraction unit 903 extracts a black run by scanning the binary image in the range of the ruled line rectangle of interest, the number of black pixels inside the ruled line rectangle (pixe
l) is obtained and the value is stored in the black pixel number memory 913. The number of black pixels (pixel) may be obtained from the black run data (in the black run memory 904) included in the ruled line rectangle.
【0081】次に、傾き検出部911において、罫線矩
形メモリ908内のデータより注目した罫線の幅(widt
h)を求め、それと黒画素数(pixel)とから次式によっ
て罫線の太さ(thickness)を計算する。Next, in the inclination detection unit 911, the width of the ruled line (widt
h) is calculated, and the thickness of the ruled line is calculated from the calculated h and the number of black pixels by the following equation.
【0082】thickness=pixel/width 傾き検出部911はまた、罫線矩形メモリ908内のデ
ータより注目した罫線の高さ(height)を求め、これと
罫線の太さ(thickness)とから次式によって罫線のず
れ(tilt)を計算する。Thickness = pixel / width The inclination detecting unit 911 also obtains the height (height) of the ruled line from the data in the ruled line rectangle memory 908, and based on this and the thickness of the ruled line (thickness), Calculate the tilt of.
【0083】tilt=height−thickness そして、次式によって、傾きの角度(θ)を求める。Tilt = height-thickness Then, the inclination angle (θ) is calculated by the following equation.
【0084】tanθ=tilt/width <実施例6>図11は、本実施例を説明するためのブロ
ック図である。図1おいて、破線の枠1001の内部の
構成は、入力イメージの傾き検出に関しては図9に示し
た前記実施例5の構成と同一であるので、その説明を省
略する。なお、図9中の各部と対応する部分には同一の
符号で示されている。Tan θ = tilt / width <Sixth Embodiment> FIG. 11 is a block diagram for explaining the present embodiment. In FIG. 1, the internal structure of the broken-line frame 1001 is the same as that of the fifth embodiment shown in FIG. 9 with respect to the inclination detection of the input image, and therefore its description is omitted. Note that the portions corresponding to the respective portions in FIG. 9 are indicated by the same reference numerals.
【0085】図11において、画像補正部1002は、
傾き検出部911より出力された傾きの方向及び角度の
情報に応じて、画像の傾きと逆方向へ、傾きの角度と同
じ角度だけ、2値イメージメモリ902内の2値イメー
ジデータを回転させることによって、傾きを補正した2
値イメージを作成し、それを補正2値イメージメモリ1
003に格納する。In FIG. 11, the image correction unit 1002 is
Rotating the binary image data in the binary image memory 902 in the direction opposite to the tilt of the image by the same angle as the tilt angle in accordance with the tilt direction and angle information output from the tilt detection unit 911. The tilt was corrected by 2
Create a value image and correct it Binary image memory 1
It is stored in 003.
【0086】この補正2値イメージメモリ1003内の
2値イメージデータに対して、黒ラン抽出部903によ
り、主走査方向及び副走査方向に一定値以上の長さを持
つ黒ランを抽出し、黒ランのデータを黒ランメモリ90
4に格納する。黒ランメモリ904内の古いデータ(傾
き検出のための黒ランデータ)は廃棄される。From the binary image data in the corrected binary image memory 1003, the black run extraction unit 903 extracts a black run having a length equal to or more than a certain value in the main scanning direction and the sub-scanning direction to obtain black. Run data to black run memory 90
Store in 4. Old data (black run data for tilt detection) in the black run memory 904 is discarded.
【0087】矩形統合部905において、黒ランメモリ
904内のデータを参照し、主走査方向の黒ラン及び副
走査方向の黒ランのそれぞれに対して、予め定められた
距離の範囲内の黒ランを、それらを全部包含する矩形に
統合する処理を行ない、その矩形のデータを矩形メモリ
906に格納する。矩形メモリ906内の古いデータは
廃棄される。The rectangular integration section 905 refers to the data in the black run memory 904 and refers to the black runs in the main scanning direction and the black runs in the sub-scanning direction respectively within a predetermined distance range. Is integrated into a rectangle that includes them, and the data of the rectangle is stored in the rectangle memory 906. Old data in the rectangular memory 906 is discarded.
【0088】罫線矩形抽出部907において、矩形メモ
リ906内のデータを参照し、主走査方向黒ランの統合
矩形及び副走査方向黒ランの統合矩形のそれぞれに対し
て、予め定められた距離の範囲内の黒ランを、それらを
全部包含する矩形に統合する処理を行ない、統合した矩
形(罫線矩形)のデータを罫線矩形メモリ908に格納
する。罫線矩形メモリ908内の古いデータは廃棄され
る。このようにして、文書類の傾きが補正されたイメー
ジ上の罫線矩形が抽出されたことになる。The ruled line rectangle extraction unit 907 refers to the data in the rectangular memory 906, and sets a predetermined distance range for each of the integrated rectangle of the black run in the main scanning direction and the integrated rectangle of the black run in the sub scanning direction. The black run in the above is integrated into a rectangle that includes all of them, and the data of the integrated rectangle (ruled line rectangle) is stored in the ruled line rectangle memory 908. Old data in the ruled line rectangle memory 908 is discarded. In this way, the ruled line rectangle on the image in which the inclination of the documents is corrected is extracted.
【0089】次に、枠認識部1004において、罫線矩
形メモリ908内の罫線矩形のデータを基に、表の枠
(縦横の罫線で囲まれた矩形領域)を認識し、各枠の座
標(対角頂点座標)を枠座標メモリ1005に格納す
る。そして、この枠座標を基に、枠内文字抽出部100
6によって各枠の内部の文字の画像を、補正2値イメー
ジメモリ1003内の補正2値イメージより切り出し、
切り出した文字画像を文字認識部1007へ渡し、文字
認識を行なわせる。かくして、傾いて入力された文書類
上の表の文字を、正確に認識できる。Next, the frame recognition unit 1004 recognizes the frame of the table (rectangular area surrounded by vertical and horizontal ruled lines) based on the data of the ruled line rectangle in the ruled line rectangle memory 908, and coordinates of each frame (pair The corner vertex coordinates) are stored in the frame coordinate memory 1005. Then, based on the frame coordinates, the in-frame character extraction unit 100
The image of the character inside each frame is cut out from the corrected binary image in the corrected binary image memory 1003 by 6,
The cut-out character image is passed to the character recognizing unit 1007 to be recognized. Thus, it is possible to accurately recognize the characters in the table on the document that are input with a tilt.
【0090】[0090]
【発明の効果】以上に説明した如く、本発明によれば以
下のような効果を得られる。As described above, according to the present invention, the following effects can be obtained.
【0091】(1)請求項1乃至11の各項の発明の方
法によれば、入力画像上の罫線を基準として、画像の傾
き方向を検出できる。さらに請求項10または11の発
明の方法によれば、入力画像の傾きの角度も検出でき
る。このように、罫線を基準とする方法であるので、例
えば、文字が存在しない表のみの帳票等でも、その画像
の傾き検出が可能となる。(1) According to the methods of the inventions of claims 1 to 11, the tilt direction of the image can be detected with reference to the ruled line on the input image. Furthermore, according to the method of the invention of claim 10 or 11, the angle of inclination of the input image can also be detected. In this way, since the method uses ruled lines as a reference, it is possible to detect the inclination of the image even in a form such as a table without characters.
【0092】(2)請求項1または2の発明の方法は、
黒ランの統合の際に統合される黒ランの位置関係、また
は黒ランの統合矩形の統合の際に統合される矩形の位置
関係に基づいて画像の傾きを検出するが、黒ランの矩形
統合や、その矩形の統合処理は表処理で一般に必要な処
理ステップであるため、表処理に適用するのに無駄のな
い合理的な方法である。(2) The method of the invention of claim 1 or 2 is
Image tilt is detected based on the positional relationship of the black runs that are integrated when the black runs are integrated, or the positional relationship of the rectangles that are integrated when the integrated rectangles of the black runs are integrated. Also, since the rectangle integration processing is a processing step that is generally necessary for table processing, it is a rational method that can be applied to table processing without waste.
【0093】(3)請求項3の発明の方法によれば、罫
線を構成する黒ランの位置関係に加えて、罫線を構成す
る黒ランの統合矩形の位置関係を利用して、傾き方向判
定に利用する。したがって、黒ランの位置関係のみを利
用した方法に比べ、より正確な傾き方向検出が可能であ
る。(3) According to the method of the third aspect of the present invention, in addition to the positional relationship of the black runs forming the ruled line, the positional relationship of the integrated rectangles of the black runs forming the ruled line is utilized to determine the tilt direction. To use. Therefore, it is possible to detect the tilt direction more accurately as compared with the method using only the positional relationship of the black runs.
【0094】(4)請求項4または5の発明の方法によ
れば、黒ランまたは矩形の始点及び終点の座標の大小関
係に基づき、極めて単純なルールで傾き方向を判定する
ことができる。(4) According to the method of the invention of claim 4 or 5, the tilt direction can be determined by an extremely simple rule based on the magnitude relationship between the coordinates of the start point and the end point of the black run or the rectangle.
【0095】(5)請求項6または8の発明の方法によ
れば、罫線を構成する黒ランまたは黒ラン統合矩形の複
数のペアの位置関係に基づいて傾き方向を判定するた
め、ノイズによる影響などを回避し、安定確実に傾き方
向を検出できる。(5) According to the method of the invention of claim 6 or 8, since the tilt direction is determined based on the positional relationship of a plurality of pairs of black runs or black run integrated rectangles that form a ruled line, the influence of noise is exerted. It is possible to detect the tilt direction in a stable and reliable manner by avoiding such problems.
【0096】(6)請求項7または9の発明によれば、
入力画像上の最も長い罫線を基準として傾き方向を判定
することになるため、正確な判定結果を得られる。ま
た、一つの罫線の範囲のみに着目するので、全ての罫線
を対象する場合に比べ処理の負担を軽減できる。(6) According to the invention of claim 7 or 9,
Since the inclination direction is determined based on the longest ruled line on the input image, an accurate determination result can be obtained. Further, since attention is paid only to the range of one ruled line, the processing load can be reduced as compared with the case where all ruled lines are targeted.
【0097】(7)請求項10または11の発明の方法
によれば、入力画像の傾きによる黒ラン統合矩形または
その統合矩形の太りを考慮して、入力画像の傾き角度を
精度よく検出することができる。(7) According to the method of the tenth or eleventh aspect of the present invention, the inclination angle of the input image is accurately detected in consideration of the black run integrated rectangle or the thickening of the integrated rectangle due to the inclination of the input image. You can
【0098】請求項12の発明によれば、入力画像の傾
きを検出して、入力画像の傾きを補正してから罫線を抽
出して表の枠を認識し、枠内の文字画像を傾き補正画像
から切り出すので、傾いて入力された画像上の表中の文
字を正確に認識することができる。According to the twelfth aspect of the present invention, the inclination of the input image is detected, the inclination of the input image is corrected, the ruled lines are extracted, the frame of the table is recognized, and the character image in the frame is corrected for inclination. Since the image is cut out from the image, it is possible to accurately recognize the characters in the table on the image that is input with a tilt.
【図1】本発明の実施例1を説明するためのブロック図
である。FIG. 1 is a block diagram for explaining a first embodiment of the present invention.
【図2】(a)右下がりに傾いた画像上の主走査方向罫
線を構成する黒ランのペアの位置関係の例を示す。 (b)右上がりに傾いた画像上の主走査方向罫線を構成
する黒ランのペアの位置関係の例を示す。FIG. 2A shows an example of the positional relationship of pairs of black runs that form a ruled line in the main scanning direction on an image that is inclined to the lower right. (B) An example of the positional relationship of a pair of black runs forming a ruled line in the main scanning direction on an image inclined to the upper right is shown.
【図3】(a)右下がりに傾いた画像上の副走査方向罫
線を構成する黒ランのペアの位置関係の例を示す。 (b)右上がりに傾いた画像上の副走査方向罫線を構成
する黒ランのペアの位置関係の例を示す。FIG. 3A shows an example of the positional relationship of pairs of black runs that form a ruled line in the sub-scanning direction on an image that is inclined to the lower right. (B) An example of the positional relationship of a pair of black runs forming a ruled line in the sub-scanning direction on an image inclined to the right is shown.
【図4】本発明の実施例2を説明するためのブロック図
である。FIG. 4 is a block diagram for explaining a second embodiment of the present invention.
【図5】(a)右下がりに傾いた画像上の主走査方向罫
線を構成する矩形のペアの位置関係の例を示す。 (b)右上がりに傾いた画像上の主走査方向罫線を構成
する矩形のペアの位置関係の例を示す。FIG. 5A shows an example of the positional relationship of a pair of rectangles forming a ruled line in the main scanning direction on an image inclined to the lower right. (B) An example of the positional relationship of the pair of rectangles forming the ruled line in the main scanning direction on the image tilted to the right is shown.
【図6】(a)右下がりに傾いた画像上の副走査方向罫
線を構成する矩形のペアの位置関係の例を示す。 (b)右上がりに傾いた画像上の副走査方向罫線を構成
する矩形のペアの位置関係の例を示す。FIG. 6A shows an example of the positional relationship of a pair of rectangles forming a ruled line in the sub-scanning direction on an image inclined to the lower right. (B) An example of the positional relationship of a pair of rectangles forming a ruled line in the sub-scanning direction on an image tilted to the right is shown.
【図7】本発明の実施例3を説明するためのブロック図
である。FIG. 7 is a block diagram for explaining a third embodiment of the present invention.
【図8】本発明の実施例4を説明するためのブロック図
である。FIG. 8 is a block diagram for explaining a fourth embodiment of the present invention.
【図9】本発明の実施例5を説明するためのブロック図
である。FIG. 9 is a block diagram for explaining a fifth embodiment of the present invention.
【図10】主走査方向罫線の場合の傾き角度を検出の説
明図である。FIG. 10 is an explanatory diagram of detecting an inclination angle in the case of a ruled line in the main scanning direction.
【図11】本発明の実施例6を説明するためのブロック
図である。FIG. 11 is a block diagram for explaining a sixth embodiment of the present invention.
101,401,701,801,901 2値画像入
力部 102,402,702,802,902 2値イメー
ジメモリ 103,403,703,803,903 黒ラン抽出
部 104,404,704,804,904 黒ランメモ
リ 105,405,705,805,905 矩形統合部 106,406,706,806,906 矩形メモリ 107,409,710,811,911 傾き検出部 407,807,907 罫線矩形抽出部 408,808,908 罫線矩形メモリ 809,909 傾き条件判定部 810,910 条件合致回数メモリ 1002 画像補正部 1003 補正2値イメージメモリ 1004 枠認識部 1005 枠座標メモリ 1006 枠内文字抽出部 1007 文字認識部 LH 主走査方向罫線の黒ラン LV 副走査方向罫線の黒ラン RH 主走査方向罫線の黒ラン統合矩形 RV 副走査方向罫線の黒ラン統合矩形101, 401, 701, 801, 901 Binary image input unit 102, 402, 702, 802, 902 Binary image memory 103, 403, 703, 803, 903 Black run extraction unit 104, 404, 704, 804, 904 Black Run memory 105, 405, 705, 805, 905 Rectangle integration section 106, 406, 706, 806, 906 Rectangle memory 107, 409, 710, 811, 911 Tilt detection section 407, 807, 907 Ruled line rectangle extraction section 408, 808, 908 Ruled-line rectangle memory 809,909 Inclination condition determination unit 810,910 Condition matching number memory 1002 Image correction unit 1003 Corrected binary image memory 1004 Frame recognition unit 1005 Frame coordinate memory 1006 Frame character extraction unit 1007 Character recognition unit LH Main scanning direction Ruled line black run LV side run Black run of ruled lines RH Black integrated run rectangle of ruled lines in the main scanning direction RV Black run integrated rectangle of ruled lines in the sub-scanning direction
Claims (12)
を抽出し、抽出した黒ランで予め定められた距離内にあ
る黒ランを、それら全てを包含する矩形に統合し、この
黒ランの統合の際に統合される黒ランの相互の位置関係
によって入力画像の傾きの方向を判定することを特徴と
する画像傾き検出方法。1. A black run having a length equal to or greater than a certain value on an input image is extracted, and black runs within a predetermined distance of the extracted black runs are integrated into a rectangle including all of them, and An image inclination detection method, characterized in that the direction of inclination of an input image is determined based on the mutual positional relationship of the black runs that are integrated when the black runs are integrated.
を抽出し、抽出した黒ランで予め定められた距離内にあ
る黒ランを、それら全てを包含する矩形に統合し、黒ラ
ンを統合した矩形で予め定められた距離内にあるもの
を、それら全てを包含する罫線矩形に統合し、前記矩形
の統合の際に統合される矩形の相互の位置関係によっ
て、入力画像の傾きの方向を判定することを特徴とする
画像傾き検出方法。2. A black run having a length equal to or greater than a certain value on an input image is extracted, and black runs within a predetermined distance of the extracted black runs are integrated into a rectangle including all of them to obtain a black run. Rectangle that integrates runs and is within a predetermined distance is integrated into a ruled line rectangle that includes all of them, and the inclination of the input image is determined by the mutual positional relationship of the rectangles that are integrated when the rectangles are integrated. An image inclination detection method characterized by determining the direction of
を抽出し、抽出した黒ランで予め定められた距離内にあ
る黒ランを、それら全てを包含する矩形に統合し、黒ラ
ンを統合した矩形で予め定められた距離内にあるもの
を、それら全てを包含する罫線矩形に統合し、前記黒ラ
ンの統合の際に統合される黒ランの相互の位置関係、及
び、前記矩形の統合の際に統合される矩形の相互の位置
関係によって、入力画像の傾きの方向を判定することを
特徴とする画像傾き検出方法。3. A black run having a length equal to or greater than a certain value on an input image is extracted, and black runs within a predetermined distance of the extracted black runs are integrated into a rectangle including all of them to obtain a black run. The run integrated rectangles within a predetermined distance are integrated into a ruled line rectangle that includes all of them, and the mutual positional relationship of the black runs integrated when the black runs are integrated, and An image tilt detection method characterized in that the direction of tilt of an input image is determined based on the mutual positional relationship of the rectangles that are integrated when the rectangles are integrated.
の大小比較によって傾き方向を判定することを特徴とす
る請求項1または3記載の画像傾き検出方法。4. The image inclination detection method according to claim 1, wherein the inclination direction is determined by comparing the coordinates of the start point and the end point of the integrated black run.
大小比較によって傾きの方向を判定することを特徴とす
る請求項2または3記載の画像傾き検出方法。5. The image tilt detection method according to claim 2, wherein the tilt direction is determined by comparing the coordinates of the start point and the end point of the integrated rectangle.
各ペア毎に傾き方向の判定を行ない、傾きの方向毎にそ
の判定回数を計数し、計数した判定回数の多いほうの傾
きの方向を黒ランによる傾き方向の判定結果とすること
を特徴とする請求項1,3または4記載の画像傾き検出
方法。6. For multiple pairs of integrated black runs,
The tilt direction is determined for each pair, the number of times of judgment is counted for each direction of tilt, and the tilt direction with the larger number of times of judgment is used as the judgment result of the tilt direction by the black run. The image inclination detection method according to claim 1, 3 or 4.
つの矩形の範囲に関して行なうことを特徴とする請求項
6記載の画像傾き検出方法。7. The image inclination detecting method according to claim 6, wherein the inclination is determined with respect to one longest rectangular area on the input image.
ペア毎に傾き方向の判定を行ない、傾きの方向毎にその
判定回数を計数し、計数した判定回数の多いほうの傾き
の方向を矩形による傾き方向の判定結果とすることを特
徴とする請求項2,3または5記載の画像傾き検出方
法。8. The inclination direction is determined for each pair of a plurality of integrated rectangular pairs, the number of determinations is counted for each inclination direction, and the inclination direction having the larger number of determinations is the rectangle. The image inclination detecting method according to claim 2, 3 or 5, wherein the determination result of the inclination direction is obtained.
つの罫線矩形の範囲に関して行なうことを特徴とする請
求項8記載の画像傾き検出方法。9. The image inclination detecting method according to claim 8, wherein the inclination is determined with respect to the range of one longest ruled line rectangle on the input image.
形の長手方向のサイズで除した値を、該罫線矩形の短手
方向のサイズより減算し、該減算後のサイズと該罫線矩
形の長手方向のサイズとから、入力画像の傾き角度を求
めることを特徴とする請求項2または3に記載の画像傾
き検出方法。10. A value obtained by dividing the number of black pixels inside the ruled line rectangle by the size of the ruled line rectangle in the longitudinal direction is subtracted from the size of the ruled line rectangle in the lateral direction, and the size after the subtraction and the ruled line rectangle. The image inclination detection method according to claim 2, wherein the inclination angle of the input image is obtained from the size of the input image in the longitudinal direction.
方向のサイズで除した値を、該矩形の短手方向のサイズ
より減算し、該減算後のサイズと該矩形の長手方向のサ
イズとから、入力画像の傾き角度を求めることを特徴と
する請求項1記載の画像傾き検出方法。11. A value obtained by dividing the number of black pixels inside a rectangle by the size in the longitudinal direction of the rectangle is subtracted from the size in the lateral direction of the rectangle, and the size after the subtraction and the length in the longitudinal direction of the rectangle are subtracted. The image inclination detecting method according to claim 1, wherein the inclination angle of the input image is obtained from the size.
9のいずれか1項に記載の方法によって検出するととも
に、該入力画像の傾きの角度を請求項10または11記
載の方法によって検出し、該検出した傾きの方向及び角
度に基づいて該入力画像の傾きを補正した画像を作成
し、該傾き補正画像より罫線の矩形を抽出し、該抽出し
た罫線の矩形の座標より表の枠を認識し、該認識した枠
の内部の文字画像を該傾き補正画像より切り出して文字
認識をすることを特徴とする表処理方法。12. The method according to claim 1, wherein the tilt direction of the input image is detected, and the tilt angle of the input image is detected by the method according to claim 10. An image in which the tilt of the input image is corrected based on the detected tilt direction and angle, a ruled line rectangle is extracted from the tilt corrected image, and a table frame is formed from the extracted ruled line rectangle coordinates. A table processing method, which comprises recognizing and slicing a character image inside the recognized frame from the tilt correction image for character recognition.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24891493A JP3443141B2 (en) | 1993-10-05 | 1993-10-05 | Image tilt detection method and table processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP24891493A JP3443141B2 (en) | 1993-10-05 | 1993-10-05 | Image tilt detection method and table processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH07105310A true JPH07105310A (en) | 1995-04-21 |
JP3443141B2 JP3443141B2 (en) | 2003-09-02 |
Family
ID=17185305
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP24891493A Expired - Fee Related JP3443141B2 (en) | 1993-10-05 | 1993-10-05 | Image tilt detection method and table processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3443141B2 (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FR2766180A1 (en) * | 1997-07-17 | 1999-01-22 | Rhone Poulenc Rorer Sa | MEDICINAL PRODUCTS CONTAINING AS ACTIVE SUBSTANCE A 2- (1,2,3,4-TETRAHYDROXYBUTYL) PYRAZINE DERIVATIVE, NEW DERIVATIVES OF 2- (1,2,3,4-TETRAHYDROXYBUTYL) PYRAZINE AND THEIR PREPARATION |
FR2766185A1 (en) * | 1997-07-18 | 1999-01-22 | Rhone Poulenc Rorer Sa | MEDICINAL PRODUCTS CONTAINING AS AT LEAST ONE SUBSTITUTED POLYHYDROXYLALKYLPYRAZINE DERIVATIVE, THE NEW POLYHYDROXYLALKYLPYRAZINE DERIVATIVES AND THEIR PREPARATION |
US9679217B2 (en) | 2014-08-26 | 2017-06-13 | Kabushiki Kaisha Toshiba | Information processing apparatus, information processing system, information processing method and storage medium |
US9819860B2 (en) | 2015-03-09 | 2017-11-14 | Kabushiki Kaisha Toshiba | Data processor, data processing method and storage medium |
US10121086B2 (en) | 2015-07-14 | 2018-11-06 | Kabushiki Kaisha Toshiba | Information processing apparatus and information processing method |
CN110837796A (en) * | 2019-11-05 | 2020-02-25 | 泰康保险集团股份有限公司 | Image processing method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS59142678A (en) * | 1983-02-03 | 1984-08-15 | Ricoh Co Ltd | Frame recognizing system |
JPH0496878A (en) * | 1990-08-15 | 1992-03-30 | Hitachi Ltd | Image tilt detection method |
JPH05128306A (en) * | 1991-11-08 | 1993-05-25 | Oki Electric Ind Co Ltd | Attribute discriminating method for sentence picture |
JPH0652309A (en) * | 1992-07-31 | 1994-02-25 | Hitachi Ltd | Tilt detection method and image processing apparatus |
JPH0676108A (en) * | 1992-08-24 | 1994-03-18 | Oki Electric Ind Co Ltd | Tilt detecting method for document image |
JPH06150060A (en) * | 1992-11-12 | 1994-05-31 | Ricoh Co Ltd | Image inclination detecting method and table processing method |
JPH06203202A (en) * | 1992-12-28 | 1994-07-22 | Ricoh Co Ltd | Image processor |
-
1993
- 1993-10-05 JP JP24891493A patent/JP3443141B2/en not_active Expired - Fee Related
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS59142678A (en) * | 1983-02-03 | 1984-08-15 | Ricoh Co Ltd | Frame recognizing system |
JPH0496878A (en) * | 1990-08-15 | 1992-03-30 | Hitachi Ltd | Image tilt detection method |
JPH05128306A (en) * | 1991-11-08 | 1993-05-25 | Oki Electric Ind Co Ltd | Attribute discriminating method for sentence picture |
JPH0652309A (en) * | 1992-07-31 | 1994-02-25 | Hitachi Ltd | Tilt detection method and image processing apparatus |
JPH0676108A (en) * | 1992-08-24 | 1994-03-18 | Oki Electric Ind Co Ltd | Tilt detecting method for document image |
JPH06150060A (en) * | 1992-11-12 | 1994-05-31 | Ricoh Co Ltd | Image inclination detecting method and table processing method |
JPH06203202A (en) * | 1992-12-28 | 1994-07-22 | Ricoh Co Ltd | Image processor |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
FR2766180A1 (en) * | 1997-07-17 | 1999-01-22 | Rhone Poulenc Rorer Sa | MEDICINAL PRODUCTS CONTAINING AS ACTIVE SUBSTANCE A 2- (1,2,3,4-TETRAHYDROXYBUTYL) PYRAZINE DERIVATIVE, NEW DERIVATIVES OF 2- (1,2,3,4-TETRAHYDROXYBUTYL) PYRAZINE AND THEIR PREPARATION |
WO1999003838A1 (en) * | 1997-07-17 | 1999-01-28 | Rhone-Poulenc Rorer S.A. | 2-(1,2,3,4-tetrahydroxybutyl)pyrazine derivatives, preparation and medicines containing them |
FR2766185A1 (en) * | 1997-07-18 | 1999-01-22 | Rhone Poulenc Rorer Sa | MEDICINAL PRODUCTS CONTAINING AS AT LEAST ONE SUBSTITUTED POLYHYDROXYLALKYLPYRAZINE DERIVATIVE, THE NEW POLYHYDROXYLALKYLPYRAZINE DERIVATIVES AND THEIR PREPARATION |
WO1999003843A1 (en) * | 1997-07-18 | 1999-01-28 | Rhone-Poulenc Rorer S.A. | Polyhydroxyalkylpyrazine derivatives, preparation and medicines containing them |
US9679217B2 (en) | 2014-08-26 | 2017-06-13 | Kabushiki Kaisha Toshiba | Information processing apparatus, information processing system, information processing method and storage medium |
US9819860B2 (en) | 2015-03-09 | 2017-11-14 | Kabushiki Kaisha Toshiba | Data processor, data processing method and storage medium |
US10121086B2 (en) | 2015-07-14 | 2018-11-06 | Kabushiki Kaisha Toshiba | Information processing apparatus and information processing method |
CN110837796A (en) * | 2019-11-05 | 2020-02-25 | 泰康保险集团股份有限公司 | Image processing method and device |
CN110837796B (en) * | 2019-11-05 | 2022-08-19 | 泰康保险集团股份有限公司 | Image processing method and device |
Also Published As
Publication number | Publication date |
---|---|
JP3443141B2 (en) | 2003-09-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2595158B2 (en) | Automatic picture / character separation apparatus for image information and its method | |
US5613016A (en) | Area discrimination system for text image | |
JPH03201866A (en) | Decision of picture skew angle from data including data of compressed form | |
US6188790B1 (en) | Method and apparatus for pre-recognition character processing | |
CN103198468A (en) | Image processing apparatus, image processing method, and image processing system | |
US6493470B1 (en) | Image processing method and apparatus for detecting the tilt amount of input image data | |
US7612918B2 (en) | Image processing apparatus | |
JPH11341259A (en) | Document image skew correction method | |
JP3443141B2 (en) | Image tilt detection method and table processing method | |
US7151859B2 (en) | Method and system for correcting direction or orientation of document image | |
US7415168B2 (en) | Image reading device | |
JPH07288679A (en) | Image processing unit | |
JP2009284190A (en) | Image reading apparatus and image reading system | |
JPH07230525A (en) | Method for recognizing ruled line and method for processing table | |
JP3359377B2 (en) | Background concentration detector | |
JPH11288453A (en) | Method and system for detecting skew angle and black boundary line of original image in scan environment for reproduction | |
JP2005020413A (en) | Image processor, image processing method and program for making computer execute the method | |
JP2004056181A (en) | Image processor | |
JP2602089B2 (en) | Character recognition device | |
JP3177508B2 (en) | Image processing device | |
JPH0581475A (en) | Character area extracting method | |
JP2859307B2 (en) | Character extraction device | |
JP3274063B2 (en) | Image tilt detector | |
JPH06150060A (en) | Image inclination detecting method and table processing method | |
JPH08221515A (en) | Image processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080620 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090620 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090620 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100620 Year of fee payment: 7 |
|
LAPS | Cancellation because of no payment of annual fees |