JPH09179936A - Ruled-line erasing method and character recognition method - Google Patents

Ruled-line erasing method and character recognition method

Info

Publication number
JPH09179936A
JPH09179936A JP7336690A JP33669095A JPH09179936A JP H09179936 A JPH09179936 A JP H09179936A JP 7336690 A JP7336690 A JP 7336690A JP 33669095 A JP33669095 A JP 33669095A JP H09179936 A JPH09179936 A JP H09179936A
Authority
JP
Japan
Prior art keywords
ruled line
black
binary image
memory
rectangle
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.)
Pending
Application number
JP7336690A
Other languages
Japanese (ja)
Inventor
Goro Bessho
吾朗 別所
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP7336690A priority Critical patent/JPH09179936A/en
Priority to US08/762,439 priority patent/US5898795A/en
Publication of JPH09179936A publication Critical patent/JPH09179936A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

PROBLEM TO BE SOLVED: To securely erase ruled lines from an unknown document and recognize characters with high accuracy without being affected by the skew of an image. SOLUTION: Long black runs are extracted (108) from an OR-compressed binary image (106) of a binary image (102) of a document and the ruled-line rectangle formed by uniting the black runs is extracted (112). The coordinate values of the black runs in the ruled-line rectangle are converted (116) into coordinate values on the original binary image (102). The coordinate values after the conversion are used to convert (118) black pixels in an area corresponding to the black runs on the original binary image (102) or black pixels in an area obtained by enlarging the area of the black runs into white pixels (118), thereby obtaining a binary image from which the ruled lines are erased.

Description

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

【0001】[0001]

【発明の属する分野】本発明は、文書もしくは帳票の画
像処理に係り、特に、文書や帳票中の罫線の消去及び文
字認識に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to image processing of documents or forms, and more particularly to erasing ruled lines and character recognition in documents or forms.

【0002】[0002]

【従来の技術】文書もしくは帳票には、文字が記入され
る枠が設けられているものが少なくない。このような枠
の内部に書かれた文字を読み取る方法としては、枠と枠
内文字とを異なる色で記録し、文書もしくは帳票を光学
的にスキャンして得られる信号を各色の信号に分離する
方法(特開昭56−9877号)が一般的であった。し
かし、この方法では、文書もしくは帳票を作成する段階
で、予めスキャナの特性を考慮して決めた特定の色で枠
等を印刷しなければならず、文書もしくは帳票の作成コ
ストが増加することと、枠内への文字記入に特定の色の
筆記具を用いなければならない等の不都合があった。
2. Description of the Related Art Many documents or forms are provided with a frame in which characters are entered. As a method of reading characters written inside such a frame, the frame and the characters inside the frame are recorded in different colors, and the signal obtained by optically scanning the document or the form is separated into signals of each color. The method (JP-A-56-9877) was common. However, with this method, at the stage of creating a document or form, it is necessary to print a frame or the like in a specific color determined in advance in consideration of the characteristics of the scanner, which increases the cost of creating the document or form. However, there are inconveniences such as having to use a writing instrument of a specific color for writing characters in the frame.

【0003】近年、枠と文字を色で区別せず、普通紙に
ワードプロセッサ等で印刷した文書や帳票が用いられる
ことが多くなっている。このような文書や帳票における
枠と枠内文字との分離の方法としては、水平方向にヒス
トグラムを作成し、そのピーク位置から罫線を抽出し、
罫線部分を除去してから文字認識を行う方法(特開昭6
1−196382号、特開平2−7183号)が知られ
ている。
In recent years, documents and forms printed on plain paper by a word processor or the like are often used without distinguishing between frames and characters by color. As a method of separating the frame and the characters in the frame in such a document or form, a histogram is created in the horizontal direction, and a ruled line is extracted from the peak position,
A method of recognizing characters after removing the ruled line portion
1-196382 and JP-A-2-7183) are known.

【0004】[0004]

【発明が解決しようとする課題】しかし、特開昭61−
196382号の方法では、黒画素のヒストグラムから
罫線の位置を検出するので、原稿に傾きがある場合に
は、罫線の範囲を正確に検出できないという問題があ
る。また、特開平2−7183号の方法では、行と垂直
な方向に領域を分割してから射影パターンにより罫線の
存在範囲を検出するので、未知の帳票に対しては、分割
する領域が定まらないため罫線の存在範囲を正確に検出
できないという問題があった。
However, Japanese Patent Application Laid-Open No.
In the method of 196382, since the position of the ruled line is detected from the histogram of the black pixels, there is a problem that the range of the ruled line cannot be accurately detected when the document has an inclination. Further, in the method disclosed in Japanese Patent Laid-Open No. 2-7183, since the area in which the ruled line is present is detected by dividing the area in the direction perpendicular to the line, the area to be divided is not determined for the unknown form. Therefore, there is a problem that the existence range of the ruled line cannot be accurately detected.

【0005】よって、本発明の目的は、未知の文書や帳
票に対して、その画像の傾きがある場合にも正確な罫線
消去を行う手段を提供することにある。本発明の目的
は、罫線(アンダーラインも含む、以下同様)の存在す
る未知の文書や帳票に対して、その画像の傾きがある場
合にも、高い精度の文字認識を行う手段を提供すること
にある。本発明の他の目的は、罫線消去のための処理に
必要なメモリ量を削減する手段を提供することにある。
Therefore, it is an object of the present invention to provide a means for accurately erasing ruled lines for an unknown document or form even if the image is tilted. An object of the present invention is to provide means for performing high-accuracy character recognition on an unknown document or form having ruled lines (including underlines, the same applies below) even when the image is tilted. It is in. Another object of the present invention is to provide means for reducing the amount of memory required for the processing for erasing ruled lines.

【0006】[0006]

【課題を解決するための手段】請求項1記載の発明は、
第1のメモリに格納された2値イメージ上の一定値以上
の長さを持つ黒ランを抽出する黒ラン抽出ステップと、
該黒ラン抽出ステップで抽出された黒ランの中の予め定
められた距離内にある黒ランを統合し、統合した黒ラン
をすべて包含する矩形を罫線矩形として抽出する罫線矩
形抽出ステップと、該罫線矩形抽出ステップで抽出され
た罫線矩形に包含される黒ランに対応した、該第1メモ
リ内の2値イメージ中の黒画素を白画素に変換する罫線
消去ステップとを有することを特徴とする。
According to the first aspect of the present invention,
A black run extraction step of extracting a black run having a length equal to or greater than a certain value on the binary image stored in the first memory;
A ruled line rectangle extracting step of integrating black runs within a predetermined distance among the black runs extracted in the black run extracting step, and extracting a rectangle including all the integrated black runs as ruled line rectangles; A ruled line erasing step for converting black pixels in the binary image in the first memory into white pixels corresponding to the black runs included in the ruled line rectangle extracted in the ruled line rectangle extracting step. .

【0007】請求項2記載の発明は、第1のメモリに格
納された2値イメージ上の一定値以上の長さを持つ黒ラ
ンを抽出する黒ラン抽出ステップと、該黒ラン抽出ステ
ップで抽出された黒ランの中の予め定められた距離内に
ある黒ランを統合し、統合した黒ランをすべて包含する
矩形を罫線矩形として抽出する罫線矩形抽出ステップ
と、該第1メモリ内の2値イメージより、該罫線矩形抽
出ステップで抽出された罫線矩形の内部の一定値以上の
長さを持つ黒ランを抽出する罫線矩形内黒ラン抽出ステ
ップと、該第1メモリ内の2値イメージ中の該罫線矩形
内黒ラン抽出ステップで抽出された黒ランに対応する黒
画素を白画素に変換する罫線消去ステップとを有するこ
とを特徴とする。
According to a second aspect of the present invention, a black run extraction step of extracting a black run having a length of a predetermined value or more on the binary image stored in the first memory, and the black run extraction step are performed. Ruled line rectangle extraction step of integrating black runs within a predetermined distance among the selected black runs and extracting a rectangle including all the integrated black runs as a ruled line rectangle, and a binary value in the first memory A black run in a ruled line rectangle extracting step for extracting a black run having a length equal to or more than a certain value inside the ruled line rectangle extracted in the ruled line rectangle extracting step from the image; and a black run in the binary image in the first memory. A ruled line erasing step of converting a black pixel corresponding to the black run extracted in the ruled line rectangle black run extraction step into a white pixel.

【0008】請求項3記載の発明は、請求項1又は2記
載の発明の罫線消去方法において、該第1メモリ内の2
値イメージに対応する2値イメージを第2のメモリに格
納するステップを有し、該黒ラン抽出ステップは該第2
のメモリ内の2値イメージを用いて黒ランの抽出を行う
ことを特徴とする。
According to a third aspect of the present invention, in the ruled line erasing method according to the first or second aspect of the present invention, in the first memory, 2
Storing a binary image corresponding to the value image in a second memory, the black run extracting step including the second image.
The black run is extracted using the binary image in the memory.

【0009】請求項4記載の発明は、請求項1記載の発
明の罫線消去方法において、該第1メモリ内の2値イメ
ージを所定の縮小率でOR圧縮した2値イメージを第2
のメモリに格納するステップと、該第罫線矩形抽出ステ
ップで抽出された罫線矩形に包含される、該黒ラン抽出
ステップにより抽出された黒ランの座標値を該第1メモ
リ内の2値イメージ上の座標値に変換する座標変換ステ
ップとを有し、該罫線消去ステップは該座標変換ステッ
プによって変換された黒ランの座標値に基づき白画素へ
変換すべき黒画素の位置を認識することを特徴とする。
According to a fourth aspect of the present invention, in the ruled line erasing method according to the first aspect of the present invention, the binary image in the first memory is OR-compressed at a predetermined reduction ratio to generate a second binary image.
And storing the coordinate values of the black run extracted by the black run extraction step included in the ruled line rectangle extracted by the first ruled line rectangle extraction step on the binary image in the first memory. And a coordinate conversion step for converting the coordinate values of the black pixels to be converted into white pixels based on the coordinate values of the black run converted by the coordinate conversion step. And

【0010】請求項5記載の発明は、請求項2記載の発
明の罫線消去方法において、該第1メモリ内の2値イメ
ージを所定の縮小率でOR圧縮した2値イメージを第2
のメモリに格納するステップと、該第罫線矩形抽出ステ
ップで抽出された罫線矩形の座標値を該第1メモリ内の
2値イメージ上の座標値に変換する座標変換ステップと
を有し、該第罫線矩形内黒ラン抽出ステップは該座標変
換ステップによって変換された罫線矩形の座標値に基づ
き黒ランを抽出すべき範囲を認識することを特徴とす
る。
According to a fifth aspect of the present invention, in the ruled line erasing method according to the second aspect of the present invention, the binary image in the first memory is OR-compressed at a predetermined reduction ratio to generate a second binary image.
And a coordinate conversion step of converting the coordinate values of the ruled line rectangle extracted in the first ruled line rectangle extraction step into coordinate values on the binary image in the first memory. The step of extracting black runs within a ruled line rectangle is characterized by recognizing a range in which a black run should be extracted based on the coordinate values of the ruled line rectangle converted by the coordinate conversion step.

【0011】請求項6記載の発明は、請求項1乃至5の
いずれか1項記載の発明の罫線消去方法において、該罫
線消去ステップは黒ランの領域を拡大した領域の内部の
黒画素を白画素に変換することを特徴とする。
According to a sixth aspect of the present invention, in the ruled line erasing method according to any one of the first to fifth aspects of the invention, the ruled line erasing step is such that black pixels inside a region obtained by enlarging a black run region are white. It is characterized by conversion into pixels.

【0012】請求項7記載の発明は、請求項6項記載の
発明の罫線消去方法において、該黒ランの領域を拡大し
た領域の拡大量は該黒ランを包含する罫線矩形の幅に応
じて制御されることを特徴とする。
According to a seventh aspect of the present invention, in the ruled line erasing method according to the sixth aspect of the invention, the enlargement amount of the area obtained by enlarging the area of the black run depends on the width of the ruled line rectangle including the black run. It is characterized by being controlled.

【0013】請求項8記載の発明は、請求項1乃至5の
いずれか1項記載の発明の罫線消去方法において、該罫
線消去ステップによって罫線消去後の2値イメージに対
し、消去された黒ランの位置から一定距離の範囲内にあ
る所定の大きさより小さい孤立した黒画素連結矩形を抽
出する黒画素連結矩形抽出ステップと、該罫線消去後の
2値イメージに対して該黒画素連結矩形抽出ステップに
より抽出された黒画素連結矩形の内部の黒画素を白画素
に変換する罫線矩形内白画素変換ステップとを有するこ
とを特徴とする。
According to an eighth aspect of the present invention, in the ruled line erasing method according to any one of the first to fifth aspects of the present invention, the black run which is erased from the binary image after the ruled line is erased by the ruled line erasing step. Step for extracting an isolated black pixel connected rectangle smaller than a predetermined size within a certain distance from the position of, and a black pixel connected rectangle extracting step for the binary image after the ruled line is erased. And a step of converting white pixels inside the ruled line rectangle into black pixels inside the black pixel connected rectangle extracted by.

【0014】請求項9記載の発明は、2値イメージ中の
罫線を請求項1乃至8のいずれか1項記載の発明の罫線
消去方法により消去する処理と、該処理により罫線が消
去された2値イメージの文字イメージを切り出し、文字
認識を行う処理とからなることを特徴とする。
According to a ninth aspect of the present invention, a ruled line in a binary image is erased by the ruled line erasing method according to any one of the first to eighth aspects of the invention, and the ruled line is erased by the process. The character image of the value image is cut out and the character recognition is performed.

【0015】請求項10記載の発明は、請求項9記載の
発明の文字認識方法において、2値イメージ中の罫線を
消去する処理で文字行に対し平行な方向の罫線のみを消
去することを特徴とする。
According to a tenth aspect of the present invention, in the character recognition method according to the ninth aspect, only the ruled lines parallel to the character lines are erased in the process of eliminating the ruled lines in the binary image. And

【0016】請求項11記載の発明は、第1のメモリに
格納された2値イメージ上の罫線により囲まれた枠を認
識する枠認識処理と、該枠認識処理により認識された枠
内の文字イメージを該第1メモリ内の2値イメージより
切り出し、切り出した文字イメージの文字認識を行う文
字認識処理と、該第1メモリ内の2値イメージ中の罫線
を消去する罫線消去処理と、該文字認識処理の認識結果
の確信度が低い文字が存在する場合に、少なくともも該
確信度の低い文字について、該罫線消去処理によって罫
線消去後の2値イメージより改めて文字イメージを切り
出し文字認識を行う再文字認識処理とを有することを特
徴とする。
According to an eleventh aspect of the present invention, a frame recognition process for recognizing a frame surrounded by a ruled line on a binary image stored in the first memory and a character in the frame recognized by the frame recognition process. A character recognition process for cutting out an image from a binary image in the first memory and character recognition of the cut out character image; a ruled line erasing process for erasing ruled lines in the binary image in the first memory; When there is a character with a low certainty factor in the recognition result of the recognition process, a character image is again cut out from the binary image after ruled line elimination by the ruled line elimination process for at least the character with a low certainty factor, and character recognition is performed again. Character recognition processing is included.

【0017】請求項12記載の発明は、請求項11記載
の発明の文字認識方法において、該罫線消去処理は請求
項1乃至8のいずれか1項記載の発明の罫線消去方法に
より罫線の消去を行うことを特徴とする。
According to a twelfth aspect of the present invention, in the character recognition method according to the eleventh aspect of the present invention, the ruled line erasing processing is performed by the ruled line erasing method according to any one of the first to eighth aspects. It is characterized by performing.

【0018】[0018]

【発明の実施の形態】以下、本発明の実施の形態を明ら
かにするため、図面を用い本発明の実施例について説明
する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings in order to clarify the embodiments of the present invention.

【0019】[実施例1]図1は本発明の実施例1を示
すブロック図である。このブロック図を参照し、本実施
例の装置構成と処理内容を、処理の流れにそって説明す
る。初めに、イメージスキャナ等の2値画像入力部10
0によって、文書や帳票等の原稿を読み取り、原稿の2
値イメージデータを2値イメージメモリ102に格納す
る。
[First Embodiment] FIG. 1 is a block diagram showing a first embodiment of the present invention. With reference to this block diagram, the device configuration and processing contents of the present embodiment will be described according to the flow of processing. First, a binary image input unit 10 such as an image scanner
0 reads a document such as a document or form, and
The value image data is stored in the binary image memory 102.

【0020】次に、圧縮画像生成部104において、2
値イメージメモリ102内の2値イメージデータを所定
の圧縮率で圧縮した圧縮2値イメージデータを生成し、
これを圧縮2値イメージメモリ106に格納する。この
際、1/4、1/8等のデジタル演算系で処理が容易な
圧縮率が採用される。圧縮方法はOR圧縮が採用され
る。OR圧縮以外の方法を採用することも可能である
が、後述のようにイメージスキャナの解像度や2値化の
誤差の影響による罫線の切れが生じた場合でも、罫線の
抽出を確実にするため、本実施例ではOR圧縮が採用さ
れる。オリジナルの2値イメージでなく圧縮2値イメー
ジデータに対して黒ラン抽出を行う方法が採用される理
由は、後述のようにイメージスキャナの解像度や2値化
の誤差等によりイメージの周辺部で生じる揺らぎに対応
しやすいからである。
Next, in the compressed image generation unit 104, 2
Generating compressed binary image data by compressing the binary image data in the value image memory 102 at a predetermined compression rate,
This is stored in the compressed binary image memory 106. At this time, a compression ratio of 1/4, 1/8, etc., which is easy to process in a digital operation system, is adopted. As the compression method, OR compression is adopted. Although a method other than the OR compression can be adopted, in order to ensure the extraction of the ruled line even when the ruled line is cut due to the influence of the resolution of the image scanner or the error of binarization, as will be described later, In this embodiment, OR compression is adopted. The reason why the black run extraction method is applied to the compressed binary image data instead of the original binary image is generated in the peripheral portion of the image due to the resolution of the image scanner, the error of binarization, etc. as described later. This is because it is easy to deal with fluctuations.

【0021】圧縮2値イメージは後述の黒ラン抽出のた
めにのみ用いられ、後述の罫線消去の対象となるのは2
値イメージメモリ102内のオリジナルの2値イメージ
データである。このように黒ラン抽出対象イメージ用メ
モリと罫線消去対象イメージ用メモリとを別々に用意し
たのは、縦横の罫線が混在した原稿の場合に両方の罫線
の消去を容易にするためである。すなわち、一つのメモ
リを両処理に共用すると、例えば横罫線を抽出して横罫
線の消去を行った後に、縦罫線の抽出を行おうとする
と、横罫線と交差したような縦罫線の黒ランの一部を抽
出できなくなるが、メモリを分ければそのような不都合
を回避できる。そして、圧縮2値イメージデータはオリ
ジナル2値イメージデータに比べデータサイズが小さい
ため、二つのメモリを設けても必要なメモリ量はそれほ
ど増加しない。この点も、黒ラン抽出を圧縮2値イメー
ジデータに対して行うことによる利益である。
The compressed binary image is used only for the black run extraction described later, and the target of the ruled line elimination described later is 2.
It is the original binary image data in the value image memory 102. The reason why the black run extraction target image memory and the ruled line erasing target image memory are separately prepared is to facilitate the erasure of both ruled lines in the case of a document in which vertical and horizontal ruled lines are mixed. That is, if one memory is shared by both processes, for example, if a horizontal ruled line is extracted and the horizontal ruled line is erased and then a vertical ruled line is extracted, a black run of a vertical ruled line that intersects with the horizontal ruled line is generated. Although a part cannot be extracted, such inconvenience can be avoided by dividing the memory. Since the compressed binary image data has a smaller data size than the original binary image data, the required memory amount does not increase so much even if two memories are provided. This point is also a benefit obtained by performing the black run extraction on the compressed binary image data.

【0022】圧縮2値イメージデータが生成されると、
黒ラン抽出部108において、圧縮2値イメージデータ
をスキャンし、罫線を構成する黒ランである可能性が高
い一定値以上の長さを持つ黒ランを抽出し、そのデータ
(始点及び終点の座標)を黒ランメモリ110に抽出す
る。縦横罫線を含む表領域が存在する原稿を処理するよ
うな場合には、横方向(主走査方向)の黒ランと縦方向
(副走査方向)の黒ランの両方を抽出する。両方向の黒
ランの抽出を同時に行うことも可能であるが、本実施例
では、一方向について黒ラン抽出が行われ、同方向の罫
線抽出と罫線消去が行われた後に、他方向についての同
様処理が行われる。なお、原稿中のアンダーラインのよ
うな文字行と平行な線だけを消去したい場合には、文字
行と平行な方向の黒ランの抽出だけが行われる。
When the compressed binary image data is generated,
The black run extraction unit 108 scans the compressed binary image data, extracts a black run having a length equal to or greater than a certain value that is likely to be a black run forming a ruled line, and extracts the data (coordinates of the start point and the end point). ) Is extracted to the black run memory 110. In the case of processing a document having a table area including vertical and horizontal ruled lines, both black runs in the horizontal direction (main scanning direction) and black runs in the vertical direction (sub scanning direction) are extracted. Although it is possible to extract black runs in both directions at the same time, in the present embodiment, black run extraction is performed in one direction, and ruled line extraction and ruled line deletion in the same direction are performed, and then the same is performed in the other directions. Processing is performed. When it is desired to erase only a line parallel to a character line such as an underline in a document, only a black run in a direction parallel to the character line is extracted.

【0023】黒ランデータが得られると、罫線抽出部1
12において、抽出された黒ランに対し、予め定められ
た距離の範囲内にある黒ランを、それらを全て包含する
矩形(罫線矩形と呼ぶ)に統合する処理を行う。そし
て、罫線矩形のデータ(罫線矩形の対角頂点座標と、罫
線矩形に統合された黒ランの座標を黒ランメモリ110
より取り出すための情報)を罫線メモリ114に格納す
る。
When the black run data is obtained, the ruled line extraction unit 1
In step 12, the black run extracted is integrated into a rectangle (called a ruled line rectangle) that includes all black runs within a predetermined distance range. Then, the data of the ruled line rectangle (the diagonal vertex coordinates of the ruled line rectangle and the coordinates of the black run integrated in the ruled line rectangle are stored in the black run memory 110).
Information for further extraction) is stored in the ruled line memory 114.

【0024】少なくとも一つの罫線矩形の抽出が終わる
と、座標変換部116において、その罫線矩形の対角頂
点座標値を罫線メモリ114から読み込み、また、罫線
メモリ114内のデータに基づき罫線矩形に統合された
各黒ランの始点及び終点の座標値を黒ランメモリ110
より読み込み、これらの座標値(圧縮2値イメージ上の
座標値である)を圧縮前のオリジナル2値イメージ上の
座標値に変換(写像)し、変換結果を罫線消去部118
へ送る。
When at least one ruled line rectangle has been extracted, the coordinate conversion unit 116 reads the diagonal vertex coordinate values of the ruled line rectangle from the ruled line memory 114 and integrates the ruled line rectangle based on the data in the ruled line memory 114. The coordinate values of the start point and the end point of each of the black runs are stored in the black run memory
Are read, and these coordinate values (which are the coordinate values on the compressed binary image) are converted (mapped) into the coordinate values on the original binary image before compression, and the conversion result is the ruled line erasing unit 118.
Send to

【0025】図2は、この座標変換の様子を模式的に示
している。200は圧縮2値イメージ上の罫線矩形であ
り、201はオリジナル2値イメージ上に写像された罫
線矩形である。L1,L2,L3,L4は罫線矩形に統
合された、罫線を構成する黒ランである。黒ランはOR
圧縮された2値イメージより抽出されたものであるた
め、オリジナル2値イメージへ写像された黒ランはオリ
ジナル2値イメージ上の元の黒ランよりOR圧縮の分だ
け若干太る。また、オリジナル2値イメージ上ではスキ
ャナの解像度や2値化の誤差の影響により罫線の黒ラン
に微少な切れが生じることがあるが、この切れはOR圧
縮によって繋がった形になるため、そのような切れのな
い罫線の黒ランがオリジナル2値イメージデータへ写像
される。
FIG. 2 schematically shows this coordinate conversion. Reference numeral 200 is a ruled line rectangle on the compressed binary image, and 201 is a ruled line rectangle mapped on the original binary image. L1, L2, L3, and L4 are black runs that form a ruled line and are integrated into a ruled line rectangle. Black run is OR
Since it is extracted from the compressed binary image, the black run mapped to the original binary image is slightly thicker by OR compression than the original black run on the original binary image. Also, on the original binary image, there may be a slight break in the black run of the ruled line due to the influence of the resolution of the scanner or the error of the binarization, but this break becomes a form connected by OR compression, so that An unbroken ruled black run is mapped to the original binary image data.

【0026】罫線消去部118は、座標変換部116よ
り与えられた変換後座標値を用いて2値イメージメモリ
102内のオリジナル2値イメージに対して、黒ランに
対応した黒画素を白画素に変換することにより、罫線の
消去を行う。この罫線消去処理には、消去範囲の制御に
関連して複数の処理モードを選択できる。以下、各モー
ドにおける消去範囲の制御を説明する。
The ruled line erasing unit 118 converts the black pixel corresponding to the black run into a white pixel in the original binary image in the binary image memory 102 using the converted coordinate values provided by the coordinate converting unit 116. By converting, ruled lines are erased. In this ruled line erasing process, a plurality of processing modes can be selected in relation to the control of the erasing range. The control of the erase range in each mode will be described below.

【0027】1)モードA 座標変換後の黒ランの範囲をそのまま消去範囲とする。
このモードでも、OR圧縮により罫線の黒ランが太った
分だけ、オリジナル2値イメージ上の元の罫線の黒ラン
の範囲よりも、消去範囲は広がる。したがって、オリジ
ナル2値イメージに多少の揺らぎがあっても、また、罫
線に小さな切れが生じた場合にも、確実に罫線を消去で
きる。
1) Mode A The range of black runs after coordinate conversion is used as it is as an erasing range.
Even in this mode, the erasing range is wider than the black run range of the original ruled line on the original binary image by the amount that the black run of the ruled line is thickened by the OR compression. Therefore, even if there is some fluctuation in the original binary image, or even if there is a small break in the ruled line, the ruled line can be reliably erased.

【0028】2)モードB 座標変換後の黒ランの範囲よりも一定幅だけ広い範囲を
消去範囲とする。イメージの揺らぎが大きい場合でも罫
線の黒画素を確実に消去できる。
2) Mode B A range wider than the range of black runs after coordinate conversion by a certain width is set as an erasing range. Even if the image fluctuation is large, the black pixels on the ruled line can be reliably erased.

【0029】3)モードC 座標変換後の黒ランの範囲より、罫線矩形幅の一定割合
(例えば4分の1)分だけ広い範囲を消去範囲とする。
消去範囲の拡大幅を固定した場合(モードBの場合)、
拡大幅が小さすぎると揺らぎの影響を十分に除去でき
ず、拡大幅が大きすぎると罫線に接近した文字等の黒画
素まで過剰に消去する心配があり、拡大幅の選定が難し
い。これに対し、このモードCは、メージの揺らぎの大
きさが罫線の幅に比例するという性質に着目することに
より、揺らぎにの大きさに応じて消去範囲を適切に調整
できる。
3) Mode C A range that is wider than the range of black runs after coordinate conversion by a certain ratio (for example, 1/4) of the ruled line rectangle width is set as an erasing range.
When the expansion width of the erase range is fixed (in mode B),
If the enlargement width is too small, the influence of fluctuation cannot be sufficiently removed, and if the enlargement width is too large, black pixels such as characters close to the ruled line may be excessively erased, making it difficult to select the enlargement width. On the other hand, in this mode C, the erasure range can be appropriately adjusted according to the size of the fluctuation by paying attention to the property that the size of the fluctuation of the image is proportional to the width of the ruled line.

【0030】必要な方向の黒ラン抽出、罫線矩形抽出、
罫線消去が終了すると、文字切り出し部120は、2値
イメージメモリ102内の罫線消去後2値イメージデー
タに対して文字り切り出しを行い、文字イメージを文字
認識部122へ与える。文字認識部122は、その文字
イメージに対する文字認識を行い、認識結果を出力す
る。文字切出しは、射影を利用する方法、黒画素連結矩
形の抽出と統合による方法等、従来と同様の方法で行っ
てよい。文字切り出しの障害となる罫線が予めイメージ
から除去されているため、確実な切り出しが可能であ
り、したがって表領域中の文字やアンダーライン付きの
文字も、高い精度で認識可能である。
Black run extraction in the required direction, ruled line rectangle extraction,
When the ruled line deletion is completed, the character cutout unit 120 performs character cutout on the binary image data after the ruled line deletion in the binary image memory 102, and gives the character image to the character recognition unit 122. The character recognition unit 122 performs character recognition on the character image and outputs the recognition result. The character cutting may be performed by a method similar to the conventional method, such as a method using projection or a method by extracting and integrating black pixel connected rectangles. Since the ruled lines that obstruct character extraction have been removed from the image in advance, it is possible to reliably cut out the characters, and therefore the characters in the table area and the underlined characters can also be recognized with high accuracy.

【0031】[実施例2]図3は本実施例の装置構成を
示すブロック図である。本実施例と前記実施例1との大
きな違いは、図3と図1とを対照すれば明らかなよう
に、前記実施例1に存在した黒ランメモリ(110)が
省かれ、逆に、もう一つの黒ラン抽出部300とその処
理が追加された点である。
[Embodiment 2] FIG. 3 is a block diagram showing a device configuration of this embodiment. A big difference between this embodiment and the first embodiment is that the black run memory (110) existing in the first embodiment is omitted, as is clear by comparing FIG. 3 and FIG. The point is that one black run extraction unit 300 and its processing are added.

【0032】処理内容を説明する。2値画像入力部10
0により原稿の2値イメージデータが2値イメージメモ
リ102に格納され、この2値イメージデータを所定の
圧縮率でOR圧縮した2値イメージデータが圧縮画像生
成部104により生成されて圧縮2値イメージメモリ1
06に格納される。この圧縮2値イメージデータより一
定値以上の長さの黒ランが黒ラン抽出部108Aにて抽
出される。ただし、抽出された黒ランのデータはメモリ
には蓄積されず、罫線抽出部112Aへ直接的に送られ
る。罫線抽出部112Aは、与えられた黒ランのデータ
を用い、所定の距離以内の黒ランを矩形に統合して罫線
矩形を抽出し、罫線のデータを罫線メモリ114Aに格
納する。なお、前記実施例1と異なり黒ランメモリ(1
10)が存在しないので、罫線メモリ114Aに格納さ
れる罫線矩形のデータは罫線矩形の対角2頂点座標だけ
でよく、黒ランの参照のための情報を含まない。この罫
線矩形の対角2頂点座標の値は圧縮2値イメージ上の座
標であるので、座標変換部116Aによって圧縮前のオ
リジナルの2値イメージデータ上の座標に変換され、変
換後の座標値は追加された黒ラン抽出部300へ送られ
る。
The processing content will be described. Binary image input unit 10
When the value is 0, the binary image data of the original is stored in the binary image memory 102, and the binary image data obtained by OR-compressing the binary image data at a predetermined compression rate is generated by the compressed image generation unit 104 to generate a compressed binary image. Memory 1
06. From this compressed binary image data, a black run having a length equal to or greater than a certain value is extracted by the black run extraction unit 108A. However, the extracted black run data is not stored in the memory and is directly sent to the ruled line extraction unit 112A. The ruled line extraction unit 112A uses the given black run data, integrates black runs within a predetermined distance into a rectangle, extracts a ruled line rectangle, and stores the ruled line data in the ruled line memory 114A. Note that, unlike the first embodiment, the black run memory (1
10) does not exist, the data of the ruled line rectangle stored in the ruled line memory 114A need only be the coordinates of the two corners of the diagonal of the ruled line rectangle and do not include information for referencing the black run. Since the value of the diagonal two-vertex coordinates of this ruled line rectangle is the coordinate on the compressed binary image, it is converted to the coordinate on the original binary image data before compression by the coordinate conversion unit 116A, and the coordinate value after conversion is It is sent to the added black run extraction unit 300.

【0033】黒ラン抽出部300においては、2値イメ
ージメモリ102内のオリジナル2値イメージデータの
罫線矩形の範囲内についてスキャンし、一定値以上の黒
ランを抽出し、抽出した黒ランの始点と終点の座標を罫
線消去部118へ送る。罫線消去部118は、与えられ
た黒ランの座標値に基づき、2値イメージメモリ102
内の2値イメージデータに対して罫線消去の処理を行
う。この罫線消去の具体的内容は、前記実施例1の場合
と同様である。
In the black run extraction unit 300, the range of the ruled line rectangle of the original binary image data in the binary image memory 102 is scanned to extract black runs having a certain value or more, and the starting point of the extracted black runs is set. The coordinates of the end point are sent to the ruled line erasing unit 118. The ruled line erasing unit 118 uses the binary image memory 102 based on the given coordinate values of the black run.
The ruled line erasing process is performed on the binary image data inside. The specific contents of this ruled line deletion are the same as in the case of the first embodiment.

【0034】このように本実施例は、黒ランのデータを
格納するためのメモリ(黒ランメモリ110)を使わず
に前記実施例1と同様の罫線消去が可能であり、メモリ
の余裕のないパーソナルコンピュータ等を用いてソフト
ウエアにより各処理部の機能を実現するような場合に有
利である。
As described above, in this embodiment, it is possible to erase the ruled lines as in the first embodiment without using the memory (black run memory 110) for storing the black run data, and there is no memory space. This is advantageous when the function of each processing unit is realized by software using a personal computer or the like.

【0035】罫線消去が完了すると、前記実施例1と同
様に、文字切り出し部120によって2値イメージメモ
リ102に得られた罫線消去後の2値イメージデータよ
り文字のイメージが切り出され、それに対する文字認識
が文字認識部122によってなされる。
When ruled line elimination is completed, a character image is cut out from the binary image data after ruled line elimination obtained in the binary image memory 102 by the character cutout unit 120 as in the case of the first embodiment, and the character corresponding thereto is cut out. The recognition is performed by the character recognition unit 122.

【0036】[実施例3]図4は本実施例の装置構成を
示すブロック図である。2値画像入力部100による2
値イメージデータの入力から罫線消去部118までの装
置構成及び処理内容は前記実施例1と同様である。ただ
し、罫線消去部118は、前記実施例1におけるモード
Aにより罫線消去を行う。すなわち、座標変換後の罫線
の黒ランにの範囲に対応する黒画素だけを白画素に変換
する処理を行う。
[Third Embodiment] FIG. 4 is a block diagram showing the arrangement of the device according to the present embodiment. 2 by the binary image input unit 100
The device configuration and processing contents from the input of the value image data to the ruled line erasing unit 118 are the same as those in the first embodiment. However, the ruled line erasing unit 118 performs ruled line erasing in the mode A in the first embodiment. That is, only the black pixels corresponding to the black run range of the ruled line after the coordinate conversion are converted into white pixels.

【0037】本実施例にあっては、黒画素連結矩形抽出
部400とその処理、それに関連した黒画素連結矩形メ
モリ402、矩形内白画素変換部404とその処理が追
加されている。黒画素連結矩形抽出部400は、2値イ
メージメモリ102内の罫線消去部118による罫線消
去後の2値イメージに対して、消去された黒ランの位置
から一定の距離の範囲内をスキャンし、一定の大きさよ
り小さい孤立した黒画素連結矩形を抽出し、その矩形の
対角2頂点の座標を黒画素連結矩形メモリ402に格納
する。矩形内白画素変換部404は、黒画素連結矩形メ
モリ402内の黒画素連結矩形のデータを参照し、2値
イメージメモリ102内の罫線消去後の2値イメージデ
ータの、抽出された黒画素連結矩形の内部を締め画素に
置き換える処理を行う。
In this embodiment, a black pixel concatenated rectangle extraction section 400 and its processing, a black pixel concatenated rectangular memory 402 related thereto, a rectangular white pixel conversion section 404 and its processing are added. The black pixel concatenated rectangle extraction unit 400 scans the binary image after the ruled line is erased by the ruled line eraser 118 in the binary image memory 102 within a certain distance from the position of the erased black run, An isolated black pixel connected rectangle smaller than a certain size is extracted, and the coordinates of the two diagonal vertices of the rectangle are stored in the black pixel connected rectangle memory 402. The in-rectangle white pixel conversion unit 404 refers to the data of the black pixel connection rectangle in the black pixel connection rectangle memory 402, and extracts the extracted black pixel connection of the binary image data after ruled line deletion in the binary image memory 102. The process of replacing the inside of the rectangle with a pixel is performed.

【0038】このような黒画素連結矩形の抽出とその白
画素への置換により、黒ランの範囲内だけを白画素に置
換するだけでは除去し切れないような罫線の黒画素(イ
メージの揺らぎにより生じる)も確実に除去できる。図
5は、その説明図である。図5の(a)は罫線矩形とそ
の黒ランを示している。(b)は黒ランの範囲について
罫線消去を行った結果であるが、イメージの揺らぎによ
る黒ランr1,r2は消去されず残ってしまう。そこ
で、消去した罫線の黒ランの位置から距離Δdの範囲内
の孤立した黒画素連結矩形を検出して、その矩形内を白
画素に置換することにより、残存した黒ランr1,r2
をも消去することができる。
By extracting such a black pixel connected rectangle and replacing it with a white pixel, black pixels of a ruled line (due to image fluctuations) that cannot be removed only by replacing only the black run range with white pixels. Can also be reliably removed. FIG. 5 is an explanatory diagram thereof. FIG. 5A shows a ruled line rectangle and its black run. (B) shows the result of erasing ruled lines in the range of black runs, but black runs r1 and r2 due to image fluctuations are left unerased. Therefore, an isolated black pixel connected rectangle within a range of a distance Δd from the position of the black run of the erased ruled line is detected, and the inside of the rectangle is replaced with a white pixel, thereby remaining black runs r1 and r2.
Can also be erased.

【0039】前記実施例の罫線消去のB又はCは、黒ラ
ンより広い範囲にある黒画素は全て白画素に置換するた
め、例えば罫線に接近した文字列の一部の画素等を過剰
に消去してしまうおそれがある。これに対し、本実施例
によれば、小さな黒画素連結矩形だけを抽出し消去する
ので、イメージの揺らぎ等による黒ランr1,r2のよ
うな黒画素連結成分だけを消去し、消去すべきでない黒
画素の過剰消去を防止できる。
In the ruled line erasing B or C of the above-described embodiment, all black pixels in a range wider than the black run are replaced with white pixels. Therefore, for example, some pixels of a character string close to the ruled line are excessively erased. There is a risk of doing it. On the other hand, according to this embodiment, only small black pixel connected rectangles are extracted and erased. Therefore, only black pixel connected components such as black runs r1 and r2 due to image fluctuation or the like should be erased and should not be erased. It is possible to prevent excessive erasure of black pixels.

【0040】以上の罫線消去処理の後の2値イメージデ
ータに対する文字切り出し、文字認識は前記実施例1と
同様である。
Character extraction and character recognition for the binary image data after the above ruled line erasing processing are the same as in the first embodiment.

【0041】なお、本実施例は、前記実施例2と同様
に、黒ランメモリ110を用いずに罫線矩形抽出を行っ
た後に罫線矩形内の黒ランの抽出を行い、この後に上に
述べた罫線消去と、黒画素連結矩形の抽出及び白画素へ
の変換を実行するように変形してもよい。
In this embodiment, similarly to the second embodiment, the ruled line rectangle is extracted without using the black run memory 110, and then the black run in the ruled line rectangle is extracted, which is described above. It may be modified so as to execute ruled line removal, extraction of black pixel connected rectangles, and conversion into white pixels.

【0042】[実施例4]図6は本実施例の装置構成を
示すブロック図である。このブロック図を参照し、本実
施例の装置構成と処理内容を、処理の流れに沿って説明
する。
[Fourth Embodiment] FIG. 6 is a block diagram showing the arrangement of the device according to the present embodiment. With reference to this block diagram, the device configuration and processing contents of the present embodiment will be described along the processing flow.

【0043】2値画像入力部100によって原稿の2値
イメージデータを入力して2値イメージメモリ102に
格納する。この2値イメージデータより、罫線抽出部6
00は一定以上の長さを持つ主走査方向及び副走査方向
の黒ランを抽出し、各方向の黒ランについて、一定の距
離以内のものを矩形に統合し、統合した矩形(罫線矩
形)のデータ(罫線矩形の対角2頂点の座標)を罫線メ
モリ602に格納する。枠抽出部604において、罫線
メモリ602内の罫線矩形データを参照し、主走査方向
及び副走査方向の罫線に囲まれた枠を、その罫線矩形の
枠から見て外側の座標を用いて認識し、枠のデータ(枠
の対角2頂点の座標)を枠メモリ606に格納する。こ
のような枠の認識については、本出願人の特願平7−3
20066号の願書に添付の明細書及び図面に詳しく述
べられている。
Binary image data of the original is input by the binary image input unit 100 and stored in the binary image memory 102. Based on this binary image data, the ruled line extraction unit 6
00 extracts black runs in the main-scanning direction and the sub-scanning direction having a length of a certain length or more, and black runs in each direction within a certain distance are integrated into a rectangle, and integrated blacks (ruled line rectangles) Data (coordinates of two diagonal corners of a ruled line rectangle) is stored in the ruled line memory 602. The frame extracting unit 604 refers to the ruled line rectangle data in the ruled line memory 602 and recognizes the frame surrounded by the ruled lines in the main scanning direction and the sub-scanning direction using the coordinates outside the ruled line rectangular frame. , Frame data (coordinates of two diagonal corners of the frame) are stored in the frame memory 606. Regarding the recognition of such a frame, the applicant's Japanese Patent Application No. 7-3
It is described in detail in the specification and drawings attached to the application No. 20066.

【0044】次に、認識された枠の内部の文字の認識を
行う。すなわち、文字切り出し部608において、2値
イメージメモリ102内の2値イメージデータより、各
枠の内部の文字のイメージデータを切り出し、それを文
字イメージメモリ610に格納する。文字イメージの切
り出し方法は、枠内のイメージをスキャンし、黒画素連
結矩形を抽出し、その統合によって文字の領域を切り出
す行う方法でよい。この際、本出願人の特願平7−32
0066号の願書に添付の明細書及び図面に詳しく述べ
られているように、枠に接した黒画素連結矩形や罫線矩
形の内部に包含された黒画素連結矩形のような隣接枠か
らの入り込み文字と判断される黒画素連結矩形を除外し
て、文字切り出しをする方法を採用してもよい。また、
枠内のイメージの行方向の射影をとって行領域を切り出
し、各行領域の垂直方向の射影をとって文字領域を切り
出す方法等を採用することも可能である。
Next, the characters inside the recognized frame are recognized. That is, the character cutout unit 608 cuts out the image data of the character inside each frame from the binary image data in the binary image memory 102, and stores it in the character image memory 610. The method of cutting out a character image may be a method of scanning an image in a frame, extracting black pixel connected rectangles, and cutting out a character area by integrating them. At this time, the applicant's Japanese Patent Application No. 7-32
As described in detail in the specification and drawings attached to the application of No. 0066, a character entered from an adjacent frame such as a black pixel connecting rectangle in contact with a frame or a black pixel connecting rectangle included in a ruled line rectangle. It is also possible to adopt a method of cutting out characters by excluding the black pixel connected rectangle determined to be. Also,
It is also possible to adopt a method in which the line area is cut out by projecting the image in the frame in the row direction, and the character area is cut out by projecting each line area in the vertical direction.

【0045】次に、切り出された文字イメージに対し
て、特徴の抽出と認識辞書とのマッチング、言語知識や
文法知識による言語処理等による文字認識を文字認識部
612で行い、認識結果と、その評価値(例えば、辞書
との距離を文字の輪郭数で正規化した値等)を認識メモ
リ614に格納する。次に、確信度算出部616によっ
て、各認識結果の確からしさの度合である確信度を算出
し、それを認識メモリ614に格納する。この確信度の
決定の方法は、例えば本出願人の特願平7−29422
3号の願書に添付の明細書及び図面に詳しく述べられて
いるので、ここでは詳細な説明は割愛する。なお、評価
値そのものも、1文字単位の情報に基づいてはいるが確
信度の一種であるので、それを最終的な確信度として用
いることも可能である。
Next, with respect to the cut out character image, the character recognition unit 612 performs character recognition such as feature extraction and matching with a recognition dictionary, and language processing by language knowledge or grammatical knowledge. An evaluation value (for example, a value obtained by normalizing the distance from the dictionary by the number of character contours) is stored in the recognition memory 614. Next, the certainty factor calculation unit 616 calculates the certainty factor, which is the degree of certainty of each recognition result, and stores it in the recognition memory 614. The method of determining the certainty factor is, for example, Japanese Patent Application No. 7-29422 filed by the present applicant.
The detailed description is omitted here because it is described in detail in the specification and drawings attached to the application of No. 3. The evaluation value itself is also a kind of certainty factor although it is based on the information on a character-by-character basis, and thus it can be used as the final certainty factor.

【0046】このようにして得られた全ての枠内の全て
の文字の認識結果の確信度が一定レベルよりも高い場合
には、この段階までに得られた認識結果が最終的な認識
結果として外部に出力され、以下に述べる罫線消去のた
めの処理は不要であるので実行されない。もちろん、以
上の文字認識の処理と並行し、以下に述べる罫線消去の
ための処理を無条件に実行してもよい。この罫線消去の
ための処理は、少なくとも、一つの枠内の1文字でも、
その確信度が一定レベルより低い場合には、必ず実行さ
れる。
When the certainty factor of the recognition result of all the characters in all the frames thus obtained is higher than a certain level, the recognition result obtained up to this stage is the final recognition result. It is output to the outside and is not executed because the processing for deleting ruled lines described below is unnecessary. Of course, in parallel with the above character recognition processing, the following ruled line erasing processing may be unconditionally executed. The process for deleting the ruled line is at least for one character in one frame,
If the certainty factor is lower than a certain level, it is always executed.

【0047】この罫線消去のための処理は、前記実施例
1と同じであり、圧縮画像生成部104による圧縮2値
イメージデータの生成と圧縮2値イメージメモリ106
への格納、この圧縮2値イメージデータに対する黒ラン
抽出部108による一定値以上の長さの黒ランの抽出と
黒ランデータの黒ランメモリ110への格納、罫線抽出
部112による黒ランの統合による罫線矩形の抽出と、
罫線矩形データの罫線メモリ114への格納、座標変換
部116による罫線矩形データの変換、変換結果に基づ
く罫線消去部118による罫線消去とからなる。ただ
し、この罫線消去の処理は、前記実施例2又は3と同様
の方法で行ってもよい。また、確信度の低い文字を含む
枠に関連した範囲のみを対象にして罫線消去処理を行っ
てもよい。
The processing for erasing the ruled lines is the same as that in the first embodiment, and the compressed image generation unit 104 generates compressed binary image data and the compressed binary image memory 106.
To the compressed binary image data, the black run extraction unit 108 extracts a black run having a length equal to or more than a certain value, the black run data is stored in the black run memory 110, and the ruled line extraction unit 112 integrates the black runs. Extraction of ruled line rectangle by
The ruled line rectangular data is stored in the ruled line memory 114, the ruled line rectangular data is converted by the coordinate conversion unit 116, and the ruled line erasing unit 118 erases the ruled line based on the conversion result. However, this ruled line erasing process may be performed by the same method as in the second or third embodiment. Further, the ruled line erasing process may be performed only on the range related to the frame including the character with low confidence.

【0048】少なくとも一つの枠について確信度の低い
文字が存在した場合、上に述べた罫線消去処理後の2値
イメージデータに対し、確信度の低いを含む枠内につい
て文字切り出しが文字切り出し部608で再度実行さ
れ、切り出された文字イメージに対する文字認識が文字
認識部616により再度実行され、その認識結果に対す
る確信度の計算が確信度算出部616によって改めて実
行される。そして、文字認識部612は、各認識結果の
後で算出された確信度と前に算出されていた確信度とを
比較し、後で算出された確信度の方が高いときには認識
メモリ614の前の認識結果を後の認識結果で書き換え
る。
When there is a character with a low certainty factor in at least one frame, the character cutout unit 608 extracts the character within the frame containing the low certainty factor with respect to the binary image data after the ruled line deleting process described above. The character recognition unit 616 executes again the character recognition for the cut out character image, and the reliability calculation unit 616 executes the reliability calculation for the recognition result again. Then, the character recognition unit 612 compares the certainty factor calculated after each recognition result with the certainty factor calculated before, and when the certainty factor calculated afterwards is higher, the character recognition unit 612 is in front of the recognition memory 614. The recognition result of is rewritten with the recognition result of later.

【0049】このように、罫線矩形を消去しない2値イ
メージデータを用いた文字認識結果の確信度が低い場
合、少なくとも確信度の低い文字の含まれる枠について
は、罫線消去後の2値イメージデータを用いて再度認識
を行い、認識結果の修正を行うため、文書や帳票の表領
域内の文字をより正確に認識可能である。
As described above, when the certainty factor of the character recognition result using the binary image data in which the ruled line rectangle is not erased is low, the binary image data after the ruled line erase is performed at least for the frame including the character with the low certainty factor. The characters in the table area of the document or the form can be recognized more accurately because the recognition result is corrected again by using.

【0050】[0050]

【発明の効果】請求項1記載の発明によれば、罫線を構
成する黒ランの単位で罫線消去を行うため、イメージの
スキューがあっても、その影響を受けることなく正確な
罫線消去が可能である。
According to the first aspect of the present invention, since ruled lines are erased in units of black runs that form ruled lines, even if there is an image skew, accurate ruled line elimination is possible without being affected by it. Is.

【0051】請求項2記載の発明によれば、黒ラン単位
で罫線消去を行うため、イメージのスキューの影響を受
けない正確な罫線消去が可能である。請求項1記載の発
明によれば、黒ラン抽出処理により抽出した黒ランのデ
ータを罫線消去ステップに用いるので、黒ランデータを
罫線消去ステップが終わるまで保存するため、ある程度
の大きさのメモリを用意する必要がある。この発明によ
れば、罫線消去ステップの直前で罫線矩形内の黒ランの
抽出を行い、抽出した黒ランのデータを罫線消去に利用
するため、黒ランデータの保存のためのメモリが不要と
なり、必要メモリ量を削減できる。
According to the second aspect of the present invention, since the ruled lines are erased in units of black runs, the ruled lines can be erased accurately without being affected by the image skew. According to the first aspect of the present invention, since the black run data extracted by the black run extraction process is used in the ruled line erasing step, the black run data is stored until the ruled line erasing step is completed. You need to prepare. According to the present invention, the black run in the ruled line rectangle is extracted immediately before the ruled line erasing step, and the extracted black run data is used for the ruled line erasing. Therefore, a memory for saving the black run data is unnecessary, The amount of memory required can be reduced.

【0052】請求項3記載の発明によれば、黒ラン抽出
対象イメージ用メモリと罫線消去対象イメージ用メモリ
とを別々に用意するので、同じメモリを両処理に用いる
場合に比べ、縦横の罫線が混在した原稿上の罫線消去の
処理が容易になる。
According to the third aspect of the present invention, since the black run extraction target image memory and the ruled line erasing target image memory are prepared separately, the vertical and horizontal ruled lines are different from those when the same memory is used for both processes. The process of erasing ruled lines on mixed documents becomes easy.

【0053】請求項4又は5記載の発明によれば、請求
項3記載の発明と同様にメモリが1つの場合に比べ混在
した縦横罫線の消去処理が容易になるとともに、第2メ
モリには圧縮されたイメージが格納されるので、第2メ
モリのサイズを小さくでき、したがって処理に必要なメ
モリを削減できる。また、OR圧縮した2値イメージデ
ータを用いて黒ランを抽出し、この黒ランを圧縮前の2
値イメージ上に写像し黒画素を白画素へ変換するので、
罫線に小さな切れが生じたり、罫線の周辺部にイメージ
の揺らぎが生じた場合にも正確な罫線消去が可能であ
る。
According to the invention described in claim 4 or 5, as in the invention described in claim 3, the process of erasing mixed vertical and horizontal ruled lines becomes easier as compared with the case of one memory, and the second memory is compressed. Since the stored image is stored, the size of the second memory can be reduced, and thus the memory required for processing can be reduced. In addition, a black run is extracted by using OR-compressed binary image data, and this black run is
Since it maps on the value image and converts black pixels to white pixels,
Accurate ruled line deletion is possible even if a small break occurs in the ruled line or if there is image fluctuation around the ruled line.

【0054】請求項6記載の発明によれば、黒画素を白
画素に変換する領域を黒ランの領域より広げることによ
り、イメージスキャナの解像度や2値化の誤差の影響に
よりイメージの揺らぎが生じた場合にも確実な罫線消去
が可能となる。
According to the sixth aspect of the invention, by making the area for converting the black pixel into the white pixel wider than the area of the black run, the image fluctuation occurs due to the influence of the resolution of the image scanner and the binarization error. In this case, the ruled lines can be surely erased.

【0055】イメージスキャナの解像度や2値化の誤差
の影響により罫線の周辺部にイメージの揺らぎが生じや
すいが、この揺らぎの大きさは罫線の幅(太さ)に比例
する傾向が認められる。請求項7記載の発明によれば、
黒画素を白画素に変換する領域の広さを罫線矩形の幅に
応じて調節することにより、イメージの揺らぎによる不
必要な黒画素を適切に消去できる。
Image fluctuations are likely to occur in the peripheral portion of the ruled lines due to the influence of the resolution of the image scanner and the binarization error, but the magnitude of this fluctuation tends to be proportional to the width (thickness) of the ruled lines. According to the invention of claim 7,
By adjusting the size of the area for converting the black pixels into the white pixels according to the width of the ruled line rectangle, unnecessary black pixels due to image fluctuation can be appropriately erased.

【0056】請求項8記載の発明によれば、消去した黒
ランの位置から一定距離の範囲内にある黒画素連結矩形
を白画素へ置換することにより、黒ランの範囲内だけを
白画素に置換するだけでは除去し切れないような罫線の
黒画素(イメージの揺らぎにより生じる)も確実に除去
できる。また、黒ランより広い範囲にある黒画素を全て
白画素に置換すると、例えば罫線に接近した文字列の一
部の画素等を過剰に消去してしまうおそれがあるが、請
求項8記載の発明によれば、小さな黒画素連結矩形だけ
を抽出し消去するので、消去すべきでない黒画素の過剰
消去を防止できる。
According to the eighth aspect of the present invention, by replacing the black pixel connecting rectangles within a fixed distance from the position of the erased black run with white pixels, only the black run range becomes white pixels. Black pixels of a ruled line (generated by image fluctuation) that cannot be completely removed only by replacement can be surely removed. Further, when all black pixels in a range wider than the black run are replaced with white pixels, for example, some pixels of a character string close to a ruled line may be excessively erased. However, the invention according to claim 8 According to this, only small black pixel connected rectangles are extracted and erased, so that it is possible to prevent excessive erasure of black pixels that should not be erased.

【0057】請求項9記載の発明によれば、文字切り出
しの障害となる罫線を予めイメージから除去した後に、
文字切り出しを行うため、確実な文字切り出しが可能で
あり、したがって罫線に接近した文字やアンダーライン
付きの文字も、高い精度で認識可能である。
According to the ninth aspect of the invention, after the ruled lines which obstruct the character segmentation are removed from the image in advance,
Since character cutting is performed, reliable character cutting is possible, and therefore characters close to a ruled line and characters with underlines can also be recognized with high accuracy.

【0058】請求項10記載の発明によれば、罫線が存
在した状態では切り出しエラーの起きやすい枠に接触も
しくは接近した文字についても、罫線消去後の再認識に
よって高精度の認識が可能である。
According to the tenth aspect of the invention, even in the state where the ruled line exists, a character which comes into contact with or approaches the frame where a clipping error is likely to occur can be recognized with high accuracy by re-recognizing after the ruled line is erased.

【0059】請求項11記載の発明によれば、請求項9
又は10の発明における罫線消去の制度を高めることに
より、文字認識の精度をさらに高めることができる。
According to the invention of claim 11, claim 9 is provided.
Alternatively, the accuracy of character recognition can be further improved by improving the ruled line removal accuracy in the tenth invention.

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

【図1】本発明の実施例1の装置構成を示すブロック図
である。
FIG. 1 is a block diagram showing a device configuration according to a first embodiment of the present invention.

【図2】圧縮イメージ上の罫線及び黒ランのオリジナル
イメージ上への写像を説明する図である。
FIG. 2 is a diagram illustrating mapping of ruled lines and a black run on a compressed image onto an original image.

【図3】本発明の実施例2の装置構成を示すブロック図
である。
FIG. 3 is a block diagram showing a device configuration of a second embodiment of the present invention.

【図4】本発明の実施例3の装置構成を示すブロック図
である。
FIG. 4 is a block diagram showing a device configuration according to a third embodiment of the present invention.

【図5】(a)イメージの揺らぎによる黒ランが存在す
る罫線の例を示す図である。 (b)同罫線の例の内部の黒ランを消去した状態を示す
図である。
FIG. 5A is a diagram showing an example of a ruled line in which a black run due to image fluctuation is present. (B) It is a figure which shows the state which erased the black run inside the example of the same ruled line.

【図6】本発明の実施例4の装置構成を示すブロック図
である。
FIG. 6 is a block diagram showing a device configuration according to a fourth embodiment of the present invention.

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

100 2値画像入力部 102 2値イメージメモリ 104 圧縮画像生成部 106 圧縮2値イメージメモリ 108,108A 黒ラン抽出部 110 黒ランメモリ 112,112A 罫線抽出部 114,114A 罫線メモリ 116,116A 座標変換部 118 罫線消去部 120 文字切り出し部 124 文字認識部 300 黒ラン抽出部 400 黒画素連結矩形抽出部 402 黒画素連結矩形メモリ 404 矩形内白画素変換部 600 罫線抽出部 602 罫線メモリ 604 枠抽出部 606 枠メモリ 608 文字切り出し部 610 文字イメージメモリ 612 文字認識部 614 確信度算出部 614 認識メモリ 100 binary image input unit 102 binary image memory 104 compressed image generation unit 106 compressed binary image memory 108, 108A black run extraction unit 110 black run memory 112, 112A ruled line extraction unit 114, 114A ruled line memory 116, 116A coordinate conversion unit 118 Ruled Line Erasing Unit 120 Character Cutout Unit 124 Character Recognition Unit 300 Black Run Extraction Unit 400 Black Pixel Concatenated Rectangle Extraction Unit 402 Black Pixel Concatenated Rectangle Memory 404 Rectangle White Pixel Conversion Unit 600 Ruled Line Extraction Unit 602 Ruled Line Memory 604 Frame Extraction Unit 606 Frame Memory 608 Character cutout unit 610 Character image memory 612 Character recognition unit 614 Confidence factor calculation unit 614 Recognition memory

Claims (12)

【特許請求の範囲】[Claims] 【請求項1】 第1のメモリに格納された2値イメージ
上の一定値以上の長さを持つ黒ランを抽出する黒ラン抽
出ステップと、 該黒ラン抽出ステップで抽出された黒ランの中の予め定
められた距離内にある黒ランを統合し、統合した黒ラン
をすべて包含する矩形を罫線矩形として抽出する罫線矩
形抽出ステップと、 該罫線矩形抽出ステップで抽出された罫線矩形に包含さ
れる黒ランに対応した、該第1メモリ内の2値イメージ
中の黒画素を白画素に変換する罫線消去ステップとを有
することを特徴とする罫線消去方法。
1. A black run extraction step of extracting a black run having a length equal to or greater than a predetermined value on a binary image stored in a first memory, and a black run extracted in the black run extraction step. Of the black runs within a predetermined distance, and a ruled line rectangle extraction step of extracting a rectangle that includes all the integrated black runs as a ruled line rectangle, and a ruled line rectangle extracted in the ruled line rectangle extraction step. A ruled line erasing step of converting black pixels in the binary image in the first memory into white pixels corresponding to a black run.
【請求項2】第1のメモリに格納された2値イメージ上
の一定値以上の長さを持つ黒ランを抽出する黒ラン抽出
ステップと、 該黒ラン抽出ステップで抽出された黒ランの中の予め定
められた距離内にある黒ランを統合し、統合した黒ラン
をすべて包含する矩形を罫線矩形として抽出する罫線矩
形抽出ステップと、 該第1メモリ内の2値イメージより、該罫線矩形抽出ス
テップで抽出された罫線矩形の内部の一定値以上の長さ
を持つ黒ランを抽出する罫線矩形内黒ラン抽出ステップ
と、 該第1メモリ内の2値イメージ中の該罫線矩形内黒ラン
抽出ステップで抽出された黒ランに対応する黒画素を白
画素に変換する罫線消去ステップとを有することを特徴
とする罫線消去方法。
2. A black run extraction step of extracting a black run having a length equal to or greater than a certain value on a binary image stored in a first memory, and a black run extracted in the black run extraction step. A ruled line rectangle extracting step of integrating black runs within a predetermined distance of, and extracting a rectangle including all the integrated black runs as a ruled line rectangle; and the ruled line rectangle from the binary image in the first memory. A black run within a ruled line rectangle extracting a black run having a length equal to or greater than a certain value inside the ruled line rectangle extracted in the extracting step; and a black run within the ruled line rectangle in the binary image in the first memory. A ruled line erasing step of converting a black pixel corresponding to the black run extracted in the extracting step into a white pixel, and a ruled line erasing method.
【請求項3】 請求項1又は2記載の罫線消去方法にお
いて、該第1メモリ内の2値イメージに対応する2値イ
メージを第2のメモリに格納するステップを有し、該黒
ラン抽出ステップは該第2のメモリ内の2値イメージを
用いて黒ランの抽出を行うことを特徴とする罫線消去方
法。
3. The ruled line erasing method according to claim 1, further comprising a step of storing a binary image corresponding to the binary image in the first memory in a second memory, and the black run extracting step. Is a ruled line erasing method characterized in that a black run is extracted using a binary image in the second memory.
【請求項4】 請求項1記載の罫線消去方法において、
該第1メモリ内の2値イメージを所定の縮小率でOR圧
縮した2値イメージを第2のメモリに格納するステップ
と、該第罫線矩形抽出ステップで抽出された罫線矩形に
包含される、該黒ラン抽出ステップにより抽出された黒
ランの座標値を該第1メモリ内の2値イメージ上の座標
値に変換する座標変換ステップとを有し、該罫線消去ス
テップは該座標変換ステップによって変換された黒ラン
の座標値に基づき白画素へ変換すべき黒画素の位置を認
識することを特徴とする罫線消去方法。
4. The ruled line erasing method according to claim 1,
A step of storing in the second memory a binary image obtained by OR-compressing the binary image in the first memory at a predetermined reduction ratio; and including the ruled line rectangle extracted in the first ruled line rectangle extraction step, A coordinate conversion step of converting the coordinate values of the black run extracted by the black run extraction step into the coordinate values on the binary image in the first memory, and the ruled line erasing step is converted by the coordinate conversion step. A ruled line erasing method characterized in that the position of a black pixel to be converted into a white pixel is recognized based on the coordinate value of the black run.
【請求項5】 請求項2記載の罫線消去方法において、
該第1メモリ内の2値イメージを所定の縮小率でOR圧
縮した2値イメージを第2のメモリに格納するステップ
と、該第罫線矩形抽出ステップで抽出された罫線矩形の
座標値を該第1メモリ内の2値イメージ上の座標値に変
換する座標変換ステップとを有し、該第罫線矩形内黒ラ
ン抽出ステップは該座標変換ステップによって変換され
た罫線矩形の座標値に基づき黒ランを抽出すべき範囲を
認識することを特徴とする罫線消去方法。
5. The ruled line erasing method according to claim 2,
A step of storing a binary image obtained by OR-compressing the binary image in the first memory at a predetermined reduction ratio in a second memory; and a coordinate value of a ruled line rectangle extracted in the first ruled line rectangle extraction step, A coordinate conversion step of converting into a coordinate value on a binary image in one memory, and the black run extracting step within the first ruled line rectangle extracts a black run based on the coordinate value of the ruled line rectangle converted by the coordinate conversion step. A ruled line erasing method characterized by recognizing a range to be extracted.
【請求項6】 請求項1乃至5のいずれか1項記載の罫
線消去方法において、該罫線消去ステップは黒ランの領
域を拡大した領域の内部の黒画素を白画素に変換するこ
とを特徴とする罫線消去方法。
6. The ruled line erasing method according to claim 1, wherein the ruled line erasing step converts black pixels inside a region obtained by enlarging a black run region into white pixels. How to erase ruled lines.
【請求項7】 請求項6項記載の罫線消去方法におい
て、該黒ランの領域を拡大した領域の拡大量は該黒ラン
を包含する罫線矩形の幅に応じて制御されることを特徴
とする罫線消去方法。
7. The ruled line erasing method according to claim 6, wherein the enlargement amount of the region obtained by enlarging the region of the black run is controlled according to the width of the ruled line rectangle including the black run. Ruled line erasing method.
【請求項8】 請求項1乃至5のいずれか1項記載の罫
線消去方法において、該罫線消去ステップによって罫線
消去後の2値イメージに対し、消去された黒ランの位置
から一定距離の範囲内にある所定の大きさより小さい孤
立した黒画素連結矩形を抽出する黒画素連結矩形抽出ス
テップと、該罫線消去後の2値イメージに対して該黒画
素連結矩形抽出ステップにより抽出された黒画素連結矩
形の内部の黒画素を白画素に変換する罫線矩形内白画素
変換ステップとを有することを特徴とする罫線消去方
法。
8. The ruled line erasing method according to claim 1, wherein the binary image after the ruled line is erased by the ruled line erasing step is within a certain distance from the position of the erased black run. A black pixel connected rectangle extracting step for extracting an isolated black pixel connected rectangle smaller than a predetermined size, and a black pixel connected rectangle extracted by the black pixel connected rectangle extracting step for the binary image after the ruled line is erased. A ruled line erasing method comprising: converting a black pixel inside the pixel into a white pixel;
【請求項9】 2値イメージ中の罫線を請求項1乃至8
のいずれか1項記載の罫線消去方法により消去する処理
と、該処理により罫線が消去された2値イメージの文字
イメージを切り出し、文字認識を行う処理とからなる文
字認識方法。
9. A ruled line in a binary image is defined by claim 1.
A character recognizing method comprising: a process of erasing by the ruled line erasing method described in any one of 1. above, and a process of cutting out a character image of a binary image in which the ruled lines are erased and performing character recognition.
【請求項10】 請求項9記載の文字認識方法におい
て、2値イメージ中の罫線を消去する処理で文字行に対
し平行な方向の罫線のみを消去することを特徴とする文
字認識方法。
10. The character recognition method according to claim 9, wherein in the process of deleting the ruled lines in the binary image, only the ruled lines in the direction parallel to the character line are deleted.
【請求項11】 第1のメモリに格納された2値イメー
ジ上の罫線により囲まれた枠を認識する枠認識処理と、 該枠認識処理により認識された枠内の文字イメージを該
第1メモリ内の2値イメージより切り出し、切り出した
文字イメージの文字認識を行う文字認識処理と、 該第
1メモリ内の2値イメージ中の罫線を消去する罫線消去
処理と、 該文字認識処理の認識結果の確信度が低い文字が存在す
る場合に、少なくともも該確信度の低い文字について、
該罫線消去処理によって罫線消去後の2値イメージより
改めて文字イメージを切り出し文字認識を行う再文字認
識処理とを有することを特徴とする文字認識方法。
11. A frame recognition process for recognizing a frame surrounded by ruled lines on a binary image stored in a first memory, and a character image in the frame recognized by the frame recognition process for the first memory. Of the recognition result of the character recognition process of cutting out the character image of the extracted character image from the binary image in the first memory, the ruled line erasing process of erasing the ruled line in the binary image in the first memory, and the recognition result of the character recognition process. If there is a character with a low certainty factor, at least for the character with a low certainty factor,
A character recognition method, comprising: re-character recognition processing for cutting out a character image from the binary image after ruled line erasing by the ruled line erasing processing and performing character recognition.
【請求項12】 請求項11記載の文字認識方法におい
て、該罫線消去処理は請求項1乃至8のいずれか1項記
載の罫線消去方法により罫線の消去を行うことを特徴と
する文字認識方法。
12. The character recognition method according to claim 11, wherein the ruled line erasing process is performed by the ruled line erasing method according to any one of claims 1 to 8.
JP7336690A 1995-12-08 1995-12-25 Ruled-line erasing method and character recognition method Pending JPH09179936A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP7336690A JPH09179936A (en) 1995-12-25 1995-12-25 Ruled-line erasing method and character recognition method
US08/762,439 US5898795A (en) 1995-12-08 1996-12-09 Character recognition method using a method for deleting ruled lines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7336690A JPH09179936A (en) 1995-12-25 1995-12-25 Ruled-line erasing method and character recognition method

Publications (1)

Publication Number Publication Date
JPH09179936A true JPH09179936A (en) 1997-07-11

Family

ID=18301805

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7336690A Pending JPH09179936A (en) 1995-12-08 1995-12-25 Ruled-line erasing method and character recognition method

Country Status (1)

Country Link
JP (1) JPH09179936A (en)

Similar Documents

Publication Publication Date Title
US8320019B2 (en) Image processing apparatus, image processing method, and computer program thereof
JP4655335B2 (en) Image recognition apparatus, image recognition method, and computer-readable recording medium on which image recognition program is recorded
JP5121599B2 (en) Image processing apparatus, image processing method, program thereof, and storage medium
JP2001297303A (en) Method and device for recognizing document image and computer readable recording medium
US20090274369A1 (en) Image processing device, image processing method, program, and storage medium
US5898795A (en) Character recognition method using a method for deleting ruled lines
US6947596B2 (en) Character recognition method, program and recording medium
US8229214B2 (en) Image processing apparatus and image processing method
JP4281236B2 (en) Image recognition apparatus, image recognition method, and computer-readable recording medium storing image recognition program
JPH09179936A (en) Ruled-line erasing method and character recognition method
JPH0773271A (en) Area dividing method
JP5517028B2 (en) Image processing device
JP2000082110A (en) Ruled line deletion device, character picture extraction device, ruled line deletion method, character picture extraction method and storage medium
JP4117648B2 (en) Form, form processing method, form processing program, recording medium recording form processing program, and form processing apparatus
JPH10162102A (en) Character recognition device
US20240062567A1 (en) Learning Image Generation Apparatus, Learning Image Generation Method, And Non-Transitory Computer-Readable Recording Medium
JP3269889B2 (en) Optical character reading system
JP2002049890A (en) Device and method for recognizing picture and computer- readable recording medium where picture recognizing program is recorded
JP2923004B2 (en) Image generation device
JPH10177621A (en) Method for processing document and method for recognizing ruled line and recording medium
JPH11250179A (en) Character reocognition device and its method
JP2931041B2 (en) Character recognition method in table
JPH05342409A (en) Character recognizing device
JP2000187704A (en) Character recognition device, its method and storage medium
JPS6214263A (en) Document picture processing system