JP2001109888A - Ruled-line extraction system - Google Patents

Ruled-line extraction system

Info

Publication number
JP2001109888A
JP2001109888A JP28790999A JP28790999A JP2001109888A JP 2001109888 A JP2001109888 A JP 2001109888A JP 28790999 A JP28790999 A JP 28790999A JP 28790999 A JP28790999 A JP 28790999A JP 2001109888 A JP2001109888 A JP 2001109888A
Authority
JP
Japan
Prior art keywords
image
ruled line
extracting
ruled
processing
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
JP28790999A
Other languages
Japanese (ja)
Other versions
JP4409678B2 (en
Inventor
Atsuko Obara
敦子 小原
Satoshi Naoi
聡 直井
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP28790999A priority Critical patent/JP4409678B2/en
Publication of JP2001109888A publication Critical patent/JP2001109888A/en
Application granted granted Critical
Publication of JP4409678B2 publication Critical patent/JP4409678B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a ruled-line extraction system which can perform a ruled- line extracting process corresponding to the quality of an image. SOLUTION: An image input means 101 obtains an input image and image generating means 102 with different resolutions generates a low-resolution image and a high-resolution image. A ruled-line candidate area extracting means 103 extracts a ruled-line candidate area by using the generated low-resolution image. A quality evaluating means 104 for an image searches the pixels in the extracted ruled-line candidate area to evaluate the quality of the image and a means 105 which selects a processing method or threshold according to the quality selects a processing method or threshold matching the image quality according to the result of the evaluation by the quality evaluating means 104. A means 106 for selecting image resolution by partial processes selects an image to be processed according to the image quality. Through the means mentioned above, the proper processing method, threshold, and image to be processed for a ruled-line extracting means 17 are selected to extract a ruled line.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、罫線抽出方式に係
わり、特にOCR等の文字認識装置において画像の品質
に対応して罫線を抽出するための罫線抽出方式に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a ruled line extraction method, and more particularly to a ruled line extraction method for extracting ruled lines corresponding to image quality in a character recognition device such as an OCR.

【0002】近年、スキャナ等の入力機器の普及に伴っ
て、文字認識装置(またはソフト)OCRの需要が増加
している。個々の文字の高い認識率を実現するために
は、認識の前段階である切り出し処理がその正確さの点
で重要になる。これまで、帳票等の処理をOCRで行う
場合には、あらかじめ罫線の位置や線の太さといった情
報を指定して文字の書かれている範囲についての情報を
格納しておく必要があった。また、帳票フォーマットを
変更する度に情報入力の必要があり、ユーザにとって負
担となっていた。本発明は、このような問題を解決する
技術であり、位置、形式ともに未知である帳票画像に対
して、また、画質の品質が良くても悪くても、表形式の
枠の罫線を正確に抽出することの可能な方式についてで
ある。
In recent years, with the spread of input devices such as scanners, the demand for a character recognition device (or software) OCR has been increasing. In order to realize a high recognition rate of each character, a clipping process, which is a stage before recognition, is important in terms of its accuracy. Heretofore, when processing a form or the like by OCR, it has been necessary to specify information such as the position of ruled lines and the thickness of lines in advance and store information about a range in which characters are written. Further, it is necessary to input information every time the form format is changed, which is a burden on the user. The present invention is a technique for solving such a problem, and accurately forms a ruled line of a table-shaped frame for a form image whose position and format are unknown, and whether the quality of the image quality is good or bad. This is a method that can be extracted.

【0003】なお、本技術は、文字認識装置だけでな
く、図面認識における直線認識、画像中の罫線と物体、
図形、文字の接触部分の分離などのように、広い意味で
の直線抽出を行う技術に応用することも可能である。
[0003] It should be noted that the present technology is applicable not only to character recognition devices but also to line recognition in drawing recognition, ruled lines in images and objects,
The present invention can be applied to a technique for extracting a straight line in a broad sense, such as separation of a contact portion between a figure and a character.

【0004】[0004]

【従来の技術】従来から一般に使用されているOCRで
は、あらかじめ罫線の位置情報や線の太さ等の情報を帳
票データとして格納しておく必要があり、フォーマット
を変える度に、情報入力の時間がかかり、また未知の形
式の帳票は処理を行うことができない、という問題が生
じていた。
2. Description of the Related Art In the conventional OCR, it is necessary to store information such as ruled line position information and line thickness in advance as form data. However, there is a problem that a form in an unknown format cannot be processed.

【0005】そこで、本出願人は、先に特願平9−50
527にて、あらかじめ枠の情報を必要としない処理方
式を提案した。ここに記載されている方式は、図44に
示すように、連結パターン抽出部4401により抽出さ
れた部分パターンから、横直線抽出部4403及び縦直
線抽出部4410により直線を抽出し、横直線抽出部4
403で抽出された横直線を横枠決定部4417により
上部から2本ずつ組にして横枠とし、縦直線抽出部44
10で抽出された縦直線の中から縦枠決定部4418に
より縦枠を決定し、2本の横枠と2本の縦枠で囲まれる
矩形範囲を、矩形表現部4422により枠として抽出す
る。そして、枠を構成する罫線候補を本来の罫線である
とし、枠を構成しない罫線候補は罫線以外のパターンで
あるとし、罫線ではないとする処理を行う。
Therefore, the present applicant has previously filed Japanese Patent Application No. 9-50 / 1990.
At 527, a processing method that does not require frame information in advance was proposed. In the method described here, as shown in FIG. 44, a straight line is extracted by a horizontal straight line extracting unit 4403 and a vertical straight line extracting unit 4410 from the partial pattern extracted by the connected pattern extracting unit 4401, and the horizontal straight line extracting unit 4
The horizontal straight line extracted in 403 is grouped two by two from the top by the horizontal frame determining unit 4417 to form a horizontal frame, and the vertical straight line extracting unit 4417.
A vertical frame is determined by the vertical frame determining unit 4418 from the vertical straight lines extracted in step 10, and a rectangular range surrounded by two horizontal frames and two vertical frames is extracted as a frame by the rectangular expression unit 4422. Then, it is assumed that the ruled line candidates forming the frame are the original ruled lines, and the ruled line candidates not forming the frame are patterns other than the ruled lines, and are not ruled lines.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、実際に
上述したような処理を行う場合には、掠れや潰れなどを
含む様々な低品質の画像も対象とする必要があり、実際
にスキャナで取り込んだ画像データには、品質の良い画
像と悪い画像とが混在している場合が多い。現状では、
画像の品質の良い場合または悪い場合のそれぞれの場合
において、適当な処理または閾値などを設定することは
可能である。
However, when the above-described processing is actually performed, it is necessary to target various low-quality images including blurring and crushing. Image data often includes both high-quality images and poor-quality images. In the present circumstances,
In each case of good or bad image quality, it is possible to set appropriate processing or thresholds.

【0007】しかし、品質の良い画像として設定を行っ
た場合、画像に部分的に品質が悪いところを含んでいる
と、文字認識の精度が下がってしまう可能性がある。ま
た、品質の悪い画像として設定を行った場合も、画像に
部分的に品質が良いところを含んでいると、文字認識の
精度が下がってしまう可能性がある。
However, when the image is set as a high-quality image, the accuracy of character recognition may be reduced if the image includes a part of low quality. In addition, even when the image is set as a low quality image, if the image includes a part of high quality, the accuracy of character recognition may be reduced.

【0008】例えば、品質の良い画像として設定された
場合には、低解像度画像を用いた処理を行うことになる
が、低解像度の画像だけを用いた処理方式では、比較的
潰れた画像に対して処理を行うことになるため、掠れの
影響は少なくなり、掠れ画像に対しては精度が高いが、
それ以外の画像に対しては、潰れの影響で精度が下が
る。
For example, when a high-quality image is set, processing using a low-resolution image is performed. However, in a processing method using only a low-resolution image, a relatively crushed image is processed. The effect of blurring is reduced, and the accuracy is high for blurred images.
For other images, the accuracy is reduced due to the influence of the collapse.

【0009】また、品質の悪い画像として設定された場
合には、高解像度画像を用いた処理を行うことになる
が、高解像度の画像だけを用いた処理方式では、品質の
良い画像や、潰れ画像に対しては細かく調査することが
できるため精度が高くなる。しかし、掠れ画像に対して
は、掠れの影響が大きくなるため、精度が低くなる。
When an image is set as a low-quality image, processing using a high-resolution image is performed. However, in a processing method using only high-resolution images, a high-quality image The accuracy can be improved because the image can be examined in detail. However, for a blurred image, the influence of the blurring becomes large, so that the accuracy becomes low.

【0010】そこで、品質の悪い画像であっても、品質
の良い画像であっても、またそれらの画像が混在してい
る場合であっても、高精度に罫線、及び四方を罫線候補
で囲まれた矩形領域であるセル領域を自動的に抽出する
ことができる技術が求められている。
Therefore, even if the image is of poor quality, good quality, or a mixture of these images, the ruled lines and the four sides are surrounded with ruled line candidates with high precision. There is a need for a technology that can automatically extract a cell region that is a rectangular region that has been formed.

【0011】本発明の課題は、画像の品質に対応した罫
線抽出処理を行う、罫線抽出方式を提供することであ
る。
An object of the present invention is to provide a ruled line extraction method for performing a ruled line extraction process corresponding to the quality of an image.

【0012】[0012]

【課題を解決するための手段】上述した課題を解決する
ために、請求項1の発明よれば、入力画像から異なる解
像度の画像を生成する手段と、前記入力画像の品質を評
価する手段と、前記異なる解像度の画像の中から前記品
質に応じた解像度の画像を選択する手段と、該選択され
た画像から罫線またはセルを抽出する手段と、を備えて
いる。このことにより、入力画像の品質の評価結果をも
とに、適した画像を選択して罫線抽出をすることが可能
となることから、罫線抽出の精度を向上させることが可
能となる。
In order to solve the above-mentioned problems, according to the first aspect of the present invention, means for generating images of different resolutions from an input image, means for evaluating the quality of the input image, Means for selecting an image having a resolution corresponding to the quality from among the images having different resolutions; and means for extracting ruled lines or cells from the selected image. This makes it possible to select a suitable image and extract ruled lines based on the evaluation result of the quality of the input image, thereby improving the accuracy of ruled line extraction.

【0013】また、請求項2の発明によれば、画像デー
タ内の帳票を構成する罫線を抽出する罫線抽出方式であ
って、入力画像から異なる解像度の画像を生成する手段
と、前記入力画像から異なる解像度の画像を生成する手
段によって生成された画像を用いて入力画像の品質を評
価する手段と、前記入力画像の品質を評価する手段にお
いて評価された品質に基づいて、罫線またはセルを抽出
するための処理方法または該処理に用いられる閾値の選
択を行う手段と、前記入力画像のそれぞれの部分から罫
線またはセルを抽出するための処理に適する画像解像度
を選択する手段と、前記選択された画像解像度の画像か
ら、前記罫線またはセルを抽出するための処理方法また
は該処理に用いられる閾値の選択を行う手段によって選
択された処理方法または閾値に基づいて、帳票を構成す
る罫線またはセルを抽出する手段と、を備える。このこ
とにより、入力画像の品質の評価結果をもとに、適した
画像を選択して罫線抽出をすることが可能となることか
ら、罫線抽出の精度を向上させることが可能となる。
According to a second aspect of the present invention, there is provided a ruled line extraction method for extracting a ruled line forming a form in image data, comprising: means for generating images having different resolutions from an input image; Means for evaluating the quality of the input image using the images generated by the means for generating images of different resolutions, and extracting ruled lines or cells based on the quality evaluated by the means for evaluating the quality of the input image Means for selecting a processing method or a threshold value used for the processing, means for selecting an image resolution suitable for processing for extracting ruled lines or cells from respective portions of the input image, and selecting the selected image A processing method for extracting the ruled line or the cell from an image of resolution or a processing method selected by a unit for selecting a threshold used in the processing Other comprises based on a threshold, and means for extracting a ruled line or cell constituting a form, a. This makes it possible to select a suitable image and extract ruled lines based on the evaluation result of the quality of the input image, thereby improving the accuracy of ruled line extraction.

【0014】また、請求項3の発明によれば、前記入力
画像から異なる解像度の画像を生成する手段は、入力画
像から間引くデータが多い低解像度画像と入力画像から
間引くデータが少ない高解像度画像を作成する。このこ
とにより、後の処理で適切な解像度の画像を用いること
が可能となる。
According to the third aspect of the present invention, the means for generating images having different resolutions from the input image includes a low-resolution image having a large amount of data to be thinned out from the input image and a high-resolution image having a small amount of data to be thinned out from the input image. create. This makes it possible to use an image with an appropriate resolution in subsequent processing.

【0015】また、請求項4の発明によれば、前記入力
画像の品質を評価する手段は、数値で該品質を表現する
ことを特徴とする。このことにより、画像の品質を数値
化することが可能となる。
According to a fourth aspect of the present invention, the means for evaluating the quality of the input image expresses the quality by a numerical value. This makes it possible to quantify the image quality.

【0016】また、請求項5の発明によれば、前記画像
の品質を評価する手段による処理を行う前に、あらかじ
め罫線候補領域を抽出する罫線候補領域抽出手段を更に
備える。このことにより、必要とされる部分の画像の品
質を算出することが可能となる。
According to a fifth aspect of the present invention, the image processing apparatus further comprises a ruled line candidate area extracting means for extracting a ruled line candidate area before performing the processing by the image quality evaluating means. This makes it possible to calculate the image quality of the required part.

【0017】また、請求項6の発明によれば、前記罫線
候補領域抽出手段は、低解像度画像を用いて罫線候補の
抽出処理をする。このことにより、画像が掠れている場
合であっても罫線候補位置をより正確に抽出することが
できる。
According to the invention of claim 6, the ruled line candidate area extracting means performs a ruled line candidate extracting process using a low resolution image. This makes it possible to more accurately extract ruled line candidate positions even when the image is blurred.

【0018】また、請求項7の発明によれば、前記罫線
候補領域抽出手段による処理を行う前に、低解像度画像
を用いて点線の抽出を行い、点線を構成するパターンを
除去する処理を行う。低解像度画像を用いることで、画
像が掠れている場合であっても罫線候補位置をより正確
に抽出できるとともに、確実に点線であるとわかる部分
を除去することができる。
Further, according to the present invention, before performing the processing by the ruled line candidate area extracting means, a process of extracting a dotted line using a low resolution image and removing a pattern constituting the dotted line is performed. . By using a low-resolution image, even when the image is blurred, ruled line candidate positions can be more accurately extracted, and a portion that is known as a dotted line can be reliably removed.

【0019】また、請求項8の発明によれば、低解像度
画像を用いて抽出された罫線候補領域内を、高解像度画
像を用いて点線抽出処理および罫線抽出処理を行うこと
で、罫線の属性を判断する。このことにより、低解像度
画像では潰れてしまいそうな点と点の間隔が短い点線で
もより正確に抽出することが可能となり、点線が誤って
直線候補となった場合でも、より精度を保って処理を行
うことが可能となる。
According to the eighth aspect of the present invention, the ruled line candidate area extracted using the low resolution image is subjected to the dotted line extraction processing and the ruled line extraction processing using the high resolution image, whereby the attribute of the ruled line is obtained. Judge. This makes it possible to more accurately extract even a dotted line with a short interval between points that are likely to be crushed in a low-resolution image, and processing with higher accuracy even if the dotted line is a line candidate by mistake. Can be performed.

【0020】また、請求項9の発明によれば、画像の品
質を評価する手段は、罫線候補領域抽出手段で用いた画
像とは異なる解像度( より高い解像度の画像) の画像を
用いて画像の品質の評価を行う。このことより、低解像
度画像におこる潰れによる影響をなくすことができる。
According to the ninth aspect of the present invention, the means for evaluating the quality of the image uses an image having a different resolution (higher resolution image) from the image used in the ruled line candidate area extracting means. Evaluate the quality. As a result, it is possible to eliminate the influence of the crushing that occurs on the low-resolution image.

【0021】また、請求項10の発明によれば、前記画
像の品質する手段において、罫線候補領域内を調査する
場合に、罫線候補領域内を縦または横方向に画素探索を
行うことで、画像の掠れ度合いを掠れ度という数値で算
出する。このことにより、掠れの度合いを詳細に調査す
ることができる。
According to the tenth aspect of the present invention, in the means for improving the quality of the image, when the inside of the ruled line candidate area is examined, a pixel search is performed in the ruled line candidate area in the vertical or horizontal direction. Is calculated by a numerical value called the degree of scrutiny. Thus, the degree of flaring can be investigated in detail.

【0022】また、請求項11の発明によれば、前記掠
れ度は、罫線候補領域内を画素探索することで、罫線パ
ターンの途切れの回数及び途切れの長さを求め、それぞ
れを単位長さ当たりに換算したものを加算して求める。
このことにより、掠れの度合いを数値化することができ
る。
According to the eleventh aspect of the present invention, the sharpness is obtained by searching for a pixel in a ruled line candidate area to determine the number of breaks and the length of the break in the ruled line pattern. Add the value converted to
This makes it possible to quantify the degree of shading.

【0023】また、請求項12の発明によれば、前記品
質に基づいて、罫線またはセルを抽出するための処理方
法または該処理に用いられる閾値の選択を行う手段は、
画像の品質を数値で表現した値に応じた罫線抽出の処理
方法または罫線抽出処理に用いられる閾値を選択し、設
定する。このことにより、画像の品質に適応した処理方
法または閾値によって、より高精度に罫線を抽出するこ
とができる。
According to the twelfth aspect of the present invention, a processing method for extracting a ruled line or a cell based on the quality or a means for selecting a threshold used in the processing is provided.
A rule line extraction processing method or a threshold value used for the rule line extraction process is selected and set in accordance with a value expressing the image quality by a numerical value. As a result, ruled lines can be extracted with higher accuracy by a processing method or a threshold value adapted to image quality.

【0024】また、請求項13の発明によれば、前記入
力画像のそれぞれの部分に対して罫線またはセルを抽出
するための処理に適する画像解像度を選択する手段は、
画像の品質を数値で表現した値に基づいて、後の罫線抽
出処理に用いる画像を選択する。このことにより、画像
の品質が悪い場合に、より品質の良い画像を用いて処理
を行うことが可能となり、より高精度に罫線抽出ができ
る。
According to the thirteenth aspect of the present invention, the means for selecting an image resolution suitable for processing for extracting a ruled line or a cell for each part of the input image,
An image to be used in the subsequent ruled line extraction process is selected based on a value representing the image quality by a numerical value. As a result, when the quality of the image is poor, it is possible to perform processing using a higher quality image, and it is possible to extract ruled lines with higher accuracy.

【0025】また、請求項14の発明によれば、前記掠
れ度は、画像データ全体に対する値と画像データの各部
分に対する値とのいずれも算出することができる。この
ことにより、一つの画像の各部分の画像の品質も判定す
ることができる。
According to the fourteenth aspect of the present invention, it is possible to calculate both the value for the entire image data and the value for each part of the image data. Thereby, the quality of the image of each part of one image can also be determined.

【0026】また、請求項15の発明によれば、前記入
力画像のそれぞれの部分に対して罫線またはセルを抽出
するための処理に適する画像解像度を選択する手段は、
画像データの各部分に対して求められた掠れ度に基づい
て、後の罫線抽出処理において画像データの各部分の処
理毎に適した解像度の画像を選択する。このことによ
り、部分的に掠れのある画像にも対応することができ
る。
According to the fifteenth aspect of the present invention, the means for selecting an image resolution suitable for processing for extracting a ruled line or a cell for each part of the input image,
Based on the degree of blurring obtained for each part of the image data, an image having a resolution suitable for each processing of each part of the image data in the subsequent ruled line extraction processing is selected. As a result, it is possible to cope with a partially blurred image.

【0027】また、請求項16の発明によれば、前記罫
線またはセルを抽出する手段は、画像の品質に基づい
て、前記罫線候補領域抽出手段で用いた画像とは異なる
解像度の画像を用いることも可能である。このことによ
り、掠れのある画像の場合には、罫線候補領域を抽出し
た画像より低解像度の画像かまたは同一の画像を用いて
再度罫線抽出処理を行うことができ、より高精度の罫線
を抽出できる。
According to the sixteenth aspect of the present invention, the means for extracting the ruled line or cell uses an image having a resolution different from the image used by the ruled line candidate area extracting means based on the quality of the image. Is also possible. As a result, in the case of a blurred image, the ruled line extraction processing can be performed again using an image having a lower resolution than the image from which the ruled line candidate region has been extracted or the same image, and a more accurate ruled line can be extracted. it can.

【0028】また、請求項17の発明によれば、前記罫
線またはセルを抽出する手段は、掠れのない画像である
と判断された場合に、より高解像度な画像を用い、掠れ
のある画像であると判断された場合に、より低解像度な
画像を用いる。このことにより、より高精度に罫線を抽
出できる。
According to the seventeenth aspect of the present invention, the means for extracting the ruled line or the cell uses a higher resolution image when it is determined that the image is not blurred. If it is determined that there is, an image with a lower resolution is used. As a result, ruled lines can be extracted with higher accuracy.

【0029】また、請求項18の発明によれば、掠れに
よって複数部分に分離した帳票を含む画像から罫線を抽
出する罫線抽出方法に関して、入力画像において縦、
横、斜めの八方向のいずれかで繋がっているパターンを
連結パターンとして抽出し、抽出された連結パターンの
うち、ある一定の大きさを有するもの同士が接近して位
置している場合、それらのパターン間の白画素領域の形
状を用いて、同一の表を構成するか否かの判断を行う。
これにより、掠れ等によって分離した帳票の表構造を正
確に抽出することが可能となる。
According to the eighteenth aspect of the present invention, there is provided a ruled line extracting method for extracting ruled lines from an image including a form separated into a plurality of portions by shading.
A pattern connected in any one of the eight horizontal and diagonal directions is extracted as a connection pattern, and among the extracted connection patterns, those having a certain size are located close to each other. Using the shape of the white pixel area between the patterns, it is determined whether or not the same table is formed.
This makes it possible to accurately extract the table structure of a form separated by shading or the like.

【0030】また、請求項20の発明によれば、掠れに
よって複数部分に分離した帳票を含む画像から罫線を抽
出する罫線抽出方法に関して、入力画像において縦、
横、斜めの八方向のいずれかで繋がっているパターンを
連結パターンとして抽出し、抽出された連結パターンの
うち、ある一定の大きさを有するもの同士が接近して位
置している場合、それらのパターンの端の黒画素の形状
を用いて、同一の表を構成するか否かの判断を行う。こ
れにより、掠れ等によって分離した帳票の表構造を正確
に抽出することが可能となる。
According to the twentieth aspect of the present invention, there is provided a ruled line extracting method for extracting a ruled line from an image including a form separated into a plurality of portions by shading.
A pattern connected in any one of the eight horizontal and diagonal directions is extracted as a connection pattern, and among the extracted connection patterns, those having a certain size are located close to each other. Using the shape of the black pixel at the end of the pattern, it is determined whether the same table is formed. This makes it possible to accurately extract the table structure of a form separated by shading or the like.

【0031】また、請求項22の発明によれば、掠れに
よって複数部分に分離した帳票を含む画像から罫線を抽
出する罫線抽出方法に関して、入力画像において縦、
横、斜めの八方向のいずれかで繋がっているパターンを
連結パターンとして抽出し、抽出された連結パターンの
うち、ある一定の大きさを有するもの同士が接近して位
置していた場合、それらのパターンから罫線の抽出を行
い、それぞれのパターンから抽出された罫線位置に対応
関係が一致すれば同一の表を構成すると判断して統合処
理を行う。これにより、掠れ等によって分離した帳票の
表構造を正確に抽出することが可能となる。
According to the twenty-second aspect of the present invention, there is provided a ruled line extracting method for extracting a ruled line from an image including a form separated into a plurality of parts by shading.
A pattern connected in any one of the eight horizontal and diagonal directions is extracted as a connection pattern, and when extracted connection patterns having a certain size are located close to each other, those connection patterns are extracted. Rule lines are extracted from the patterns, and if the correspondences match the rule positions extracted from the respective patterns, it is determined that the same table is to be formed, and the integration process is performed. This makes it possible to accurately extract the table structure of a form separated by shading or the like.

【0032】[0032]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照しながら説明する。図1は、本発明の第1実施例
による罫線抽出方式を示すブロック図である。図1にお
いて、画像入力手段101により入力画像が取得され、
異なる解像度の画像生成手段102は入力画像からデー
タを間引くことによって低解像度画像( 図2( a))、高
解像度画像( 図2( b))を作成する。なお、高解像度画
像とは、入力画像の解像度に等しいかまたはそれより低
い解像度の画像のことをいい、低解像度画像とは高解像
度画像より低い解像度の画像のことをいう。罫線候補領
域抽出手段103は生成された低解像度画像を用いて罫
線候補領域を抽出する。画像の品質評価手段104は、
高解像度画像の直線候補領域内の画素を探索することに
より、画像の品質を評価する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a ruled line extraction method according to a first embodiment of the present invention. In FIG. 1, an input image is acquired by an image input unit 101,
The image generating means 102 having different resolutions creates a low-resolution image (FIG. 2A) and a high-resolution image (FIG. 2B) by thinning out data from the input image. Note that a high-resolution image refers to an image having a resolution equal to or lower than the resolution of an input image, and a low-resolution image refers to an image having a lower resolution than a high-resolution image. The ruled line candidate area extracting means 103 extracts ruled line candidate areas using the generated low-resolution image. Image quality evaluation means 104 includes:
The quality of the image is evaluated by searching for pixels in the line candidate area of the high-resolution image.

【0033】また、画像の品質評価手段104は、画像
データ全体の品質評価を行うとともに、画像データの各
部分の品質評価をすることも可能である。品質に応じた
処理方法または閾値を選択する手段105は、画像の品
質評価手段104で評価した結果に基づいて、画像品質
に適応した処理方法または閾値の選択を行う。また、部
分処理毎に適した画像解像度を選択する手段106は、
画像品質に基づいて、処理対象とする画像を選択する。
または、画像の各部分に対して求められた画像の品質に
基づいて画像の各部分を処理する際に用いる画像の解像
度を選択する。以上の前処理から、より正確な罫線抽出
処理が罫線抽出処理手段107によって行うことが可能
である。
The image quality evaluation means 104 can evaluate the quality of the entire image data and also can evaluate the quality of each part of the image data. The means 105 for selecting a processing method or a threshold value according to the quality selects a processing method or a threshold value adapted to the image quality based on the result evaluated by the image quality evaluation means 104. The means 106 for selecting an image resolution suitable for each partial process is
An image to be processed is selected based on the image quality.
Alternatively, the resolution of the image used when processing each part of the image is selected based on the image quality obtained for each part of the image. From the above preprocessing, more accurate ruled line extraction processing can be performed by the ruled line extraction processing unit 107.

【0034】罫線候補領域抽出手段103では、掠れの
影響を受けて直線として抽出できないような場合でも、
低解像度画像を用いるため掠れた部分が潰れて直線と判
別することができるようになり、罫線候補領域抽出の精
度を上げることができる。
In the ruled line candidate area extracting means 103, even if it cannot be extracted as a straight line due to the influence of blurring,
Since the low-resolution image is used, the sharpened portion is crushed and can be determined as a straight line, and the accuracy of ruled line candidate region extraction can be improved.

【0035】また、画像の品質評価手段104では、罫
線候補領域抽出手段103で抽出された直線候補領域内
を画素探索し、検出された途切れの回数および途切れの
長さを用いて罫線の掠れの度合い(掠れ度)の算出を行
う。算出された掠れ度を画像の品質として、品質に応じ
た処理方法を選択する手段または閾値を選択する手段1
05において適した画像解像度、適した処理及び閾値を
選択することが可能となる。
The image quality evaluation means 104 searches for a pixel in the straight line candidate area extracted by the ruled line candidate area extracting means 103, and uses the detected number of breaks and the length of the break to determine the blur of the ruled line. The degree (shearing degree) is calculated. Means 1 for selecting a processing method according to the quality or means for selecting a threshold, using the calculated degree of blur as image quality.
05, it is possible to select a suitable image resolution, a suitable process and a threshold.

【0036】本発明は、画像に掠れのある場合は、画像
の掠れの影響が少ない低解像度画像( 図2( a))を処理
画像として選択し、掠れのない画像においては、詳細な
部分に関して調査を行うことができるように高解像度画
像( 図2( b))を処理画像として選択して罫線を抽出し
ていくことが特徴である。このように本発明では、罫線
抽出処理の前処理として画像の品質評価を行い、その
後、評価結果に基づいて品質に適した処理を行うこと
で、罫線抽出処理の精度を向上させることができる。
According to the present invention, when an image is blurred, a low-resolution image (FIG. 2A) which is less affected by image blurring is selected as a processed image. A feature is that a high-resolution image (FIG. 2B) is selected as a processing image and ruled lines are extracted so that a survey can be performed. As described above, in the present invention, the accuracy of the ruled line extraction process can be improved by performing a quality evaluation of the image as a pre-process of the ruled line extraction process, and then performing a process suitable for the quality based on the evaluation result.

【0037】図3は、本発明の第2実施例による罫線抽
出方式を示すブロック図である。図3に示すように、本
実施例における罫線抽出方式は、低解像度画像作成部3
01、高解像度画像作成部302、連結パターン抽出部
303、点線抽出部304、点線画像消去部305、ラ
ベル統合処理部306、罫線候補領域抽出部307、罫
線属性判定部308、点線部を掠れ度算出処理の対象外
領域に設定する部分309、掠れ度算出部310、罫線
判別処理部311、罫線統合処理部312、セル抽出部
313から成る。
FIG. 3 is a block diagram showing a ruled line extraction method according to a second embodiment of the present invention. As shown in FIG. 3, the ruled line extraction method according to the present embodiment employs a low-resolution image creation unit 3.
01, a high-resolution image creation unit 302, a connection pattern extraction unit 303, a dotted line extraction unit 304, a dotted line image elimination unit 305, a label integration processing unit 306, a ruled line candidate region extraction unit 307, a ruled line attribute determination unit 308, It is composed of a part 309 to be set as a non-target area for calculation processing, a blurring degree calculation unit 310, a ruled line discrimination processing unit 311, a ruled line integration processing unit 312, and a cell extraction unit 313.

【0038】図3において、入力画像は極端な傾きのな
い2値画像である。低解像度画像作成部301、高解像
度画像作成部302では、入力された画像をOR間引き
を用いて縮小処理する。なお、作成された低解像度画
像、高解像度画像は後述の処理に用いられる画像とは別
に記憶しておき、表示装置での表示に用いる。また、図
3における連結パターン抽出部303から罫線候補領域
抽出307までは、掠れによって抽出できなくなること
を避けるために低解像度画像を用いる。
In FIG. 3, the input image is a binary image having no extreme inclination. The low-resolution image creation unit 301 and the high-resolution image creation unit 302 reduce the input image using OR thinning. Note that the created low-resolution image and high-resolution image are stored separately from images used for processing described later, and are used for display on a display device. A low-resolution image is used from the connection pattern extraction unit 303 to the ruled line candidate area extraction 307 in FIG.

【0039】図3の連結パターン抽出部303では、前
処理で得られた低解像度画像において8連結で繋がって
いるパターンをラベリングし、抽出する。「8連結で繋
がっている」のパターンとは、縦、横、斜めの8方向の
いずれかで繋がっているパターンを言う。上記ラベリン
グには、一般的な手法を用いることができる。なお、連
結パターン抽出部303により得られた画像内の各連結
パターンを部分パターンと呼ぶ。又、ラベリングで得ら
れた部分パターンの外接矩形が後述する処理で必要とな
るので、部分パターンを矩形に近似して得られる矩形の
角の座標をラベリングの処理中に算出しておく。
The connected pattern extracting unit 303 in FIG. 3 labels and extracts patterns connected by eight connections in the low-resolution image obtained in the preprocessing. The pattern “connected by eight connections” refers to a pattern that is connected in any one of eight vertical, horizontal, and diagonal directions. A general technique can be used for the labeling. Each connection pattern in the image obtained by the connection pattern extraction unit 303 is called a partial pattern. Since the circumscribed rectangle of the partial pattern obtained by the labeling is required in the processing described later, the coordinates of the corners of the rectangle obtained by approximating the partial pattern to the rectangle are calculated during the labeling processing.

【0040】図3の点線抽出処理部304では、連結パ
ターン抽出部303によってラベリングされた入力画像
において、点線を構成するパターンを抽出する。この場
合の抽出の対象となる点線を構成するパターンは、一定
の長さの線分を一定間隔で配列してなる破線や、異なる
長さの線分を規則的に配列してなる鎖線、同じサイズの
部分パターンが規則正しく配列する点線などがある。こ
の処理では、点線が抽出されればどのような手法を用い
ても構わない。以下に、同じサイズの部分パターンが規
則正しく並んでいる部分を点線部として抽出する場合の
点線抽出処理部304を、図4に示す点線を含む表を例
に説明する。
The dotted line extraction processing unit 304 in FIG. 3 extracts a pattern forming a dotted line from the input image labeled by the connection pattern extraction unit 303. In this case, the pattern constituting the dotted line to be extracted may be a dashed line in which segments of a fixed length are arranged at regular intervals, or a chain line in which segments of different lengths are regularly arranged. There are dotted lines in which size partial patterns are regularly arranged. In this processing, any method may be used as long as a dotted line is extracted. Hereinafter, the dotted line extraction processing unit 304 for extracting a portion where partial patterns of the same size are regularly arranged as a dotted line portion will be described using a table including dotted lines shown in FIG. 4 as an example.

【0041】まず、図5に示すように、図4のパターン
からラベリングにより算出されたラベルの外接矩形40
1内の画像の一部を縦または横方向に短冊501として
取り出す。そして、その短冊501の内部に存在するパ
ターンの大きさと、あらかじめ設定していた点線を構成
するパターンの大きさとを比較し、上記あらかじめ設定
していた点線を構成するパターンと同じ大きさを有する
部分パターンを探す(ここでは例として縦方向の点線を
抽出する場合を示す)。
First, as shown in FIG. 5, the circumscribed rectangle 40 of the label calculated by labeling from the pattern of FIG.
A part of the image in 1 is taken out as a strip 501 in the vertical or horizontal direction. Then, the size of the pattern existing inside the strip 501 is compared with the size of the pattern constituting the preset dotted line, and the portion having the same size as the pattern constituting the preset dotted line is compared. A pattern is searched (here, a case where a vertical dotted line is extracted is shown as an example).

【0042】次に、図6に示すように、あらかじめ設定
してあった大きさと同じ大きさの部分パターンが見つか
った部分を、図5の短冊501に垂直な( この場合は縦
方向に) 短冊601として切り出す。そして、この短冊
601の範囲内で、上記あらかじめ設定していた点線を
構成するパターンと同じ大きさを有する部分パターンを
抽出する。
Next, as shown in FIG. 6, a portion where a partial pattern having the same size as the previously set size is found is inserted into a strip perpendicular to the strip 501 in FIG. 5 (in this case, in the vertical direction). Cut out as 601. Then, a partial pattern having the same size as the pattern constituting the previously set dotted line is extracted within the range of the strip 601.

【0043】次に、図7に示すように、上記抽出された
部分パターンが、ある一定の間隔で並び、かつある一定
の数以上連続して並んでいるものを点線部と判断して、
これを矩形701により近似する。そして、図8に示す
ように、以上の処理を繰り返して、次々に点線を抽出
し、これらを矩形801により近似する。
Next, as shown in FIG. 7, a pattern in which the extracted partial patterns are arranged at a certain interval and are arranged continuously for a certain number or more is determined as a dotted line part.
This is approximated by a rectangle 701. Then, as shown in FIG. 8, the above processing is repeated to sequentially extract dotted lines, and these are approximated by a rectangle 801.

【0044】図9は点線抽出処理部304の動作を示す
フローチャートである。図9において、まず、ステップ
S901で、ラベリングされた入力画像の一部を横方
向、または縦方向に短冊状に切り出す。
FIG. 9 is a flowchart showing the operation of the dotted line extraction processing unit 304. In FIG. 9, first, in step S901, a part of the labeled input image is cut out in a strip shape in the horizontal direction or the vertical direction.

【0045】次に、ステップS902で、ステップS9
01で短冊状に切り出した範囲内で、ある一定の大きさ
の部分パターンが存在するかどうかを判定する。そし
て、ある一定の大きさの部分パターンが存在しない場
合、処理を終了する。一方、ステップS902におい
て、ある一定の大きさの部分パターンが存在すると判定
された場合、ステップS903に進み、抽出した部分パ
ターンを含み、かつステップS901で用いた短冊と垂
直な短冊状の画像を入力画像から切り出す。
Next, in step S902, step S9
It is determined whether or not a partial pattern of a certain size exists within the range cut out in a strip shape at 01. Then, when there is no partial pattern having a certain size, the process is terminated. On the other hand, if it is determined in step S902 that a partial pattern having a certain size exists, the process advances to step S903 to input a strip-shaped image including the extracted partial pattern and perpendicular to the strip used in step S901. Cut out from the image.

【0046】次に、ステップS904で、ステップS9
03で切り出した短冊状の画像の内部に、ある一定の大
きさの部分パターンが存在するかどうかを判定する。そ
して、ある一定の大きさの部分が存在しない場合、処理
を終了する。一方、ステップS904において、ある一
定の大きさの部分パターンが存在すると判定された場
合、ステップS905に進み、上記部分パターンを抽出
し、該部分パターンが一定の間隔で並んでいるかどうか
判定する。そして、該部分パターンが一定の間隔で並ん
でいない場合、処理を終了する。
Next, in step S904, step S9
It is determined whether or not a partial pattern having a certain size exists inside the strip-shaped image cut out in 03. Then, if there is no portion having a certain size, the process is terminated. On the other hand, if it is determined in step S904 that there is a partial pattern having a certain size, the process proceeds to step S905, where the partial patterns are extracted, and it is determined whether the partial patterns are arranged at regular intervals. If the partial patterns are not arranged at regular intervals, the process ends.

【0047】一方、ステップS905において、上記抽
出した部分パターンが一定の間隔で並んでいると判定さ
れた場合、ステップS906に進み、部分パターンの存
在する範囲を矩形で囲む。そして、ステップS907
で、該矩形で囲まれた範囲を点線の存在範囲とする。
On the other hand, if it is determined in step S905 that the extracted partial patterns are arranged at regular intervals, the flow advances to step S906 to enclose a range in which the partial patterns exist in a rectangle. Then, Step S907
Thus, the range surrounded by the rectangle is defined as the range where the dotted line exists.

【0048】図3における点線画像消去部305では、
前処理の点線抽出処理で点線の存在範囲であると判定さ
れた範囲内の全ての黒画素を白画素に書き換える処理を
行う。
The dotted image erasing unit 305 in FIG.
A process of rewriting all black pixels within the range determined to be the range where the dotted line exists in the dotted line extraction process of the preprocessing to white pixels is performed.

【0049】図3におけるラベル統合処理部306で
は、掠れによって複数部分に分離した表である場合、同
一ラベルを割り振られた部分パターンを統合し、一つの
表と見なす処理を行う。ラベルの位置関係だけで判断す
ると、図10に示すような二例は、左下のセルが同一の
表を構成するのか否かを判断するのは不可能である。し
かし、図10( a) はもともと同一の表を構成している
ため、統合処理を行う必要があり、図10( b) は異な
る表を構成するため統合処理を行う必要はない。ラベル
統合処理306では、図10の( a) 、( b) に示す二
種類の場合に、一つの表としてみなすかどうかの判定を
行い、その結果に基づいて、ラベルの統合処理を行う。
In the case of a table separated into a plurality of parts by blurring, the label integration processing unit 306 in FIG. 3 integrates partial patterns to which the same label is assigned, and performs a process of regarding it as one table. Judging only by the positional relationship of the labels, in the two examples as shown in FIG. 10, it is impossible to determine whether or not the lower left cell forms the same table. However, since FIG. 10A originally includes the same table, it is necessary to perform the integration process, and FIG. 10B does not need to perform the integration process because the table is different. In the label integration process 306, it is determined whether or not the two types shown in (a) and (b) of FIG. 10 are regarded as one table, and the label integration process is performed based on the result.

【0050】ラベル統合処理部306では、部分パター
ンのラベル間の白または黒画素の形状によりラベルを統
合するか否かの判定を行う方法と、罫線の位置情報を用
いてラベルを統合するか否かの判定を行う方法との二つ
の方法がある。これらの二つの方法について、以下に順
に説明する。
The label integration processing unit 306 determines whether to integrate labels based on the shape of white or black pixels between partial pattern labels, and determines whether or not to integrate labels by using ruled line position information. There are two methods: These two methods are described in turn below.

【0051】まず、部分パターンのラベル間の白または
黒画素の形状によりラベルを統合する方法については、
ラベル間の白画素の形状で判定する方法を例に説明す
る。図11( a) に示すように、もともと同一の表を構
成するラベル1101aとラベル1102aの間の白画
素領域の形状は、図中の矢印の長さが示すように、罫線
等により凹凸のある形状の領域となる。また、図11(
b) に示すように、もともと異なる表を構成するラベル
1101bとラベル1102bの間の白画素領域の形状
は、凹凸のない滑らかな形状となる。本手法は、この特
徴を利用するものである。
First, a method for integrating labels by the shape of white or black pixels between labels of partial patterns is described below.
A method of making a determination based on the shape of a white pixel between labels will be described as an example. As shown in FIG. 11 (a), the shape of the white pixel area between the label 1101a and the label 1102a, which originally constitute the same table, has irregularities due to ruled lines as shown by the length of the arrow in the figure. It becomes a shape area. FIG.
As shown in b), the shape of the white pixel area between the label 1101b and the label 1102b, which originally constitute a different table, is a smooth shape without unevenness. The present method utilizes this feature.

【0052】形状の凹凸判定は、ラベル間の白画素の長
さを用いる。ある2つのラベル外接矩形の重なりが、大
きいものを統合候補として抽出する。候補とされたラベ
ル間の白画素の長さ変化を調査する。この時、大局的な
変化だけの場合には、画像が傾いた場合である可能性が
あるため(近隣の白画素の長さの変異は少なくても、最
長値と最短値の差は大きい場合。図11( b) が傾いた
場合を想定)、局所的変化の調査を行う。その結果、大
きな変異があれば形状に凹凸があるものとみなす。形状
に凹凸があると判断された場合には、対象のラベルと統
合し、外接矩形のサイズ変更を行い、以降は同じラベル
であるとみなす。
The shape unevenness determination uses the length of white pixels between labels. A large overlap between two certain label circumscribed rectangles is extracted as an integration candidate. The change in the length of the white pixel between the candidate labels is investigated. At this time, if there is only a global change, it is possible that the image is tilted (when the difference between the longest value and the shortest value is large even if the variation in the length of the neighboring white pixel is small, 11 (b) is inclined), and a local change is investigated. As a result, if there is a large variation, it is considered that the shape has irregularities. If it is determined that the shape has irregularities, it is integrated with the target label, the size of the circumscribed rectangle is changed, and thereafter the label is regarded as the same.

【0053】また、同様に黒画素の領域の凹凸を調査し
ても判定可能である。黒画素の領域の凹凸を調査する場
合は、部分パターンを構成するラベルの端の形状が突起
状(対象ラベルが上下方向に位置する部分では、縦罫線
が出っ張っている状態。対象ラベルが左右に位置する部
分では、横罫線が出っ張っている状態。) になっている
場合に同一の表を構成すると判定できる。
Similarly, the determination can be made by examining the unevenness of the black pixel area. When investigating the unevenness of the black pixel area, the shape of the end of the label constituting the partial pattern is protruding (in the part where the target label is located in the vertical direction, the vertical ruled line is projected. In the position where the horizontal ruled line is protruding, it can be determined that the same table is configured.

【0054】図12に、ラベル間の白画素の形状により
ラベルを統合するか否かの判定を行う場合のラベル統合
処理のフローチャートを示す。まず、画像情報とラベル
情報が入力される。ステップS1201で、二つのラベ
ル( a、b) を選択する。ステップS1202で、ラベ
ルaとラベルbの外接矩形が重なっておらず、かつ、ラ
ベルaとラベルbの外接矩形間の距離が一定値以下でな
い場合、ステップS1201に戻る。また、ステップS
1202で、ラベルaとラベルbの外接矩形が重なって
いるか、またはラベルaとラベルbの外接矩形間の距離
が一定値以下である場合、ステップS1203に進み、
ラベルaとラベルbの間の白画素の幅を調べる。ステッ
プS1204に進み、ラベルaとラベルbの間の白画素
の幅の変化量が、あらかじめ決めた一定値より大きいか
を判定し、一定値より大きくない場合は、ステップS1
201に戻る。また、ステップS1204でラベルaと
ラベルbの間の白画素の幅の変化量が一定値より大きい
と判定された場合、ステップS1205に進み、ラベル
aとラベルbを統合してラベルcとし、ステップS12
06でラベルcの外接矩形を示す座標値を算出し、処理
を終了する。
FIG. 12 shows a flowchart of the label integration process when it is determined whether or not to integrate labels based on the shape of white pixels between labels. First, image information and label information are input. In step S1201, two labels (a, b) are selected. If it is determined in step S1202 that the circumscribed rectangles of the label a and the label b do not overlap and the distance between the circumscribed rectangles of the label a and the label b is not smaller than a predetermined value, the process returns to step S1201. Step S
In step 1202, if the circumscribed rectangles of the label a and the label b overlap or the distance between the circumscribed rectangles of the label a and the label b is equal to or smaller than a certain value, the process proceeds to step S1203.
The width of the white pixel between the label a and the label b is checked. In step S1204, it is determined whether the amount of change in the width of the white pixel between the label a and the label b is greater than a predetermined value.
Return to 201. If it is determined in step S1204 that the amount of change in the width of the white pixel between the label a and the label b is greater than a certain value, the process proceeds to step S1205, where the label a and the label b are integrated into a label c. S12
In step 06, the coordinate value indicating the circumscribed rectangle of the label c is calculated, and the process ends.

【0055】次に、罫線の位置情報を用いてラベルを統
合するか否かの判定を行う方法について説明する。本手
法は、二つのラベルから罫線を抽出し、抽出された罫線
の対応関係に基づいて判定を行うものである。図13(
a) のように、まず、ラベル1301aと、その対象ラ
ベルであるラベル1302aの罫線が抽出される。そし
て、図13( a) の丸で囲んで示すように、ラベル13
01aの罫線が出っ張った状態になっており、かつ、対
象ラベルである1302aから抽出された罫線の座標と
ほぼ同じ位置にある場合には、もともとは連続した罫線
が掠れによって、途切れた状態であると判断することが
でき、同一の表を構成していたものとして統合処理を行
うことができる。図13( b) に示すように、もともと
異なる表を構成するラベル1301bとラベル1302
bから抽出された罫線には、出っ張った部分はないため
統合処理は行わない。
Next, a method for judging whether or not to integrate labels using the position information of the ruled line will be described. In this method, ruled lines are extracted from two labels, and a determination is made based on the correspondence between the extracted ruled lines. FIG.
As shown in a), first, the ruled lines of the label 1301a and the label 1302a which is the target label are extracted. Then, as shown by a circle in FIG.
When the ruled line 01a is in a protruding state and is located at substantially the same position as the coordinates of the ruled line extracted from the target label 1302a, the originally continuous ruled line is broken and cut off. It can be determined that the same table is configured, and the integration processing can be performed. As shown in FIG. 13 (b), a label 1301b and a label 1302 which originally constitute different tables.
Since the ruled line extracted from b does not have a protruding portion, no integration processing is performed.

【0056】図14に、罫線の位置情報を用いてラベル
を統合するか否かの判定を行う場合のラベル統合処理の
フローチャートを示す。まず、画像情報とラベル情報が
入力される。ステップS1401で二つのラベルa、b
それぞれから罫線の抽出を行う。ステップS1402に
進み、ラベルaから抽出された罫線のx座標が、ラベル
bから抽出された罫線のx座標とほぼ同じでないなら、
ステップS1407に進み、統合処理を行わず、処理を
終了する。ステップS1402で、ラベルaから抽出さ
れた罫線のx座標が、ラベルbから抽出された罫線のx
座標とほぼ同じである場合、ステップS1403に進
み、ラベルaから抽出された罫線のy座標がラベルbか
ら抽出された罫線のy座標とほぼ同じでない場合、ステ
ップS1407に進み、統合処理を行わず、処理を終了
する。ステップS1403でラベルaから抽出された罫
線のy座標がラベルbから抽出された罫線のy座標とほ
ぼ同じ場合、ステップS1404に進み、ラベルaから
抽出された罫線のうち、ラベルb方向に突き出た罫線が
ない場合、ステップS1407に進み、統合処理を行わ
ず、処理を終了する。ステップS1404で、ラベルa
から抽出された罫線のうち、ラベルb方向に突き出た罫
線がある場合、ステップS1405に進み、ラベルbか
ら抽出された罫線のうち、ラベルa方向に突き出た罫線
がない場合、ステップS1407に進み、統合処理を行
わず、処理を終了する。ステップS1405で、ラベル
bから抽出された罫線のうち、ラベルa方向に突き出た
罫線がある場合、ステップS1406に進み、ラベル統
合処理を行い、処理を終了する。
FIG. 14 shows a flowchart of a label integration process when it is determined whether or not labels should be integrated using ruled line position information. First, image information and label information are input. In step S1401, two labels a and b
A ruled line is extracted from each. Proceeding to step S1402, if the x coordinate of the ruled line extracted from the label a is not substantially the same as the x coordinate of the ruled line extracted from the label b,
Proceeding to step S1407, the process ends without performing the integration process. In step S1402, the x coordinate of the ruled line extracted from the label a is replaced by the x coordinate of the ruled line extracted from the label b.
If the coordinates are substantially the same, the process proceeds to step S1403. If the y coordinate of the ruled line extracted from the label a is not substantially the same as the y coordinate of the ruled line extracted from the label b, the process proceeds to step S1407, and the integration process is not performed. , And the process ends. If the y-coordinate of the ruled line extracted from the label a in step S1403 is substantially the same as the y-coordinate of the ruled line extracted from the label b, the process advances to step S1404 to protrude from the ruled line extracted from the label a in the direction of the label b. If there is no ruled line, the process advances to step S1407 to terminate the process without performing the integration process. In step S1404, the label a
If there is a ruled line protruding in the direction of the label b among the ruled lines extracted from, the process proceeds to step S1405. If there is no ruled line protruding in the direction of the label a among the ruled lines extracted from the label b, the process proceeds to step S1407. The processing ends without performing the integration processing. If it is determined in step S1405 that there is a ruled line protruding in the direction of the label a among the ruled lines extracted from the label b, the process advances to step S1406 to perform a label integration process and end the process.

【0057】以上、図3のラベル統合処理部306の説
明をした。なお、ラベル統合処理部は掠れ等により分離
した帳票の表構造をより正確に抽出するのに有効であ
り、単独に上記ラベル統合処理に相当する処理を用い
て、品質の悪い画像において罫線を抽出することも可能
である。よって、上記のように本実施例の処理手順に組
み込まれるにとどまらない。
The label integration processing unit 306 in FIG. 3 has been described above. Note that the label integration processing unit is effective for more accurately extracting the table structure of a form separated by shading or the like, and separately uses a process corresponding to the above-described label integration process to extract ruled lines in an image of poor quality. It is also possible. Therefore, the present invention is not limited to being incorporated in the processing procedure of the present embodiment as described above.

【0058】次に、図3に示す罫線候補領域抽出部30
7について述べる。罫線候補領域抽出部307は、上述
までの処理画像から、罫線の候補領域の抽出を行う。こ
の処理は、罫線を構成する画像の存在する領域を示す情
報が示されれば、いかなる方法でも構わない。ここで
は、罫線候補領域抽出処理部307の一例を以下に示
す。
Next, the ruled line candidate area extraction unit 30 shown in FIG.
7 will be described. The ruled line candidate area extraction unit 307 extracts a ruled line candidate area from the processed image described above. This process may be performed by any method as long as information indicating the area where the image forming the ruled line exists is indicated. Here, an example of the ruled line candidate area extraction processing unit 307 is shown below.

【0059】図15に罫線候補領域抽出部307のブロ
ック図を示す。罫線候補領域抽出部307は、マスク処
理部1501、縦横罫線抽出部1502から成る。さら
に、縦横罫線抽出部1502は、線分抽出部1503、
直線抽出部1504、罫線候補抽出部1505から成
る。図15に示すブロック図の流れに従って、順に説明
する。
FIG. 15 is a block diagram of the ruled line candidate area extracting unit 307. The ruled line candidate area extracting unit 307 includes a mask processing unit 1501 and a vertical and horizontal ruled line extracting unit 1502. Further, the vertical and horizontal ruled line extraction unit 1502 includes a line segment extraction unit 1503,
It comprises a straight line extraction unit 1504 and a ruled line candidate extraction unit 1505. The description will be given in order according to the flow of the block diagram shown in FIG.

【0060】マスク処理部1501は、ラベル統合処理
部306によって得られた部分パターン毎に以下に説明
するマスク処理を行う。このマスク処理は、ラベル統合
処理された画像全体に対して横長及び縦長の2種類のマ
スク内で走査を行い、マスク内のパターンの示す割合を
算出する。算出された値が所定値より大きければ、その
マスク内を全てパターンとみなす。他方、算出された値
が所定値以下であれば、マスク内のパターンを削除する
ことにより縦横成分の抽出を行う。複数の行又は列が続
いて上記割合が所定値より大きくなると、それらの行又
は列をまとめて矩形範囲を作成し、その矩形範囲の中心
線を処理結果とする。 尚、マスク処理の結果得られる
線分間で、隙間が開かないようにするには、マスク処理
を行う範囲に各々重なりを持たせればよい。図16は、
縦×横が1×6画素の矩形範囲を指定するマスクにより
横成分を抽出する場合を説明する図である。同図中、(
a) は互いに重なり合ったマスク「M1」〜「M9」を
示す。また、同図( b) は原部分パターンの画像の一例
を示し、同図( c) は、同図( a) に示すマスクを用い
てマスク処理を行った場合に抽出される横成分を示す。
同図中、黒い丸印が抽出された横成分の画素を表す。
The mask processing unit 1501 performs a mask process described below for each partial pattern obtained by the label integration processing unit 306. In the mask process, the entire image subjected to the label integration process is scanned in two types of masks, a horizontally long one and a vertically long one, and the ratio of the pattern in the mask is calculated. If the calculated value is larger than a predetermined value, the entire mask is regarded as a pattern. On the other hand, if the calculated value is equal to or smaller than the predetermined value, the vertical and horizontal components are extracted by deleting the pattern in the mask. When a plurality of rows or columns continue and the ratio becomes larger than a predetermined value, a rectangular range is created by combining the rows or columns, and the center line of the rectangular range is set as a processing result. Note that in order to prevent a gap from being opened between line segments obtained as a result of the mask processing, it is only necessary to overlap each of the areas where the mask processing is performed. FIG.
FIG. 9 is a diagram illustrating a case where a horizontal component is extracted by using a mask that specifies a rectangular range of 1 × 6 pixels in length and width. In the figure, (
a) shows masks “M1” to “M9” overlapping each other. FIG. 2B shows an example of an image of the original partial pattern, and FIG. 2C shows horizontal components extracted when mask processing is performed using the mask shown in FIG. 1A. .
In the figure, black circles represent extracted horizontal component pixels.

【0061】図17は、マスク処理部1501の処理の
一実施例をより詳細に説明する図であり、処理をソフト
ウェアで実現する場合のフローチャートを示す。図17
において、ステップS1701は、ラベル統合処理され
た画像全体に対して横長及び縦長の2種類のマスク内で
走査を行う。ステップS1702は、マスク内のパター
ンの占める割合、即ち、マスクの大きさに対するマスク
内のパターンの面積を算出し、この割合が所定値より大
きいか否かを判断する。ステップS1702の判断結果
がNOであれば、ステップS1703で縦成分又は横成
分がないと判断して処理が終わる。他方、ステップS1
702の判断結果がYESの場合は、ステップS170
4でマスク内を全てパターンとみなし、全てを縦成分ま
たは横成分とする。ステップS1705は、得られた成
分が上下の成分又は左右の成分と接しているか否かを判
断する。ステップS1705の判断結果がNOである
と、ステップS1706で得られた成分を処理結果とし
て出力する。
FIG. 17 is a diagram for explaining an embodiment of the processing of the mask processing section 1501 in more detail, and shows a flowchart when the processing is realized by software. FIG.
In step S1701, the entire image subjected to the label integration process is scanned in two types of masks, a horizontally long one and a vertically long one. In step S1702, the ratio of the pattern in the mask, that is, the area of the pattern in the mask with respect to the size of the mask is calculated, and it is determined whether the ratio is greater than a predetermined value. If the decision result in the step S1702 is NO, it is determined in the step S1703 that there is no vertical component or horizontal component, and the process ends. On the other hand, step S1
If the determination result of step 702 is YES, step S170
In step 4, all of the inside of the mask is regarded as a pattern, and all of them are set as vertical or horizontal components. A step S1705 determines whether or not the obtained component is in contact with the upper and lower components or the left and right components. If the decision result in the step S1705 is NO, the component obtained in the step S1706 is output as a processing result.

【0062】ステップS1705の判断結果がYESの
場合は、ステップS1707で接している成分を統合
し、ステップS1708で統合された成分から矩形範囲
を作成する。ステップS1709は作成された矩形範囲
の中心線を算出し、ステップS1710はその中心線を
処理結果として出力する。
If the decision result in the step S1705 is YES, the components in contact are integrated in a step S1707, and a rectangular range is created from the integrated components in a step S1708. A step S1709 calculates a center line of the created rectangular range, and a step S1710 outputs the center line as a processing result.

【0063】次に、縦横罫線抽出部1502について述
べる。縦横罫線候補の抽出には、100dpi相当の低
解像度画像を用いるものとする。まず、縦横罫線抽出部
1502における線分抽出部1503では、マスク処理
されたパターンを横方向及び縦方向に複数に分割し、横
方向及び縦方向に分割したそれぞれの範囲でパターンの
隣接投影を算出し、ある一定の長さの線分または直線の
一部を矩形近似により検出する。ここで、隣接投影と
は、注目行または、注目列の投影値に周囲の行又は列の
投影値を足し合わせたものである。また、注目行又は注
目列の投影値は、その行又は列に存在する黒画素の総和
をとったものである。この隣接投影により、直線が傾い
ていて複数の行又は複数の列にわたってその直線が存在
している場合においても、直線を正確に検出することが
できる。このため、ブロック枠などの大きな枠を検出す
る場合、その枠が傾いていても、枠を構成する直線を検
出することが可能となる。
Next, the vertical / horizontal ruled line extracting unit 1502 will be described. For extracting vertical and horizontal ruled line candidates, a low-resolution image equivalent to 100 dpi is used. First, the line segment extraction unit 1503 in the vertical and horizontal ruled line extraction unit 1502 divides the masked pattern into a plurality of parts in the horizontal and vertical directions, and calculates the adjacent projection of the pattern in each of the divided areas in the horizontal and vertical directions. Then, a line segment or a part of a straight line having a certain length is detected by rectangular approximation. Here, the adjacent projection is obtained by adding the projection value of the surrounding row or column to the projection value of the target row or column. The projection value of the target row or column is the sum of the black pixels present in the row or column. By this adjacent projection, a straight line can be accurately detected even when the straight line is inclined and exists over a plurality of rows or a plurality of columns. For this reason, when detecting a large frame such as a block frame, it is possible to detect a straight line constituting the frame even if the frame is inclined.

【0064】図18は、ある矩形枠を構成する線分の投
影結果を示す図である。図18において、縦方向の長さ
がLY 、横方向の長さがLX の矩形枠1801の水平方
向jの投影値Ph( i) をHP( i) 、矩形枠1801
の垂直方向iの投影値Pv(j) をVP( j) とする
と、HP( 0) =HP( n) =m、HP( 1) 〜HP
(n−1) =2、VP( 0) =VP( m) =n、VP(
1) 〜VP(n−1) =2である。このように矩形枠1
801を構成する直線が存在している部分は、その投影
値が大きくなるので、この投影値を算出することによ
り、矩形枠1801を構成している直線を抽出すること
ができる。 P( i) =p( i−j) +p( i−j+1) +・・・+p( i) +・・・+p( i+j) ( 1) また、図19は傾いた直線の画素レベルの様子を示して
いる。この場合、図19において、( 1) 式のj=1と
して隣接投影値を求める。i−1行目には黒画素が9個
だけ存在しているので、p( i−1) =9となり、i行
目には黒画素が6個だけ存在しているので、p( i) =
6となる。同様にp( i+1) =6。この結果、P(
i) =p( i−1) +p( i) +p( i+1) =21と
なる。
FIG. 18 is a diagram showing a projection result of a line segment constituting a certain rectangular frame. In FIG. 18, a projection value Ph (i) in a horizontal direction j of a rectangular frame 1801 having a length LY in the vertical direction and a length LX in the horizontal direction is represented by HP (i) and a rectangular frame 1801.
Let VP (j) be the projection value Pv (j) in the vertical direction i of HP (0) = HP (n) = m, HP (1) to HP (1)
(N-1) = 2, VP (0) = VP (m) = n, VP (
1) -VP (n-1) = 2. Thus, the rectangular frame 1
Since the projection value of the portion where the straight line constituting 801 exists is large, the straight line constituting the rectangular frame 1801 can be extracted by calculating the projection value. P (i) = p (ij) + p (ij + 1) + ... + p (i) + ... + p (i + j) (1) FIG. 19 shows the state of the pixel level of the inclined straight line. Is shown. In this case, in FIG. 19, the adjacent projection value is determined as j = 1 in the equation (1). Since only nine black pixels exist in the (i-1) th row, p (i-1) = 9. Since only six black pixels exist in the (i) th row, p (i) =
It becomes 6. Similarly, p (i + 1) = 6. As a result, P (
i) = p (i-1) + p (i) + p (i + 1) = 21

【0065】このように、直線が傾いているために、複
数の行又は複数の列に渡ってその直線が存在している場
合、その傾いた直線の隣接投影値は大きくなることか
ら、枠が傾いている場合においても、枠を構成する直線
を効率的に検出することが可能となる。
As described above, when the straight line is inclined, and the straight line exists over a plurality of rows or a plurality of columns, the adjacent projection value of the inclined straight line becomes large. Even in a case where the frame is inclined, it is possible to efficiently detect a straight line that forms the frame.

【0066】図20は、隣接投影処理の動作を示すフロ
ーチャートである。図20において、ステップS200
1はマスク処理部1501で得られた同一のラベルを有
する部分パターンを縦方向及び横方向の複数の部分に分
割する。次に、ステップS2002で、縦横それぞれの
分割範囲内で投影値を算出する。ステップS2003
で、算出されたそれぞれの投影値に周囲の投影値を加算
する。更に、ステップS2004で、上記( 1) 式に基
づいて隣接投影値を算出する。線分抽出部1503は、
部分パターンのマスク処理画像に対する隣接投影値に基
づいて、横方向及び縦方向におけるある一定の長さの線
分又は直線の一部を、矩形近似により検出する。
FIG. 20 is a flowchart showing the operation of the adjacent projection process. In FIG. 20, step S200
Reference numeral 1 divides the partial pattern having the same label obtained by the mask processing unit 1501 into a plurality of vertical and horizontal portions. Next, in step S2002, a projection value is calculated within each of the vertical and horizontal division ranges. Step S2003
Then, the surrounding projection values are added to the calculated projection values. Further, in step S2004, an adjacent projection value is calculated based on the above equation (1). The line segment extraction unit 1503
Based on adjacent projection values of the partial pattern with respect to the mask processing image, a line segment or a part of a straight line having a certain length in the horizontal direction and the vertical direction is detected by rectangle approximation.

【0067】すなわち、分割された部分パターンの隣接
投影値と縦横それぞれの分割長との比が所定の閾値以上
となった場合は、それらの連続する複数の行又は列をま
とめた矩形範囲を直線の候補が存在する位置となる。な
お、この矩形近似により検出した一定の長さの線分また
は直線の一部を「矩形線分」と呼ぶ。
That is, when the ratio between the adjacent projection value of the divided partial pattern and the vertical / horizontal division length is equal to or greater than a predetermined threshold, a rectangular range obtained by combining a plurality of continuous rows or columns is represented by a straight line. Is the position where the candidate exists. Note that a line segment of a certain length or a part of a straight line detected by this rectangular approximation is called a “rectangular line segment”.

【0068】例えば、図21( a) に示すように斜めに
傾いた横線2101を3つの部分に分割し、隣接投影値
が閾値以上となっている位置を算出する。この結果、図
21( b) に示すように、横方向に分割された3つの矩
形線分2102を得ることができる。
For example, as shown in FIG. 21A, the oblique horizontal line 2101 is divided into three parts, and the position where the adjacent projection value is equal to or larger than the threshold value is calculated. As a result, as shown in FIG. 21B, three rectangular line segments 2102 divided in the horizontal direction can be obtained.

【0069】ここで、隣接投影法ではなく、通常の投影
法を用いて斜めに傾いている直線2101を検出した場
合、その投影値は小さくなってしまうので、直線210
1を検出することは不可能となる。一方、斜めに傾いて
いる直線2101を通常の投影法で検出するために、部
分パターンの分割数を増やし分割長を短くした場合、文
字を構成している短い直線も多数検出され、文字と枠と
を区別することが困難になる。
Here, when a straight line 2101 that is obliquely inclined is detected by using a normal projection method instead of the adjacent projection method, the projection value becomes small.
It becomes impossible to detect 1. On the other hand, when the number of divisions of the partial pattern is increased and the division length is shortened in order to detect the oblique straight line 2101 by the normal projection method, a large number of short straight lines constituting the character are also detected, and the character and the frame are detected. It becomes difficult to distinguish between

【0070】これに対して隣接投影法を用いることによ
り、直線2101が斜めに傾いている場合でも、部分パ
ターンの分割長を極端に小さくすることなく、隣接投影
値を大きくすることが可能となることから、枠を構成す
る比較的長い直線を、文字を構成している短い直線と区
別しながら正確に検出することができる。
On the other hand, by using the adjacent projection method, even when the straight line 2101 is obliquely inclined, it is possible to increase the adjacent projection value without extremely reducing the division length of the partial pattern. Therefore, a relatively long straight line forming the frame can be accurately detected while being distinguished from a short straight line forming the character.

【0071】図22は、線分抽出部1503の動作を示
すフローチャートである。図22において、まず、ステ
ップS2201で、分割された部分パターンの隣接投影
値と縦横それぞれの分割長との比が所定の閾値以上であ
るかどうかを判定する。そして、隣接投影値と縦横それ
ぞれの分割長との比が所定の閾値以上でないと判断され
た場合、ステップS2203に進み、線分が存在しない
ものとみなす。他方、ステップS2201で隣接投影値
と縦横それぞれの分割長との比が所定の閾値以上である
と判断された場合、ステップS2202に進み、線分が
存在するものとみなす。
FIG. 22 is a flowchart showing the operation of the line segment extraction unit 1503. In FIG. 22, first, in step S2201, it is determined whether the ratio between the adjacent projection value of the divided partial pattern and the vertical and horizontal division lengths is equal to or greater than a predetermined threshold. If it is determined that the ratio between the adjacent projection value and the vertical / horizontal division length is not equal to or greater than the predetermined threshold, the process proceeds to step S2203, and it is determined that no line segment exists. On the other hand, if it is determined in step S2201 that the ratio between the adjacent projection value and the vertical / horizontal division length is equal to or greater than the predetermined threshold, the process advances to step S2202, and it is determined that a line segment exists.

【0072】次に、ステップS2204において、ステ
ップS2202で線分とみなされたパターンがその上下
に存在する線分と接していないと判断された場合、ステ
ップS2205に進み、矩形線分とする。一方、ステッ
プS2206において、ステップS2202で線分とみ
なされたパターンがその上下に存在する線分と接してい
ると判断された場合、ステップS2206に進み、線分
とみなされたパターンとその上下に存在する線分とを統
合する。そして、ステップS2207において、ステッ
プS2206で統合した線分を矩形線分として検出す
る。
Next, in step S2204, if it is determined that the pattern regarded as a line segment in step S2202 is not in contact with the lines above and below it, the process proceeds to step S2205, where a rectangular line segment is set. On the other hand, if it is determined in step S2206 that the pattern regarded as a line segment in step S2202 is in contact with a line segment existing above and below it, the process proceeds to step S2206, and the pattern regarded as a line segment and the pattern above and below it are determined. Integrate with existing line segments. Then, in step S2207, the line segments integrated in step S2206 are detected as rectangular line segments.

【0073】図15の説明に戻ると、直線抽出部150
4は、線分抽出において抽出された矩形近似された線分
のうち、近隣の線分同士を統合して長い直線を検出す
る。検出された直線は矩形近似を行う。
Returning to the description of FIG.
No. 4 detects long straight lines by integrating neighboring line segments among the rectangular approximated line segments extracted in the line segment extraction. The detected straight line performs rectangular approximation.

【0074】直線抽出部1504は、線分統合部、直線
検出部から成る。線分統合部は、図23( a) に示す線
分y、zのように途中で途切れていない矩形線分同士が
接触あるいは繋がっていれば、これらの矩形線分を統合
して長い直線とする。さらに、図23( a) に示す線分
x、yのように、矩形線分が互いに繋がっていなくて
も、垂直方向の距離が上記隣接投影の際加える行又は列
数j以内であれば、これらの矩形線分を統合して長い直
線とする( 図23( b))。直線検出部は、線分統合部で
統合された直線の長さと、同じラベルである部分パター
ンを近似する矩形の長さとの比が所定の閾値以上であれ
ば、横または縦枠を構成する直線の候補であると判断す
る。
The straight line extracting unit 1504 includes a line segment integrating unit and a straight line detecting unit. If the unbroken rectangular line segments are in contact or connected with each other as in the line segments y and z shown in FIG. 23A, the line segment integrating unit integrates these rectangular line segments to form a long straight line. I do. Furthermore, even if the rectangular line segments are not connected to each other as in the case of the line segments x and y shown in FIG. 23 (a), if the vertical distance is within the number j of rows or columns added during the adjacent projection, These rectangular line segments are integrated into a long straight line (FIG. 23B). If the ratio of the length of the straight line integrated by the line integration unit to the length of the rectangle approximating the partial pattern having the same label is equal to or greater than a predetermined threshold, the straight line detection unit Is determined to be a candidate.

【0075】図24は、直線抽出部1504の線分統合
部の処理をより詳細に説明する図であり、処理をソフト
ウェアで実現する場合のフローチャートを示す。図24
において、ステップS2401は検出された矩形線分同
士の距離を算出する。ステップS2402で、算出され
た距離が隣接投影の際、加える行又は列数以内であるか
否かを判定する。ステップS2402の判定結果がNO
であれば、ステップS2404で矩形線分の統合は行わ
ないものとする。一方、ステップS2402の判定結果
がYESであれば、ステップS2403で矩形線分の統
合を行う。
FIG. 24 is a diagram for explaining the processing of the line segment integrating section of the straight line extracting section 1504 in more detail, and shows a flowchart in the case where the processing is realized by software. FIG.
In step S2401, a distance between the detected rectangular line segments is calculated. In step S2402, it is determined whether or not the calculated distance is within the number of rows or columns to be added during the adjacent projection. If the determination result in step S2402 is NO
If so, it is assumed that the integration of the rectangular lines is not performed in step S2404. On the other hand, if the decision result in the step S2402 is YES, a step S2403 carries out integration of rectangular lines.

【0076】以上のように、罫線候補領域抽出部307
の線分抽出部1503、直線抽出部1504について述
べたが、最後に、罫線候補領域抽出部307の処理とし
て、図15の罫線候補抽出部1505で、直線抽出部1
504において抽出された直線を罫線候補として抽出を
行い、処理を終了する。
As described above, the ruled line candidate area extraction unit 307
The line segment extracting unit 1503 and the straight line extracting unit 1504 have been described. Finally, as the processing of the ruled line candidate area extracting unit 307, the ruled line candidate extracting unit 1505 shown in FIG.
At 504, the extracted straight line is extracted as a ruled line candidate, and the process is terminated.

【0077】低解像画像における以上の処理が終了する
と、今度は高解像度画像を用いた処理が進む。図3に戻
って説明すると、罫線属性判定部308では、低解像度
画像を処理することによって得られた罫線候補領域を高
解像度で詳細に調査し、罫線の属性( 点線または実線)
の判定を行う。
When the above processing for the low-resolution image is completed, the processing using the high-resolution image proceeds. Referring back to FIG. 3, the ruled line attribute determining unit 308 examines the ruled line candidate area obtained by processing the low resolution image in high resolution in detail, and determines the ruled line attribute (dotted line or solid line).
Is determined.

【0078】罫線属性判定部308は、点線抽出処理部
304では低解像度画像を用いて抽出したため、点線が
繋がってしまっている可能性があるため、高解像度画像
で再度調査することで、属性を誤ってつけていることを
防ぐ役割を果たす。処理方法は、点線抽出処理部304
で行ったのと同様に、連結パターン抽出部303’でラ
ベリングされた高解像度画像を用い、同じサイズのラベ
ルが規則的に整列しているか否かで判断する。
The ruled line attribute determination unit 308 extracts the attribute using the low resolution image in the dotted line extraction processing unit 304, and the dotted line may be connected. Plays a role in preventing accidental attachment. The processing method is as follows:
In the same manner as described above, the determination is made based on whether or not labels of the same size are regularly arranged using the high-resolution image labeled by the connection pattern extraction unit 303 ′.

【0079】次に、図3の掠れ度算出処理の対象外領域
設定部309で、点線抽出処理部304で点線領域とし
て抽出された領域と罫線属性判定部308で点線領域と
して得られた領域とを、掠れ度算出処理の対象外領域と
して設定する。
Next, in the non-target area setting unit 309 of the shading degree calculation processing in FIG. 3, the area extracted as the dotted line area by the dotted line extraction processing unit 304 and the area obtained as the dotted line area by the ruled line attribute determination unit 308 Is set as a region not to be subjected to the flaring degree calculation process.

【0080】そして、図3の掠れ度算出部310で、処
理を行っている画像の罫線の品質を示す度合いとして、
掠れの度合い( 掠れ度) を算出する。この結果によっ
て、この後の処理で使用する画像及び閾値等を決定す
る。
Then, the degree of sharpness calculation unit 310 shown in FIG. 3 calculates the degree of the quality of the ruled line of the image being processed as
Calculate the degree of scrutiny (degree of scrutiny). Based on the result, an image, a threshold value, and the like to be used in the subsequent processing are determined.

【0081】前処理で設定された掠れ度算出対象領域内
に処理範囲を限定し( つまり、直線候補のみに対して処
理を行う) 、対象となっている画像の掠れ度算出を行
う。使用する画像の解像度は、掠れ度合いを正確に調査
できるように、高解像度を用いる。
The processing range is limited within the region for calculating the degree of blurring set in the preprocessing (that is, processing is performed only on the straight line candidates), and the degree of blurring of the target image is calculated. A high resolution is used for the resolution of the image to be used so that the degree of blur can be accurately investigated.

【0082】パターンがより多くのパターンに分離して
いる場合に掠れ度が高いとし、さらに、黒画素が消えて
白画素が多いほど掠れ度が高いと判断できる。この判断
基準に基づいて掠れ度を求めるため、直線候補領域内の
画素探査処理において、パターンの途切れの回数及びパ
ターンの途切れ( 白画素) の長さの算出を行う。縦横両
方の罫線候補領域に対して処理を行い、算出された結果
を単位長さ当たりに換算する。単位長さ当たりのパター
ンの途切れの回数及びパターンの途切れの長さを足し合
わせたものを掠れ度とする。直線候補領域内の探索した
画素数をL、領域内の白画素数をa、領域内の白画素領
域の数をbとすると、掠れ度cは式( 2) のように表現
できる。
When the pattern is separated into more patterns, it is determined that the degree of blur is high. Further, it can be determined that the degree of blur is higher as the black pixels disappear and the number of white pixels increases. In order to obtain the degree of blurring based on this determination criterion, the number of pattern breaks and the length of pattern breaks (white pixels) are calculated in the pixel search processing within the straight line candidate area. The processing is performed on both the vertical and horizontal ruled line candidate areas, and the calculated result is converted into per unit length. The sum of the number of pattern breaks per unit length and the pattern break length is defined as the degree of blur. Assuming that the number of searched pixels in the straight line candidate area is L, the number of white pixels in the area is a, and the number of white pixel areas in the area is b, the degree of blurring c can be expressed as in equation (2).

【0083】c=a/L+b/L ( 2) 図25に掠れ度算出の具体例を示す。図25( a) 〜(
d) において、矩形近似された罫線候補領域の探索画素
数Lは20画素である。同図( a) は白画素数aが6画
素、白画素領域bが6箇所あるため、掠れ度c=6/2
0+6/20=0.6となる。また、同図( b) は白画
素aが2画素、白画素領域が2箇所あるため、掠れ度c
=2/20+2/20=0.2となる。このことから、
白画素領域の個所の多いほうが掠れ度が高いことがわか
る。また、同図( a) 、( b) と算出した掠れ度を比較
すると、掠れ度と実際の画像の掠れ度合いは一致してい
ると言える。
C = a / L + b / L (2) FIG. 25 shows a specific example of calculating the degree of blur. FIG. 25 (a) to (
In d), the number L of search pixels in the ruled line candidate area approximated by a rectangle is 20 pixels. In FIG. 9A, the number of white pixels a is 6 and the number of white pixel regions b is 6, so that the degree of blurring c = 6/2.
0 + 6/20 = 0.6. Also, in FIG. 3B, since there are two white pixels a and two white pixel areas, the blurring degree c
= 2/20 + 2/20 = 0.2. From this,
It can be seen that the greater the number of places in the white pixel area, the higher the degree of blur. Comparing the calculated degrees of sharpness with FIGS. 7A and 7B, it can be said that the degree of sharpness and the degree of sharpness of the actual image match.

【0084】同図( c) は白画素数aが3画素、白画素
領域bか1箇所あるため、掠れ度c=3/20+1/2
0=0.2となる。また、同図( d) は白画素数が7画
素、白画素領域が1箇所あるため、掠れ度c=7/20
+1/20=0.4となる。このことから、白画素数の
多いほうが掠れ度が高いことがわかる。また、同図(c)
、( d) と算出した掠れ度を比較すると、掠れ度と実
際の画像の掠れ度合いは一致していると言える。
In FIG. 9C, the number of white pixels a is three and the white pixel area b is one, so that the degree of bleeding c = 3/20 + /.
0 = 0.2. In FIG. 11D, since the number of white pixels is 7 and there is one white pixel area, the degree of blur c = 7/20
+ 1/20 = 0.4. From this, it can be seen that the greater the number of white pixels, the higher the degree of blur. Also, FIG.
Comparing the calculated degree of sharpness with (d), it can be said that the degree of sharpness matches the degree of sharpness of the actual image.

【0085】この結果得られた掠れ度にしたがって、後
の処理方法、およびパラメータの設定を行う。この後の
処理概要を説明すると、掠れ度が低い場合には、許容す
る掠れの長さを短くし、さらに、高解像度の画像で画像
を詳細に調査し、罫線候補領域が罫線か否かを判定する
( 図3の罫線判別処理部311’) 。掠れ度が高い場合
には、許容する掠れの長さを比較的長くし、掠れの影響
の少ない低解像度画像で処理を行い( 図3の罫線判別処
理部311) 、掠れ画像を対象とした,罫線の掠れを補
完する処理を加える( 図3の掠れ補完処理部312) 。
The following processing method and parameters are set in accordance with the degree of shading obtained as a result. To explain the outline of the processing after this, when the degree of blurring is low, the allowable blurring length is shortened, and the image is examined in detail with a high-resolution image to determine whether or not the ruled line candidate area is a ruled line. judge
(Ruled line determination processing unit 311 'in FIG. 3). If the degree of sharpening is high, the allowable length of sharpening is set relatively long, and processing is performed on a low-resolution image with little influence of sharpening (ruled line determination processing unit 311 in FIG. 3). Processing for complementing the blurring of the ruled line is added (the blurring complementing processing unit 312 in FIG. 3).

【0086】また、この掠れ度算出の際に、画像全体を
一つの掠れ度で表さずに、横罫線に対する掠れ度、縦罫
線に対する掠れ度というように複数の掠れ度、またはさ
らに細かい部分に関して掠れ度を算出しても構わない。
この場合、後の処理で画像中のある部分に対して解像度
の異なる画像を参照する際、パラメータ設定等も、掠れ
度を設定した部分毎に行う。
In calculating the degree of sharpness, the entire image is not represented by one degree of sharpness, but a plurality of degrees of sharpness, such as a degree of sharpness with respect to a horizontal ruled line and a degree of sharpness with respect to a vertical ruled line, or a finer portion. The degree of rubbing may be calculated.
In this case, when referring to an image having a different resolution for a certain part in the image in a later process, parameter setting and the like are also performed for each part for which the degree of blur is set.

【0087】さらに、掠れ度を算出した結果、掠れのあ
る画像であると判断された場合には、罫線抽出処理を掠
れの影響をより少なくした、より低解像度な画像を用い
て再度抽出することができるようにすることで、より一
層の高精度化を図ることが可能である。逆に、掠れの無
い場合には、高解像度の画像を用いても、掠れによる悪
影響を考慮する必要がないため、より高解像度の画像で
処理を行い、詳細に画像の調査を行うことを可能とする
ことができる。
Further, as a result of calculating the degree of blur, if it is determined that the image is a blurred image, the ruled line extraction process should be re-extracted using a lower resolution image in which the influence of the blur is reduced. By doing so, it is possible to achieve even higher precision. Conversely, when there is no blurring, even if a high-resolution image is used, it is not necessary to consider the adverse effects of the blurring, so it is possible to process with a higher resolution image and investigate the image in detail It can be.

【0088】掠れ度が算出され、対象画像の品質が判定
されると、図3に示すように掠れ度によって処理する画
像が異なってくる。掠れ度が高い、すなわち掠れありと
判定された場合には低解像度画像がその後の処理に用い
られ、掠れ度が低い、すなわち掠れなしと判定された場
合には高解像度画像がその後の処理に用いられ、掠れ度
が0と算出された場合には、画像が潰れていると判定さ
れ、入力画像をそのまま用いる従来の罫線抽出処理31
4を行う。 図3において、掠れ度が高いと判断された
後の罫線判別処理部311と、掠れ度が低いと判断され
た後の罫線判別処理部311’は用いる画像が異なるだ
けで、処理内容は同一である。罫線判別処理部311、
311’は、罫線候補領域の凹凸の度合いを調べること
によって罫線であるか否かを判定する。したがって、掠
れ度の値が高い、つまり悪い品質の画像を用いると、直
線と途切れや線が掠れにより消えかかって細くなってい
るなどの影響により、凹凸の度合いが高く算出され、本
来罫線であるところも罫線として判定されない可能性が
ある。この場合、より低い解像度の画像を用いて罫線判
別処理を行うことで掠れによる影響を押さえることがで
きる。掠れ度の低い場合は、罫線の形状への影響はほと
んどないと考えられるため、高解像度画像を用いて罫線
判別処理を行うことで、より詳細に判断を行うことがで
きる。
When the degree of blur is calculated and the quality of the target image is determined, the image to be processed differs depending on the degree of blur as shown in FIG. If the degree of sharpness is high, that is, if it is determined that there is a sharpening, the low-resolution image is used for the subsequent processing.If the degree of sharpness is low, that is, it is determined that there is no sharpening, the high-resolution image is used for the subsequent processing. If the sharpness is calculated to be 0, it is determined that the image is crushed, and the conventional ruled line extraction processing 31 using the input image as it is is performed.
Perform 4. In FIG. 3, the ruled line discrimination processing unit 311 after the sharpness is determined to be high and the ruled line discrimination processing unit 311 ′ after the blurring is determined to be low differ only in the image used and have the same processing content. is there. Ruled line determination processing unit 311,
311 'determines whether or not the area is a ruled line by checking the degree of unevenness of the ruled line candidate area. Therefore, when the value of the degree of blur is high, that is, when an image of poor quality is used, the degree of unevenness is calculated to be high due to the effect of straight lines and discontinuities or lines becoming thinner due to fading and are originally ruled lines. However, it may not be determined as a ruled line. In this case, the effect of blurring can be suppressed by performing ruled line discrimination processing using an image with a lower resolution. When the degree of shading is low, it is considered that there is almost no influence on the shape of the ruled line. Therefore, by performing the ruled line discrimination process using a high-resolution image, it is possible to make a more detailed determination.

【0089】用いる画像は異なるが、罫線判別処理部3
11、311’は、罫線候補パターンの凹凸度によっ
て、そのパターンが罫線かそれとも文字から誤抽出され
た部分かを判断するという同一の処理を行う。凹凸度の
高いものは、文字からの誤抽出とし、凹凸度の低いもの
は罫線であると判断する。
Although the image used is different, the ruled line discrimination processing unit 3
11 and 311 'perform the same processing of determining whether the pattern is a ruled line or a part erroneously extracted from a character based on the degree of unevenness of the ruled line candidate pattern. Those with a high degree of unevenness are determined to be erroneous extractions from characters, and those with a low degree of unevenness are determined to be ruled lines.

【0090】罫線判別処理部311、311’では、罫
線候補領域として抽出されている横線または縦線の直線
について、横線の場合は左右端、縦線の場合は上下端を
正確に検出するために、罫線候補領域内のパターンの探
索を行う。図26は、罫線候補領域内のパターンの探索
結果を示す図である。図26において、罫線の間に「研
究部」の文字が記入され、「研究部」の文字列は、下方
の罫線に接触している。そして、上方の罫線が罫線候補
2601として抽出されているとともに、下方の罫線が
罫線候補2603として抽出され、「研」の文字と
「究」の文字とが互いに近接しているため、「研究部」
の文字列の一部が罫線候補2602として抽出されてい
る。
The ruled line discrimination processing sections 311 and 311 'are used to accurately detect the horizontal or vertical straight line extracted as a ruled line candidate area in the case of a horizontal line and the upper and lower ends in the case of a vertical line. A search for a pattern in the ruled line candidate area is performed. FIG. 26 is a diagram illustrating a search result of a pattern in a ruled line candidate area. In FIG. 26, characters of “research department” are written between the ruled lines, and the character string of “research department” is in contact with the lower ruled line. The upper ruled line is extracted as a ruled line candidate 2601, and the lower ruled line is extracted as a ruled line candidate 2603. Since the characters "ken" and "ku" are close to each other, "
Are extracted as ruled line candidates 2602.

【0091】罫線判別処理部311、311’では、こ
れら罫線候補2601、2602、2603内のパター
ンについて探索を行う。この際、探索方向の変化回数を
計数する。ここで、罫線候補2601のパターンは、本
来罫線であることから、真っ直ぐに探索され、探索方向
の変化回数の値が小さくなる。一方、罫線候補2602
のパターンは、本来文字であることから、文字の形状が
反映されて探索経路が屈曲し、探索方向の変化回数の値
が大きくなる。
The ruled line discrimination processing units 311, 311 'search for patterns in these ruled line candidates 2601, 2602, 2603. At this time, the number of changes in the search direction is counted. Here, since the pattern of the ruled line candidate 2601 is originally a ruled line, it is searched straight, and the value of the number of changes in the search direction becomes small. On the other hand, ruled line candidates 2602
Is a character, the search path is bent reflecting the shape of the character, and the value of the number of changes in the search direction increases.

【0092】この結果、探索方向の変化回数の値が小さ
いパターンを罫線とみなし、探索方向の変化回数の値が
大きいパターンを罫線でないと見なすことにより、罫線
候補2601のパターンを罫線であると判定することが
可能となるとともに、罫線候補2602のパターンを罫
線でないと判定することが可能となる。
As a result, a pattern having a small value of the number of changes in the search direction is regarded as a ruled line, and a pattern having a large value of the number of changes in the search direction is not regarded as a ruled line, whereby the pattern of the ruled line candidate 2601 is determined to be a ruled line. In addition to this, it is possible to determine that the pattern of the ruled line candidate 2602 is not a ruled line.

【0093】また、探索方向に隣接画素が存在しない場
合に限り、斜め方向の画素を探索し、探索方向に隣接画
素が存在している間は、同一方向に探索を行うことによ
り、「研究部」の文字列が接触している罫線候補260
3のパターンについても、探索方向の変化回数の値が小
さくなることから、罫線候補2603のパターンを罫線
であると判定することが可能となる。
Also, only when there is no adjacent pixel in the search direction, a diagonal pixel is searched, and as long as there is an adjacent pixel in the search direction, the search is performed in the same direction. Ruled line candidate 260 touching the character string
For pattern 3 as well, the value of the number of changes in the search direction becomes smaller, so that it is possible to determine that the pattern of ruled line candidate 2603 is a ruled line.

【0094】罫線判別処理部311、311’は探索方
向の変化の回数、つまりパターンの凹凸度が、設定した
閾値を超えるか否かでそのパターンが罫線であるか否か
を判定するが、図27に該閾値の設定例を示す。図27
において、掠れた罫線の上方に「研究部」の文字列が記
入され、掠れた罫線が罫線候補2702として抽出され
ているとともに、「研」の文字と「究」の文字と「部」
の文字が互いに近接しているため、「研究部」の文字列
の一部が罫線候補2701として抽出されている。
The ruled line determination processing units 311 and 311 'determine whether the pattern is a ruled line based on whether the number of changes in the search direction, that is, whether the degree of unevenness of the pattern exceeds a set threshold value. 27 shows an example of setting the threshold. FIG.
In the above, the character string of "research section" is entered above the shaved ruled line, and the blurred ruled line is extracted as a ruled line candidate 2702, and the characters "ken", "ku" and "part"
Are close to each other, a part of the character string of “research section” is extracted as a ruled line candidate 2701.

【0095】罫線候補2701は、「研究部」の文字列
の一部から誤って抽出されたものであり、罫線候補27
01の近くには、罫線候補2701として抽出された
「研究部」の文字列の残りパターンが存在している。し
たがって、罫線候補2701の近くに他のパターンが存
在するため、罫線候補2701のパターンの凹凸度の閾
値TH1を小さく設定する。このことにより罫線候補2
701として抽出された「研究部」の文字列の一部を罫
線候補から除外することをより正確に行うことが可能と
なる。
The ruled line candidate 2701 is erroneously extracted from a part of the character string of “research section”.
In the vicinity of 01, there is a remaining pattern of the character string of “research section” extracted as the ruled line candidate 2701. Therefore, since another pattern exists near the ruled line candidate 2701, the threshold value TH1 of the degree of unevenness of the pattern of the ruled line candidate 2701 is set to be small. As a result, ruled line candidate 2
It is possible to more accurately exclude a part of the character string of “research section” extracted as 701 from ruled line candidates.

【0096】他方、罫線候補2702は、罫線から正し
く抽出されたものであり、「研究部」の文字列から離れ
ているため、罫線候補2702の近くには文字列などの
他のパターンは存在しない。したがって、罫線候補27
02のパターンの凹凸度の閾値TH2を大きく設定す
る。このことにより、掠れているために凹凸度が大きく
なってしまった罫線候補2702を、罫線候補から除外
することなくより正確に罫線と判定することが可能とな
る。
On the other hand, since the ruled line candidate 2702 is correctly extracted from the ruled line and is apart from the character string of “research section”, no other pattern such as a character string exists near the ruled line candidate 2702. . Therefore, ruled line candidate 27
The threshold value TH2 of the unevenness degree of the pattern No. 02 is set to be large. This makes it possible to more accurately determine a ruled line candidate 2702, which has been sharpened and thus has an increased degree of unevenness, without being excluded from the ruled line candidates.

【0097】図28及び29に、凹凸度算出処理を示す
フローチャートを示す。なお、このフローチャートで
は、探索を横方向に行う場合について示している。図2
8において、まずステップS2801で、罫線候補の矩
形領域を探索範囲に設定する。次に、ステップS280
2で、罫線候補の矩形領域内のパターンのうち、最も細
い部分の横方向の座標を算出し、この最も細い部分の横
方向の座標におけるパターンの中心点を算出する。そし
て、このパターンの中心点を探索の開始点とする。ここ
で、探索の開始点をパターンの最も細い部分とするの
は、最も細い部分は罫線である可能性が高く、枠となる
直線の探索をより確実に行うことができるからである。
次に、ステップS2803で、直線の探索方向を右に設
定する。次に、ステップS2804で、ステップS28
02において設定した探索開始点を注目画素として設定
する。
FIGS. 28 and 29 are flowcharts showing the processing for calculating the degree of unevenness. Note that this flowchart shows a case where the search is performed in the horizontal direction. FIG.
8, in step S2801, a rectangular area of a ruled line candidate is set as a search range. Next, step S280
In step 2, the horizontal coordinates of the thinnest portion of the pattern in the rectangular area of the ruled line candidate are calculated, and the center point of the pattern at the horizontal coordinates of the thinnest portion is calculated. Then, the center point of this pattern is set as the search start point. Here, the start point of the search is set to the narrowest part of the pattern because the narrowest part is likely to be a ruled line, and the search for a straight line serving as a frame can be performed more reliably.
Next, in step S2803, the search direction of the straight line is set to the right. Next, in step S2804, step S28
The search start point set in 02 is set as a target pixel.

【0098】次に、ステップS2805で、空白領域の
長さをカウントする計数Kの初期値を0に設定する。ス
テップS2806で、右上がりまたは左上がりに探索方
向が変化した回数をカウントする変数hupを0に設定
し、ステップS2807で、右下がりまたは左下がりに
探索方向が変化した回数をカウントする変数hblを0
に設定する。また、ステップS2808で垂直方向線を
横切る回数をカウントする変数hverを0に設定す
る。
Next, in step S2805, the initial value of the count K for counting the length of the blank area is set to 0. In step S2806, a variable hup for counting the number of times the search direction has changed upward or downward to the left is set to 0, and in step S2807, a variable hbl for counting the number of times the search direction has changed downward or to the left downward is set to 0.
Set to. Also, in step S2808, a variable hver for counting the number of times of crossing the vertical line is set to 0.

【0099】図30は、本発明の第2実施例に係わる画
素の配置関係を示す図である。図30において、×印で
示した注目画素に対し、D1は左上斜め隣に隣接する画
素、D2は左に隣接する画素、D3は左下斜め隣に隣接
する画素、D4は上に隣接する画素、D5は下に隣接す
る画素、D6は右上斜めに隣接する画素、D7は右に隣
接する画素、D8は右下斜め隣に隣接する画素である。
FIG. 30 is a diagram showing an arrangement relationship of pixels according to the second embodiment of the present invention. In FIG. 30, D1 is a pixel adjacent to the upper left diagonally adjacent, D2 is a pixel adjacent to the left, D3 is a pixel adjacent diagonally to the lower left, D4 is a pixel adjacent to the upper, D5 is a lower adjacent pixel, D6 is an upper right diagonally adjacent pixel, D7 is a right adjacent pixel, and D8 is a lower right diagonally adjacent pixel.

【0100】探索が注目画素から画素D1に進んだ場
合、探索が左上がりに変化し、探索が注目画素から画素
D3に進んだ場合、探索方向が左下がりに変化し、探索
が注目画素から画素D6に進んだ場合、探索方向が右上
がりに変化し、探索が注目画素から画素D8に進んだ場
合、探索方向が右下がりに変化することとする。
When the search proceeds from the pixel of interest to the pixel D1, the search changes to the upper left. When the search advances to the pixel D3 from the pixel of interest, the search direction changes to the lower left. When the search progresses to D6, the search direction changes to the upper right, and when the search advances from the target pixel to the pixel D8, the search direction changes to the lower right.

【0101】図28の説明に戻ると、ステップS280
9で、注目画素が探索を行うパターンの矩形領域の内部
であるかどうかを判定し、注目画素が探索を行うパター
ンの矩形領域の内部でない場合、ステップS2823に
進み、空白領域の長さをカウントする変数Kの値を0に
設定してからステップS2824に進む。
Returning to the description of FIG. 28, step S280
In step 9, it is determined whether the target pixel is inside the rectangular area of the pattern to be searched. If the target pixel is not inside the rectangular area of the pattern to be searched, the process advances to step S2823 to count the length of the blank area. After setting the value of the variable K to be performed to 0, the process proceeds to step S2824.

【0102】他方、ステップS2809で注目画素が探
索を行うパターンの矩形領域の内部であると判定された
場合、ステップS2810に進み、注目画素に対し図3
0で説明したD7の位置に黒画素があるかどうかを判定
する。判定がYESの場合ステップS2811に進み、
注目画素をD7の位置の画素とし、注目画素に対しD7
の位置に黒画素がある場合は右方向に探索を進める。
On the other hand, if it is determined in step S2809 that the pixel of interest is inside the rectangular area of the pattern to be searched, the process advances to step S2810, and the process proceeds to step S2810.
It is determined whether there is a black pixel at the position of D7 described with reference to 0. If the determination is YES, the process proceeds to step S2811,
Let the pixel of interest be the pixel at position D7,
If there is a black pixel at the position, the search proceeds to the right.

【0103】一方、ステップS2810の判定がNOの
場合、ステップS2812に進み、注目画素に対しD6
の位置に黒画素があるかどうかを判定する。判定がYE
Sの場合、ステップS2813に進み、変数hupの値
を1だけ増加させてから、ステップS2814に進み、
注目画素をD6の位置の画素とする。これにより、探索
方向が右上がりに変化すると伴に、探索方向が右上がり
に変化した回数がカウントされる。注目画素がD6の位
置に移った後は、ステップS2809〜ステップS28
11の処理が繰り返される。
On the other hand, if the determination in step S2810 is NO, the flow advances to step S2812 to set D6 for the target pixel.
It is determined whether there is a black pixel at the position of. Judgment is YE
In the case of S, the process proceeds to step S2813 to increase the value of the variable hup by 1, and then proceeds to step S2814.
The pixel of interest is the pixel at the position D6. Thus, the number of times the search direction changes to the right as well as the search direction changes to the right is counted. After the target pixel has moved to the position of D6, steps S2809 to S28
Step 11 is repeated.

【0104】一方、ステップS2812の判定がNOの
場合、ステップS2815に進み、注目画素に対しD8
の位置に黒画素があるかどうかを判断する。判定がYE
Sの場合、ステップS2816に進み、変数hblの値
を1だけ増加させてから、ステップS2817に進み、
注目画素をD8の位置の画素とする。これにより、探索
方向が右下がりに変化すると伴に、探索方向が右下がり
に変化した回数がカウントされる。注目画素がD8の位
置に移った後は、ステップS2809〜ステップS28
11の処理が繰り返される。
On the other hand, if the determination in step S2812 is NO, the flow advances to step S2815 to set D8 for the target pixel.
It is determined whether there is a black pixel at the position of. Judgment is YE
In the case of S, the process proceeds to step S2816 to increase the value of the variable hbl by 1, and then proceeds to step S2817.
The pixel of interest is the pixel at the position D8. Thus, the number of times that the search direction has changed to the lower right while the search direction changes to the lower right is counted. After the target pixel moves to the position of D8, steps S2809 to S28
Step 11 is repeated.

【0105】一方、ステップS2815の判定がNOの
場合、ステップS2818に進み、空白領域の長さをカ
ウントする変数Kが閾値以下であるかどうかを判定す
る。判定結果がYESの場合、ステップS2819に進
み、注目画素が黒画素であり、かつ、注目上下( D4及
びD5) の画素がともに黒画素であるかを判定する。ス
テップS2819の判定がYESの場合、垂直方向線を
横切るとみなして、ステップS2820に進み、変数h
verを1だけ増加させてから、ステップS2821に
進み、注目画素をD7の位置の画素とする。一方、ステ
ップS2819の判定がNOの場合、ステップS282
1に直接進み、注目画素をD7の位置の画素とする。ス
テップS2822で、空白領域の長さをカウントする変
数Kを1だけ増加させ、ステップS2809に戻る。
On the other hand, if the determination in step S2815 is NO, the process advances to step S2818 to determine whether the variable K for counting the length of the blank area is equal to or smaller than a threshold. If the result of the determination is YES, the flow advances to step S2819 to determine whether the pixel of interest is a black pixel and both the pixels above and below (D4 and D5) are black pixels. If the determination in step S2819 is YES, it is assumed that the vehicle crosses the vertical line, and the flow advances to step S2820 to set the variable h
After incrementing ver by 1, the process advances to step S2821 to set the target pixel as the pixel at the position D7. On the other hand, if the determination in step S2819 is NO, step S282
Proceeding directly to 1, the target pixel is set as the pixel at the position of D7. In step S2822, the variable K for counting the length of the blank area is increased by 1, and the flow returns to step S2809.

【0106】他方、ステップS2818の判定がNOの
場合、ステップS2824に進み、探索方向は右に設定
されているかどうかを判定する。ここで、探索方向が右
に設定されている場合、ステップS2825に進み、探
索方向を左に設定してから、ステップS2826に進
み、ステップS2802で決定した探索開始点を注目画
素に設定する。そして、ステップS2809に戻り、左
方向の探索を行う。
On the other hand, if the determination in step S2818 is NO, the process advances to step S2824 to determine whether the search direction is set to the right. Here, if the search direction is set to the right, the process proceeds to step S2825, where the search direction is set to the left, and then the process proceeds to step S2826, where the search start point determined in step S2802 is set as the target pixel. Then, the process returns to step S2809 to search leftward.

【0107】他方、ステップS2824の判定で探索方
向が右でないと判定された場合、ステップS2827に
進み、変数hup及び変数hblの値から画像の傾きに
対応する値を減算することにより、画像の傾きの補正を
行う。画像の傾きに対応する値は、罫線候補の傾きの平
均値から予め算出しておく。そして、ステップS282
8で、変数hup及び変数hbl及び変数hverの値
を、ある一定の長さ当たりの値に換算する。次に、ステ
ップS2829で、ある一定長当たりの値に換算された
変数hup、変数hblまたは変数hverの値が閾値
以上となった場合、そのパターンを罫線候補から除外す
る。
On the other hand, if it is determined in step S2824 that the search direction is not right, the flow advances to step S2827 to subtract the value corresponding to the image inclination from the values of the variables hup and hbl, thereby obtaining the image inclination. Is corrected. The value corresponding to the image inclination is calculated in advance from the average value of the inclination of the ruled line candidate. Then, step S282
At 8, the values of the variables hup, hbl, and hver are converted to values per a certain length. Next, in step S2829, when the value of the variable hup, the variable hbl, or the variable hver converted to a value per a certain length is equal to or larger than the threshold, the pattern is excluded from ruled line candidates.

【0108】以上の手順で得られた変数hup、変数h
blおよび変数hverの値を凹凸度とし、罫線判別処
理部では図27を用いて述べた凹凸度の閾値を用いて罫
線であるか否かを判定する。また、変数hup、変数h
blおよび変数hverの値を加算し、その結果を直線
の長さに対する割合に換算し、その値を注目している直
線の変化量、つまり凹凸度とするようにしてもよい。
The variables hup and h obtained by the above procedure
The value of bl and the variable hver is set as the degree of unevenness, and the ruled line determination processing unit determines whether or not the line is a ruled line using the threshold value of the degree of unevenness described with reference to FIG. In addition, variable hup, variable h
The value of bl and the value of the variable hver may be added, and the result may be converted into a ratio to the length of the straight line.

【0109】なお、図28及び図29のフローチャート
では、横方向の探索について述べたが、探索方向を左右
から上下に変更することにより、縦方向に探索を行う場
合についても同様に行うことが可能である。
In the flowcharts of FIGS. 28 and 29, the search in the horizontal direction has been described. However, the search can be performed in the vertical direction by changing the search direction from left to right and up and down. It is.

【0110】以上、図3における罫線判別処理部31
1、311’の処理について説明した。次に、図3の罫
線統合処理部312の説明を以下に述べる。図3に示す
ように、罫線統合処理部312による処理は、掠れ度算
出部310で掠れありと判定された場合に、上述の罫線
判別処理部311での処理を経た後に行われる。罫線統
合処理部312では、掠れによって分離した罫線の統合
処理を行う。
As described above, the ruled line discrimination processing section 31 in FIG.
The processing of 1, 311 'has been described. Next, the ruled line integration processing unit 312 in FIG. 3 will be described below. As shown in FIG. 3, the processing by the ruled line integration processing unit 312 is performed after the processing by the above-described ruled line determination processing unit 311 when the blurring degree calculation unit 310 determines that the image is blurred. The ruled line integration processing unit 312 performs a process of integrating ruled lines separated by blurring.

【0111】また、図3には示していないが、掠れなし
と判定された場合にも、罫線統合処理部312’を罫線
統合判別処理部311’とセル抽出部313’間に挿入
し、罫線抽出精度をより向上させることも可能である。
この場合、掠れありと判定された場合に罫線統合処理部
312で統合可能な罫線間の長さを示す閾値を大きく設
定するのに対して、掠れなしと判定された後の罫線統合
処理部312’では統合可能な罫線間の長さを示す閾値
を小さく、または、0として処理を行わないようにす
る。
Although not shown in FIG. 3, even when it is determined that there is no blur, the ruled line integration processing unit 312 'is inserted between the ruled line integration determination processing unit 311' and the cell extraction unit 313 ', and It is also possible to further improve the extraction accuracy.
In this case, the ruled line integration processing unit 312 sets a large threshold value indicating the length between ruled lines that can be integrated when it is determined that the image is blurred, whereas the ruled line integration processing unit 312 after determining that the image is not blurred. In ', the threshold value indicating the length between the ruled lines that can be integrated is set to a small value or set to 0 so that no processing is performed.

【0112】例えば図31( a) に示すように、前処理
までで、横線3101〜3106が抽出されている。こ
こで、横線3102と横線3103は掠れの影響により
分離している。この場合、同じY座標上にあり、かつX
方向の距離が所定値以下であるかどうかを調べる。横線
3102と横線3103がこの条件を満たす場合、図3
1( b) に示すように、横線3102と横線3103と
を統合して横線3112とする。この結果、掠れ310
7を補正した横線3111〜3115を得る。
For example, as shown in FIG. 31A, horizontal lines 3101 to 3106 have been extracted up to the pre-processing. Here, the horizontal line 3102 and the horizontal line 3103 are separated by the influence of blurring. In this case, they are on the same Y coordinate and X
It is checked whether the distance in the direction is equal to or less than a predetermined value. When the horizontal lines 3102 and 3103 satisfy this condition, FIG.
As shown in FIG. 1 (b), the horizontal line 3102 and the horizontal line 3103 are integrated into a horizontal line 3112. As a result, the shading 310
The horizontal lines 3111 to 1115 obtained by correcting 7 are obtained.

【0113】また、縦線の場合、同じX座標上にあり、
かつY方向の距離が所定値以下である直線の統合を行
う。なお、対象としている枠が、不規則な枠である場
合、直線の長さや位置が様々であるため、極端に距離が
離れた直線の統合を行わないようにする。
In the case of a vertical line, they are on the same X coordinate,
In addition, straight lines whose distance in the Y direction is equal to or smaller than a predetermined value are integrated. If the target frame is an irregular frame, the lengths and positions of the straight lines vary, so that integration of straight lines that are extremely far apart is not performed.

【0114】図32は、罫線統合処理部312において
横直線を統合する場合の処理の動作を示すフローチャー
トである。図32において、まずステップS3201
で、罫線候補領域抽出処理により抽出された横直線を二
本ずつ抽出する。次に、ステップS3202で、ステッ
プS3201で抽出された二本の直線のX方向の距離が
所定の閾値以下であるかどうかを判定する。判定結果が
NOの場合、処理を終了する。
FIG. 32 is a flowchart showing the operation of the process when the ruled line integration processing unit 312 integrates horizontal straight lines. In FIG. 32, first, in step S3201
Then, two horizontal straight lines extracted by the ruled line candidate area extraction processing are extracted two by two. Next, in step S3202, it is determined whether the distance in the X direction between the two straight lines extracted in step S3201 is equal to or less than a predetermined threshold. If the result of the determination is NO, the process ends.

【0115】一方、ステップS3202の判定がYES
の場合、ステップS3203に進み、ステップS320
1で抽出された二本の横直線のY方向の距離が所定の閾
値以下であるかどうかを判定する。判定結果がNOの場
合、処理を終了する。
On the other hand, the determination in step S3202 is YES
In step S3203, the process proceeds to step S3203.
It is determined whether the distance in the Y direction between the two horizontal straight lines extracted in step 1 is equal to or smaller than a predetermined threshold. If the result of the determination is NO, the process ends.

【0116】一方、ステップS3203の判定がYES
の場合、ステップS3204に進み、ステップS320
1で抽出された二本の横直線を統合して一本の直線とみ
なす。
On the other hand, the determination in step S3203 is YES
In the case of, the process proceeds to step S3204, and step S320
The two horizontal straight lines extracted in 1 are integrated and regarded as one straight line.

【0117】図33は、罫線統合処理部312において
縦直線を統合する場合の処理の動作を示すフローチャー
トである。図33は、横直線を統合する場合とほぼ同様
である。
FIG. 33 is a flow chart showing the operation of processing when the ruled line integration processing unit 312 integrates vertical straight lines. FIG. 33 is almost the same as the case where the horizontal straight lines are integrated.

【0118】図33において、まずステップS3301
で、罫線候補領域抽出処理により抽出された縦直線を二
本ずつ抽出する。次に、ステップS3302で、ステッ
プS3301で抽出された二本の直線のY方向の距離が
閾値以下であるかどうかを判定する。判定結果がNOの
場合、処理を終了する。一方、ステップS3302の判
定がYESの場合、ステップS3303に進み、ステッ
プS3301で抽出された二本の縦直線のX方向の距離
が所定の閾値以下であるかどうかを判定する。判定結果
がNOの場合、処理を終了する。一方、ステップS33
03の判定がYESの場合、ステップS3304に進
み、ステップS3301で抽出された二本の縦直線を統
合して一本の直線とみなす。
In FIG. 33, first, at step S3301
Then, two vertical straight lines extracted by the ruled line candidate area extraction processing are extracted two by two. Next, in step S3302, it is determined whether the distance in the Y direction between the two straight lines extracted in step S3301 is equal to or smaller than a threshold. If the result of the determination is NO, the process ends. On the other hand, if the determination in step S3302 is YES, the process advances to step S3303 to determine whether the distance in the X direction between the two vertical straight lines extracted in step S3301 is equal to or less than a predetermined threshold. If the result of the determination is NO, the process ends. On the other hand, step S33
If the determination in step 03 is YES, the process advances to step S3304, and the two vertical straight lines extracted in step S3301 are integrated and regarded as one straight line.

【0119】次に、以上の処理により得られた罫線から
枠を構成する直線を決定し、上下左右の四辺が枠で囲ま
れた矩形範囲をセルとして抽出する。図3のセル抽出部
313、313’がこの役割を担う。なお、セル抽出部
313、313’において、セルの抽出を行う方法は、
いかなる方法を用いても構わない。ここでは、一例とし
て以下の方法を説明する。
Next, a straight line constituting the frame is determined from the ruled lines obtained by the above processing, and a rectangular range in which the upper, lower, left, and right sides are surrounded by the frame is extracted as a cell. The cell extraction units 313 and 313 ′ in FIG. 3 play this role. Note that a method for extracting cells in the cell extraction units 313 and 313 ′ is as follows.
Any method may be used. Here, the following method will be described as an example.

【0120】図34は、本発明の第2実施例におけるセ
ル抽出処理部313、313’の一例を説明する図であ
る。図34( a) において、入力画像から罫線候補を取
得することにより、帳票3401を構成する直線が決定
される。次に、図34( b)に示すように、帳票340
1を構成する直線から、横枠を決定することにより、帳
票3401を行単位に分割する。次に図34( c) に示
すように、帳票3401を構成する直線から、縦枠を決
定することにより、帳票3401からセルを抽出する。
ここで、帳票3401から抽出されたセルの中に入れ子
構造3402があるかどうかを調べる。次に、図34(
d) に示すように、入れ子構造3402を新たな帳票と
みなして、入れ子構造3402からセルを抽出する。
FIG. 34 is a view for explaining an example of the cell extraction processing sections 313 and 313 'according to the second embodiment of the present invention. In FIG. 34A, a straight line forming the form 3401 is determined by obtaining ruled line candidates from the input image. Next, as shown in FIG.
The form 3401 is divided into rows by determining the horizontal frame from the straight line constituting 1. Next, as shown in FIG. 34C, a cell is extracted from the form 3401 by determining a vertical frame from a straight line constituting the form 3401.
Here, it is checked whether a nested structure 3402 exists in the cells extracted from the form 3401. Next, FIG.
As shown in d), the nested structure 3402 is regarded as a new form, and cells are extracted from the nested structure 3402.

【0121】図35は、上述の横枠を決定する際の決定
方法を説明する図である。図35において、帳票340
1に対し、横直線〜及び縦直線( I) 〜( VI) が
抽出され、横直線〜を一番上の行から順番に一行づ
つ組としていくことにより、横枠を決定する。例えば、
横直線と横直線とが二本組の横線と判断され、この
横直線と横直線とが横枠とされる。この横枠決定方
法は、以下の手順により行われる。
FIG. 35 is a diagram for explaining a method of determining the above-described horizontal frame. In FIG. 35, a form 340
For 1, the horizontal frame and the vertical lines (I) to (VI) are extracted, and the horizontal line is determined as a group one by one in order from the top row to determine a horizontal frame. For example,
The horizontal straight line and the horizontal straight line are determined as a pair of horizontal lines, and the horizontal straight line and the horizontal straight line are set as a horizontal frame. This horizontal frame determination method is performed according to the following procedure.

【0122】1) セル抽出処理部の前までの処理で、罫
線候補と判別された横直線の中から、上から順番に横直
線を二本抽出し、これらを二本の横直線の組の候補とす
る。 2) 組の候補とした二本の横直線の長さが同じ、または
下の直線のほうが長ければ、その二本を横直線の組とす
る。このとき、二本の横直線の長さが異なる場合、長い
ほうの横直線を再使用可能とする。
1) From the horizontal straight lines determined to be ruled line candidates in the process up to the cell extraction processing unit, two horizontal straight lines are extracted in order from the top, and these are extracted as a set of two horizontal straight lines. Make it a candidate. 2) If the length of the two horizontal straight lines as the set candidates is the same or the lower straight line is longer, the two straight lines are regarded as a set of horizontal straight lines. At this time, if the lengths of the two horizontal straight lines are different, the longer horizontal straight line can be reused.

【0123】3) 組の候補とした二本の横線のうち、下
の横直線のほうが短ければ、さらにその下の横直線を横
枠の候補として、これらの横直線の長さを比較する。ま
た、下の横直線のほうが、右方向又は左方向に短けれ
ば、さらにその下の横直線を組みの候補とし、これらの
横直線の長さを比較する。
3) If the lower horizontal straight line among the two horizontal lines as a set candidate is shorter, the lower horizontal straight line is further set as a horizontal frame candidate and the lengths of these horizontal straight lines are compared. If the lower horizontal line is shorter in the right or left direction, the lower horizontal line is set as a candidate for a set, and the lengths of these horizontal lines are compared.

【0124】4) 横直線の長さの比較の結果、上記2)
を満足する横直線を満足する横直線が下にないことが判
明すると、この場合に限り、上の横直線とその下の横直
線を組みとする。
4) As a result of comparing the lengths of the horizontal straight lines, 2)
If it is found that there is no horizontal line that satisfies the horizontal line that satisfies the above condition, only in this case, the upper horizontal line and the lower horizontal line are combined.

【0125】5) 一番下の横直線の処理後、上部にまだ
未処理の横直線がある場合は、再び上から順に未処理の
横直線と再使用可能な横直線とを用いて、上記1) 〜
4) の処理を行い、二本の横直線の組を作る。
5) After the processing of the bottom horizontal line, if there is an unprocessed horizontal line at the top, the unprocessed horizontal line and the reusable horizontal line are again used in order from the top again. 1) ~
Perform the processing of 4) to create a set of two horizontal straight lines.

【0126】図36は、上述の縦枠を決定する際の決定
方法を説明する図である。図36において、帳票340
1に対し、横直線〜及び縦直線( I) 〜( VI) が
抽出され、組となっている横枠に上下とも達している縦
直線( I) 〜( VI) を縦枠と決定する。例えば、縦直
線( I) と縦直線( VI) とが、横枠とみなされた横直
線及び横直線に上下とも達しているので、縦直線(
I) と縦直線( VI)とが縦枠とされる。
FIG. 36 is a diagram for explaining a method of determining the above-described vertical frame. Referring to FIG.
With respect to 1, horizontal straight lines and vertical straight lines (I) to (VI) are extracted, and vertical straight lines (I) to (VI) reaching both upper and lower sides of the set horizontal frame are determined as vertical frames. For example, since the vertical straight line (I) and the vertical straight line (VI) both reach the horizontal straight line and the horizontal straight line regarded as a horizontal frame, the vertical straight line (VI)
I) and a vertical straight line (VI) are a vertical frame.

【0127】図37は、上述のセル抽出の方法を説明す
る図である。図37において、帳票3401に対し、横
直線〜及び縦直線( I) 〜( VI) が抽出され、四
方が横枠及び縦枠で囲まれた矩形領域をセルとして抽出
する。例えば、横直線と縦直線( IV) と横直線と
縦直線( I) とで囲まれた矩形領域がセルとして抽出さ
れるとともに、横直線と縦直線( VI) と横直線と
縦直線( IV) とで囲まれた矩形領域がセルとして抽出
される。
FIG. 37 is a diagram for explaining the above-described cell extraction method. In FIG. 37, the horizontal straight line and the vertical straight lines (I) to (VI) are extracted from the form 3401, and a rectangular area surrounded by horizontal and vertical frames on all four sides is extracted as a cell. For example, a rectangular area surrounded by a horizontal straight line and a vertical straight line (IV), a horizontal straight line and a vertical straight line (I) is extracted as a cell, and a horizontal straight line and a vertical straight line (VI), a horizontal straight line and a vertical straight line (IV) are extracted. ) Is extracted as a cell.

【0128】図38は、上述の入れ子構造の抽出の方法
を説明する図である。図38において、横直線と縦直
線( III) と横直線と縦直線( I) とで囲まれた矩
形領域がセルとして抽出された場合、このセルは入れ子
構造3402となっている。このため、入れ子構造34
02を構成する直線から横枠及び縦枠を決定し、入れ子
構造3402内で、四方が横枠及び縦枠で囲まれた矩形
領域をセルとして抽出する。例えば、横直線と縦直線
( III) と横直線と縦直線( I) とで囲まれた矩形
領域、横直線と縦直線( II) と横直線と縦直線(
I) とで囲まれた矩形領域、及び横直線と縦直線( I
II) と横直線と縦直線( II) とで囲まれた矩形領
域がセルとして抽出される。
FIG. 38 is a diagram for explaining a method of extracting the nested structure described above. In FIG. 38, when a rectangular area surrounded by a horizontal straight line and a vertical straight line (III) and a horizontal straight line and a vertical straight line (I) is extracted as a cell, the cell has a nested structure 3402. Therefore, the nested structure 34
The horizontal frame and the vertical frame are determined from the straight lines that constitute 02, and a rectangular area surrounded by the horizontal frame and the vertical frame on all four sides is extracted as a cell in the nested structure 3402. For example, horizontal straight line and vertical straight line
(III), a rectangular area surrounded by a horizontal straight line and a vertical straight line (I), a horizontal straight line and a vertical straight line (II), a horizontal straight line and a vertical straight line (II).
I) and a rectangular area surrounded by horizontal and vertical lines (I
II), a rectangular area surrounded by a horizontal straight line and a vertical straight line (II) is extracted as a cell.

【0129】以下に、図35に示した横枠決定方法のフ
ローチャートを図39に示す。図39において、まず、
ステップS3901で、罫線候補と判別された直線の中
から、最上部の二本の横直線を取り出す。次に、ステッ
プS3902で、取り出した二本の直線のうち、上側の
横直線をupline、下側の横直線をblline、
とする。ステップS3903で、直線uplineと直
線bllineとに縦方向の重なりがあるかどうかを判
定する。判定結果がNOの場合、ステップS3904に
進み、直線bllineの下の直線を新たに直線bll
ineとし、この処理を直線uplineと直線bll
ineとに縦方向の重なりがあることが判定されるまで
続ける。
FIG. 39 shows a flowchart of the horizontal frame determining method shown in FIG. 35. In FIG. 39, first,
In step S3901, the top two horizontal straight lines are extracted from the straight lines determined to be ruled line candidates. Next, in step S3902, of the two straight lines taken out, the upper horizontal straight line is upline, the lower horizontal straight line is blline,
And In step S3903, it is determined whether the straight line upline and the straight line blline overlap in the vertical direction. If the determination result is NO, the process advances to step S3904 to replace the straight line below the straight line blline with a new straight line blll.
ine, and this processing is performed by using a straight line upline and a straight line bll.
The process is continued until it is determined that there is a vertical overlap with the ine.

【0130】一方、ステップS3903の判定結果がY
ESの場合、ステップS3905に進み、直線upli
neと直線bllineとの長さが同じであるか、また
は直線uplineより直線bllineのほうが長い
かどうかを判定する。そして、上記条件を満足する直線
uplineと直線bllineが存在する場合、ステ
ップS3908に進み、直線uplineと上記直線b
llineを二本の横直線の組( 二本組の横枠) とす
る。なお、直線uplineと直線bllineとの長
さが同じであるとは、図40に示した横直線の配置状態
を説明する図のうち、同図( a) のような状態を示す。
On the other hand, if the decision result in the step S3903 is Y
In the case of ES, the process proceeds to step S3905, where
It is determined whether the length of ne and the straight line blline are the same, or whether the straight line blline is longer than the straight line upline. If there are a straight line upline and a straight line blline that satisfy the above condition, the process advances to step S3908 to proceed to step S3908.
Let lline be a set of two horizontal straight lines (horizontal frame of two sets). The fact that the length of the straight line upline is the same as the length of the straight line blline indicates a state as shown in FIG.

【0131】一方、ステップS3905において、直線
uplineと直線bllineとの長さが異なってお
り、かつ直線uplineより直線bllineのほう
が短い場合、ステップS3906に進み、直線blli
neより下部に、直線uplineと長さが同じである
か、または直線uplineより長い直線blline
2が存在するかどうかを判定する。判定結果がYESの
場合、ステップS3907に進み、直線bllineを
直線blline2に変更してステップS3908に進
む。なお、直線uplineより直線bllineのほ
うが短いとは、図40( b) のような状態を示し、直線
uplineより直線bllineのほうが長いとは、
図40( c) のような状態を示す。
On the other hand, if it is determined in step S3905 that the length of the straight line upline is different from the length of the straight line blline, and that the straight line blline is shorter than the straight line upline, the flow advances to step S3906 to proceed to step S3906.
a straight line blline which is equal to or longer than the straight line upline below ne
It is determined whether or not 2 exists. If the result of the determination is YES, the flow advances to step S3907 to change the straight line blline to the straight line blline2, and the flow advances to step S3908. It should be noted that the fact that the straight line blline is shorter than the straight line upline indicates a state as shown in FIG. 40 (b), and that the straight line blline is longer than the straight line upline.
A state as shown in FIG. 40 (c) is shown.

【0132】ステップS3906の判定結果がNOの場
合、ステップS3908に進み、直線uplineと直
線bllineとを二本組の横枠とする。次に、ステッ
プS3909で、図41のフローチャートで示す縦枠決
定処理及び入れ子処理を行う。次に、ステップS391
0で、ステップS3908で二本枠とした直線upli
neと直線bllineの長さが異なるかどうかを判定
する。判定結果がYESの場合、ステップS3911に
進み、右方向へ長い直線又は左方向に長い直線を再利用
可能として、ステップS3912に進む。なお、右方向
へ長い直線とは図40( d) に示す直線bllineの
ことを言い、左方向に長い直線とは、図40( e) に示
す直線bllineである。
If the decision result in the step S3906 is NO, the process advances to a step S3908 to set the straight line upline and the straight line blline as a set of two horizontal frames. Next, in step S3909, vertical frame determination processing and nesting processing shown in the flowchart of FIG. 41 are performed. Next, step S391
0, a straight line upli defined as two frames in step S3908
It is determined whether the length of ne and the line blline are different. When the result of the determination is YES, the flow proceeds to step S3911, where a straight line that is long in the right direction or a straight line that is long in the left direction is reusable, and the flow proceeds to step S3912. The straight line extending rightward means the straight line blline shown in FIG. 40 (d), and the straight line extending leftward is the straight line blline shown in FIG. 40 (e).

【0133】一方、ステップS3910の判定結果がN
Oの場合、ステップS3912に進み、直線bllin
eより下方に直線が存在するかどうかを判定する。そし
て、判定結果がNOの場合、ステップS3913に進
み、直線bllineとその下の直線を抽出し、ステッ
プS3902に戻る。
On the other hand, if the decision result in step S3910 is N
In the case of O, the process proceeds to step S3912, where the straight line bllin
It is determined whether a straight line exists below e. If the determination is NO, the flow advances to step S3913 to extract the straight line blline and the straight line below it, and returns to step S3902.

【0134】ステップS3912の判定結果がYESの
場合、ステップS3914に進み、再使用可能の直線を
除いて、処理済の直線を処理対象からはずす。次に、ス
テップS3915で、未処理の直線が存在するかどうか
を判定する。判定結果がNOの場合、処理を終了する。
一方、ステップS3915の判定結果がYESの場合、
ステップS3916に進み、最上部から直線を二本取り
出し、ステップS3902に戻る。
If the decision result in the step S3912 is YES, the process advances to a step S3914 to remove the processed straight line from the processing target except for the reusable straight line. Next, in step S3915, it is determined whether an unprocessed straight line exists. If the result of the determination is NO, the process ends.
On the other hand, if the decision result in the step S3915 is YES,
Proceeding to step S3916, two straight lines are extracted from the uppermost portion, and the process returns to step S3902.

【0135】図41は、ステップS3909の縦枠決定
及び入れ子処理の詳細を示すフローチャートである。図
41において、まず、ステップS4101で、最上位の
行の二本組の横枠を選択し、ステップS4102で、罫
線候補の縦直線の中から、上端と下端との両方が二本組
の横枠に達しているものを選択する。次に、ステップS
4103で、選択した縦直線を縦枠と決定する。次に、
ステップS4104で、二本組の横枠と二本組の縦枠と
で囲まれた矩形領域を抽出する。そして、ステップS4
105で、矩形領域の左右二本の縦枠に両端が達してい
る横直線が存在するかどうかを判定する。判定結果がN
Oの場合、次の行の横枠を選択する処理を行い、これに
より新たに決定された二本組みの横枠に対して上記ステ
ップS4102〜ステップS4107と同様の処理を実
行する。
FIG. 41 is a flowchart showing details of the vertical frame determination and nesting processing in step S3909. In FIG. 41, first, in step S4101, a horizontal set of two sets in the top row is selected, and in step S4102, both the upper end and the lower end of the vertical straight line of the ruled line candidate are set in the horizontal set of two sets. Select the one that has reached the frame. Next, step S
In 4103, the selected vertical straight line is determined as a vertical frame. next,
In step S4104, a rectangular area surrounded by a horizontal set of two sets and a vertical frame of two sets is extracted. Then, step S4
In 105, it is determined whether or not there is a horizontal straight line reaching both ends of the left and right vertical frames of the rectangular area. Judgment result is N
In the case of O, the process of selecting the horizontal frame of the next row is performed, and the same process as the above-described steps S4102 to S4107 is executed on the newly determined horizontal frame of the double set.

【0136】一方、ステップS4105の判定結果がY
ESの場合、ステップS4106に進み、その矩形領域
を新たに小さな表( 入れ子構造の矩形) とみなし、この
入れ子構造の矩形領域内に存在する小さな矩形領域の横
枠を決定する。そして、ステップS4107に示すよう
に、入れ子構造の矩形領域内の縦枠を決定する処理を行
う。
On the other hand, if the decision result in the step S4105 is Y
In the case of ES, the flow advances to step S4106 to regard the rectangular area as a new small table (nested rectangle), and determine the horizontal frame of the small rectangular area existing in the nested rectangular area. Then, as shown in step S4107, a process of determining a vertical frame in the nested rectangular area is performed.

【0137】以上のように、図3に示す第2実施例の罫
線抽出方式について述べた。本発明により、画像の品質
によらず、より高精度に罫線の抽出が可能となる。ま
た、本発明第1の実施例、第2の実施例で述べた罫線抽
出方式を実現するためのハードウェア構成の一例を図4
2に示す。帳票等の画像データは、スキャナ等の入力機
器4201を介して、コンピュータ等の処理装置420
2に取り込まれる。ここで、上述した罫線抽出方式によ
る一連の処理が行われる。途中の処理結果を、ディスプ
レイ等の出力装置4203に出力させ、出力画像により
処理経過を確認しながら、抽出処理を行わせることもで
きる。また、図42では処理装置は単体で示してある
が、複数のコンピュータからなる処理装置やネットワー
クによって接続された複数の処理装置( コンピュータ)
によっても実現が可能で、この場合、上述の罫線抽出方
式の各処理手段を各処理装置に分散させた形態となる。
As described above, the ruled line extraction method of the second embodiment shown in FIG. 3 has been described. According to the present invention, ruled lines can be extracted with higher accuracy regardless of the quality of an image. FIG. 4 shows an example of a hardware configuration for realizing the ruled line extraction method described in the first embodiment and the second embodiment of the present invention.
It is shown in FIG. Image data such as a form is input to a processing device 420 such as a computer via an input device 4201 such as a scanner.
2 Here, a series of processing by the above-described ruled line extraction method is performed. The processing result in the middle can be output to an output device 4203 such as a display, and the extraction processing can be performed while confirming the progress of the processing based on the output image. In FIG. 42, the processing device is shown as a single unit. However, a processing device including a plurality of computers or a plurality of processing devices (computers) connected via a network
In this case, each processing means of the above-described ruled line extraction method is distributed to each processing device.

【0138】なお、本発明は処理装置4202において
画像の品質によらず、より高精度に罫線の抽出が可能な
罫線抽出方式に係わるプログラムであり、図43は、本
発明に係わるソフトウェアプログラムの提供方法を説明
する図である。プログラムは、例えば以下の3つの方法
の中の任意の方法により提供される。
The present invention relates to a program relating to a ruled line extraction method capable of extracting ruled lines with higher accuracy regardless of the quality of an image in the processing device 4202. FIG. 43 provides a software program according to the present invention. It is a figure explaining a method. The program is provided by any of the following three methods, for example.

【0139】( a) コンピュータ等の処理装置4301
にインストールされて提供される。この場合、プログラ
ム等は例えば出荷前にプレインストールされる。これ
は、上述してきた罫線抽出方式のソフトウェアプログラ
ムの配布方法に相当する。
(A) Processing device 4301 such as computer
Installed and provided. In this case, the program or the like is pre-installed before shipment, for example. This corresponds to the above described method of distributing the software program of the ruled line extraction method.

【0140】( b) 可搬性記憶媒体に格納されて提供さ
れる。この場合、可搬性記憶媒体4302に格納されて
いるプログラム等は、コンピュータ等の処理装置430
1の記憶装置にインストールされる。
(B) Provided by being stored in a portable storage medium. In this case, the programs and the like stored in the portable storage medium 4302 are stored in a processing device 430 such as a computer.
1 storage device.

【0141】(c) ネットワーク4303上のサーバから
提供される。この場合、基本的には、コンピュータ等の
処理装置4301がサーバ4304に格納されているプ
ログラム等をダウロードすることによって、そのプログ
ラム等を取得する。
(C) Provided from a server on the network 4303. In this case, basically, a processing device 4301 such as a computer downloads a program or the like stored in the server 4304 to acquire the program or the like.

【0142】[0142]

【発明の効果】以上詳細に説明したように、本発明によ
れば、画像の掠れの度合いを算出して画像の品質を評価
し、それに基づいて罫線抽出処理に用いる画像を低解像
度画像、高解像度画像の中から選択することにより、従
来、掠れによって正しく抽出されなかったような罫線も
正しく抽出することが可能となり、罫線抽出の精度を向
上させることが可能となる。
As described above in detail, according to the present invention, the quality of an image is evaluated by calculating the degree of blurring of the image, and based on the calculated image quality, the image used for the ruled line extraction processing is converted into a low-resolution image and a high-resolution image. By selecting from among the resolution images, it is possible to correctly extract a ruled line that has not been correctly extracted in the past due to blurring, thereby improving the accuracy of ruled line extraction.

【0143】また、本発明の一態様によれば、掠れの度
合いを表す掠れ度は、経線候補領域内を縦または横方向
に画素探索し、罫線単位長当たりのパターンの途切れの
回数及び途切れの長さを求めることで算出される。この
ことにより、掠れの度合いを数値化することができ、ま
た数値化された掠れ度に応じた、罫線抽出の処理方法、
罫線抽出処理に用いられる閾値、用いる画像等を設定す
ることができる。
Further, according to one aspect of the present invention, the degree of blur, which indicates the degree of blur, is obtained by searching pixels in the meridian candidate area in the vertical or horizontal direction, and determining the number of pattern breaks per ruled line unit length and the number of breaks It is calculated by calculating the length. This makes it possible to digitize the degree of sharpness, and to perform a ruled line extraction processing method according to the digitized degree of sharpness,
A threshold value used for the ruled line extraction processing, an image used, and the like can be set.

【0144】また、本発明の一態様によれば、前記掠れ
度は、画像データ全体に対する値と画像データの各部分
に対する値とのいずれでも求めることができる。このこ
とにより、一つの画像の各部分の画像の品質を判定する
ことができ、その結果、後の画像データの各部分毎の処
理に適した解像度の画像を選択することができる。
Further, according to one aspect of the present invention, the degree of blurring can be determined by using either a value for the entire image data or a value for each part of the image data. As a result, the quality of the image of each part of one image can be determined, and as a result, an image having a resolution suitable for processing of each part of the subsequent image data can be selected.

【0145】また、本発明の一態様によれば、掠れによ
って複数部分に分離した帳票を含む画像から罫線を抽出
する罫線抽出方法に関して、入力画像において縦、横、
斜めの八方向のいずれかで繋がっているパターンを連結
パターンとして抽出し、抽出された連結パターンのう
ち、ある一定の大きさを有するもの同士が接近して位置
している場合、以下の3つの方法のうちいずれかを用い
て同一の表として統合するか否かの判断を行う。1) そ
れらのパターン間の白画素領域の形状を用いて判断す
る。2) それらのパターンの端の黒画素領域の形状を用
いて判断する。3)抽出された罫線位置の対応関係を用
いて判断する。このことにより、掠れ等によって分離し
た帳票の表構造をより正確に抽出することができる。
Further, according to one aspect of the present invention, a ruled line extracting method for extracting ruled lines from an image including a form separated into a plurality of parts by shading is described with reference to the vertical, horizontal, horizontal
A pattern connected in any one of the eight diagonal directions is extracted as a connection pattern, and when the connection patterns having a certain size are located close to each other, the following three A determination is made as to whether or not to integrate the same table using one of the methods. 1) Judgment is made using the shape of the white pixel region between those patterns. 2) Judgment is made using the shape of the black pixel area at the end of those patterns. 3) Judgment is made using the correspondence between the extracted ruled line positions. This makes it possible to more accurately extract the table structure of a form separated by shading or the like.

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

【図1】本発明の第1の実施例に係わる罫線抽出方式を
示すブロック図である。
FIG. 1 is a block diagram showing a ruled line extraction method according to a first embodiment of the present invention.

【図2】(a) は低解像度画像の例を示す図であり、
(b) は高解像度画像の例を示す図である。
FIG. 2A is a diagram illustrating an example of a low-resolution image.
(B) is a diagram showing an example of a high-resolution image.

【図3】本発明の第2の実施例に係わる罫線抽出方式を
示すブロック図である。
FIG. 3 is a block diagram showing a ruled line extraction method according to a second embodiment of the present invention.

【図4】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理を説明する図(その1)である。
FIG. 4 is a diagram (part 1) illustrating a dotted line extraction process of a ruled line extraction method according to a second embodiment of the present invention.

【図5】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理を説明する図(その2)である。
FIG. 5 is a diagram (part 2) for explaining the dotted line extraction processing of the ruled line extraction method according to the second embodiment of the present invention.

【図6】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理を説明する図(その3)である。
FIG. 6 is a diagram (part 3) for explaining the dotted line extraction processing of the ruled line extraction method according to the second embodiment of the present invention.

【図7】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理を説明する図(その4)である。
FIG. 7 is a diagram (part 4) illustrating a dotted line extraction process of the ruled line extraction method according to the second embodiment of the present invention.

【図8】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理を説明する図(その5)である。
FIG. 8 is a diagram (part 5) illustrating a dotted line extraction process of the ruled line extraction method according to the second embodiment of the present invention.

【図9】本発明の第2実施例に係わる罫線抽出方式の点
線抽出処理部の動作を示すフローチャートである。
FIG. 9 is a flowchart showing an operation of a dotted line extraction processing unit of a ruled line extraction method according to a second embodiment of the present invention.

【図10】本発明の第2実施例に係わる罫線抽出方式の
ラベル統合処理部に入力されるデータの例を示す図であ
り、(a) は、もともと一つの表を構成したものが掠れ
によって分離した例を示し、(b) は、もともと二つの
表を構成する例を示したものである。
FIG. 10 is a diagram illustrating an example of data input to a label integration processing unit of a ruled line extraction system according to a second embodiment of the present invention. FIG. An example of separation is shown, and (b) shows an example in which two tables are originally configured.

【図11】ラベル間の白画素領域の例を示す図であり、
(a) は、もともと同一の表を構成する場合であり、
(b) は、もともと異なる表を構成する場合の例を示し
たものである。
FIG. 11 is a diagram showing an example of a white pixel area between labels;
(A) is a case where the same table is originally constituted,
(B) shows an example in which a different table is originally configured.

【図12】ラベル間の白( または黒) 画素の形状により
ラベルを統合するか否かの判定を行う場合のラベル統合
処理のフローチャートを示す図である。
FIG. 12 is a diagram illustrating a flowchart of a label integration process when determining whether to integrate labels based on the shape of white (or black) pixels between labels.

【図13】対象ラベルの罫線の対応関係の例を示す図で
あり、(a) は、もともと同一の表を構成する場合であ
り、(b) は、もともと異なる表を構成する場合の例を
示したものである。
13A and 13B are diagrams illustrating an example of a correspondence relationship between ruled lines of a target label. FIG. 13A illustrates an example in which the same table is originally configured, and FIG. 13B illustrates an example in which a different table is originally configured. It is shown.

【図14】罫線の位置情報( 対応関係) を用いてラベル
を統合するか否かの判定を行う場合のラベル統合処理の
フローチャートを示す図である。
FIG. 14 is a diagram illustrating a flowchart of a label integration process when it is determined whether or not to integrate labels by using ruled line position information (correspondence relationship).

【図15】本発明の第2実施例に係わる罫線候補領域抽
出部のブロック図の一例を示す図である。
FIG. 15 is a diagram illustrating an example of a block diagram of a ruled line candidate area extraction unit according to a second embodiment of the present invention.

【図16】本発明の第2実施例に係わるマスク処理の方
法を示す図である。
FIG. 16 is a diagram showing a mask processing method according to a second embodiment of the present invention.

【図17】本発明の第2実施例に係わるマスク処理の動
作を示すフローチャートである。
FIG. 17 is a flowchart illustrating an operation of a mask process according to the second embodiment of the present invention.

【図18】枠を構成する線分のの投影結果を示す図であ
る。
FIG. 18 is a diagram showing a projection result of line segments constituting a frame.

【図19】本発明の第2実施例に係わる線分抽出部にお
ける隣接投影処理を説明する図である。
FIG. 19 is a diagram illustrating adjacent projection processing in a line segment extraction unit according to the second embodiment of the present invention.

【図20】本発明の第2実施例に係わる線分抽出部にお
ける隣接投影処理の動作を示すフローチャートである。
FIG. 20 is a flowchart illustrating an operation of an adjacent projection process in a line segment extraction unit according to the second embodiment of the present invention.

【図21】本発明の第2実施例に係わる線分抽出処理を
示す図である。
FIG. 21 is a diagram showing a line segment extraction process according to the second embodiment of the present invention.

【図22】本発明の第2実施例に係わる線分抽出処理部
の動作を示すフローチャートである。
FIG. 22 is a flowchart illustrating an operation of a line segment extraction processing unit according to the second embodiment of the present invention.

【図23】本発明の第2実施例に係わる直線抽出処理を
示す図である。
FIG. 23 is a diagram showing a straight line extraction process according to the second embodiment of the present invention.

【図24】本発明の第2実施例に係わる直線抽出処理部
における線分統合処理の動作を示すフローチャートであ
る。
FIG. 24 is a flowchart illustrating an operation of line segment integration processing in a straight line extraction processing unit according to the second embodiment of the present invention.

【図25】本発明の第2実施例に係わる掠れ度算出処理
を示す図である。
FIG. 25 is a diagram illustrating a skewness calculating process according to the second embodiment of the present invention.

【図26】本発明の第2実施例に係わる罫線判別処理に
おいて、罫線候補領域のパターン探索結果を示す図であ
る。
FIG. 26 is a diagram showing a result of a pattern search of a ruled line candidate area in a ruled line determination process according to the second embodiment of the present invention.

【図27】本発明の第2実施例に係わる罫線判別処理部
において、罫線候補領域のパターンの凹凸度の閾値の設
定例を示す図である。
FIG. 27 is a diagram illustrating a setting example of a threshold value of the degree of unevenness of the pattern of the ruled line candidate area in the ruled line determination processing unit according to the second embodiment of the present invention.

【図28】本発明の第2実施例に係わる罫線判別処理部
における凹凸度算出処理を示すフローチャートである。
FIG. 28 is a flowchart illustrating a roughness calculating process in a ruled line discrimination processing unit according to the second embodiment of the present invention.

【図29】図28のフローチャートの続きである。FIG. 29 is a continuation of the flowchart in FIG. 28;

【図30】本発明の第2実施例に係わる画素の配置関係
を示す図である。
FIG. 30 is a diagram showing an arrangement relationship of pixels according to a second embodiment of the present invention.

【図31】本発明の第2実施例に係わる罫線統合処理部
における横直線統合処理を説明する図である。
FIG. 31 is a view for explaining horizontal straight line integration processing in a ruled line integration processing unit according to the second embodiment of the present invention.

【図32】本発明の第2実施例に係わる罫線統合処理部
において、横直線を統合する場合の処理の動作を示すフ
ローチャートである。
FIG. 32 is a flowchart illustrating an operation of a process when a horizontal straight line is integrated in a ruled line integration processing unit according to the second embodiment of the present invention.

【図33】本発明の第2実施例に係わる罫線統合処理部
において、縦直線を統合する場合の処理の動作を示すフ
ローチャートである。
FIG. 33 is a flowchart showing an operation of a process for integrating vertical straight lines in a ruled line integration processing unit according to the second embodiment of the present invention.

【図34】本発明の第2実施例に係わるセル抽出処理部
の処理を説明する図である。
FIG. 34 is a diagram illustrating processing of a cell extraction processing unit according to the second embodiment of the present invention.

【図35】本発明の第2実施例に係わるセル抽出処理部
における横枠決定方法を説明する図である。
FIG. 35 is a diagram illustrating a method for determining a horizontal frame in a cell extraction processing unit according to the second embodiment of the present invention.

【図36】本発明の第2実施例に係わるセル抽出処理部
における縦枠決定方法を説明する図である。
FIG. 36 is a diagram illustrating a vertical frame determination method in the cell extraction processing unit according to the second embodiment of the present invention.

【図37】本発明の第2実施例に係わるセル抽出処理部
におけるセル抽出方法を説明する図である。
FIG. 37 is a diagram illustrating a cell extraction method in a cell extraction processing unit according to the second embodiment of the present invention.

【図38】本発明の第2実施例に係わるセル抽出部にお
ける入れ子構造の抽出方法を説明する図である。
FIG. 38 is a diagram for explaining a method of extracting a nested structure in the cell extracting unit according to the second embodiment of the present invention.

【図39】本発明の第2実施例に係わるセル抽出部にお
ける横枠決定方法を示すフローチャートである。
FIG. 39 is a flowchart illustrating a method for determining a horizontal frame in a cell extracting unit according to the second embodiment of the present invention.

【図40】本発明の第2実施例に係わる横直線の配置状
態を説明する図である。
FIG. 40 is a diagram illustrating an arrangement of horizontal straight lines according to the second embodiment of the present invention.

【図41】本発明の第2実施例に係わるセル抽出部にお
ける縦枠決定及び入れ子処理を示すフローチャートであ
る。
FIG. 41 is a flowchart showing vertical frame determination and nesting processing in a cell extraction unit according to the second embodiment of the present invention.

【図42】本発明に係わる罫線抽出方式を実行するハー
ドウェア構成の一例を示す図である。
FIG. 42 is a diagram showing an example of a hardware configuration for executing a ruled line extraction method according to the present invention.

【図43】本発明に係わるソフトウェアプログラム等の
提供方法を説明する図である。
FIG. 43 is a diagram illustrating a method for providing a software program and the like according to the present invention.

【図44】あらかじめ枠の情報を必要としない帳票処理
における従来法の一例を示す図である。
FIG. 44 is a diagram showing an example of a conventional method in form processing that does not require frame information in advance.

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

101画像入力手段 102異なる解像度の画像生成手段 103罫線候補領域抽出手段 104画像の品質評価手段 105品質に応じた処理方法または閾値を選択する手段 106部分処理毎に適した画像解像度を選択する手段 107罫線抽出処理( セル抽出) 手段 301低解像度画像作成部 302高解像度画像作成部 303、303’連結パターン抽出部 304点線抽出処理部 305点線画像消去部 306ラベル統合処理部 307罫線候補領域抽出部 308罫線属性判定部 309掠れ度算出処理の対象外領域設定部 310掠れ度算出部 311、311’罫線判別処理部 312罫線統合処理部( 掠れ補完処理) 313セル抽出部 314従来の処理 1501マスク処理部 1502縦横罫線の抽出 1503線分抽出部 1504直線抽出部 1505罫線候補抽出部 4201入力機器 4202処理装置( コンピュータ等) 4203出力装置 4301処理装置( コンピュータ等) 4302記憶媒体 4303ネットワーク 4304サーバ 101 image input means 102 image generation means with different resolutions 103 ruled line candidate area extraction means 104 image quality evaluation means 105 means for selecting a processing method or threshold value according to quality 106 means for selecting an image resolution suitable for each partial processing 107 Ruled line extraction processing (cell extraction) means 301 Low-resolution image creation unit 302 High-resolution image creation unit 303, 303 'Connected pattern extraction unit 304 Dotted line extraction processing unit 305 Dotted line image deletion unit 306 Label integration processing unit 307 Ruled line candidate area extraction unit 308 Ruled line attribute determining unit 309 Non-target area setting unit for blurredness calculation processing 310 Blurredness calculating unit 311, 311 'Ruled line discriminating processing unit 312 Ruled line integration processing unit (blurring complementing process) 313 cell extraction unit 314 Conventional processing 1501 Mask processing unit 1502 vertical and horizontal ruled line extraction 1503 line segment extraction unit 1504 line extraction unit 505 ruled line candidate extraction unit 4201 input device 4202 processor (computer) 4203 Output device 4301 processing unit (computer) 4302 a storage medium 4303 network 4304 server

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5B009 PA03 PA04 PB03 5B029 CC27 DD05 EE12 EE19 5C076 AA19 AA22 5L096 EA03 EA37 FA03 FA18 FA38 FA54 FA64 FA70 GA10 GA15 GA26 GA28 GA34 GA51  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5B009 PA03 PA04 PB03 5B029 CC27 DD05 EE12 EE19 5C076 AA19 AA22 5L096 EA03 EA37 FA03 FA18 FA38 FA54 FA64 FA70 GA10 GA15 GA26 GA28 GA34 GA51

Claims (23)

【特許請求の範囲】[Claims] 【請求項1】 画像データ内の帳票を構成する罫線を抽
出する罫線抽出方式であって、 入力画像から異なる解像度の画像を生成する手段と、 前記入力画像の品質を評価する手段と、 前記異なる解像度の画像の中から前記品質に応じた解像
度の画像を選択する手段と、 該選択された画像から罫線またはセルを抽出する手段
と、 を備えることを特徴とする罫線抽出方式。
1. A ruled line extraction method for extracting ruled lines forming a form in image data, comprising: means for generating images of different resolutions from an input image; means for evaluating the quality of the input image; A ruled line extraction method, comprising: means for selecting an image having a resolution corresponding to the quality from images having a resolution; and means for extracting a ruled line or a cell from the selected image.
【請求項2】 画像データ内の帳票を構成する罫線を抽
出する罫線抽出方式であって、 入力画像から異なる解像度の画像を生成する手段と、 前記入力画像から異なる解像度の画像を生成する手段に
よって生成された画像を用いて入力画像の品質を評価す
る手段と、 前記入力画像の品質を評価する手段において評価された
品質に基づいて、罫線またはセルを抽出するための処理
方法または該処理に用いられる閾値の選択を行う手段
と、 前記入力画像のそれぞれの部分に対して罫線またはセル
を抽出するための処理に適する画像解像度を選択する手
段と、 前記選択された画像解像度の画像から、前記罫線または
セルを抽出するための処理方法または該処理に用いられ
る閾値の選択を行う手段によって選択された処理方法ま
たは閾値に基づいて帳票を構成する罫線またはセルを抽
出する手段と、 を備えることを特徴とする罫線抽出方式。
2. A ruled line extraction method for extracting ruled lines constituting a form in image data, comprising: means for generating images having different resolutions from an input image; and means for generating images having different resolutions from the input image. Means for evaluating the quality of the input image using the generated image; and a processing method for extracting a ruled line or a cell based on the quality evaluated by the means for evaluating the quality of the input image, or a method for performing the processing. Means for selecting a threshold value to be selected; means for selecting an image resolution suitable for processing for extracting a ruled line or a cell for each part of the input image; and selecting the ruled line from the image of the selected image resolution. Alternatively, a book based on a processing method or a threshold value selected by a processing method for extracting cells or a threshold value used for the processing is selected. Ruled line extraction method, characterized in that it comprises, means for extracting a ruled line or cell constituting.
【請求項3】 前記異なる解像度の画像を生成する手段
は、入力画像を縮小する際、縮小率が大きい低解像度画
像と、縮小率が小さい高解像度画像とを作成することを
特徴とする請求項2記載の罫線抽出方式。
3. The image processing apparatus according to claim 1, wherein said means for generating images having different resolutions generates a low-resolution image having a large reduction ratio and a high-resolution image having a small reduction ratio when reducing an input image. 2. The ruled line extraction method described in 2.
【請求項4】 前記入力画像の品質を評価する手段は、
数値で該品質を表現することを特徴とする請求項2記載
の罫線抽出方式。
4. The means for evaluating the quality of the input image,
3. The ruled line extraction method according to claim 2, wherein the quality is expressed by a numerical value.
【請求項5】 前記入力画像の品質を評価する手段によ
る処理を行う前に、あらかじめ罫線候補領域を抽出する
罫線候補領域抽出手段をさらに備えることを特徴とする
請求項2記載の罫線抽出方式。
5. The ruled line extraction method according to claim 2, further comprising a ruled line candidate area extracting means for extracting a ruled line candidate area in advance before performing processing by the means for evaluating the quality of the input image.
【請求項6】 前記罫線候補領域抽出手段は、低解像度
画像を用いて罫線候補の抽出処理をすることを特徴とす
る請求項5記載の罫線抽出方式。
6. The ruled line extraction method according to claim 5, wherein the ruled line candidate area extracting means performs a ruled line candidate extraction process using a low resolution image.
【請求項7】 前記罫線候補領域抽出手段による処理を
行う前に、低解像度画像を用いて点線の抽出を行い、点
線を構成するパターンを除去する処理を行う手段を更に
備えることを特徴とする請求項6記載の罫線抽出方式。
7. The image processing apparatus according to claim 1, further comprising: means for extracting a dotted line using a low-resolution image and removing a pattern forming the dotted line before performing the processing by the ruled line candidate area extracting means. The ruled line extraction method according to claim 6.
【請求項8】 罫線候補領域抽出手段によって抽出され
た罫線候補領域内を、高解像度画像を用いて点線抽出処
理および罫線抽出処理を行うことで、直線の属性を判断
する罫線属性判定手段を更に備えることを特徴とする請
求項6記載の罫線抽出方式。
8. A ruled line attribute determining means for determining a straight line attribute by performing a dotted line extracting process and a ruled line extracting process on the ruled line candidate area extracted by the ruled line candidate area extracting means using a high-resolution image. 7. The ruled line extraction method according to claim 6, further comprising:
【請求項9】 前記画像の品質を評価する手段は、前記
罫線候補領域抽出手段で用いる画像とは異なる解像度の
画像を用いて画像の品質の評価を行うことを特徴とする
請求項5記載の罫線抽出方式。
9. The image quality evaluation device according to claim 5, wherein the image quality evaluation unit evaluates the image quality using an image having a different resolution from the image used in the ruled line candidate area extraction unit. Ruled line extraction method.
【請求項10】 前記画像の品質を評価する手段は、罫
線候補領域内を調査する場合に、罫線候補領域内を縦ま
たは横方向に画素探索を行うことで、画像の掠れ度合い
を掠れ度という数値で算出し、該掠れ度を画像の品質と
して用いることを特徴とする請求項5記載の罫線抽出方
式。
10. The image quality evaluation means, when examining the ruled line candidate area, performs a pixel search in the ruled line candidate area in the vertical or horizontal direction, and the blurring degree of the image is referred to as the blurring degree. 6. The ruled line extraction method according to claim 5, wherein the calculated degree is used as a quality of an image.
【請求項11】 前記掠れ度は、罫線候補領域内を画素
探索することで、罫線パターンの途切れの回数及び途切
れの長さを求め、それぞれを単位長さ当たりに換算した
ものを加算して求めることを特徴とする請求項10記載
の罫線抽出方式。
11. The blurring degree is obtained by searching for a pixel in a ruled line candidate area to obtain the number of breaks and the length of the break in the ruled line pattern, and adding the converted values per unit length. 11. The ruled line extraction method according to claim 10, wherein:
【請求項12】 前記品質に基づいて、罫線またはセル
を抽出するための処理方法または該処理に用いられる閾
値の選択を行う手段は、画像の品質を数値で表現した値
に応じた罫線抽出処理方法または罫線抽出処理に用いら
れる閾値を選択し、設定することを特徴とする請求項4
記載の罫線抽出方式。
12. A processing method for extracting a ruled line or a cell based on the quality or a means for selecting a threshold used in the processing, the ruled line extraction processing corresponding to a value representing the image quality by a numerical value. 5. The method according to claim 4, wherein a threshold value used in a ruled line extraction process is selected and set.
Ruled line extraction method described.
【請求項13】 前記入力画像のそれぞれの部分に対し
て罫線またはセルを抽出するための処理に適する画像解
像度を選択する手段は、画像の品質を数値で表現した値
に基づいて、後の罫線抽出処理に用いる画像を選択する
ことを特徴とする請求項4記載の罫線抽出方式。
13. A means for selecting an image resolution suitable for a process for extracting a ruled line or a cell for each part of the input image, comprising: 5. The ruled line extraction method according to claim 4, wherein an image used for the extraction processing is selected.
【請求項14】 前記掠れ度は、画像データ全体に対す
る値と画像データの各部分に対する値とのいずれも算出
することができることを特徴とする請求項10記載の記
載の罫線抽出方式。
14. The ruled line extraction method according to claim 10, wherein the degree of blurring can be calculated for both a value for the entire image data and a value for each part of the image data.
【請求項15】 前記入力画像のそれぞれの部分に対し
て罫線またはセルを抽出するための処理に適する画像解
像度を選択する手段は、画像データの各部分に対して求
められた掠れ度に基づいて、後の罫線抽出処理において
画像データの各部分の処理毎に適した解像度の画像を選
択することを特徴とする請求項14記載の罫線抽出方
式。
15. A means for selecting an image resolution suitable for processing for extracting a ruled line or a cell for each part of the input image, wherein the means for selecting the image resolution is based on the degree of blurring determined for each part of the image data. 15. The ruled line extraction method according to claim 14, wherein in the subsequent ruled line extraction process, an image having a resolution suitable for each processing of each part of the image data is selected.
【請求項16】 前記罫線またはセルを抽出する手段
は、画像の品質に基づいて、前記罫線候補領域抽出手段
で用いた画像とは異なる解像度の画像を用いることも可
能とすることを特徴とする請求項5記載の罫線抽出方
式。
16. The image processing apparatus according to claim 16, wherein the means for extracting the ruled line or the cell can use an image having a different resolution from the image used by the ruled line candidate area extracting means based on the quality of the image. The ruled line extraction method according to claim 5.
【請求項17】 前記罫線またはセルを抽出する手段
は、掠れのない画像であると判断された場合に、より高
解像度な画像を用い、掠れのある画像であると判断され
た場合に、より低解像度な画像を用いることを特徴とす
る請求項16記載の罫線抽出方式。
17. A means for extracting a ruled line or a cell uses a higher-resolution image when it is determined that the image is not blurred, and uses a higher-resolution image when it is determined that the image is blurred. 17. The ruled line extraction method according to claim 16, wherein a low-resolution image is used.
【請求項18】 掠れによって複数部分に分離した帳票
を含む画像から罫線を抽出する罫線抽出方法であって、 入力画像において、注目画素に縦、横、斜めの八方向の
いずれかで隣接している画素を順に探索することで、繋
がっているパターンを連結パターンとして抽出し、 抽出された連結パターンのうち、ある一定の大きさを有
するもの同士が接近して位置している場合、それらのパ
ターン間の白画素領域の形状を用いて、同一の表を構成
すると判断して統合処理を行った後、帳票を構成する罫
線を抽出する罫線抽出方法。
18. A ruled line extraction method for extracting a ruled line from an image including a form separated into a plurality of parts by shading, wherein the ruled line is adjacent to a target pixel in any of eight vertical, horizontal, and oblique directions in an input image. The connected patterns are extracted as a connected pattern by searching for the pixels in sequence, and when the extracted connected patterns having a certain size are located close to each other, those patterns are detected. A ruled line extraction method for extracting a ruled line forming a form after performing an integration process by determining that the same table is configured using the shape of a white pixel region between the two.
【請求項19】 請求項18記載の罫線抽出方法であっ
て、 パターン間の白画素領域の形状に、凹凸があれば同一の
表を構成すると判断して統合処理を行い、 パターン間の白画素領域の形状に、凹凸がなければ異な
る表を構成すると判断して統合処理を行うことを特徴と
する罫線抽出方法。
19. The ruled line extraction method according to claim 18, wherein if there is unevenness in the shape of the white pixel area between the patterns, it is determined that the same table is formed, and the integration process is performed. A ruled line extraction method characterized by determining that a different table is formed if there is no unevenness in the shape of a region and performing an integration process.
【請求項20】 掠れによって複数部分に分離した帳票
を含む画像から罫線を抽出する罫線抽出方法であって、 入力画像において、注目画素に縦、横、斜めの八方向の
いずれかで隣接している画素を順に探索することで、繋
がっているパターンを連結パターンとして抽出し、 抽出された連結パターンのうち、ある一定の大きさを有
するもの同士が接近して位置していた場合、それらのパ
ターンの端に位置する黒画素の形状を用いて、同一の表
を構成すると判断して統合処理を行った後、帳票を構成
する罫線を抽出する罫線抽出方法。
20. A ruled line extracting method for extracting a ruled line from an image including a form separated into a plurality of portions by shading, wherein the ruled line is adjacent to a target pixel in any of eight vertical, horizontal, and oblique directions in an input image. The connected patterns are extracted as a connected pattern by sequentially searching for the pixels that exist, and when those having a certain size are located close to each other among the extracted connected patterns, those patterns are detected. A ruled line extraction method for extracting the ruled lines forming the form after determining that the same table is configured using the shape of the black pixel located at the end of the form and performing the integration processing.
【請求項21】 請求項20記載の罫線抽出方法であっ
て、 パターン端の黒画素領域の形状が、突起状になっている
場合、同一の表を構成すると判断して統合処理を行うこ
とを特徴とする罫線抽出方法。
21. The ruled line extraction method according to claim 20, wherein when the shape of the black pixel area at the end of the pattern is a protruding shape, it is determined that the same table is formed and the integration processing is performed. Characteristic ruled line extraction method.
【請求項22】 掠れによって複数部分に分離した帳票
を含む画像から罫線を抽出する罫線抽出方法であって、 入力画像において、注目画素に縦、横、斜めの八方向の
いずれかで隣接している画素を順に探索することで、繋
がっているパターンを連結パターンとして抽出し、 抽出された連結パターンのうち、ある一定の大きさを有
するもの同士が接近して位置していた場合、それらのパ
ターンから罫線の抽出を行い、それぞれのパターンから
抽出された罫線位置に対応関係が一致すれば同一の表を
構成すると判断して統合処理を行うことを特徴とする罫
線抽出方法。
22. A ruled line extraction method for extracting a ruled line from an image including a form separated into a plurality of parts by shading, wherein the input image is adjacent to a target pixel in any of eight vertical, horizontal, and oblique directions. The connected patterns are extracted as a connected pattern by sequentially searching for the pixels that exist, and when those having a certain size are located close to each other among the extracted connected patterns, those patterns are detected. A ruled line extraction method for extracting a ruled line from each pattern, and determining that the same table is formed if the correspondence is the same with the ruled line position extracted from each pattern, and performing an integration process.
【請求項23】 画像データ内の帳票を構成する罫線を
抽出するプログラムを記憶した記憶媒体であって、 入力画像から異なる解像度の画像を生成するステップ
と、 前記入力画像から異なる解像度の画像を生成するステッ
プによって生成された画像を用いて入力画像の品質を評
価するステップと、 前記入力画像の品質を評価するステップにおいて評価さ
れた品質に基づいて、罫線またはセルを抽出するための
処理方法または該処理に用いられる閾値の選択を行うス
テップと、 前記入力画像のそれぞれの部分から罫線またはセルを抽
出するための処理に適する画像解像度を選択するステッ
プと、 前記選択された画像解像度の画像から、前記罫線または
セルを抽出するための処理方法または該処理に用いられ
る閾値の選択を行う手段によって選択された処理方法ま
たは閾値に基づいて帳票を構成する罫線またはセルを抽
出するステップと、 を含む処理を処理装置に実行させるためのプログラムを
記憶したコンピュータ読み取り可能な記憶媒体。
23. A storage medium storing a program for extracting a ruled line forming a form in image data, the method comprising: generating images of different resolutions from an input image; and generating images of different resolutions from the input image. Evaluating the quality of the input image using the image generated by the step of performing, and a processing method for extracting ruled lines or cells based on the quality evaluated in the step of evaluating the quality of the input image, or Selecting a threshold used for processing; selecting an image resolution suitable for processing for extracting a ruled line or a cell from each part of the input image; and A processing method for extracting a ruled line or a cell or a threshold value used for the processing is selected by means for selecting. Has been processing method or computer-readable storage medium storing a program for executing the steps, the process comprising the processing apparatus for extracting ruled lines or cells constituting a form based on a threshold.
JP28790999A 1999-10-08 1999-10-08 Ruled line extraction method Expired - Fee Related JP4409678B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28790999A JP4409678B2 (en) 1999-10-08 1999-10-08 Ruled line extraction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28790999A JP4409678B2 (en) 1999-10-08 1999-10-08 Ruled line extraction method

Publications (2)

Publication Number Publication Date
JP2001109888A true JP2001109888A (en) 2001-04-20
JP4409678B2 JP4409678B2 (en) 2010-02-03

Family

ID=17723306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28790999A Expired - Fee Related JP4409678B2 (en) 1999-10-08 1999-10-08 Ruled line extraction method

Country Status (1)

Country Link
JP (1) JP4409678B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8131082B2 (en) * 2007-04-12 2012-03-06 Canon Kabushiki Kaisha Image processing apparatus configured to calculate a resolution suitable for the size of a region to be processed and method for controlling the same
CN105787937A (en) * 2016-02-25 2016-07-20 武汉大学 OSM-based high-resolution remote sensing image road change detection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8131082B2 (en) * 2007-04-12 2012-03-06 Canon Kabushiki Kaisha Image processing apparatus configured to calculate a resolution suitable for the size of a region to be processed and method for controlling the same
CN105787937A (en) * 2016-02-25 2016-07-20 武汉大学 OSM-based high-resolution remote sensing image road change detection method

Also Published As

Publication number Publication date
JP4409678B2 (en) 2010-02-03

Similar Documents

Publication Publication Date Title
US5335290A (en) Segmentation of text, picture and lines of a document image
JP3748164B2 (en) Pattern extraction device
JP2951814B2 (en) Image extraction method
US20070168382A1 (en) Document analysis system for integration of paper records into a searchable electronic database
US6711292B2 (en) Block selection of table features
JPH08293001A (en) Image processing unit and method and optical character recognition unit and method
JP2002024836A (en) Method for extracting title from digital image
RU2640322C2 (en) Methods and systems of effective automatic recognition of symbols
RU2648638C2 (en) Methods and systems of effective automatic recognition of symbols using a multiple clusters of symbol standards
JPH06301781A (en) Method and equipment for image transformation for pattern recognition by computer
JP2000207489A (en) Character extracting method and device and record medium
JPH07105312A (en) Method and device for eliminating dirt from character image in optical character reader
JP2013171310A (en) Character recognition method, character recognition device using the same and program
JPH0950527A (en) Frame extracting device and rectangle extracting device
JP5029412B2 (en) Telop character pattern extraction program, telop character pattern extraction device, and telop character pattern extraction method
JP4409678B2 (en) Ruled line extraction method
RU2582064C1 (en) Methods and systems for effective automatic recognition of symbols using forest solutions
JP3607753B2 (en) Document image region dividing method and apparatus, and column type discrimination method and apparatus
JP3172498B2 (en) Image recognition feature value extraction method and apparatus, storage medium for storing image analysis program
JP4194309B2 (en) Document direction estimation method and document direction estimation program
JP3187895B2 (en) Character area extraction method
JP2796561B2 (en) Tabular document recognition method
JP3661774B2 (en) Character string recognition method, character recognition device and program
JP2003216958A (en) Device, method and program for detecting polygon
JPH11316797A (en) Method and device for discriminating area of document image

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060926

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090708

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090714

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090909

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20091110

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20091112

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20121120

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20121120

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20131120

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees