JPH1125218A - Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification - Google Patents

Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification

Info

Publication number
JPH1125218A
JPH1125218A JP9218913A JP21891397A JPH1125218A JP H1125218 A JPH1125218 A JP H1125218A JP 9218913 A JP9218913 A JP 9218913A JP 21891397 A JP21891397 A JP 21891397A JP H1125218 A JPH1125218 A JP H1125218A
Authority
JP
Japan
Prior art keywords
section
black pixel
length
divided
pixel section
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.)
Withdrawn
Application number
JP9218913A
Other languages
Japanese (ja)
Inventor
Kazuhiro Ishikawa
和弘 石川
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP9218913A priority Critical patent/JPH1125218A/en
Publication of JPH1125218A publication Critical patent/JPH1125218A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)

Abstract

PROBLEM TO BE SOLVED: To attain line segmentation without preliminarily or individually judging a line direction even when the line direction of a document picture is not clear. SOLUTION: When a line direction is not clear, or when the line direction is a first direction, a line segmenting device 10 produces a first direction divided area, generates a first direction projective distribution by scanning the above area, and segments a first divided line, based on this distribution. Meanwhile, when the line direction is not clear, or when the line direction is a second direction, this line segmenting device 10 produces a second direction divided area, generates a second direction projective distribution by scanning the above area, and segments a second divided line, based on this distribution. Then, when the line direction is not clear, the line direction is judged by using the information of the first and second divided lines, and the divided lines in the judged line direction are connected with each other so that a line can be segmented.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、原稿上の文字を
光学的に走査して例えば2値画像で表される文書画像
(イメージデータ)を取得し、その文書画像に対して文
字認識を行なう光学式文字読取装置(OCR)におい
て、文書画像の行を切り出す方法および装置、行切出し
修正方法および装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention optically scans characters on a document to obtain a document image (image data) represented by, for example, a binary image, and performs character recognition on the document image. The present invention relates to a method and an apparatus for cutting out a line of a document image in an optical character reader (OCR), and a method and an apparatus for correcting a line cutout.

【0002】[0002]

【従来の技術】文字認識にあたり、一般に、先ず、原稿
をスキャナで読み込んで生成された文書画像の行切出し
を行なう。次に、切り出された行から文字を切り出す。
そして、切り出された文字の認識を行なう。
2. Description of the Related Art In character recognition, generally, first, a document is read by a scanner and lines of a generated document image are cut out. Next, characters are extracted from the extracted lines.
Then, the cut-out character is recognized.

【0003】従来の行切出し方法の一例が、文献1:
「特開昭64−48186号公報」に開示されている。
この文献に開示の技術によれば、行切出しを行なうにあ
たり、先ず、文書画像を文字列(行)を横切る分割線に
よって分割する。次に、分割領域毎に、文字列方向の射
影分布(投影)を作成する。次に、この射影分布に基づ
いて、各分割領域毎にそれぞれ部分文字列を切り出す。
次に、各部分文字列それぞれ、隣接する分割領域の部分
文字列の切出し座標が重複するものに同一のラベルを付
す。そして、隣接した分割領域のラベルが同一の部分文
字列どうしを連結して、文書画像の行切出しを行なう。
An example of a conventional line segmentation method is disclosed in Reference 1:
It is disclosed in "JP-A-64-48186".
According to the technique disclosed in this document, when performing line segmentation, first, a document image is divided by a dividing line that crosses a character string (line). Next, a projection distribution (projection) in the character string direction is created for each divided area. Next, a partial character string is cut out for each divided area based on the projection distribution.
Next, the same label is assigned to each of the partial character strings in which the cutout coordinates of the partial character strings of the adjacent divided areas overlap. Then, the partial character strings having the same label in the adjacent divided areas are connected to each other, and the line of the document image is cut out.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来の
行切出し方法においては、文書画像の行方向が既知であ
ることが前提である。従って、従来の行切出し方法にお
いては、行方向が不明である文書画像の行切出しは行な
うことができない。このため、従来は、文書画像の行方
向が不明の場合には、行切出しを行なう前に個別に行方
向を判定しておく必要があった。
However, the conventional line segmentation method is based on the premise that the line direction of the document image is known. Therefore, in the conventional line extraction method, line extraction of a document image whose line direction is unknown cannot be performed. For this reason, conventionally, when the line direction of a document image is unknown, it has been necessary to determine the line direction individually before performing line segmentation.

【0005】このため、文書画像の行方向が不明である
場合でも、事前に個別に行方向を判定することなく、行
切出しが可能な行切出し方法および装置の出現が望まれ
ていた。
[0005] For this reason, there has been a demand for a line cutting method and apparatus capable of line cutting without individually determining the line direction in advance even when the line direction of the document image is unknown.

【0006】また、従来の行切出し方法においては、例
えば、隣り合った行どうしが近接している場合や、例え
ば射影分布を作成する際の走査方向に対して文書画像の
行方向(文字列を構成する文字が並んでいる方向)が傾
斜して入力された場合には、隣り合った2つの個別の行
が1つの行として切り出されてしまうことがあった。
Further, in the conventional line segmentation method, for example, a case where adjacent lines are close to each other or a line direction of a document image (a character string is When the input is performed with the inclination of the direction in which the constituent characters are arranged), two adjacent individual lines may be cut out as one line.

【0007】また、従来の行切出し方法においては、例
えば、ある文字列を構成する各文字が、いずれも上下に
分かれる部首からなる場合に、1つの行が2つの個別の
行として切り出されてしまうことがあった。
In the conventional line segmentation method, for example, when each character constituting a certain character string is composed of radicals divided vertically, one line is segmented as two separate lines. There was sometimes.

【0008】このため、行切出しの確実化を図ることが
できる行切出し修正方法および装置の出現が望まれてい
た。
[0008] For this reason, there has been a demand for a method and apparatus for correcting a line cutout that can ensure the line cutout.

【0009】[0009]

【課題を解決するための手段】[Means for Solving the Problems]

(行切出し方法)この出願に係る発明者は、種々の研究
および実験を重ねた結果、行切出しの処理によって得ら
れる情報を用いて行方向の判定を行なえば、行切出しの
前に行切出しの処理とは別個に行方向判定の処理を行な
わなくとも、行方向が不明である文書画像の行切出しが
可能になることに想到した。
(Line extraction method) The inventor of the present application has made various studies and experiments, and as a result, if the line direction is determined using the information obtained by the line extraction processing, the line extraction is performed before the line extraction. The inventor has conceived that it is possible to cut out a line of a document image whose line direction is unknown without performing a line direction determination process separately from the process.

【0010】そこで、この発明の行切出し方法によれ
ば、(a1)文書画像の行方向が不明である場合および
文書画像の行方向が第1方向である場合に、該第1方向
と直交する第2方向に沿った分割線によって文書画像を
分割することにより、該第1方向に沿って並んだ複数の
第1方向分割領域を生成するプロセスと、(b1)第1
方向分割領域が生成された場合に、当該第1方向分割領
域の各々を、第1方向に沿って走査して走査毎の累積黒
画素数を検出し、当該累積黒画素数の第2方向に沿った
分布を求めることにより第1方向射影分布を作成するプ
ロセスと、(c1)第1方向射影分布が作成された場合
に、当該第1方向射影分布の各々において第1基準値以
上の累積黒画素数が第2方向に沿って連続する区間をそ
れぞれ第1黒画素区間として、当該第1黒画素区間が得
られる走査領域をそれぞれ第1分割行として分割行切出
しを行なうプロセスと、(a2)文書画像の行方向が不
明である場合およびこの文書画像の行方向が第2方向で
ある場合に、第1方向に沿った分割線によって文書画像
を分割することにより、この第1方向と直交する第2方
向に沿って並んだ複数の第2方向分割領域を生成するプ
ロセスと、(b2)第2方向分割領域が生成された場合
に、当該第2方向分割領域の各々を、第2方向に沿って
走査して走査毎の累積黒画素数を検出し、当該累積黒画
素数の第1方向に沿った分布を求めることにより第2方
向射影分布を作成するプロセスと、(c2)第2方向射
影分布が作成された場合に、当該第2方向射影分布の各
々において第2基準値以上の累積黒画素数が第1方向に
沿って連続する区間をそれぞれ第2黒画素区間として、
当該第2黒画素区間が得られる走査領域をそれぞれ第2
分割行として分割行切出しを行なうプロセスと、(d)
文書画像の行方向が不明である場合に、第1方向射影分
布と第2方向射影分布とに基づいて、文書画像の行方向
を判定するプロセスと、(e1)文書画像の行方向が第
1方向である場合に、第1方向で互いに隣接する第1方
向分割領域にそれぞれ含まれる分割行どうしであって、
当該分割行を走査して得られた第1黒画素区間の少なく
とも一部分どうしが重なっている分割行どうしを接続し
て行切出しを行なうプロセスと、(e2)文書画像の行
方向が第2方向である場合に、第2方向で互いに隣接す
る第2方向分割領域にそれぞれ含まれる分割行どうしで
あって、当該分割行を走査して得られた第2黒画素区間
の少なくとも一部分どうしが重なっている分割行どうし
を接続して行切出しを行なうプロセスとを含むことを特
徴とする。
Therefore, according to the line extracting method of the present invention, (a1) when the line direction of the document image is unknown and when the line direction of the document image is the first direction, the line is orthogonal to the first direction. (B1) generating a plurality of first direction divided regions arranged along the first direction by dividing the document image by dividing lines along the second direction;
When the direction division area is generated, each of the first direction division areas is scanned in the first direction to detect the cumulative number of black pixels for each scan, and is detected in the second direction of the cumulative number of black pixels. (C1) when the first-direction projection distribution is created, the cumulative black that is equal to or more than the first reference value in each of the first-direction projection distributions. A process in which a section in which the number of pixels is continuous along the second direction is a first black pixel section, and a scanning area in which the first black pixel section is obtained is a first division row, and a divided row is cut out; When the line direction of the document image is unknown and when the line direction of the document image is the second direction, the document image is divided by a dividing line along the first direction to be orthogonal to the first direction. Lined up along the second direction (B2) when the second direction divided regions are generated, each of the second direction divided regions is scanned along the second direction to generate a plurality of second direction divided regions. A process of detecting a cumulative number of black pixels and obtaining a distribution of the cumulative number of black pixels along the first direction to form a second direction projection distribution; and (c2) a case where the second direction projection distribution is generated. In each of the second direction projection distributions, a section in which the cumulative number of black pixels equal to or greater than the second reference value is continuous along the first direction is defined as a second black pixel section,
The scanning area in which the second black pixel section is obtained is defined as a second
(D) a process of extracting a divided line as a divided line;
A process of determining the line direction of the document image based on the first direction projection distribution and the second direction projection distribution when the line direction of the document image is unknown; In the case of the direction, the divided rows included in the first direction divided areas adjacent to each other in the first direction,
A process of connecting the divided lines in which at least a part of the first black pixel section obtained by scanning the divided line overlaps to perform line cutout, and (e2) the line direction of the document image is in the second direction. In some cases, the divided rows included in the second direction divided areas adjacent to each other in the second direction overlap each other, and at least a part of the second black pixel sections obtained by scanning the divided rows overlap. A process of connecting the divided rows to perform line segmentation.

【0011】このように、この発明の行切出し方法によ
れば、文書画像の行方向が不明である場合に、行切出し
の処理の一環である(b1)のプロセスにおいて得られ
た第1方向射影分布および(b2)のプロセスにおいて
得られた第2方向射影分布を用いて、(d)のプロセス
において行方向を判定する。従って、この発明によれ
ば、文書画像の行方向が不明である場合でも、事前に行
切出しとは個別に行方向を判定する処理を行なうことな
く、行切出しを行なうことができる。
As described above, according to the line extracting method of the present invention, when the line direction of the document image is unknown, the first direction projection obtained in the process (b1) which is a part of the line extracting process. Using the distribution and the second direction projection distribution obtained in the process (b2), the row direction is determined in the process (d). Therefore, according to the present invention, even when the line direction of a document image is unknown, line extraction can be performed without performing a process of determining the line direction separately from line extraction in advance.

【0012】尚、行方向に沿って文書画像を走査して得
られた射影分布において、各行にそれぞれ対応した黒画
素区間を求めるためには、累積黒画素数の基準値(例え
ば上記の第1基準値および第2基準値)を設定して、こ
の基準値以上の累積黒画素数の部分を黒画素区間とする
と良い。例えば、文書画像のうち、行(文字列)以外の
文書画像部分を走査して1画素以上の累積黒画素数が検
出される場合(例えば、文書画像の走査領域に枠線が含
まれている場合)でも、任意好適な基準値を適切に設定
すれば、各行にそれぞれ対応した黒画素区間が求まる可
能性が高くなる。
In order to determine the black pixel section corresponding to each row in the projection distribution obtained by scanning the document image along the row direction, the reference value of the cumulative number of black pixels (for example, the first A reference value and a second reference value are set, and a portion of the accumulated number of black pixels equal to or larger than the reference value is preferably set as a black pixel section. For example, when the document image portion other than the line (character string) in the document image is scanned and the number of accumulated black pixels of one or more pixels is detected (for example, the scanning region of the document image includes a frame line) In this case, if any suitable reference value is appropriately set, the possibility that the black pixel section corresponding to each row is obtained is increased.

【0013】また、例えば、文書画像の行方向が走査方
向に対して傾斜している場合には、隣り合った分割行の
射影どうしが、射影分布において、部分的に重複してし
まう場合がある。その場合、重複部分の射影の累積黒画
素数は、非重複部分の射影累積黒画素数よりも少ないこ
とが多い。そこで、任意好適な基準値(例えば重複部分
の累積黒画素数程度の数値や、例えば重複部分の累積黒
画素数程度の数値と非重複部分の累積黒画素数程度の数
値との間の数値)を設定すれば、各行にそれぞれ対応し
た黒画素区間が求まる可能性が高くなる。
Further, for example, when the row direction of a document image is inclined with respect to the scanning direction, the projections of adjacent divided rows may partially overlap in the projection distribution. . In this case, the number of cumulative black pixels in the projection of the overlapping portion is often smaller than the number of cumulative black pixels in the non-overlapping portion. Therefore, any suitable reference value (for example, a numerical value about the cumulative number of black pixels in the overlapping portion, for example, a numerical value between a numerical value about the cumulative number of black pixels in the overlapping portion and a numerical value about the cumulative number of black pixels in the non-overlapping portion) Is set, there is a high possibility that a black pixel section corresponding to each row is obtained.

【0014】(黒画素区間長のばらつきによる行方向判
定)ところで、上記の(d)のプロセスにおいて行方向
の判定を行なうにあたり、この出願に係る発明者は、行
方向の判定の手がかりの一つとして、行の高さや行の幅
のばらつきに着目した。
(Determination of Row Direction Based on Variation in Black Pixel Section Length) By the way, in performing the determination of the row direction in the above process (d), the inventor of the present application has one of the clues of the row direction determination. We focused on variations in row height and row width.

【0015】一般に、文書画像が横書きの場合には、各
行の文字の高さが揃っている。また、文書画像が縦書き
の場合には、各行の文字の幅が揃っている。従って、文
書画像を行方向に沿って走査して得られる射影分布にお
いては、各行にそれぞれ対応する射影部分である黒画素
区間の長さ(黒画素区間長)のばらつきが一般に小さ
い。これに対して、行方向と直交する方向に沿って走査
して得られる射影分布においては、一般に、各黒画素区
間長のばらつきが大きい。従って、この黒画素区間長の
ばらつきの大小に着目すれば、行方向判定が可能とな
る。
In general, when a document image is written horizontally, the heights of the characters on each line are uniform. When the document image is written vertically, the widths of the characters on each line are uniform. Therefore, in the projection distribution obtained by scanning the document image along the row direction, the variation in the length of the black pixel section (black pixel section length), which is the projection portion corresponding to each row, is generally small. On the other hand, in a projection distribution obtained by scanning along a direction orthogonal to the row direction, generally, there is a large variation in the length of each black pixel section. Therefore, focusing on the magnitude of the variation in the black pixel section length, the row direction can be determined.

【0016】そこで、この発明の行切出し方法の実施に
あたり、好ましくは、(d)のプロセスにおいて、第1
黒画素区間の各々の長さをそれぞれ第1黒画素区間長と
して、当該第1黒画素区間長のばらつきを算出するプロ
セスと、第2黒画素区間の各々の長さをそれぞれ第2黒
画素区間長として、当該第2黒画素区間長のばらつきを
算出するプロセスと、および、第1黒画素区間長のばら
つきと第2黒画素区間長のばらつきとを比較して、当該
第1黒画素区間長のばらつきと当該第2黒画素区間長の
ばらつきとの比率が第3基準値以上の場合に、ばらつき
の小さい方の黒画素区間長が得られた射影分布の走査方
向を行方向と判定するプロセスとを含むと良い。
Therefore, in carrying out the line extracting method of the present invention, preferably, in the process (d), the first
The process of calculating the variation of the first black pixel section length, with the length of each black pixel section as the first black pixel section length, and the length of each of the second black pixel sections as the second black pixel section As the length, the process of calculating the variation of the second black pixel section length, and comparing the variation of the first black pixel section length with the variation of the second black pixel section length, to determine the first black pixel section length Determining the scanning direction of the projection distribution from which the smaller black pixel section length is obtained as the row direction when the ratio of the variation of the second black pixel section length to the variation of the second black pixel section length is equal to or greater than the third reference value. It is good to include

【0017】前述のように、文書画像を行方向に実質的
に沿って走査して得られる射影分布の黒画素区間長のば
らつきは、文書画像を行を横切って走査して得られる射
影分布の黒画素区間長のばらつきよりも一般に小さい。
従って、第1黒画素区間長のばらつきと第2黒画素区間
長のばらつきとを比較すれば、行方向の判定の確実化を
図ることができる。
As described above, the variation in the black pixel section length of the projection distribution obtained by scanning the document image substantially in the row direction is caused by the variation of the projection distribution obtained by scanning the document image across the row. Generally smaller than the variation of the black pixel section length.
Therefore, by comparing the variation in the first black pixel section length with the variation in the second black pixel section length, the determination in the row direction can be assured.

【0018】また、上記の第3基準値は、任意好適な値
を設定すると良い。例えば第3基準値を「1」と設定し
た場合は、第1黒画素区間のばらつきと第2黒画素区間
のばらつきとの大小を単に比較することに相当する。
尚、第3基準値を「1」に限定しない理由は、ばらつき
の比率が小さい場合に、単にばらつきの大小だけで行方
向を判定すると、誤った判定結果が出力される場合があ
り得るためである。
The third reference value may be set to any suitable value. For example, when the third reference value is set to “1”, it corresponds to simply comparing the variation between the first black pixel section and the variation between the second black pixel sections.
The reason why the third reference value is not limited to “1” is that when the ratio of the variation is small, if the row direction is determined only by the magnitude of the variation, an erroneous determination result may be output. is there.

【0019】(平均白画素区間長による行方向判定)ま
た、この出願に係る発明者は、行方向の判定のさらなる
手がかりの一つとして、行間隔と文字間隔に着目した。
一般の文書画像においては、行間隔が文字間隔よりも広
い。この行間隔は、文書画像を行方向に沿って走査して
得られる射影分布において、各行に対応する黒画素区間
の隣どうしの間隔に反映される。また、文字間隔は、行
方向を直交する方向に沿って走査して得られる射影分布
において、隣り合った黒画素区間どうしの間隔に反映さ
れる。従って、この行間隔および文字間隔に着目すれ
ば、行方向の判定が可能となる。
(Judgment of Line Direction Based on Average White Pixel Section Length) The inventor of the present application has paid attention to the line interval and the character interval as one of the clues for determining the line direction.
In a general document image, the line interval is wider than the character interval. This line interval is reflected in the interval between adjacent black pixel sections corresponding to each line in the projection distribution obtained by scanning the document image along the line direction. The character spacing is reflected in the spacing between adjacent black pixel sections in a projection distribution obtained by scanning along a direction orthogonal to the row direction. Therefore, if attention is paid to the line spacing and the character spacing, it is possible to determine the line direction.

【0020】そこで、この発明の行切出し方法の実施に
あたり、より好ましくは、(d)のプロセスにおいて、
第1黒画素区間長のばらつきと第2黒画素区間長のばら
つきとの比率が第3基準値未満の場合に、第1方向射影
分布において隣り合った第1黒画素区間どうしの間の第
1白画素区間の長さと、第2方向射影分布において隣り
合った第2黒画素区間どうしの間の第2白画素区間の長
さとを利用して、行方向を判定するプロセスを含むのが
良い。
Therefore, in carrying out the line segmentation method of the present invention, more preferably, in the process (d),
When the ratio of the variation in the first black pixel section length to the variation in the second black pixel section length is less than the third reference value, the first interval between the adjacent first black pixel sections in the first direction projection distribution. It is preferable to include a process of determining the row direction using the length of the white pixel section and the length of the second white pixel section between the adjacent second black pixel sections in the second direction projection distribution.

【0021】ところで、第1および第2黒画素区間長の
ばらつきどうしを比較しない場合であっても、行間隔お
よび文字間隔に着目することにより、行方向の判定は可
能となる。
By the way, even if the first and second black pixel section length variations are not compared, the line direction can be determined by focusing on the line interval and the character interval.

【0022】そこで、この発明の行切出し方法の実施に
あたっては、(d)のプロセスにおいて、第1方向射影
分布において隣り合った第1黒画素区間どうしの間の第
1白画素区間の長さと、第2方向射影分布において隣り
合った第2黒画素区間どうしの間の第2白画素区間の長
さとを利用して、行方向を判定するプロセスを含むのが
良い。
Therefore, in implementing the line segmentation method of the present invention, in the process (d), the length of the first white pixel section between the first black pixel sections adjacent to each other in the first direction projection distribution; It is preferable to include a process of determining the row direction by using the length of the second white pixel section between adjacent second black pixel sections in the second direction projection distribution.

【0023】さらに、この第1白画素区間長および第2
白画素区間長に着目して行方向判定を行なうにあたり、
より好ましくは、第1白画素区間が1箇所の場合には、
当該第1白画素区間の長さを第1平均白画素区間長と
し、かつ、第1白画素区間が複数箇所の場合には、当該
第1白画素区間の各々の長さの相加平均を第1平均白画
素区間長として算出するプロセスと、第2白画素区間が
1箇所の場合には、当該第2白画素区間の長さを第2平
均白画素区間長とし、かつ、第2白画素区間が複数箇所
の場合には、当該第2白画素区間の各々の長さの相加平
均を第2平均白画素区間長として算出するプロセスと第
1平均白画素区間長と第2平均白画素区間長とを比較し
て、より大きな平均白画素区間長の得られた射影分布の
走査方向を行方向と判定するプロセスとを含むと良い。
Further, the first white pixel section length and the second
In performing the row direction determination focusing on the white pixel section length,
More preferably, when there is one first white pixel section,
The length of the first white pixel section is defined as a first average white pixel section length, and when there are a plurality of first white pixel sections, the arithmetic average of the lengths of the first white pixel sections is calculated. The process of calculating as the first average white pixel section length, and when there is one second white pixel section, the length of the second white pixel section is set to the second average white pixel section length, and the second white pixel section When there are a plurality of pixel sections, the process of calculating the arithmetic mean of the lengths of the second white pixel sections as the second average white pixel section length, the first average white pixel section length and the second average white pixel section It is preferable to include a process of comparing with the pixel section length and determining the scanning direction of the obtained projection distribution having the larger average white pixel section length as the row direction.

【0024】前述のように、行間隔は、一般に文字間隔
よりも広い。従って、第1平均白画素区間長と第2平均
白画素区間長とのうちの、より大きな平均白画素区間長
の方が行間の空白に対応する。従って、第1平均白画素
区間長と第2平均白画素区間長とを比較して行方向を判
定すれば、第1黒画素区間長のばらつきと第2黒画素区
間長のばらつきとの比率が小さい場合(例えば、文字間
隔が固定ピッチの場合)であっても、行方向判定の確実
化を図ることができる。
As mentioned above, line spacing is generally wider than character spacing. Therefore, of the first average white pixel section length and the second average white pixel section length, the larger average white pixel section length corresponds to a blank between rows. Therefore, if the row direction is determined by comparing the first average white pixel section length with the second average white pixel section length, the ratio of the variation of the first black pixel section length to the variation of the second black pixel section length is determined. Even in a small case (for example, when the character interval is a fixed pitch), it is possible to ensure the determination of the line direction.

【0025】(1行のみの場合の行方向判定)ところ
で、文書画像に文字列が1行のみ含まれている場合に
は、行方向と直交する分割線によって分割されて生成さ
れた各分割領域に、分割行が1つずつ含まれる。その結
果、この場合には、分割領域の数と、各分割領域にそれ
ぞれ含まれる分割行の数の合計とが一致する。これに対
して、行方向に沿った分割線によって文書画像を分割し
た場合には、分割領域の数と、分割行の数の合計とは一
致しない。例えば、複数の分割領域が生成されても、分
割行の数の合計は1つのままとなる。従って、文字列が
1行だけの場合には、分割領域の数と分割行の数の合計
とを比較すれば、黒画素区間長のばらつきどうしや平均
白画素区間長どうしを比較するまでもなく、行方向を判
定することができる。
(Judgment of Line Direction in Case of Only One Line) By the way, when the character string is included in the document image only in one line, each divided area generated by dividing by a dividing line orthogonal to the line direction is generated. Contains one divided line at a time. As a result, in this case, the number of divided areas matches the total number of divided rows included in each divided area. On the other hand, when the document image is divided by the dividing line along the line direction, the number of divided regions does not match the total number of divided lines. For example, even if a plurality of divided areas are generated, the total number of divided rows remains one. Therefore, when the character string is only one line, if the number of divided areas and the total number of divided lines are compared, it is needless to compare the variation of the black pixel section length and the average white pixel section length. , The row direction can be determined.

【0026】そこで、この発明の行切出し方法を実施す
るにあたり、好ましくは、(d)のプロセスにおいて、
第1方向分割領域の数の合計を第1分割領域数として求
めるプロセスと、第1黒画素区間の数の、全ての第1方
向分割領域にわたっての合計を第1黒画素区間数として
求めるプロセスと、第2方向分割領域の数の合計を第2
分割領域数として求めるプロセスと、第2黒画素区間の
数の、全ての第2方向分割領域にわたっての合計を第2
黒画素区間数として求めるプロセスと、第1黒画素区間
数とこの第1分割領域数とが一致し、かつ、第2黒画素
区間数と第2分割領域数とが不一致の場合に、行方向を
第1方向と判定するプロセスと、および、第2黒画素区
間数とこの第2分割領域数とが一致し、かつ、第1黒画
素区間数と第1分割領域数とが不一致の場合に、行方向
を第2方向と判定するプロセスとを含むと良い。
Therefore, in carrying out the line segmentation method of the present invention, preferably, in the process (d),
A process of calculating the total number of the first direction divided regions as the first divided region number, and a process of calculating the total number of the first black pixel regions over all the first direction divided regions as the first black pixel region number. , The sum of the number of divided regions in the second direction
The sum of the process of obtaining the number of divided areas and the number of second black pixel sections over all the second direction divided areas is defined as a second
If the process for obtaining the number of black pixel sections is equal to the number of first black pixel sections and the number of the first divided areas and the number of second black pixel sections is not equal to the number of the second divided areas, the row direction Is determined as the first direction, and when the number of second black pixel sections and the number of the second divided areas match, and the number of first black pixel sections and the number of the first divided areas do not match. And a process of determining the row direction as the second direction.

【0027】このように、分割領域の数と分割行の数の
合計とを比較すれば、文字列が1行だけの場合には、黒
画素区間長のばらつきどうしや平均白画素区間長どうし
を比較するまでもなく、行方向判定を行なうことができ
る。
As described above, when the number of divided regions and the total number of divided lines are compared, when the character string is only one line, the variation in the black pixel section length and the average white pixel section length are determined. The row direction can be determined without comparison.

【0028】(分割行の接続)ところで、各分割領域に
おいてそれぞれ分割行を切り出した後、各分割行を接続
する際に、1つの分割行が片側だけで2つの分割行と接
続可能な場合がある。すなわち、1つの分割行の黒画素
区間が、片側だけで2つの分割行の黒画素区間とそれぞ
れ部分的に重複している場合がある。このような、重複
は、文書画像の行方向が走査方向に対して傾斜している
場合に発生し易い傾向がある。
(Connection of Divided Rows) By the way, after each divided row is cut out in each divided area, when each divided row is connected, there is a case where one divided row can be connected to two divided rows on only one side. is there. That is, the black pixel section of one divided row may partially overlap the black pixel section of two divided rows on one side only. Such duplication tends to occur when the row direction of the document image is inclined with respect to the scanning direction.

【0029】また、このように行方向が傾斜している場
合には、例えば、上記の文献1に開示の技術において
も、部分文字列(分割行に相当する)の切出し座標が隣
接する分割領域の2つの部分文字列の切出し座標とそれ
ぞれ重複するため、同じラベルを2つの部分文字列の両
方に付けなければならなくなる場合が生じ得る。この場
合、文献1に開示の技術においては、行切出しが困難と
なる。
In the case where the row direction is inclined as described above, for example, even in the technique disclosed in the above-mentioned document 1, the cut-out coordinates of the partial character string (corresponding to the divided line) are adjacent to the divided area. Since the cutout coordinates of the two partial character strings overlap with each other, the same label may need to be attached to both of the two partial character strings. In this case, in the technique disclosed in Document 1, line segmentation becomes difficult.

【0030】そこで、この発明の行切出し方法を実施す
るにあたり、好ましくは、(e1)のプロセス、すなわ
ち、第1分割行どうしの接続を行なうプロセスにおい
て、分割領域に含まれる第1方向分割行の第1黒画素区
間の一部分が、当該分割領域と隣接する他の1つの分割
領域に含まれる2つの第1分割行の第1黒画素区間の一
部分とそれぞれ重なっている場合、重なっている区間の
長さが第4基準値よりも長い分割行どうしを接続し、
(e2)のプロセス、すなわち、第2分割行どうしの接
続を行なうプロセスにおいて、分割領域に含まれる第2
方向分割行の第2黒画素区間の一部分が、当該分割領域
と隣接する他の1つの分割領域に含まれる2つの第2分
割行の第2黒画素区間の一部分とそれぞれ重なっている
場合、重なっている区間の長さが第5基準値よりも長い
分割行どうしを接続すると良い。
Therefore, in carrying out the line segmentation method of the present invention, preferably, in the process (e1), that is, in the process of connecting the first divided lines, the first direction divided lines included in the divided region are separated. When a part of the first black pixel section overlaps with a part of the first black pixel section of two first divided rows included in another divided area adjacent to the divided area, respectively, Connecting the divided lines whose length is longer than the fourth reference value,
In the process (e2), that is, the process of connecting the second divided rows, the second
When a part of the second black pixel section of the direction divided row overlaps with a part of the second black pixel section of two second divided rows included in another divided area adjacent to the divided area, respectively, the overlap occurs. It is preferable to connect divided rows whose section length is longer than the fifth reference value.

【0031】このように、第4基準値や第5基準値を用
いて接続する分割行どうしを決定すれば、分割行の片側
で2つの分割行と重なっている場合でも、適切に分割行
どうしを接続することができる。その結果、各分割領域
にわたって分割行を適切に接続して行切出しを行なうこ
とができる。
As described above, if the divided rows to be connected are determined using the fourth reference value or the fifth reference value, even if two divided rows overlap on one side of the divided row, the divided rows can be appropriately connected. Can be connected. As a result, line segmentation can be performed by appropriately connecting the divided lines over each divided region.

【0032】また、上記の第4基準値および第5基準値
は、任意好適な値を設定すると良い。例えば、第4基準
値と第5基準値とは互いに等しくても良いし、互いに異
なっていても良い。また、第4および第5基準値は、そ
れぞれ、互いに接続される分割行どうしのずれの量が最
小となるように設定するのが望ましい。例えば、黒画素
区間長と白画素区間長とが同程度の長さの場合には、第
4および第5基準値の少なくとも一方を「0.5」程度
の値としても良い。その場合、1つの分割行の片側でそ
れぞれ重なっている、となりの分割領域の2つの分割行
のうち、一方が、基準値を満たすと、他方が基準値を満
たさなくなる。
The fourth reference value and the fifth reference value may be set to any suitable values. For example, the fourth reference value and the fifth reference value may be equal to each other, or may be different from each other. Further, it is preferable that the fourth and fifth reference values are set so that the amount of deviation between the divided rows connected to each other is minimized. For example, when the black pixel section length and the white pixel section length are almost the same length, at least one of the fourth and fifth reference values may be set to a value of about “0.5”. In this case, if one of the two divided rows of the adjacent divided area that overlaps on one side of one divided row satisfies the reference value, the other does not satisfy the reference value.

【0033】(統合修正1)ところで、分割行切出しの
際には、本来1つの分割行を誤って2つの分割行として
切り出してしまうことがある。例えば、ある横書き文字
列を構成する各文字が、いずれも上下に分かれる部首か
らなる場合に、本来1つの分割行を2つの個別の分割行
として切り出すことがある。また、例えば、ある縦書き
の文字列を構成する各文字が、いずれも左右に分かれる
部首からなる場合に、本来1つの分割行を2つの個別の
分割行として切り出してしまうことがある。
(Integration Correction 1) By the way, when a divided line is cut out, there is a case where one divided line is originally cut out as two divided lines by mistake. For example, when each character constituting a certain horizontal writing character string is composed of radicals that are vertically divided, one divided line may be originally cut out as two individual divided lines. Also, for example, when each character constituting a certain vertically written character string is composed of radicals that are divided into left and right, one divided line may be originally cut out as two individual divided lines.

【0034】この誤って切り出された2つの分割行は、
それぞれ分割行の高さ(横書きの場合)または幅(縦書
きの場合)が、適切に切り出された他の分割行に比べて
短い。そして、誤って切り出された2つの分割行の高さ
または幅は、一般に、他の分割行の半分程度である。さ
らに、この誤って切り出された2つの分割行どうしの行
間隔は、一般に、他の分割行どうしの行間隔間に比べて
狭い。
The two divided lines erroneously cut out are:
The height (in the case of horizontal writing) or width (in the case of vertical writing) of each divided line is shorter than other divided lines that are appropriately cut out. The height or width of two erroneously divided rows is generally about half that of the other divided rows. Furthermore, the line interval between the two erroneously extracted divided lines is generally smaller than the line interval between the other divided lines.

【0035】従って、切り出された分割行の高さ若しく
は幅と行間隔とに着目すれば、本来1つの分割行として
切り出されるべきところを誤って2つの分割行として切
り出された分割行を発見して、分割行切出しの修正が可
能となる。
Therefore, if attention is paid to the height or width and the line spacing of the cut-out divided lines, a divided line that is supposed to be cut out as one divided line is erroneously found as two divided lines. As a result, it is possible to correct the division line cutout.

【0036】そこで、この発明の行切出し方法を実施す
るにあたり、好ましくは、(e1)のプロセスを行なう
前に、(c1)のプロセスにおいて切り出された第1分
割行の第1黒画素区間の長さ(以下、第1黒画素区間長
とも称する。)の相加平均を第1平均黒画素区間長とし
て求めるプロセスと、この第1平均黒画素区間長と第1
黒画素区間長とを比較して、第1黒画素区間のうち、第
1平均黒画素区間長に対する第1黒画素区間長の比率が
第6基準値よりも小さな第1黒画素区間を第1候補区間
として選択するプロセスと、この第1候補区間の一方の
側の直近の第1黒画素区間である第1候補黒画素区間と
この第1候補区間とを一つの連続した黒画素区間とした
場合の当該黒画素区間を第1統合区間とし、当該第1統
合区間の長さを求めるプロセスと、この第1統合区間の
長さと第1平均黒画素区間長との差の大きさを第1統合
区間長誤差として求めるプロセスと、この第1候補区間
の他方の側の直近の第1黒画素区間である第2候補黒画
素区間とこの第1候補区間とを1つの連続した黒画素区
間とした場合の当該黒画素区間を第2統合区間とし、当
該第2統合区間の長さを求めるプロセスと、この第2統
合区間の長さと第1平均黒画素区間長との差の大きさを
第2統合区間長誤差として求めるプロセスと、第1統合
区間長誤差と第2統合区間長誤差とを比較して、誤差の
小さい方の統合区間を第1選択統合区間として選択する
プロセスと、この第1選択統合区間のうちの、第1候補
区間と当該第1候補区間の直近の第1黒画素区間との間
の第1白画素区間の長さを求めるプロセスと、この第1
白画素区間の長さと第7基準値とを比較して、当該第1
白画素区間の長さが当該第7基準値よりも短い場合に、
第1選択統合区間を1つの連続した第1黒画素区間とす
ることにより、行切出しの修正を行なうプロセスとを含
むと良い。
Therefore, in carrying out the line segmentation method of the present invention, preferably, before performing the process (e1), the length of the first black pixel section of the first divided row segmented in the process (c1) (Hereinafter, also referred to as a first black pixel section length) as a first average black pixel section length, and a process of obtaining the first average black pixel section length and the first average black pixel section length.
By comparing the black pixel section length with the first black pixel section, the first black pixel section in which the ratio of the first black pixel section length to the first average black pixel section length is smaller than the sixth reference value is defined as the first black pixel section. The process of selecting as a candidate section, the first candidate black pixel section which is the nearest first black pixel section on one side of the first candidate section, and the first candidate section as one continuous black pixel section In this case, the black pixel section is defined as a first integrated section, and the process of obtaining the length of the first integrated section, and the magnitude of the difference between the length of the first integrated section and the first average black pixel section length is defined as the first integrated section. A process of obtaining the integrated section length error, a second candidate black pixel section that is the nearest first black pixel section on the other side of the first candidate section, and the first candidate section as one continuous black pixel section In this case, the black pixel section is defined as a second integrated section, and the black pixel section of the second integrated section is A second integrated section length error, a process of obtaining the magnitude of the difference between the length of the second integrated section and the first average black pixel section length as a second integrated section length error, A process of comparing a long error with the integrated section having a smaller error as a first selected integrated section; and a first candidate section and a nearest one of the first candidate section of the first selected integrated section. A process of obtaining a length of a first white pixel section between the first black pixel section and the first black pixel section;
By comparing the length of the white pixel section with the seventh reference value,
When the length of the white pixel section is shorter than the seventh reference value,
It is preferable to include a process of correcting the line segmentation by setting the first selection integrated section as one continuous first black pixel section.

【0037】ここでは、行切出しの修正にあたり、先
ず、黒画素区間長に着目して、誤って分割されて切り出
された可能性の高い第1候補区間を選択する。第1候補
区間の選択にあたっては、第1黒画素区間長と第1平均
黒画素区間長とを比較する。そして、第1平均黒画素区
間長に対する比率が第6基準値よりも小さい第1黒画素
区間を第1候補区間として選択する。この第6基準値
は、例えば1未満で0よりも大きな任意好適な値(例え
ば0.5程度)を設定すると良い。
Here, in correcting the line segmentation, first, focusing on the black pixel segment length, a first candidate segment having a high possibility of being erroneously divided and segmented is selected. In selecting the first candidate section, the first black pixel section length is compared with the first average black pixel section length. Then, a first black pixel section whose ratio to the first average black pixel section length is smaller than the sixth reference value is selected as a first candidate section. As the sixth reference value, for example, any suitable value (for example, about 0.5) smaller than 1 and larger than 0 may be set.

【0038】この第1候補区間の両側には、第1候補区
間が端の行である場合を除いて、それぞれ分割行が存在
している。そして、この両側の2つの分割行のうちのど
ちらの分割行を第1候補区間と統合して修正すべきかを
決定する。この決定にあたっては、第1統合区間長誤差
と第2統合区間長誤差とを比較して、誤差の小さい方を
第1選択統合区間として選択する。
Except for the case where the first candidate section is an end row, divided rows exist on both sides of the first candidate section. Then, which of the two divided rows on both sides is to be integrated with the first candidate section to determine which should be corrected. In making this determination, the first integrated section length error and the second integrated section length error are compared, and the one with the smaller error is selected as the first selected integrated section.

【0039】さらに、1行を誤って2つの行に分割した
場合には、一般に、分割された2つの行の間の白画素区
間の長さが短い。そこで、第1候補区間と第1選択統合
区間との間の第1白画素区間の長さを、第7基準値と比
較する。この第7基準値は、任意好適な値を設定すると
良い。例えば、白画素区間の長さの平均値よりも小さい
値(例えば、平均値の半分程度の長さ)を第7基準値と
して設定しても良い。
Further, when one row is incorrectly divided into two rows, the length of the white pixel section between the two divided rows is generally short. Therefore, the length of the first white pixel section between the first candidate section and the first selection integration section is compared with a seventh reference value. The seventh reference value may be set to any suitable value. For example, a value smaller than the average value of the length of the white pixel section (for example, about half the average value) may be set as the seventh reference value.

【0040】そして、第1白画素区間の長さが第7基準
値よりも短い場合に、第1選択統合区間を1つの行とし
て行切出しを修正する。尚、第1白画素区間の長さが第
7基準値以上の場合には、第1選択統合区間が本来1行
ではない可能性が高いため、その第1候補区間の行切出
しから第1選択統合区間の行切出しへ修正は行なわな
い。
When the length of the first white pixel section is shorter than the seventh reference value, the line extraction is corrected with the first selected integrated section as one line. If the length of the first white pixel section is equal to or longer than the seventh reference value, it is highly likely that the first selection integrated section is not originally one line. No correction is made to the line segmentation of the integrated section.

【0041】(統合修正2)また、この発明の行切出し
方法を実施するにあたり、好ましくは、(e2)のプロ
セスを行なう前に、(c2)のプロセスにおいて切り出
された第2分割行の第2黒画素区間の長さ(以下、第2
黒画素区間長とも称する。)の相加平均を第2平均黒画
素区間長として求めるプロセスと、第2平均黒画素区間
長と第2黒画素区間長とを比較して、第2黒画素区間の
うち、第2平均黒画素区間長に対する第2黒画素区間長
の比率が第8基準値よりも小さな第2黒画素区間を第2
候補区間として選択するプロセスと、この第2候補区間
の一方の側の直近の第2黒画素区間である第3候補黒画
素区間とこの第2候補区間とを一つの連続した黒画素区
間とした場合の当該黒画素区間を第3統合区間とし、当
該第3統合区間の長さを求めるプロセスと、この第3統
合区間の長さと第2平均黒画素区間長との差の大きさを
第3統合区間長誤差として求めるプロセスと、この第2
候補区間の他方の側の直近の第2黒画素区間である第4
候補黒画素区間とこの第2候補区間とを1つの連続した
黒画素区間とした場合の当該黒画素区間を第4統合区間
とし、当該第4統合区間の長さを求めるプロセスと、こ
の第4統合区間の長さと第2平均黒画素区間長との差の
大きさを第4統合区間長誤差として求めるプロセスと、
第3統合区間長誤差と第4統合区間長誤差とを比較し
て、誤差の小さい方の統合区間を第2選択統合区間とし
て選択するプロセスと、この第2選択統合区間のうち
の、第2候補区間と当該第2候補区間の直近の第2黒画
素区間との間の第2白画素区間の長さを求めるプロセス
と、この第2白画素区間の長さと第9基準値とを比較し
て、当該第2白画素区間の長さが当該第9基準値よりも
短い場合に、第2選択統合区間を1つの連続した第2黒
画素区間とすることにより、行切出しの修正を行なうプ
ロセスとを含むと良い。
(Integration Correction 2) In carrying out the line segmentation method of the present invention, preferably, before performing the process (e2), the second segment of the second divided line segmented in the process (c2) is performed. Length of black pixel section (hereinafter referred to as second
Also referred to as black pixel section length. ) Is calculated as the second average black pixel section length, and the second average black pixel section length is compared with the second black pixel section length to determine the second average black pixel section length of the second black pixel section. The second black pixel section in which the ratio of the second black pixel section length to the pixel section length is smaller than the eighth reference value is defined as the second black pixel section.
The process of selecting as a candidate section, the third candidate black pixel section which is the second black pixel section nearest to one side of the second candidate section, and the second candidate section are regarded as one continuous black pixel section. In this case, the black pixel section is defined as a third integrated section, and the length of the third integrated section is determined. The difference between the length of the third integrated section and the second average black pixel section length is determined as the third integrated section. The process for obtaining the integrated section length error and the second
A fourth black pixel section, which is the nearest second black pixel section on the other side of the candidate section,
When the candidate black pixel section and the second candidate section are defined as one continuous black pixel section, the black pixel section is defined as a fourth integrated section, and the process of obtaining the length of the fourth integrated section is performed. A process of determining the magnitude of the difference between the length of the integrated section and the second average black pixel section length as a fourth integrated section length error;
A process of comparing the third integrated section length error with the fourth integrated section length error and selecting an integrated section having a smaller error as a second selected integrated section; and a process of selecting a second integrated section of the second selected integrated section. The process of determining the length of the second white pixel section between the candidate section and the second black pixel section immediately adjacent to the second candidate section, and comparing the length of the second white pixel section with the ninth reference value When the length of the second white pixel section is shorter than the ninth reference value, the process of correcting the line segmentation by setting the second selection integrated section to one continuous second black pixel section It is good to include

【0042】ここでも、上記の第1黒画素区間に対する
行切出の修正の場合と同様にして、第2選択統合区間を
選択して行切出の修正を行なう。また、第8基準値は、
上記の第6基準値と同様に、任意好適な値を設定すると
良い。また、第9基準値も、上記の第7基準値と同様
に、任意好適な値を設定すると良い。
Also in this case, similarly to the above-described correction of the line cutout for the first black pixel section, the second selected integrated section is selected and the line cutout is corrected. The eighth reference value is
As with the sixth reference value, any suitable value may be set. Also, the ninth reference value may be set to any suitable value, similarly to the seventh reference value.

【0043】(分割修正1)ところで、分割行切出しの
際に、2つの個別の行を誤って1つの行として切り出し
てしまうことがある。例えば、隣り合った行どうしが近
接している場合や、例えば射影分布を作成する際の走査
方向に対して文書画像の行方向(文字列を構成する文字
が並んでいる方向)が傾斜して入力された場合には、隣
り合った2つの個別の行が誤って1つの行として切り出
されてしまうことがある。
(Division Correction 1) By the way, at the time of division line extraction, two individual lines may be erroneously extracted as one line. For example, when the adjacent lines are close to each other, or when the line direction of the document image (the direction in which the characters forming the character string are arranged) is inclined with respect to the scanning direction when creating the projection distribution, for example. When input, two adjacent individual lines may be erroneously cut out as one line.

【0044】誤って1行として切り出された分割行は、
分割行の高さ(横書きの場合)または幅(縦書きの場
合)が、適切に切り出された他の分割行に比べて長い。
そして、誤って1行として切り出された分割行の高さま
たは幅は、一般に、他の分割行の2倍程度である。
The divided line erroneously cut out as one line is
The height (in the case of horizontal writing) or width (in the case of vertical writing) of the divided line is longer than other divided lines that are appropriately cut out.
In general, the height or width of a divided row that is erroneously cut out as one row is about twice as large as other divided rows.

【0045】従って、切り出された分割行の高さ若しく
は幅に着目すれば、本来2つの分割行として個別に切り
出されるべきところを誤って1つの分割行として切り出
された分割行を発見して、分割行切出しの修正が可能と
なる。
Therefore, if attention is paid to the height or width of the cut-out divided lines, a divided line that is supposed to be cut out individually as two divided lines is mistakenly found as one divided line. It is possible to correct the split line segmentation.

【0046】そこで、この発明の行切出し方法を実施す
るにあたり、好ましくは、(c1)のプロセスにおいて
切り出された第1分割行の第1黒画素区間の長さ(以
下、第1黒画素区間長とも称する。)の相加平均を第1
平均黒画素区間長として求めるプロセスと、第1平均黒
画素区間長と第1黒画素区間長とを比較して、第1黒画
素区間のうち、第1平均黒画素区間長に対する第1黒画
素区間長の比率が第11基準値よりも大きな第1黒画素
区間を第1分割候補区間として選択するプロセスと、走
査線のうち第1分割候補区間の中央付近を走査する走査
線上で黒画素の検出される位置のうち、第1方向に沿っ
て最も一方寄りの位置を第1位置として求めるプロセス
と、第1位置のうち、第1方向に沿って最も他方寄りの
第1位置を最寄第1位置として求めるプロセスと、走査
線のうち第1分割候補区間の中央付近を走査する走査線
上で黒画素の検出される位置のうち、第2方向に沿って
最も他方寄りの位置を第2位置として求めるプロセス
と、第2位置のうち、第2方向に沿って最も一方寄りの
第2位置を最寄第2位置として求めるプロセスと、最寄
第1位置と最寄第2位置とを比較して、この最寄第1位
置がこの最寄第2位置よりも他方側である場合またはこ
の最寄第1位置とこの最寄第2位置とが第2方向に沿っ
た同一直線上に位置する場合に、第1分割候補区間を、
当該第1分割候補区間の中央で2つに分割させて2つの
分割黒画素区間を生成することにより、行切出しの修正
を行なうプロセスと、最寄第1位置と最寄第2位置とを
比較して、この最寄第1位置がこの最寄第2位置よりも
一方側である場合に、この最寄第1位置とこの最寄第2
位置との中間を通りかつ第2方向に沿った分割線で第1
分割候補区間を分割することにより、一方側の第一方分
割領域および他方側の他方分割領域を生成し、一方分割
領域を最寄第2位置が得られた走査線によって分割して
2つの分割黒画素区間を生成し、かつ、他方分割領域を
最寄第1位置が得られた走査線によって分割して2つの
分割黒画素区間を生成することにより行切出しの修正を
行なうプロセスとを含むと良い。
Therefore, in carrying out the line extracting method of the present invention, it is preferable that the length of the first black pixel section of the first divided row cut out in the process (c1) (hereinafter referred to as the first black pixel section length) The arithmetic mean of the first
The process of obtaining the average black pixel section length is compared with the first average black pixel section length and the first black pixel section length, and among the first black pixel sections, the first black pixel corresponding to the first average black pixel section length A process of selecting a first black pixel section whose section length ratio is larger than the eleventh reference value as a first division candidate section; and a step of selecting black pixels on a scan line that scans the vicinity of the center of the first division candidate section among scan lines. A process for determining, as the first position, a position closest to the first direction along the first direction among the detected positions, and a process for determining the first position closest to the other side along the first direction among the first positions. A process of obtaining one position, and a position closest to the other side in the second direction among positions where black pixels are detected on a scanning line that scans the vicinity of the center of the first division candidate section in the scanning line is a second position. And the second position The process of determining the closest second position along the second direction as the closest second position, and comparing the closest first position and the closest second position, determine that the closest first position is the closest second position. When the second position is on the other side than the second position or when the first position and the second position are located on the same straight line along the second direction, the first division candidate section is
The process of correcting the line segmentation by dividing the first divided candidate section into two at the center of the first divided candidate section to generate two divided black pixel sections, and comparing the nearest first position with the nearest second position Then, when the nearest first position is located on one side of the nearest second position, the nearest first position and the nearest second position are set.
The first line is a dividing line passing through the middle of the position and along the second direction.
By dividing the division candidate section, a first divided area on one side and another divided area on the other side are generated, and one divided area is divided by a scanning line from which a nearest second position is obtained, thereby dividing the divided area into two divided areas. Generating a black pixel section, and dividing the other divided area by the scanning line at which the nearest first position is obtained to generate two divided black pixel sections to correct the line segmentation. good.

【0047】ここでは、行切出しの修正にあたり、先
ず、第1黒画素区間長に着目して、誤って統合されて切
り出された可能性の高い第1分割候補区間を選択する。
第1分割候補区間の選択にあたっては、第1黒画素区間
長と第1平均黒画素区間長とを比較する。そして、第1
平均黒画素区間長に対する比率が第11基準値よりも大
きな第1黒画素区間を第1分割候補区間として選択す
る。この第11基準値は、例えば1以上の任意好適な値
(例えば1.5〜2程度)を設定すると良い。
Here, in correcting the line segmentation, first, focusing on the first black pixel segment length, a first division candidate segment having a high possibility of being erroneously integrated and segmented is selected.
In selecting the first division candidate section, the first black pixel section length is compared with the first average black pixel section length. And the first
A first black pixel section whose ratio to the average black pixel section length is larger than the eleventh reference value is selected as a first division candidate section. As the eleventh reference value, for example, one or more arbitrary suitable value (for example, about 1.5 to 2) may be set.

【0048】2つの個別の分割行が1つの分割行として
誤って切り出されてしまう場合には、例えば、その2
つの個別の分割行どうしが近接している場合と、文書
画像の行方向が走査方向に対して傾斜している場合とが
ある。いずれの場合も、2つの個別の分割行のそれぞれ
の射影分布が互いに重なって、1つの連続した黒画素区
間として誤って切り出されてしまうことがある。
If two individual divided lines are erroneously cut out as one divided line, for example,
There are a case where two individual divided lines are close to each other, and a case where the line direction of the document image is inclined with respect to the scanning direction. In either case, the projection distributions of the two individual divided rows may overlap each other and be erroneously cut out as one continuous black pixel section.

【0049】例えば、上記の分割行どうしが近接して
いる場合には、走査方向に沿った分割線によって、第1
分割候補区間を強制的に2分割すれば良い。これに対し
て、例えば、上記の行方向が走査走行に対して傾斜し
ている場合には、強制的に2分割したのでは、各行を適
切に切り出せない場合がある。すなわち、強制的に2分
割したのでは、分割された各行に、それぞれ2つの行の
一部分ずつが斜めに含まれてしまう場合がある。
For example, when the above-mentioned divided rows are close to each other, the first divided line is formed by a dividing line along the scanning direction.
What is necessary is just to forcibly divide the division candidate section into two. On the other hand, for example, in the case where the row direction is inclined with respect to the scanning travel, it may not be possible to properly cut out each row if the forcible division is performed. That is, if the division is forcibly performed, a part of each of the two rows may be included diagonally in each of the divided rows.

【0050】そこで、ここでは、最寄第1位置と最寄第
2位置とを比較する。そして、最寄第1位置がこの最寄
第2位置よりも一方側である場合またはこの最寄第1位
置とこの最寄第2位置とが第2方向に沿った同一直線上
に位置する場合に(これらの場合は、例えば上記のの
場合に相当する。)、第1分割候補区間を強制的に2分
割することにより、行切出の修正を行なう。
Therefore, here, the nearest first position and the nearest second position are compared. Then, when the nearest first position is one side of the nearest second position, or when the nearest first position and the nearest second position are located on the same straight line along the second direction. (These cases correspond to, for example, the case described above.), The first segmentation section is forcibly divided into two to correct the line segmentation.

【0051】一方、この最寄第1位置がこの最寄第2位
置よりも他方側である場合に(この場合は、例えば上記
のの場合に相当する。)、第1分割候補区間を4分割
することにより、行切出の修正を行なう。
On the other hand, when the nearest first position is on the other side of the nearest second position (this case corresponds to, for example, the above case), the first division candidate section is divided into four. By doing so, the line segmentation is corrected.

【0052】(分割修正2)また、この発明の行切出し
方法を実施するにあたり、好ましくは、(c2)のプロ
セスにおいて切り出された第2分割行の第2黒画素区間
の長さ(以下、第2黒画素区間長とも称する。)の相加
平均を第2平均黒画素区間長として求めるプロセスと、
第2平均黒画素区間長と第2黒画素区間長とを比較し
て、第2黒画素区間のうち、第2平均黒画素区間長に対
する第2黒画素区間長の比率が第12基準値よりも大き
な第2黒画素区間を第2分割候補区間として選択するプ
ロセスと、第2分割候補区間の中央付近を走査する走査
線上で黒画素の検出される位置のうち、第2方向に沿っ
て最も一方寄りの位置を第3位置として求めるプロセス
と、第3位置のうち、第2方向に沿って最も他方寄りの
第3位置を最寄第3位置として求めるプロセスと、走査
線のうち第2分割候補区間の中央付近を走査する走査線
上で黒画素の検出される位置のうち、第1方向に沿って
最も他方寄りの位置を第4位置として求めるプロセス
と、第4位置のうち、第1方向に沿って最も一方寄りの
第4位置を最寄第4位置として求めるプロセスと、最寄
第3位置と最寄第4位置とを比較して、この最寄第3位
置がこの最寄第4位置よりも他方側である場合に、第2
分割候補区間を、当該第2分割候補区間の中央で2つに
分割させて2つの分割黒画素区間を生成することによ
り、行切出しの修正を行なうプロセスと、最寄第3位置
と最寄第4位置とを比較して、この最寄第3位置がこの
最寄第4位置よりも一方側である場合およびこの最寄第
3位置とこの最寄第4位置とが第1方向に沿った同一直
線上に位置する場合に、この最寄第3位置とこの最寄第
4位置との中間を通りかつ第1方向に沿った分割線で第
2分割候補区間を分割することにより、一方側の第一方
分割領域および他方側の他方分割領域を生成し、一方分
割領域を最寄第4位置が得られた走査線によって分割し
て2つの分割黒画素区間を生成し、かつ、他方分割領域
を最寄第3位置が得られた走査線によって分割して2つ
の分割黒画素区間を生成することにより行切出しの修正
を行なうプロセスとを含むと良い。
(Division Correction 2) In carrying out the line extraction method of the present invention, preferably, the length of the second black pixel section (hereinafter, referred to as the second black pixel section) of the second division line extracted in the process (c2) is used. A process of calculating the arithmetic mean of the two black pixel section lengths as a second average black pixel section length;
The second average black pixel section length is compared with the second average black pixel section length, and the ratio of the second average black pixel section length to the second average black pixel section length in the second black pixel section is greater than the twelfth reference value. Selecting the second black pixel section that is also large as the second division candidate section, and selecting the black pixel detection position along the second direction among the positions where black pixels are detected on the scanning line that scans the vicinity of the center of the second division candidate section. A process of obtaining a position closer to one side as a third position, a process of obtaining a third position closest to the other side along the second direction among the third positions as a closest third position, and a second division of scanning lines. A process for determining, as a fourth position, a position closest to the other side along the first direction among positions where black pixels are detected on a scanning line that scans the vicinity of the center of the candidate section, and a first direction among the fourth positions. 4th position closest to you along 4th And processes determined as in the case by comparing the nearest third position and nearest the fourth position, the nearest third position is the other side from the nearest fourth position, the second
The process of correcting the line segmentation by dividing the division candidate section into two in the center of the second division candidate section to generate two divided black pixel sections, and the third position and the nearest third position Compared with the four positions, when the third closest position is one side of the fourth closest position, and when the third closest position and the fourth closest position are along the first direction. When located on the same straight line, the second division candidate section is divided by a division line that passes through the middle between the nearest third position and the nearest fourth position and extends in the first direction. A first divided region and the other divided region on the other side, and the one divided region is divided by a scanning line at which the nearest fourth position is obtained to generate two divided black pixel sections; The area is divided by the scanning line from which the nearest third position is obtained, and the two divided black pixel sections are divided. It may include a process of correcting the line cut by forming.

【0053】ここでは、上記の第1分割候補区間を選択
する場合と同様にして、第2分割候補区間を選択する。
尚、第12基準値は、上記の11基準値と同様に任意好
適な値を設定すると良い。
Here, the second division candidate section is selected in the same manner as in the case of selecting the first division candidate section.
Note that the twelfth reference value may be set to any suitable value as in the case of the eleventh reference value.

【0054】そして、上記の最寄第1位置と最寄第2位
置との比較と同様にして、最寄第3位置と最寄第4位置
とを比較して、上記の第1第分割候補区間の場合と同様
にして、第2分割候補区間を2分割若しくは4分割す
る。
Then, in the same manner as the comparison between the closest first position and the closest second position, the closest third position and the closest fourth position are compared, and the first division candidate is determined. Similarly to the case of the section, the second division candidate section is divided into two or four.

【0055】(第1の行切出し修正方法)この発明の行
切出し方法における上記の(統合修正1)および(統合
修正2)においては、分割行の切出しについて修正を行
なったが、これらの統合修正の方法は、分割行の切出し
の修正に限定せず、分割されていない行の切出しの修正
にも適用することができる。
(First Line Extraction Correction Method) In the above (Integration Correction 1) and (Integration Correction 2) in the line extraction method of the present invention, the correction of the division line extraction was performed. The method is not limited to the modification of the extraction of the divided line, but can be applied to the modification of the extraction of the line which is not divided.

【0056】そこで、この発明の第1の行切出し修正方
法によれば、文書画像の行方向に実質的に沿った第1方
向に沿って文書画像を走査して走査毎の累積黒画素数を
検出し、当該累積黒画素数の第1方向と直交する第2方
向に沿った分布を求めて射影分布を作成し、射影分布に
おいて第13基準値以上の累積黒画素数の射影部分が第
2方向に連続する各黒画素区間が得られる走査領域をそ
れぞれ1つの行領域として行切出しを行なった後に、行
切出しの修正を行なうにあたり、切り出された行領域の
黒画素区間の長さ(黒画素区間長)の相加平均を平均黒
画素区間長として求めるプロセスと、平均値と黒画素区
間長とを比較して、黒画素区間のうち、平均値に対する
黒画素区間長の比率が第14基準値よりも小さな黒画素
区間を候補区間として選択するプロセスと、この候補区
間の一方の側の直近の黒画素区間である第1候補黒画素
区間とこの候補区間とを一つの連続した黒画素区間とし
た場合の当該黒画素区間を第1統合区間とし、当該第1
統合区間の長さを求めるプロセスと、この第1統合区間
の長さと平均黒画素区間長との差の大きさを第1統合黒
画素区間長として求めるプロセスと、この候補区間の他
方の側の直近の黒画素区間である第2候補黒画素区間と
この候補区間とを1つの連続した黒画素区間とした場合
の当該黒画素区間を第2統合区間とし、当該第2統合区
間の長さを求めるプロセスと、この第2統合区間の長さ
と平均黒画素区間長との差の大きさを第2統合黒画素区
間長として求めるプロセスと、第1統合区間長誤差と第
2統合区間長誤差とを比較して、誤差の小さい方の統合
区間を選択統合区間として選択するプロセスと、選択統
合区間のうちの候補区間と当該候補区間の直近の黒画素
区間との間の白画素区間の長さを求めるプロセスと、白
画素区間の長さと第15基準値とを比較して、当該白画
素区間の長さが当該第15基準値よりも短い場合に、選
択統合区間を1つの連続した黒画素区間とすることによ
り、行切出しの修正を行なうプロセスとを含むことを特
徴とする。
Therefore, according to the first line segmentation correcting method of the present invention, the document image is scanned along the first direction substantially along the line direction of the document image, and the cumulative number of black pixels for each scan is calculated. A projection distribution is created by detecting the distribution of the cumulative number of black pixels along a second direction orthogonal to the first direction to create a projection distribution. After performing line segmentation with a scanning region in which each black pixel segment continuous in the direction is obtained as one row region, when performing line segmentation correction, the length of the black pixel segment of the segmented row region (black pixel segment) The process of calculating the arithmetic mean of the section lengths as the average black pixel section length, and comparing the average value with the black pixel section length, determine that the ratio of the black pixel section length to the average value among the black pixel sections is based on the 14th standard A black pixel section smaller than the value is defined as a candidate section. And the first candidate black pixel section, which is the nearest black pixel section on one side of the candidate section, and the black pixel section when the candidate section is regarded as one continuous black pixel section. One integrated section and the first
A process of obtaining the length of the integrated section, a process of obtaining the magnitude of the difference between the length of the first integrated section and the average black pixel section length as the first integrated black pixel section length, and a process of obtaining the other side of the candidate section. When the second candidate black pixel section that is the nearest black pixel section and this candidate section are defined as one continuous black pixel section, the black pixel section is defined as a second integrated section, and the length of the second integrated section is defined as A process for determining the length of the difference between the length of the second integrated section and the average black pixel section length as a second integrated black pixel section length; a first integrated section length error and a second integrated section length error; And selecting the integrated section with the smaller error as the selected integrated section, and the length of the white pixel section between the candidate section of the selected integrated section and the nearest black pixel section of the candidate section And the length of the white pixel section If the length of the white pixel section is shorter than the fifteenth reference value, the line segmentation is corrected by setting the selected integrated section as one continuous black pixel section. And a process.

【0057】このように、この発明の第1の行切出し修
正方法では、この発明の行切出し方法における上記の
(統合修正1)の場合と同様にして、1つの行が誤って
2つの行として切り出されてしまった場合の行切出しの
修正を行なうことができる。また、第14基準値は、上
記の第6基準値と同様に、任意好適な値を設定すると良
い。また、第15基準値も、上記の第7基準値と同様
に、任意好適な値を設定すると良い。
As described above, in the first line segmentation correcting method of the present invention, one line is mistakenly replaced with two lines in the same manner as in the case of the above (integrated correction 1) in the line segmenting method of the present invention. Correction of line cutout when cut out can be made. The 14th reference value may be set to any suitable value, similarly to the above-mentioned 6th reference value. Also, the fifteenth reference value may be set to any suitable value, similarly to the seventh reference value.

【0058】(第2の行切出し修正方法)この発明の行
切出し方法における上記の(分割修正1)および(分割
修正2)においては、分割行の切出しについて修正を行
なったが、これらの分割修正の方法は、分割行の切出し
の修正に限定せず、分割されていない行の切出しの修正
にも適用することができる。
(Second Line Extraction Correction Method) In the above (division correction 1) and (division correction 2) in the line extraction method of the present invention, the division line extraction was corrected. The method is not limited to the modification of the extraction of the divided line, but can be applied to the modification of the extraction of the line which is not divided.

【0059】そこで、この発明の第2の行切出し修正方
法によれば、文書画像の行方向に実質的に沿った第1方
向に沿って走査して、走査毎の累積黒画素数を検出し、
当該累積黒画素数の第1方向と直交する第2方向に沿っ
た分布を求めることにより射影分布を作成し、射影分布
において第16基準値以上の累積黒画素数の射影部分が
第2方向に連続する各黒画素区間が得られる走査領域を
それぞれ1つの行領域として行切出しを行なった後に、
行切出しの修正を行なうにあたり、切り出された行領域
の黒画素区間の長さ(黒画素区間長)の平均値を求める
プロセスと、平均値と黒画素区間長とを比較して、黒画
素区間のうち、平均値に対する黒画素区間長の比率が第
17基準値よりも大きな黒画素区間を分割候補区間とし
て選択するプロセスと、走査線のうち分割候補区間の中
央付近を走査する走査線上で黒画素の検出される位置の
うち、第1方向に沿って最も一方寄りの位置を第1位置
として求めるプロセスと、第1位置のうち、第1方向に
沿って最も他方寄りの第1位置を最寄第1位置として求
めるプロセスと、走査線のうち分割候補区間の中央付近
を走査する走査線上で黒画素の検出される位置のうち、
第2方向に沿って最も他方寄りの位置を第2位置として
求めるプロセスと、第2位置のうち、第2方向に沿って
最も一方寄りの第2位置を最寄第2位置として求めるプ
ロセスと、最寄第1位置と最寄第2位置とを比較して、
この最寄第1位置がこの最寄第2位置よりも他方側であ
る場合およびこの最寄第1位置とこの最寄第2位置とが
第2方向に沿った同一直線上に位置する場合に、分割候
補区間を、当該分割候補区間の中央で2つに分割させて
2つの分割黒画素区間を生成することにより、行切出し
の修正を行なうプロセスと、最寄第1位置と最寄第2位
置とを比較して、この最寄第1位置がこの最寄第2位置
よりも一方側である場合に、この最寄第1位置とこの最
寄第2位置との中間を通りかつ第2方向に沿った分割線
で第1分割候補区間を分割することにより、一方側の第
一方分割領域および他方側の他方分割領域を生成し、一
方分割領域を最寄第2位置が得られた走査線によって分
割して2つの分割黒画素区間を生成し、かつ、他方分割
領域を最寄第1位置が得られた走査線によって分割して
2つの分割黒画素区間を生成することにより行切出しの
修正を行なうプロセスとを含むことを特徴とする。
Therefore, according to the second line segmentation correcting method of the present invention, scanning is performed along a first direction substantially along the line direction of the document image to detect the cumulative number of black pixels for each scan. ,
A projection distribution is created by obtaining a distribution of the cumulative number of black pixels along a second direction orthogonal to the first direction. In the projection distribution, a projected portion of the cumulative number of black pixels equal to or larger than the sixteenth reference value is located in the second direction. After performing a line segmentation with a scanning region in which each continuous black pixel section is obtained as one row region,
In correcting the line segmentation, the process of obtaining the average value of the length of the black pixel section (black pixel section length) of the segmented row region, and comparing the average value with the length of the black pixel section to determine the black pixel section A process of selecting a black pixel section in which the ratio of the black pixel section length to the average value is larger than the seventeenth reference value as a division candidate section; Among the positions where the pixels are detected, the process of determining the position closest to the first side along the first direction as the first position, and the process of setting the first position closest to the other side along the first direction among the first positions. The process of determining the position as the first position and the position where the black pixel is detected on the scanning line that scans the vicinity of the center of the division candidate section in the scanning line.
A process of obtaining a position closest to the other side along the second direction as the second position, a process of obtaining a second position closest to the side of the second position along the second direction as the second position, By comparing the nearest first position and the nearest second position,
When the nearest first position is on the other side of the nearest second position and when the nearest first position and the nearest second position are located on the same straight line along the second direction. , Dividing the division candidate section into two in the center of the division candidate section to generate two divided black pixel sections, thereby correcting the line segmentation, the nearest first position and the nearest second position. When the nearest first position is located on one side of the nearest second position, the second first position passes through an intermediate point between the nearest first position and the nearest second position. By dividing the first division candidate section by a division line along the direction, the first divisional area on one side and the other divisional area on the other side are generated, and the second position closest to the one divisional area is obtained. It is divided by a scanning line to generate two divided black pixel sections, and the other divided area is placed at the nearest first place. Characterized in that it comprises a process for correcting the line cut by generating two divided black pixel period is divided by the scan line is obtained.

【0060】このように、この発明の第2の行切出し修
正方法では、この発明の行切出し方法における上記の
(分割修正1)の場合と同様にして、2つの個別の行が
誤って1つの行として切り出されてしまった場合の行切
出しの修正を行なうことができる。また、第16基準値
は、上記の第11基準値と同様に、任意好適な値を設定
すると良い。
As described above, in the second line segmenting and correcting method of the present invention, two individual lines are erroneously changed to one line in the same manner as in the above-described (division modification 1) in the line segmenting method of the present invention. Correction of line cutout when cut out as a line can be performed. Further, as the sixteenth reference value, similarly to the above-described eleventh reference value, any suitable value may be set.

【0061】(行切出し装置)また、この発明の行切出
し装置によれば、文書画像の行方向が不明である場合お
よび文書画像の行方向が第1方向である場合に、第1方
向に直交する第2方向に沿った分割線によって文書画像
を分割することにより、該第1方向に沿って並んだ複数
の第1方向分割領域を生成する第1方向分割領域生成部
と、第1方向分割領域が生成された場合に、当該第1方
向分割領域の各々を、第1方向に沿って走査して、走査
毎の累積黒画素数を検出し、当該累積黒画素数の第2方
向に沿った分布を求めることにより第1方向射影分布を
作成する第1方向射影分布作成部と、第1方向射影分布
が作成された場合に、当該第1方向射影分布の各々にお
いて第1基準値以上の累積黒画素数が第2方向に沿って
連続する区間をそれぞれ第1黒画素区間として、当該第
1黒画素区間が得られる走査領域をそれぞれ第1分割行
として分割行切出しを行なう第1分割行切出し部と、文
書画像の行方向が不明である場合およびこの文書画像の
行方向が第2方向である場合に、第1方向に沿った分割
線によって文書画像を分割することにより、この第1方
向と直交する第2方向に沿って並んだ複数の第2方向分
割領域を生成する第2方向分割領域生成部と、第2方向
分割領域が生成された場合に 当該第2方向分割領域の
各々を、第2方向に沿って走査して、走査毎の累積黒画
素数を検出し、当該累積黒画素数の第1方向に沿った分
布を求めることにより第2方向射影分布を作成する第2
方向射影分布作成部と、第2方向射影分布が作成された
場合に、当該第2方向射影分布の各々において第2基準
値以上の累積黒画素数が第1方向に沿って連続する区間
をそれぞれ第2黒画素区間として、当該第2黒画素区間
が得られる走査領域をそれぞれ第2分割行として分割行
切出しを行なう第2分割行切出し部と、文書画像の行方
向が不明である場合に、第1方向射影分布と第2方向射
影分布とに基づいて、文書画像の行方向を判定する行方
向判定部と、文書画像の行方向が第1方向である場合
に、第1方向で互いに隣接する第1方向分割領域にそれ
ぞれ含まれる分割行どうしであって、当該分割行を走査
して得られた第1黒画素区間の少なくとも一部分どうし
が重なっている分割行どうしを接続して行切出しを行な
う第1分割行接続部と、文書画像の行方向が第2方向で
ある場合に、第2方向で互いに隣接する第2方向分割領
域にそれぞれ含まれる分割行どうしであって、当該分割
行を走査して得られた第2黒画素区間の少なくとも一部
分どうしが重なっている分割行どうしを接続して行切出
しを行なう第2分割行接続部とを具えてなることを特徴
とする。
(Line clipping device) According to the line clipping device of the present invention, when the line direction of the document image is unknown or when the line direction of the document image is the first direction, the line is orthogonal to the first direction. A first direction divided region generating unit that generates a plurality of first direction divided regions arranged along the first direction by dividing the document image by dividing lines along the second direction; When an area is generated, each of the first direction divided areas is scanned in the first direction to detect the cumulative number of black pixels for each scan, and is then scanned along the second direction of the cumulative number of black pixels. A first-direction projection distribution creating unit for creating a first-direction projection distribution by calculating a first-direction projection distribution, and, when the first-direction projection distribution is created, a first reference value or more in each of the first-direction projection distributions A section in which the cumulative number of black pixels is continuous along the second direction is In the case where the scanning direction in which the first black pixel section is obtained is the first division row, a first division line extraction section that performs division line extraction as the first black pixel section, and the line direction of the document image is unknown And when the row direction of the document image is the second direction, by dividing the document image by a dividing line along the first direction, a plurality of lines arranged along a second direction orthogonal to the first direction. A second direction divided area generating unit for generating a second direction divided area, and, when the second direction divided area is generated, each of the second direction divided areas is scanned along the second direction, and each scan is performed. The second direction projection distribution is created by detecting the cumulative number of black pixels in the first direction and calculating the distribution of the cumulative number of black pixels along the first direction.
A direction projection distribution creating unit, and when a second direction projection distribution is created, a section in each of the second direction projection distributions in which the cumulative number of black pixels equal to or greater than a second reference value continues along the first direction. As a second black pixel section, a second divided line cutout unit that performs a divided line cutout using a scan area in which the second black pixel section is obtained as a second divided line, and a case where the line direction of the document image is unknown, A line direction determination unit that determines a line direction of the document image based on the first direction projection distribution and the second direction projection distribution, and a line direction determination unit that is adjacent to each other in the first direction when the line direction of the document image is the first direction The divided lines included in the first direction divided regions are connected to each other, and at least a part of the first black pixel section obtained by scanning the divided lines overlaps with each other to perform line segmentation. First split row connection to be performed When the line direction of the document image is the second direction, the divided lines included in the second direction divided areas adjacent to each other in the second direction are the second divided lines obtained by scanning the divided lines. And a second divided row connection unit that connects divided rows in which at least a part of the black pixel sections overlap each other to perform line segmentation.

【0062】このように、この発明の行切出し装置によ
れば、上述のこの発明の行切出し方法と同様にして、文
書画像の行方向が不明である場合でも、事前に行切出し
とは別個に行方向を判定する処理を行なうことなく、行
切出しを行なうことができる。
As described above, according to the line segmenting apparatus of the present invention, even if the line direction of the document image is unknown, the line segmenting apparatus of the present invention is separately provided separately from the line segmenting method. Line cutout can be performed without performing the process of determining the line direction.

【0063】(行方向判定部1)また、この発明の行切
出し装置の実施にあたり、好ましくは、行方向判定部
は、第1黒画素区間の各々の長さをそれぞれ第1黒画素
区間長として、当該第1黒画素区間長のばらつきを算出
する第1ばらつき算出部と、第2黒画素区間の各々の長
さをそれぞれ第2黒画素区間長として、当該第2黒画素
区間長のばらつきを算出する第2ばらつき算出部と、第
1黒画素区間長のばらつきと第2黒画素区間長のぱらつ
きとを比較して、当該第1黒画素区間長のばらつきと当
該第2黒画素区間長のばらつきとの比率が第3基準値以
上の場合に、ばらつきの小さい方の黒画素区間長が得ら
れた射影分布の走査方向を行方向と判定するばらつき比
較判定部とを具えてなると良い。
(Row Direction Determining Unit 1) In implementing the line extracting apparatus of the present invention, preferably, the row direction determining unit sets each of the first black pixel sections as a first black pixel section length. A first variation calculation unit that calculates the variation of the first black pixel section length, and sets the length of each of the second black pixel sections as the second black pixel section length, and calculates the variation of the second black pixel section length. The calculated second variation calculation unit compares the variation of the first black pixel section length with the variation of the second black pixel section length to determine the variation of the first black pixel section length and the variation of the second black pixel section length. When the ratio with the variation is equal to or more than the third reference value, a variation comparison / determination unit that determines the scanning direction of the projection distribution from which the black pixel section length with the smaller variation is obtained as the row direction may be provided.

【0064】このように、この行方向判定部(行方向判
定部1)を設ければ、上述のこの発明の行方向判定方法
における(黒画素区間長のばらつきによる行方向判定)
の欄で説明したように、行方向の判定の確実化を図るこ
とができる。
As described above, if the row direction determining section (row direction determining section 1) is provided, the row direction determining method of the present invention described above (row direction determination based on variation in black pixel section length).
As described in the section, the determination of the row direction can be reliably performed.

【0065】(行方向判定部2)さらに、この発明の行
切出し装置の実施にあたり、好ましくは、行間隔および
文字間隔に着目することにより、行方向判定部は、第1
黒画素区間長のばらつきと第2黒画素区間長のばらつき
との比率が第3基準値未満の場合に、第1方向射影分布
において隣り合った第1黒画素区間どうしの間の第1白
画素区間の長さと、第2方向射影分布において隣り合っ
た第2黒画素区間どうしの間の第2白画素区間の長さと
を利用して行方向を判定するのが良い。
(Line Direction Judgment Unit 2) Further, in implementing the line cutout apparatus of the present invention, preferably, the line direction judgment unit performs the first line-by-line judgment by focusing on the line interval and the character interval.
When the ratio of the variation of the black pixel section length to the variation of the second black pixel section length is less than the third reference value, the first white pixel between adjacent first black pixel sections in the first direction projection distribution. The row direction may be determined using the length of the section and the length of the second white pixel section between adjacent second black pixel sections in the second direction projection distribution.

【0066】ところで、第1および第2黒画素区間長の
ばらつきどうしを比較しない場合であっても、行間隔お
よび文字間隔に着目することにより、行方向の判定が可
能となる。
By the way, even if the first and second black pixel section length variations are not compared, the line direction can be determined by paying attention to the line interval and the character interval.

【0067】そこで、この発明の行切出し装置の実施に
あたり、好ましくは、行方向判定部は、第1方向射影分
布において隣り合った第1黒画素区間どうしの間の第1
白画素区間の長さと、第2方向射影分布において隣り合
った第2黒画素区間どうしの間の第2白画素区間の長さ
とを利用して行方向を判定するのが良い。
Therefore, in implementing the line segmenting apparatus of the present invention, it is preferable that the line direction judging section sets the first direction between adjacent first black pixel sections in the first direction projection distribution.
It is preferable to determine the row direction using the length of the white pixel section and the length of the second white pixel section between adjacent second black pixel sections in the second direction projection distribution.

【0068】さらに、第1および第2白画素区間の長さ
を利用して、行方向を判定するにあたり、行方向判定部
は、第1黒画素区間長のばらつきと第2黒画素区間長の
ばらつきとの比率が第3基準値未満の場合に、第1方向
射影分布において隣り合った第1黒画素区間どうしの間
の第1白画素区間が1箇所の場合には、当該第1白画素
区間の長さを第1平均白画素区間長とし、かつ、この第
1白画素区間が複数箇所の場合には、当該第1白画素区
間の各々の長さの相加平均を第1平均白画素区間長とし
て算出する第1平均白画素区間長算出部と、第2方向射
影分布において隣り合った第2黒画素区間どうしの間の
第2白画素区間が1箇所の場合には、当該第2白画素区
間の長さを第2平均白画素区間長とし、かつ、この第2
白画素区間が複数箇所の場合には、当該第2白画素区間
の各々の長さの相加平均を第2平均白画素区間長として
算出する第2平均白画素区間長算出部と、第1平均白画
素区間長と第2平均白画素区間長とを比較して、より大
きな平均値の白画素区間の得られた射影分布の走査方向
を行方向と判定する平均値比較判定部とを具えてなるの
が良い。
Further, in determining the row direction by using the lengths of the first and second white pixel sections, the row direction determination section determines whether the variation in the first black pixel section length and the second black pixel section length are different. If the ratio with the variation is less than the third reference value, and if there is one first white pixel section between adjacent first black pixel sections in the first direction projection distribution, the first white pixel When the length of the section is the first average white pixel section length, and when there are a plurality of the first white pixel sections, the arithmetic mean of the respective lengths of the first white pixel section is calculated as the first average white pixel section. When the first average white pixel section length calculation unit that calculates the pixel section length and the second white pixel section between adjacent second black pixel sections in the second direction projection distribution are one place, The length of the two white pixel sections is defined as a second average white pixel section length, and
When there are a plurality of white pixel sections, a second average white pixel section length calculation unit that calculates an arithmetic mean of the lengths of the second white pixel sections as a second average white pixel section length; An average value comparison / determination unit that compares the average white pixel section length with the second average white pixel section length and determines the scanning direction of the obtained projected distribution of the white pixel section having a larger average value as the row direction. It is good to get it.

【0069】このように、この行方向判定部(行方向判
定部2)を設ければ、上述のこの発明の行方向判定方法
における(平均白画素区間長による行方向判定)の欄で
説明したように、行方向の判定の確実化を図ることがで
きる。
As described above, if the row direction determining section (row direction determining section 2) is provided, the description has been given in the section of (row direction determination based on average white pixel section length) in the above-described row direction determining method of the present invention. As described above, it is possible to reliably determine the row direction.

【0070】(行方向判定部3)また、この発明の行切
出し装置の実施にあたり、好ましくは、行方向判定部
は、第1方向分割領域の数の合計を第1分割領域数とし
て求める第1分割領域数計数部と、第1黒画素区間の数
の、全ての第1方向分割領域にわたっての合計を第1黒
画素区間数として求める第1黒画素区間数計数部と、第
2方向分割領域の数の合計を第2分割領域数として求め
る第2分割領域数計数部と、第2黒画素区間の数の、全
ての第2方向分割領域にわたっての合計を第2黒画素区
間数として求める第2黒画素区間数計数部と、第1黒画
素区間数とこの第1分割領域数とが一致し、かつ、第2
黒画素区間数と第2分割領域数とが不一致の場合に、行
方向を第1方向と判定し、または、第2黒画素区間数と
この第2分割領域数とが一致し、かつ、第1黒画素区間
数と第1分割領域数とが不一致の場合に、行方向を第2
方向と判定する区間数分割数比較判定部と、を具えてな
るのが良い。
(Line Direction Determining Unit 3) In implementing the line segmenting device of the present invention, preferably, the line direction determining unit obtains the total number of the first direction divided regions as the first divided region number. A division region number counting section, a first black pixel section number counting section for calculating the total number of first black pixel sections over all the first direction division regions as a first black pixel section number, and a second direction division region And a second divided area number counting unit that calculates the total number of the second divided pixel areas as the number of the second divided area, and a second divided pixel number that calculates the sum of the number of the second black pixel sections over all the second direction divided areas as the second black pixel area number. 2 black pixel section number counting section, the first black pixel section number is equal to the first divided area number, and
If the number of black pixel sections does not match the number of second divided areas, the row direction is determined to be the first direction, or the number of second black pixel sections and the number of second divided areas match, and If the number of 1 black pixel sections does not match the number of the first divided areas, the row direction is changed to the second
And a section number division number comparison / determination unit for determining the direction.

【0071】このように、この行方向判定部(行方向判
定部3)を設ければ、上述のこの発明の行方向判定方法
における(1行のみの場合の行方向判定)の欄で説明し
たように、文書画像に含まれる行数が1行の場合に容易
に行方向を判定することができる。
As described above, if the row direction determining section (row direction determining section 3) is provided, the description has been given in the section of (row direction determination for only one row) in the above-described row direction determining method of the present invention. As described above, when the number of lines included in the document image is one, the line direction can be easily determined.

【0072】(分割行接続部)また、この発明の行切出
し装置の実施にあたり、好ましくは、第1分割行接続部
は、分割領域に含まれる第1方向分割行の第1黒画素区
間の一部分が、当該分割領域と隣接する他の1つの分割
領域に含まれる2つの第1分割行の第1黒画素区間の一
部分とそれぞれ重なっている場合に、重なっている区間
の長さが第4基準値よりも長い分割行どうしを接続し、
第2分割行接続部は、分割領域に含まれる第2方向分割
行の第2黒画素区間の一部分が、当該分割領域と隣接す
る他の1つの分割領域に含まれる2つの第2分割行の第
2黒画素区間の一部分とそれぞれ重なっている場合に、
重なっている区間の長さが第5基準値よりも長い分割行
どうしを接続すると良い。
(Division Row Connection) In implementing the line segmentation device of the present invention, preferably, the first division row connection is a part of the first black pixel section of the first direction division row included in the division region. Are respectively overlapped with a part of the first black pixel section of two first divided rows included in another divided area adjacent to the divided area, and the length of the overlapping section is the fourth reference. Connect split lines longer than the value,
The second divided row connection unit is configured such that a part of the second black pixel section of the second direction divided row included in the divided area includes two second divided rows included in another divided area adjacent to the divided area. When each overlaps with a part of the second black pixel section,
It is preferable to connect divided rows in which the length of the overlapping section is longer than the fifth reference value.

【0073】このように、この第1分割行接続部および
第2分割行接続部を設ければ、上述のこの発明の行方向
判定方法における(分割行の接続)の欄で説明したよう
に、分割行を適切に接続して行切出しを行なうことがで
きる。
As described above, if the first divided row connection section and the second divided row connection section are provided, as described in the section (connection of divided rows) in the above-described row direction determination method of the present invention, Line segmentation can be performed by appropriately connecting the divided lines.

【0074】(第1統合修正部)また、この発明の行切
出し装置の実施にあたり、好ましくは、行切出しの修正
を行なう第1統合修正部を具え、この第1統合修正部
は、第1分割行切出し部において切り出された第1分割
行の第1黒画素区間の長さ(以下、第1黒画素区間長と
も称する。)の相加平均を第1平均黒画素区間長として
求める第1平均黒画素区間長算出部と、この第1平均黒
画素区間長と第1黒画素区間長とを比較して、第1黒画
素区間のうち、第1平均黒画素区間長に対する第1黒画
素区間長の比率が第6基準値よりも小さな第1黒画素区
間を第1候補区間として選択する第1候補区間選択部
と、この第1候補区間の一方の側の直近の第1黒画素区
間である第1候補黒画素区間とこの第1候補区間とを一
つの連続した黒画素区間とした場合の当該黒画素区間を
第1統合区間とし、当該第1統合区間の長さを求める第
1統合区間長検出部と、この第1統合区間の長さと第1
平均黒画素区間長との差の大きさを第1統合区間長誤差
として求める第1統合区間長誤差算出部と、この第1候
補区間の他方の側の直近の第1黒画素区間である第2候
補黒画素区間とこの第1候補区間とを1つの連続した黒
画素区間とした場合の当該黒画素区間を第2統合区間と
し、当該第2統合区間の長さを求める第2統合区間長検
出部と、この第2統合区間の長さと第1平均黒画素区間
長との差の大きさを第2統合区間長誤差として求める第
2統合区間長誤差算出部と、第1統合区間長誤差と第2
統合区間長誤差とを比較して、誤差の小さい方の統合区
間を第1選択統合区間として選択する第1選択統合区間
選択部と、この第1選択統合区間のうちの、第1候補区
間と当該第1候補区間の直近の第1黒画素区間との間の
第1白画素区間の長さを求める第1白画素区間長検出部
と、この第1白画素区間の長さと第7基準値とを比較し
て、当該第1白画素区間の長さが当該第7基準値よりも
短い場合に、第1選択統合区間を1つの連続した第1黒
画素区間とすることにより、行切出しの修正を行なう第
1統合部とを具えてなると良い。
(First Integrated Correction Unit) In implementing the line extracting apparatus of the present invention, preferably, a first integrated correction unit for correcting line extraction is provided. A first average for calculating an arithmetic average of the length of the first black pixel section (hereinafter, also referred to as the first black pixel section length) of the first divided row cut out by the row cutout section as the first average black pixel section length. A black pixel section length calculation unit compares the first average black pixel section length with the first black pixel section length, and determines the first black pixel section of the first black pixel section with respect to the first average black pixel section length. A first candidate section selection unit that selects a first black pixel section whose length ratio is smaller than a sixth reference value as a first candidate section, and a first black pixel section closest to one side of the first candidate section. A certain first candidate black pixel section and this first candidate section are defined as one continuous black pixel section. And then the black pixel period when the first integration period, a first integration interval length detector for determining the length of the first integration interval, the length of the first integration period the first
A first integrated section length error calculating unit that obtains the magnitude of the difference from the average black pixel section length as a first integrated section length error, and a first black pixel section that is the nearest first black pixel section on the other side of the first candidate section. When the two candidate black pixel sections and the first candidate section are defined as one continuous black pixel section, the black pixel section is defined as a second integrated section, and the second integrated section length for calculating the length of the second integrated section A detecting unit, a second integrated section length error calculating unit that obtains a magnitude of a difference between the length of the second integrated section and the first average black pixel section length as a second integrated section length error, and a first integrated section length error And the second
A first selected integrated section selecting unit that compares the integrated section length error with the integrated section having a smaller error as the first selected integrated section; and a first candidate section of the first selected integrated section. A first white pixel section length detector for calculating a length of a first white pixel section between the first candidate pixel section and a first black pixel section immediately adjacent to the first candidate section; and a length of the first white pixel section and a seventh reference value. When the length of the first white pixel section is shorter than the seventh reference value, the first selection integrated section is set as one continuous first black pixel section, so that line segmentation is performed. Preferably, a first integration unit for performing correction is provided.

【0075】このように、この第1統合修正部を設けれ
ば、上述のこの発明の行方向判定方法における(統合修
正1)の欄で説明したように、分割行切出しの修正が可
能となる。
As described above, if the first integrated correction section is provided, it is possible to correct the divided line cutout as described in the section (integrated correction 1) in the above-described row direction determination method of the present invention. .

【0076】(第2統合修正部)また、この発明の行切
出し装置の実施にあたり、好ましくは、行切出しの修正
を行なう第2統合修正部を具え、この第2統合修正部
は、第2分割行切出し部において切り出された第2分割
行の第2黒画素区間の長さ(以下、第2黒画素区間長と
も称する。)の相加平均を第2平均黒画素区間長として
求める第2平均黒画素区間長算出部と、第2平均黒画素
区間長と第2黒画素区間長とを比較して、第2黒画素区
間のうち、第2平均黒画素区間長に対する第2黒画素区
間長の比率が第8基準値よりも小さな第2黒画素区間を
第2候補区間として選択する第2候補区間選択部と、こ
の第2候補区間の一方の側の直近の第2黒画素区間であ
る第3候補黒画素区間とこの第2候補区間とを一つの連
続した黒画素区間とした場合の当該黒画素区間を第3統
合区間とし、当該第3統合区間の長さを求める第3統合
区間長抽出部と、この第3統合区間の長さと第2平均黒
画素区間長との差の大きさを第3統合区間長誤差として
求める第3統合区間長誤差算出部と、この第2候補区間
の他方の側の直近の第2黒画素区間である第4候補黒画
素区間とこの第2候補区間とを1つの連続した黒画素区
間とした場合の当該黒画素区間を第4統合区間とし、当
該第4統合区間の長さを求める第4統合区間長抽出部
と、この第4統合区間の長さと第2平均黒画素区間長と
の差の大きさを第4統合区間長誤差として求める第4統
合区間長誤差算出部と、第3統合区間長誤差と第4統合
区間長誤差とを比較して、誤差の小さい方の統合区間を
第2選択統合区間として選択する第2選択統合区間選択
部と、この第2選択統合区間のうちの、第2候補区間と
当該第2候補区間の直近の第2黒画素区間との間の第2
白画素区間の長さを求める第2白画素区間長抽出部と、
この第2白画素区間の長さと第9基準値とを比較して、
当該第2白画素区間の長さが当該第10基準値よりも短
い場合に、第2選択統合区間を1つの連続した第2黒画
素区間とすることにより、行切出しの修正を行なう第2
統合部とを具えてなると良い。
(Second Integrated Correction Unit) In implementing the line extracting apparatus of the present invention, preferably, a second integrated correction unit for correcting line extraction is provided. The second average for calculating the arithmetic average of the length of the second black pixel section (hereinafter also referred to as the second black pixel section length) of the second divided row cut out by the row cutout section as the second average black pixel section length. The black pixel section length calculation unit compares the second average black pixel section length with the second black pixel section length, and, among the second black pixel sections, the second black pixel section length with respect to the second average black pixel section length A second black pixel section that selects a second black pixel section whose ratio is smaller than the eighth reference value as a second candidate section, and a second black pixel section closest to one side of the second candidate section. The third candidate black pixel section and the second candidate section are defined as one continuous black pixel section. In this case, the black pixel section is referred to as a third integrated section, and a third integrated section length extraction unit for calculating the length of the third integrated section; and a third integrated section length and a second average black pixel section length. A third integrated section length error calculating unit that obtains the magnitude of the difference as a third integrated section length error, a fourth candidate black pixel section that is the second black pixel section closest to the other side of the second candidate section, and When the second candidate section is defined as one continuous black pixel section, the black pixel section is referred to as a fourth integrated section, and a fourth integrated section length extraction unit for calculating the length of the fourth integrated section; A fourth integrated section length error calculating section for obtaining a magnitude of a difference between the length of the integrated section and the second average black pixel section length as a fourth integrated section length error, a third integrated section length error and a fourth integrated section length error And selecting the integrated section having the smaller error as the second selected integrated section. And integrating section selecting unit, the second between the one of the second selection integration section, a second candidate section and the nearest second black pixel interval of the second candidate section
A second white pixel section length extraction unit for determining the length of the white pixel section;
By comparing the length of the second white pixel section with the ninth reference value,
When the length of the second white pixel section is shorter than the tenth reference value, the second selection integrated section is set as one continuous second black pixel section, thereby correcting the line segmentation.
It is good to have an integration unit.

【0077】このように、この第2統合修正部を設けれ
ば、上述のこの発明の行方向判定方法における(統合修
正2)の欄で説明したように、分割行切出しの修正が可
能となる。
As described above, if the second integrated correction unit is provided, it is possible to correct the divided line cutout as described in the column of (integrated correction 2) in the above-described row direction determination method of the present invention. .

【0078】(第1分割修正部)また、この発明の行切
出し装置の実施にあたり、好ましくは、行切出しの修正
を行なう第1分割修正部を具え、この第1分割修正部
は、第1分割行切出し部において切り出された第1分割
行の第1黒画素区間の長さ(以下、第1黒画素区間長と
も称する。)の相加平均を第1平均黒画素区間長として
求める第1平均黒画素区間長算出部と、第1平均黒画素
区間長と第1黒画素区間長とを比較して、第1黒画素区
間のうち、第1平均黒画素区間長に対する第1黒画素区
間長の比率が第11基準値よりも大きな第1黒画素区間
を第1分割候補区間として選択する第1分割候補区間選
択部と、走査線のうち第1分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、第1
方向に沿って最も一方寄りの位置を第1位置として求め
る第1位置抽出部と、第1位置のうち、第1方向に沿っ
て最も他方寄りの第1位置を最寄第1位置として求める
最寄第1位置抽出部と、走査線のうち第1分割候補区間
の中央付近を走査する走査線上で黒画素の検出される位
置のうち、第2方向に沿って最も他方寄りの位置を第2
位置として求める第2位置抽出部と、第2位置のうち、
第2方向に沿って最も一方寄りの第2位置を最寄第2位
置として求める最寄第2位置抽出部と、最寄第1位置と
最寄第2位置とを比較して、この最寄第1位置がこの最
寄第2位置よりも他方側である場合およびこの最寄第1
位置とこの最寄第2位置とが第2方向に沿った同一直線
上に位置する場合に、第1分割候補区間を、当該第1分
割候補区間の中央で2つに分割させて2つの分割黒画素
区間を生成することにより、行切出しの修正を行なう第
1分割部と、最寄第1位置と最寄第2位置とを比較し
て、この最寄第1位置がこの最寄第2位置よりも一方側
である場合に、この最寄第1位置とこの最寄第2位置と
の中間を通りかつ第2方向に沿った分割線で第1分割候
補区間を分割することにより、一方側の第一方分割領域
および他方側の他方分割領域を生成し、一方分割領域を
最寄第2位置が得られた走査線によって分割して2つの
分割黒画素区間を生成し、かつ、他方分割領域を最寄第
1位置が得られた走査線によって分割して2つの分割黒
画素区間を生成することにより行切出しの修正を行なう
第2分割部とを具えてなると良い。
(First Division Correction Unit) In implementing the line segmentation apparatus of the present invention, preferably, a first division modification unit for correcting line segmentation is provided, and the first division modification unit is provided with a first division modification unit. A first average for calculating an arithmetic average of a length of a first black pixel section (hereinafter, also referred to as a first black pixel section length) of a first divided row cut out by the row cutout unit as a first average black pixel section length. The black pixel section length calculation unit compares the first average black pixel section length with the first black pixel section length, and, among the first black pixel sections, the first black pixel section length with respect to the first average black pixel section length A first division candidate section selection unit that selects a first black pixel section having a ratio of greater than the eleventh reference value as a first division candidate section, and a scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines Of the positions where black pixels are detected in
A first position extraction unit that determines a position closest to one side along the direction as a first position, and a first position extraction unit that determines a first position closest to the other side along the first direction as a first position among the first positions. A first position extracting unit that determines a position of the black line on the scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines in the second direction and a position closest to the other side in the second direction;
A second position extracting unit to be obtained as a position;
By comparing the nearest second position with the nearest second position extracting unit that determines the nearest second position along the second direction as the nearest second position, it compares the nearest second position with the nearest second position. When the first position is on the other side of the nearest second position and when the nearest first position is
When the position and the nearest second position are located on the same straight line along the second direction, the first division candidate section is divided into two at the center of the first division candidate section to be divided into two. By generating a black pixel section, the first division unit that corrects line segmentation is compared with the nearest first position and the nearest second position, and the nearest first position is determined as the nearest second position. When the first division candidate section is located on one side of the position, the first division candidate section is divided by a division line passing through the middle between the nearest first position and the nearest second position and extending in the second direction. A first divided region on the side and the other divided region on the other side are generated, and the one divided region is divided by a scanning line from which the nearest second position is obtained to generate two divided black pixel sections, and The divided area is divided by the scanning line from which the nearest first position is obtained to generate two divided black pixel sections. It may become comprises a second division unit to correct the line cut by the.

【0079】このように、この第1分割修正部を設けれ
ば、上述のこの発明の行方向判定方法における(分割修
正1)の欄で説明したように、分割行切出しの修正が可
能となる。
As described above, if the first division correction unit is provided, it is possible to correct the division line cutout as described in the (division correction 1) section in the above-described row direction determination method of the present invention. .

【0080】(第2分割修正部)また、この発明の行切
出し装置の実施にあたり、好ましくは、行切出しの修正
を行なう第2分割修正部を具え、この第2分割修正部
は、第2分割行切出し部において切り出された第2分割
行の第2黒画素区間の長さ(以下、第2黒画素区間長と
も称する。)の相加平均を第2平均黒画素区間長として
求める第2平均黒画素区間長算出部と、第2平均黒画素
区間長と第2黒画素区間長とを比較して、第2黒画素区
間のうち、第2平均黒画素区間長に対する第2黒画素区
間長の比率が第12基準値よりも大きな第2黒画素区間
を第2分割候補区間として選択する第2分割候補区間選
択部と、走査線のうち第2分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、第2
方向に沿って最も一方寄りの位置を第3位置として求め
る第3位置抽出部と、第3位置のうち、第2方向に沿っ
て最も他方寄りの第3位置を最寄第3位置として求める
最寄第3位置抽出部と、走査線のうち第2分割候補区間
の中央付近を走査する走査線上で黒画素の検出される位
置のうち、第1方向に沿って最も他方寄りの位置を第4
位置として求める第4位置抽出部と、第4位置のうち、
第1方向に沿って最も一方寄りの第4位置を最寄第4位
置として求める最寄第4位置抽出部と、最寄第3位置と
最寄第4位置とを比較して、この最寄第3位置がこの最
寄第4位置よりも他方側である場合に、第2分割候補区
間を、当該第2分割候補区間の中央で2つに分割させて
2つの分割黒画素区間を生成することにより、行切出し
の修正を行なう第3分割部と、最寄第3位置と最寄第4
位置とを比較して、この最寄第3位置がこの最寄第4位
置よりも一方側である場合およびこの最寄第3位置とこ
の最寄第4位置とが第1方向に沿った同一直線上に位置
する場合に、この最寄第3位置とこの最寄第4位置との
中間を通りかつ第1方向に沿った分割線で第2分割候補
区間を分割することにより、一方側の第一方分割領域お
よび他方側の他方分割領域を生成し、一方分割領域を最
寄第4位置が得られた走査線によって分割して2つの分
割黒画素区間を生成し、かつ、他方分割領域を最寄第3
位置が得られた走査線によって分割して2つの分割黒画
素区間を生成することにより行切出しの修正を行なう第
4分割部とを具えてなると良い。
(Second Division Correction Unit) In implementing the line segmentation apparatus of the present invention, preferably, a second division modification unit for correcting line segmentation is provided, and the second division modification unit is provided with a second division modification unit. The second average for calculating the arithmetic average of the length of the second black pixel section (hereinafter also referred to as the second black pixel section length) of the second divided row cut out by the row cutout section as the second average black pixel section length. The black pixel section length calculation unit compares the second average black pixel section length with the second black pixel section length, and, among the second black pixel sections, the second black pixel section length with respect to the second average black pixel section length And a second division candidate section selecting unit that selects a second black pixel section having a ratio greater than the twelfth reference value as a second division candidate section, and a scanning line that scans the vicinity of the center of the second division candidate section among the scanning lines. Out of the positions where black pixels are detected in
A third position extracting unit that determines a position closest to one side along the direction as the third position, and a third position extracting unit that determines a third position closest to the other side along the second direction among the third positions as the closest third position. A third position extracting unit that determines a position closest to the other side in the first direction among positions where black pixels are detected on a scanning line that scans the vicinity of the center of the second division candidate section among the scanning lines as a fourth position;
A fourth position extracting unit to be determined as a position;
The nearest fourth position extracting unit that determines the fourth position closest to the first position along the first direction as the nearest fourth position is compared with the nearest third position and the nearest fourth position, and the nearest fourth position is extracted. When the third position is on the other side of the nearest fourth position, the second division candidate section is divided into two at the center of the second division candidate section to generate two divided black pixel sections. Thus, the third division for correcting the line segmentation, the nearest third position and the nearest fourth
The third position is closer to the first position than the fourth position, and the third position and the fourth position are the same in the first direction. When the second candidate section is located on a straight line, the second candidate section is divided by a dividing line passing through the middle between the nearest third position and the nearest fourth position and extending along the first direction. A first divided region and another divided region on the other side are generated, and one divided region is divided by a scanning line at which a nearest fourth position is obtained to generate two divided black pixel sections, and 3rd nearest
It is preferable to include a fourth division unit that corrects line segmentation by generating two divided black pixel sections by dividing the scanning line whose position has been obtained.

【0081】このように、この第2分割修正部を設けれ
ば、上述のこの発明の行方向判定方法における(分割修
正2)の欄で説明したように、分割行切出しの修正が可
能となる。
As described above, if the second division correction unit is provided, the division line extraction can be corrected as described in the section (division correction 2) in the above-described row direction determination method of the present invention. .

【0082】(行方向確認切替部および切替出力部)ま
た、この発明の行切出し装置の実施にあたり、好ましく
は、外部から当該行切出し装置に入力された文書画像の
情報に当該文書画像の行方向を示す情報が付与されてい
るか否かを確認し、行方向が第1方向であることを示す
情報が付与されている場合には、当該文書画像の情報を
第1分割領域生成部へ送出し、行方向が第2方向である
ことを示す情報が付与されている場合には、当該文書画
像の情報を第2分割領域生成部へ送出し、または、行方
向を示す情報が非付与の場合には、当該文書画像の情報
を第1および第2分割領域生成部へ送出する行方向確認
切替部と、行方向判定部において、行方向が第1方向で
あると判定された場合には、第1分割行切出し部から得
られた情報を出力し、行方向が第2方向であると判定さ
れた場合には、第2分割行切出し部から得られた情報を
出力する切替出力部とを具えてなると良い。
(Line Direction Confirmation Switching Unit and Switching Output Unit) In implementing the line segmentation device of the present invention, it is preferable that the information of the document image externally input to the line segmentation device include the line direction of the document image. It is checked whether or not the information indicating that the line direction is the first direction is sent. If the information indicating that the line direction is the first direction is added, the information of the document image is transmitted to the first divided area generating unit. If the information indicating that the line direction is the second direction is added, the information of the document image is sent to the second divided area generating unit, or the information indicating the line direction is not added. In a case where the line direction confirmation switching unit that sends information of the document image to the first and second divided region generation units and the line direction determination unit determines that the line direction is the first direction, Outputs information obtained from the first segmented line segmentation unit , The row direction if it is determined that the second direction, may become comprises a switching output unit for outputting information obtained from the second division line cutout portion.

【0083】このように、行方向確認切替部を具えれ
ば、文書画像に付与された情報によって、文書画像の情
報の送出先を選択することができる。また、切替出力部
を具えれば、行方向が判定された場合に、判定された行
方向の行切出しに必要な情報のみを得ることができる。
As described above, if the line direction confirmation switching unit is provided, it is possible to select the transmission destination of the information of the document image according to the information added to the document image. In addition, when the switching output unit is provided, when the row direction is determined, it is possible to obtain only information necessary for cutting out the row in the determined row direction.

【0084】尚、行方向確認切替部および切替出力部
は、行切出し装置の外付けであっても良い。
Note that the line direction confirmation switching unit and the switching output unit may be external to the line cutout device.

【0085】(第1の行切出し修正装置)また、この発
明の第1の行切出し修正装置によれば、文書画像の行方
向に実質的に沿った第1方向に沿って文書画像を走査し
て、走査毎の累積黒画素数を検出し、当該累積黒画素区
間数の第2方向に沿った分布を求めることにより射影分
布を作成し、当該射影分布において第13基準値以上の
累積黒画素数の射影部分が第2方向に連続する各黒画素
区間が得られる走査領域をそれぞれ1つの行領域として
行切出しを行なって得られた行の切出しを修正する行切
出し修正装置であって、切り出された行領域の黒画素区
間の長さ(以下、黒画素区間長とも称する。)の平均黒
画素区間長を求める平均黒画素区間長算出部と、平均黒
画素区間長と黒画素区間長とを比較して、黒画素区間の
うち、平均黒画素区間長に対する黒画素区間長の比率が
第14基準値よりも小さな黒画素区間を候補区間として
選択する候補区間選択部と、この候補区間の一方の側の
直近の黒画素区間である第1候補黒画素区間とこの候補
区間とを一つの連続した黒画素区間とした場合の当該黒
画素区間を第1統合区間とし、当該第1統合区間の長さ
を求める第1統合区間長抽出部と、この第1統合区間の
長さと平均黒画素区間長との差の大きさを第1統合区間
長誤差として求める第1統合区間長誤差算出部と、この
候補区間の他方の側の直近の黒画素区間である第2候補
黒画素区間とこの候補区間とを1つの連続した黒画素区
間とした場合の当該黒画素区間を第2統合区間とし、当
該第2統合区間の長さを求める第2統合区間長抽出部
と、この第2統合区間の長さと平均黒画素区間長との差
の大きさを第2統合区間長誤差として求める第2統合区
間長誤差算出部と、第1統合区間長誤差と第2統合区間
長誤差とを比較して、誤差の小さい方の統合区間を選択
統合区間として選択する選択統合区間選択部と、選択統
合区間のうちの候補区間と当該候補区間の直近の黒画素
区間との間の白画素区間の長さを求める白画素区間長抽
出部と、白画素区間の長さと第15基準値とを比較し
て、当該白画素区間の長さが当該第15基準値よりも短
い場合に、選択統合区間を1つの連続した黒画素区間と
することにより、行切出しの修正を行なう統合部とを具
えてなることを特徴とする。
(First Line Cutout Correcting Apparatus) According to the first line cutout correcting apparatus of the present invention, the document image is scanned in the first direction substantially along the line direction of the document image. The projection distribution is created by detecting the cumulative number of black pixels for each scan, and calculating the distribution of the cumulative number of black pixel sections along the second direction. A line cutout correction device for correcting a line cutout obtained by performing line cutout using a scanning region in which each black pixel section in which a number of projected portions are continuous in the second direction as one line region, and An average black pixel section length calculation unit for calculating an average black pixel section length of a black pixel section length (hereinafter, also referred to as a black pixel section length) of the selected row area; And compare the average black pixel A candidate section selection unit that selects a black pixel section in which the ratio of the black pixel section length to the interim length is smaller than the fourteenth reference value as a candidate section, and a first candidate that is the nearest black pixel section on one side of the candidate section When the black pixel section and the candidate section are set as one continuous black pixel section, the black pixel section is defined as a first integrated section, and a first integrated section length extraction unit that determines the length of the first integrated section; A first integrated section length error calculating section for obtaining the magnitude of the difference between the length of the first integrated section and the average black pixel section length as a first integrated section length error, and a nearest black pixel on the other side of the candidate section When the second candidate black pixel section, which is a section, and this candidate section are defined as one continuous black pixel section, the black pixel section is defined as a second integrated section, and the second integration for obtaining the length of the second integrated section is performed. The section length extraction unit, the length of the second integrated section and the average black A second integrated section length error calculating unit that obtains the magnitude of the difference from the elementary section length as a second integrated section length error is compared with the first integrated section length error and the second integrated section length error. A selection integration section selection unit that selects one of the integration sections as a selection integration section, and a white pixel that determines the length of a white pixel section between a candidate section of the selection integration section and the nearest black pixel section of the candidate section The section length extraction unit compares the length of the white pixel section with the fifteenth reference value. If the length of the white pixel section is shorter than the fifteenth reference value, the selected integrated section is converted into one continuous black It is characterized in that the pixel section is provided with an integration unit for correcting line segmentation.

【0086】このように、この発明の第1の行切出し修
正装置によれば、1つの行が誤って2つの行として切り
出さてしまった場合に、上述のこの発明の第1の行切出
し修正方法と同様にして、行切出しの修正を行なうこと
ができる。
As described above, according to the first line segmentation correcting apparatus of the present invention, when one line is mistakenly segmented as two lines, the first line segmentation correcting method of the present invention described above. In the same manner as described above, the line cutout can be corrected.

【0087】(第2の行切出し修正装置)また、この発
明の第2の行切出し修正装置によれば、文書画像の行方
向に実質的に沿った第1方向に沿って文書が層を走査し
て走査毎の累積黒画素数を検出し、当該累積黒画素数の
第1方向と直交する第2方向に沿った分布を求めること
により射影分布を作成し、当該射影分布において第16
基準値以上の累積黒画素数の射影部分が第2方向に連続
する各黒画素区間が得られる走査領域をそれぞれ1つの
行領域として行切出しを行なって得られた行の切出しを
修正する行切出し修正装置であって、切り出された行領
域の黒画素区間の長さ(以下、黒画素区間長とも称す
る。)の平均黒画素区間長を求める平均黒画素区間長算
出部と、平均黒画素区間長と黒画素区間長とを比較し
て、黒画素区間のうち、平均黒画素区間長に対する黒画
素区間長の比率が第17基準値よりも大きな黒画素区間
を分割候補区間として選択する分割候補区間選択部と、
走査線のうち分割候補区間の中央付近を走査する走査線
上で黒画素の検出される位置のうち、第1方向に沿って
最も一方寄りの位置を第1位置として求める第1位置抽
出部と、第1位置のうち、第1方向に沿って最も他方寄
りの第1位置を最寄第1位置として求める最寄第1位置
抽出部と、走査線のうち分割候補区間の中央付近を走査
する走査線上で黒画素の検出される位置のうち、第2方
向に沿って最も他方寄りの位置を第2位置として求める
第2位置抽出部と、第2位置のうち、第2方向に沿って
最も一方寄りの第2位置を最寄第2位置として求める最
寄第2位置抽出部と、最寄第1位置と最寄第2位置とを
比較して、この最寄第1位置がこの最寄第2位置よりも
他方側である場合およびこの最寄第1位置とこの最寄第
2位置とが第2方向に沿った同一直線上に位置する場合
に、分割候補区間を、当該分割候補区間の中央で2つに
分割させて2つの分割黒画素区間を生成することによ
り、行切出しの修正を行なう第1分割部と、最寄第1位
置と最寄第2位置とを比較して、この最寄第1位置がこ
の最寄第2位置よりも一方側である場合に、この最寄第
1位置とこの最寄第2位置との中間を通りかつ第2方向
に沿った分割線で第1分割候補区間を分割することによ
り、一方側の一方分割領域および他方側の他方分割領域
を生成し、一方分割領域を最寄第2位置が得られた走査
線によって分割して2つの分割黒画素区間を生成し、か
つ、他方分割領域を最寄第1位置が得られた走査線によ
って分割して2つの分割黒画素区間を生成することによ
り行切出しの修正を行なう第2分割部とを具えてなるこ
とを特徴とする。
(Second Line Extraction Correction Device) According to the second line extraction correction device of the present invention, a document scans a layer along a first direction substantially along a line direction of a document image. Then, a projection distribution is created by detecting the cumulative number of black pixels for each scan, and calculating the distribution of the cumulative number of black pixels along a second direction orthogonal to the first direction.
A line segmentation that corrects the segmentation of a line obtained by performing line segmentation using a scanning area in which each black pixel section in which a projected portion having a cumulative number of black pixels equal to or more than the reference value is continuous in the second direction as one row area. An average black pixel section length calculation unit for obtaining an average black pixel section length of a black pixel section length (hereinafter, also referred to as a black pixel section length) of a cut-out row region; The length of the black pixel section is compared with the length of the black pixel section, and a black pixel section in which the ratio of the black pixel section length to the average black pixel section length is greater than the seventeenth reference value is selected as a division candidate section. A section selector,
A first position extracting unit that determines, as a first position, a position closest to the one side along the first direction among positions where black pixels are detected on a scanning line that scans the vicinity of the center of the division candidate section among the scanning lines; Among the first positions, a nearest first position extracting unit that determines the nearest first position along the first direction as the nearest first position, and a scan that scans the vicinity of the center of the division candidate section in the scan line. Among the positions where black pixels are detected on the line, a second position extracting unit that determines the position closest to the other side in the second direction as the second position, and one of the second positions along the second direction. By comparing the nearest second position with the nearest second position extracting unit that determines the nearest second position as the nearest second position, the nearest first position is compared with the nearest second position. When the second position is located on the other side of the second position and the nearest first position and the nearest second position are in the second direction. Is divided into two at the center of the division candidate section to generate two division black pixel sections, thereby correcting the line segmentation. The division unit compares the nearest first position and the nearest second position. If the nearest first position is one side of the nearest second position, the nearest first position and the nearest first position are compared with each other. By dividing the first division candidate section by a division line passing through the middle with the nearest second position and along the second direction, one divided area on one side and the other divided area on the other side are generated. The divided area is divided by the scanning line at which the nearest second position is obtained to generate two divided black pixel sections, and the other divided area is divided by the scanning line at which the nearest first position is obtained. Second division unit that corrects line segmentation by generating two divided black pixel sections Characterized by comprising comprises a.

【0088】このように、この発明の第2の行切出し修
正装置によれば、2つの行が誤って1つの行として切り
出されてしまった場合に、上述のこの発明の第2の行切
出し修正方法と同様にして、行切出しの修正を行なうこ
とができる。
As described above, according to the second line cutout correcting device of the present invention, when two lines are cut out as one line by mistake, the above-mentioned second line cutout correcting device of the present invention is used. In the same manner as in the method, the line segmentation can be corrected.

【0089】[0089]

【発明の実施の形態】以下、図面を参照して、この発明
の行切出し方法、第1および第2の行切出し修正方法、
行切出し装置、および、第1および第2の行切出し修正
装置の実施の形態について併せて説明する。尚、この発
明は、図示例に限定されるものではない。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a first embodiment of the present invention;
An embodiment of a line segmentation device and first and second line segmentation correction devices will be described together. The present invention is not limited to the illustrated example.

【0090】(構成について)先ず、図1を参照して、
この発明の行切出し装置について説明する。図1はこの
実施の形態の行切出し装置の構成の説明に供する機能ブ
ロック図である。尚、行切出し装置10の動作の詳細な
説明は(動作について)の欄で後述する。
(Constitution) First, referring to FIG.
The line cutting device according to the present invention will be described. FIG. 1 is a functional block diagram for explaining the configuration of the line segmenting apparatus according to this embodiment. A detailed description of the operation of the line segmenting device 10 will be described later in the section (Operation).

【0091】この実施の形態の行切出し装置10は、行
方向確認切替部12、第1方向分割領域生成部14a、
第2方向分割領域生成部14b、第1方向射影分布作成
部16a、第2方向射影分布作成部16b、第1分割行
切出し部18a、第2分割行切出し部18b、行方向判
定部20、切替出力部22、第1修正24a、第2修正
部24b、第1分割行接続部26a、第2分割行接続部
26bおよび制御部28を具えている。
The line segmenting apparatus 10 of this embodiment includes a line direction confirmation switching unit 12, a first direction divided area generation unit 14a,
Second direction divided area generation unit 14b, first direction projection distribution creation unit 16a, second direction projection distribution creation unit 16b, first divided line cutout unit 18a, second divided line cutout unit 18b, line direction determination unit 20, switching An output unit 22, a first correction unit 24a, a second correction unit 24b, a first divided row connection unit 26a, a second divided row connection unit 26b, and a control unit 28 are provided.

【0092】そして、この行方向確認切替部12は、行
方向確認部12aと切替部12bとを以って構成してあ
る。この行方向確認部12aは、外部から当該行切出し
装置に入力された文書画像の情報に当該文書画像の行方
向を示す情報が付与されているか否かを確認する。
The row direction confirmation switching section 12 is constituted by a row direction confirmation section 12a and a switching section 12b. The line direction checking unit 12a checks whether information indicating the line direction of the document image is added to the information of the document image input from the outside to the line cutout device.

【0093】ここで、第1方向および第2方向には、互
いに直交した任意の方向をそれぞれ設定することができ
る。例えば、第1方向を横方向(水平方向)とすれば、
第2方向は縦方向(垂直方向)となる。また、第1方向
を縦方向として、第2方向を横方向としても良い。
Here, arbitrary directions orthogonal to each other can be set as the first direction and the second direction. For example, if the first direction is a horizontal direction (horizontal direction),
The second direction is a vertical direction (vertical direction). Further, the first direction may be the vertical direction and the second direction may be the horizontal direction.

【0094】そして、文書画像の情報に、当該文書画像
の行方向が第1方向であることを示す情報が付与されて
いることを、この行方向確認部12aが確認した場合に
は、この切替部12bは、その情報(確認結果)と共
に、当該文書画像の情報を第1方向分割領域生成部14
aへ出力する。
When the line direction confirmation unit 12a confirms that the information indicating that the line direction of the document image is the first direction is added to the information of the document image, the switching is performed. The unit 12b transmits the information of the document image together with the information (confirmation result) to the first direction divided area generation unit 14
Output to a.

【0095】また、この文書画像の情報に、当該文書画
像の行方向が第2方向であることを示す情報が付与され
ていることを、この行方向確認部12aが確認した場合
には、この切替部12bは、その情報(確認結果)と共
に、当該文書画像の情報を第2方向分割領域生成部14
bへ出力する。
When the line direction confirmation unit 12a confirms that information indicating that the line direction of the document image is the second direction is added to the information of the document image, The switching unit 12b outputs the information of the document image together with the information (confirmation result) to the second direction divided area generation unit 14
Output to b.

【0096】また、この文書画像の情報に、当該文書画
像の行方向を示す情報が非付与であることを、この行方
向確認部12aが確認した場合には、この切替部12b
は、当該文書画像の情報を第1および第2方向分割領域
生成部14aおよび14bの両方へ出力する。
When the line direction confirmation unit 12a confirms that the information indicating the line direction of the document image is not added to the information of the document image, the switching unit 12b
Outputs the information of the document image to both the first and second direction divided area generation units 14a and 14b.

【0097】また、第1方向分割領域生成部14aは、
文書画像の行方向が不明である場合および文書画像の行
方向が第1方向である場合に、第2方向に沿った分割線
によって文書画像を分割することにより、第1方向に沿
って並んだ複数の第1方向分割領域を生成する。そし
て、この第1方向分割領域生成部14aは、生成された
第1方向分割領域の情報を第1方向射影分布作成部16
aへ送出する。
Further, the first direction divided area generating section 14a
When the line direction of the document image is unknown and when the line direction of the document image is the first direction, the document image is divided by the dividing line along the second direction, so that the document images are arranged in the first direction. A plurality of first direction divided areas are generated. Then, the first direction divided area generation unit 14a transmits the generated information of the first direction divided area to the first direction projection distribution generation unit 16a.
a.

【0098】また、第1方向射影分布作成部16aは、
第1方向分割領域が生成された場合に、当該第1方向分
割領域の各々を、第1方向に沿って走査して、走査毎の
累積黒画素数を検出し、累積黒画素数の第1方向と直交
する第2方向に沿った分布を求めることにより第1方向
射影分布を作成する。すなわち、第1方向射影分布作成
部16aは、第1方向分割領域が生成された場合に、第
1方向分割領域の各々について、第1方向を主走査方向
とし第2方向を副走査方向として当該第1方向分割領域
を走査して走査毎の累積黒画素数を検出することにより
第1方向射影分布を作成する。そして、第1方向射影分
布作成部16aは、作成された第1方向射影分布の情報
を第1分割行切出し部18aへ送出する。
The first direction projection distribution creating unit 16a
When the first direction divided area is generated, each of the first direction divided areas is scanned along the first direction to detect the cumulative number of black pixels for each scan, and the first cumulative number of black pixels is calculated. A first direction projection distribution is created by obtaining a distribution along a second direction orthogonal to the direction. That is, when the first direction divided area is generated, the first direction projection distribution creating unit 16a sets the first direction as the main scanning direction and the second direction as the sub scanning direction for each of the first direction divided areas. The first direction projection distribution is created by scanning the first direction divided area and detecting the cumulative number of black pixels for each scan. Then, the first direction projection distribution creating unit 16a sends the created information of the first direction projection distribution to the first divided row cutout unit 18a.

【0099】また、第1分割行切出し部18aは、第1
方向射影分布が作成された場合に、当該第1方向射影分
布の各々において第1基準値以上の累積黒画素数が第2
方向に沿って連続する区間をそれぞれ第1黒画素区間と
して、当該第1黒画素区間が得られる走査領域をそれぞ
れ第1分割行として分割行切出しを行なう。そして、第
1分割行切出し部18aは、行方向が第1方向である場
合には、切り出された分割行の情報を第1修正部24a
へ送出する。また、この第1分割行切出し部18aは、
行方向が不明である場合には、切り出された分割行の情
報を行方向判定部20へ送出する。
The first divided line segmenting section 18a
When the directional projection distribution is created, the cumulative number of black pixels equal to or more than the first reference value in each of the first directional projection distributions is equal to the second reference projection distribution.
A section that is continuous along the direction is defined as a first black pixel section, and a scanning region in which the first black pixel section is obtained is defined as a first division row, and a divided line is cut out. When the row direction is the first direction, the first divided row cutout unit 18a adds the information of the cut divided row to the first correction unit 24a.
Send to Also, the first divided line segmentation unit 18a
If the row direction is unknown, information on the cut-out divided rows is sent to the row direction determination unit 20.

【0100】また、第2方向分割領域生成部14bは、
文書画像の行方向が不明である場合およびこの文書画像
の行方向が第2方向である場合に、第1方向に沿った分
割線によって文書画像を分割することにより、この第1
方向と直交する第2方向に沿って並んだ複数の第2方向
分割領域を生成する。そして、第2方向分割領域生成部
14bは、生成された第2方向分割領域の情報を第2方
向射影分布作成部16bへ送出する。
Further, the second direction divided area generating section 14b
When the line direction of the document image is unknown or when the line direction of the document image is the second direction, the document image is divided by a dividing line along the first direction, whereby the first
A plurality of second direction divided regions arranged along a second direction orthogonal to the direction are generated. Then, the second direction divided area generation unit 14b sends the generated information of the second direction divided area to the second direction projection distribution creation unit 16b.

【0101】また、第2方向射影分布作成部16bは、
第2方向分割領域が生成された場合に、当該第2方向分
割領域の各々を、第2方向に沿って走査して、走査毎の
累積黒画素数を検出し、当該累積黒画素数の第1方向に
沿った分布を求めることにより第2方向射影分布を作成
する。すなわち、第2方向射影分布作成部16bは、第
2方向分割領域が生成された場合に、当該第2方向分割
領域の各々について、第2方向を主走査方向とし第1方
向を副走査方向として当該第2方向分割領域を走査し
て、走査毎の累積黒画素数を検出することにより第2方
向射影分布を作成する。そして、第2方向射影分布作成
部16bは、作成された第2方向射影分布の情報を第2
分割行切出し部18bへ送出する。
The second direction projection distribution creating unit 16b
When the second direction divided area is generated, each of the second direction divided areas is scanned along the second direction to detect the cumulative number of black pixels for each scan, and to determine the number of the cumulative black pixels. A second direction projection distribution is created by obtaining a distribution along one direction. That is, when the second direction divided area is generated, the second direction projection distribution creating unit 16b sets the second direction as the main scanning direction and the first direction as the sub scanning direction for each of the second direction divided areas. The second direction divided area is scanned to detect the cumulative number of black pixels for each scan, thereby creating a second direction projection distribution. Then, the second direction projection distribution creating unit 16b stores the information of the created second direction projection distribution in the second direction.
The data is sent to the divided line cutout unit 18b.

【0102】また、第2分割行切出し部18bは、第2
方向射影分布が作成された場合に、当該第2方向射影分
布の各々において第2基準値以上の累積黒画素数が第1
方向に沿って連続する区間をそれぞれ第2黒画素区間と
して、当該第2黒画素区間が得られる走査領域をそれぞ
れ第2分割行として分割行切出しを行なう。そして、第
2分割行切出し部18bは、行方向が第2方向である場
合には、切り出された第2分割行の情報を第2修正部2
4bへ送出する。また、この第2分割行切出し部18b
は、行方向が不明である場合には、切り出された第2分
割行の情報を行方向判定部20へ送出する。
Further, the second divided row cutout section 18b
When the directional projection distribution is created, the cumulative number of black pixels equal to or greater than the second reference value in each of the second directional projection distributions is the first.
A section that is continuous along the direction is defined as a second black pixel section, and a scanning area in which the second black pixel section is obtained is defined as a second divided row, and divided row cutout is performed. When the row direction is the second direction, the second divided row cutout unit 18b adds the information of the cut second divided row to the second correction unit 2b.
4b. Also, the second divided line cutout unit 18b
Sends the information of the cut-out second divided row to the row direction determination unit 20 when the row direction is unknown.

【0103】また、行方向判定部20は、文書画像の行
方向が不明である場合に、第1方向射影分布と第2方向
射影分布とに基づいて、文書画像の行方向を判定する。
そして、行方向判定部20は、行方向の判定結果、第1
分割行および第2分割行の情報を切替出力部22へ送出
する。また、行方向判定部20は、行方向の判定結果お
よび判定された行方向の分割行の情報のみを着替え出力
部22へ送出しても良い。
Further, when the line direction of the document image is unknown, the line direction determination unit 20 determines the line direction of the document image based on the first direction projection distribution and the second direction projection distribution.
Then, the row direction determination unit 20 determines the first row
The information on the divided row and the second divided row is sent to the switching output unit 22. Alternatively, the row direction determination unit 20 may transmit only the determination result of the row direction and the information on the determined divided row in the row direction to the change-over output unit 22.

【0104】また、切替出力部22は、判定された行方
向が第1方向である場合には、第1分割行の情報を第1
修正部24aへ送出する。また、この切替出力部22
は、判定された行方向が第2方向である場合には、第2
分割行の情報を第2修正部24bへ送出する。
When the determined row direction is the first direction, the switching output unit 22 outputs the information of the first divided row to the first direction.
It is sent to the correction unit 24a. Also, the switching output unit 22
Is the second direction if the determined row direction is the second direction.
The information of the divided row is sent to the second correction unit 24b.

【0105】また、第1修正部24aは、第1分割行が
誤って切り出されている場合に、分割行切出しの修正を
行なう。そして、修正された第1分割行の情報を第1分
割行接続部26aへ送出する。
Further, the first correction unit 24a corrects the division line extraction when the first division line is erroneously extracted. Then, the corrected information of the first divided row is sent to the first divided row connecting unit 26a.

【0106】また、第1分割行接続部26aは、文書画
像の行方向が第1方向である場合に、第1方向で互いに
隣接する第1方向分割領域にそれぞれ含まれる分割行ど
うしであって、当該分割行を走査して得られた第1黒画
素区間の少なくとも一部分どうしが重なっている分割行
どうしを接続して行切出しを行なう。
When the row direction of the document image is the first direction, the first divided row connecting section 26a is used for dividing rows included in the first direction divided areas adjacent to each other in the first direction. The line segmentation is performed by connecting the divided lines in which at least a part of the first black pixel section obtained by scanning the divided line overlaps.

【0107】ところで、各分割行を接続する際に、1つ
の分割行が片側だけで2つの分割行と接続可能な場合が
ある。すなわち、1つの分割行の黒画素区間が、片側だ
けで2つの分割行の黒画素区間とそれぞれ部分的に重複
している場合がある。
By the way, when connecting each divided row, there is a case where one divided row can be connected to two divided rows by only one side. That is, the black pixel section of one divided row may partially overlap the black pixel section of two divided rows on one side only.

【0108】そこで、この実施の形態の第1分割行接続
部26aにおいては、分割領域に含まれる第1方向分割
行の第1黒画素区間の一部分が、当該分割領域と隣接す
る他の1つの分割領域に含まれる2つの第1分割行の第
1黒画素区間の一部分とそれぞれ重なっている場合、重
なっている区間の長さが第4基準値よりも長い分割行ど
うしを接続する。
Therefore, in the first divided row connecting section 26a of this embodiment, a part of the first black pixel section of the first direction divided row included in the divided area is replaced with another one of the other adjacent ones of the divided area. When each of the two first divided rows included in the divided area overlaps with a part of the first black pixel section, the divided rows whose overlapping sections are longer than the fourth reference value are connected.

【0109】そして、第1分割行接続部26aは、切り
出された行の情報を制御部28へ送出する。
Then, the first divided row connection unit 26a sends the information of the cut-out row to the control unit 28.

【0110】尚、上記の第4基準値は、任意好適な値を
設定すると良い。例えば、第4基準値は、それぞれ、互
いに接続される分割行どうしのずれの量が最小となるよ
うに設定するのが望ましい。また、例えば、黒画素区間
長と白画素区間長とが同程度の長さの場合には、第4基
準値を「0.5」程度の値としても良い。第4基準値を
この程度の値とすれば、1つの分割行の片側でそれぞれ
重なっている、となりの分割領域の2つの分割行のう
ち、一方が、基準値を満たすと、他方が基準値を満たさ
なくなる。
The fourth reference value may be set to any suitable value. For example, it is preferable that the fourth reference value is set so that the amount of deviation between the divided rows connected to each other is minimized. Further, for example, when the black pixel section length and the white pixel section length are almost the same, the fourth reference value may be set to a value of about “0.5”. If the fourth reference value is set to such a value, if one of the two divided rows of the adjacent divided area overlapping on one side of one divided row satisfies the reference value, the other is the reference value. Will not be satisfied.

【0111】また、第2修正部24bは、第2分割行が
誤って切り出されている場合に、分割行切出しの修正を
行なう。そして、修正された第2分割行を第2分割行接
続部26bへ送出する。
Further, the second correction section 24b corrects the division line extraction when the second division line is erroneously extracted. Then, the corrected second divided row is sent to the second divided row connecting unit 26b.

【0112】また、第2分割行接続部26bは、文書画
像の行方向が第2方向である場合に、第2方向で互いに
隣接する第2方向分割領域にそれぞれ含まれる分割行ど
うしであって、当該分割行を走査して得られた第2黒画
素区間の少なくとも一部分どうしが重なっている分割行
どうしを接続して行切出しを行なう。
When the row direction of the document image is the second direction, the second divided row connecting section 26b is used to connect the divided rows included in the second direction divided areas adjacent to each other in the second direction. The line segmentation is performed by connecting the divided lines in which at least a part of the second black pixel section obtained by scanning the divided line overlaps.

【0113】また、第2分割行接続部26bは、第2分
割行どうしの接続を行なうプロセスにおいて、分割領域
に含まれる第2方向分割行の第2黒画素区間の一部分
が、当該分割領域と隣接する他の1つの分割領域に含ま
れる2つの第2分割行の第2黒画素区間の一部分とそれ
ぞれ重なっている場合、重なっている区間の長さが第5
基準値よりも長い分割行どうしを接続する。
In the process of connecting the second divided rows, the second divided row connecting section 26b converts a part of the second black pixel section of the second direction divided row included in the divided area into the divided area. In the case where each overlaps with a part of the second black pixel section of the two second divided rows included in another adjacent divided area, the length of the overlapping section is the fifth.
Connect divided lines longer than the reference value.

【0114】そして、第2分割行接続部26bは、切り
出された行の情報を制御部28へ送出する。
Then, the second divided row connecting section 26b sends the information of the cut-out rows to the control section 28.

【0115】尚、第5基準値は、上記の第4基準値と同
様に、任意好適な値を設定すると良い。例えば、第4基
準値と第5基準値とは互いに等しくても良いし、互いに
異なっていても良い。
The fifth reference value may be set to any suitable value, similarly to the fourth reference value. For example, the fourth reference value and the fifth reference value may be equal to each other, or may be different from each other.

【0116】また、制御部28は、行切出し装置10の
各部の動作を制御する。そして、制御部28は、行切出
し結果を行切出し装置10の外部へ出力する。尚、図1
においては、制御部28と、行切出し装置10の各部と
の結線を一部省略して示しててある。
The control unit 28 controls the operation of each unit of the line segmenting device 10. Then, the control unit 28 outputs the line segmentation result to the outside of the line segmentation device 10. FIG.
2, the connection between the control unit 28 and each unit of the line segmentation device 10 is partially omitted.

【0117】従って、この行切出し装置10によれば、
文書画像の行方向が不明である場合に、行切出しの処理
の一環である分割領域の生成のプロセスにおいて得られ
た第1および第2方向射影分布を用いて、行方向の判定
を行なう。従って、この行切出し装置10によれば、文
書画像の行方向が不明である場合でも、事前に行切出し
とは個別に行方向を判定する処理を行なうことなく、行
切出しを行なうことができる。
Therefore, according to this line segmenting device 10,
When the line direction of the document image is unknown, the line direction is determined using the first and second direction projection distributions obtained in the process of generating the divided area as a part of the line segmentation process. Therefore, according to the line cutout apparatus 10, even when the line direction of the document image is unknown, the line cutout can be performed without performing the process of determining the line direction separately from the line cutout in advance.

【0118】(文字認識装置の構成例)次に、図2を参
照して、この実施の形態の行切出し装置10を用いた文
字認識装置の構成例について説明する。図2は、この文
字認識装置の構成例の説明に供する機能ブロック図であ
る。
(Example of Configuration of Character Recognition Apparatus) Next, an example of the configuration of a character recognition apparatus using the line segmenting apparatus 10 of this embodiment will be described with reference to FIG. FIG. 2 is a functional block diagram for explaining a configuration example of the character recognition device.

【0119】この文字認識装置は、スキャナ30、イメ
ージメモリ31、文字領域設定部32、行切出し装置1
0、文字切出し部33および文字認識部34を具えてい
る。
This character recognition device includes a scanner 30, an image memory 31, a character area setting section 32, a line segmentation device 1
0, a character extracting section 33 and a character recognizing section 34 are provided.

【0120】そして、このスキャナ30は、認識対象の
原稿から文書画像(イメージデータ)を作成する。すな
わち、このスキャナ30は、原稿の紙面を光学的に走査
して、量子化された電気信号例えば白黒2値を表す電気
信号からなる文書画像のイメージデータを生成する。こ
のイメージデータにおいては、文字画素を黒画素で表
し、かつ、背景画素を白画素で表す。
The scanner 30 creates a document image (image data) from the document to be recognized. That is, the scanner 30 optically scans the paper surface of a document to generate image data of a document image including a quantized electric signal, for example, an electric signal representing black and white binary. In this image data, character pixels are represented by black pixels, and background pixels are represented by white pixels.

【0121】また、このイメージメモリ31は、スキャ
ナ30で生成された文書画像を一旦格納する。
The image memory 31 temporarily stores the document image generated by the scanner 30.

【0122】また、文字領域設定部32は、先ず、この
イメージメモリ31に格納された文書画像を読み出して
くる。そして、文字領域設定部32は、この文書画像の
うち、文字方向の判定の対象となる領域としての文字領
域を設定する。文字領域の設定にあたっては、例えば、
イメージデータをディスプレイに表示して、オペレータ
がディスプレイ上で文字領域を指定しても良い。また、
この出願に係る発明者は、文字領域を抽出する方法の一
例を、文献2:「特開平3−126181号公報」にお
いて提案している。この文献2に開示の方法によれば、
文字画素の領域の外接矩形を求め、この外接矩形により
文書画像から文字領域を切り出している。尚、この実施
の形態においては、この他の従来周知の任意好適な方法
を用いて文字領域を抽出しても良い。また、この発明で
は、行切出しにあたり、文字領域は必ずしも設定する必
要はない。
The character area setting section 32 first reads out the document image stored in the image memory 31. Then, the character area setting section 32 sets a character area as an area for which the character direction is to be determined in the document image. When setting the character area, for example,
The image data may be displayed on a display, and the operator may specify a character area on the display. Also,
The inventor of the present application proposes an example of a method for extracting a character area in Document 2: "Japanese Patent Laid-Open No. 3-126181". According to the method disclosed in Document 2,
A circumscribed rectangle of the character pixel region is obtained, and a character region is cut out from the document image by using the circumscribed rectangle. In this embodiment, the character region may be extracted by using any other conventionally known and suitable method. Further, in the present invention, it is not always necessary to set a character area for line segmentation.

【0123】また、行切出し装置10は、図1に示す構
成を有し、(動作)の欄において後述するように動作す
る。
The line segmenting apparatus 10 has the configuration shown in FIG. 1, and operates as described later in the section of (Operation).

【0124】また、文字切出し部33は、行切出し装置
10において切り出された各行から、それぞれ文字パタ
ンを切り出す。文字パタンの切出しにあたっては、従来
周知の任意好適な方法を用いることができる。また、こ
の文字切出し部33は、切り出された文字パタンを一旦
格納する内蔵メモリを具えていても良い。
The character extracting section 33 extracts a character pattern from each line extracted by the line extracting device 10. In cutting out the character pattern, any conventionally known and suitable method can be used. In addition, the character extracting section 33 may include a built-in memory for temporarily storing the extracted character pattern.

【0125】また、文字認識部34は、切り出された文
字パタンを、パターンマッチング法により文字の辞書デ
ータと照合し、この照合結果に基づいて文字パタンを認
識する。尚、辞書データは、文字認識部34の内蔵メモ
リに格納しておいても良いし、文字認識部34から独立
させて例えば文字認識辞書部を設けて、そこに保持して
おいても良い。
The character recognizing unit 34 compares the cut character pattern with character dictionary data by a pattern matching method, and recognizes the character pattern based on the result of the comparison. Note that the dictionary data may be stored in a built-in memory of the character recognition unit 34, or a character recognition dictionary unit may be provided independently of the character recognition unit 34 and held there.

【0126】(行方向判定部について)次に、図3を参
照して、この実施の形態の行切出し装置10における行
方向判定部20の構成について説明する。この行方向判
定部20は、第1判定部201、第2判定部202およ
び第3判定部203を具えている。次に、各判定部の構
成について順次に説明する。
(Regarding the Row Direction Judgment Unit) Next, the configuration of the row direction judgment unit 20 in the line segmenting apparatus 10 of this embodiment will be described with reference to FIG. The row direction determining unit 20 includes a first determining unit 201, a second determining unit 202, and a third determining unit 203. Next, the configuration of each determination unit will be sequentially described.

【0127】(第1判定部の構成について)次に、図4
を参照して、この第1判定部201の構成について説明
する。図4は、第1判定部201の構成の説明に供する
機能ブロック図である。尚、第1判定部201の動作に
ついては、後述の(第1判定部の動作について)の欄に
おいて詳細に説明する。
(Regarding Configuration of First Determination Unit) Next, FIG.
The configuration of the first determination unit 201 will be described with reference to FIG. FIG. 4 is a functional block diagram for explaining the configuration of the first determination unit 201. The operation of the first determination unit 201 will be described later in detail in the section (Operation of the first determination unit).

【0128】この第1判定部201は、文書画像に文字
列が1行のみ含まれている場合の行方向判定を行なう。
そして、この第1判定部201は、第1分割領域数計数
部36a、第2分割領域数計数部36b、第1黒画素区
間数計数部38a、第2黒画素区間数計数部38bおよ
び区間数分割数比較判定部40を具えている。
The first determination unit 201 makes a line direction determination when a document image includes only one line of a character string.
The first determination unit 201 includes a first divided area number counting unit 36a, a second divided area number counting unit 36b, a first black pixel section number counting unit 38a, a second black pixel section number counting unit 38b, and a section number. A division number comparison / determination unit 40 is provided.

【0129】そして、この第1分割領域数計数部36a
は、第1方向分割領域の数の合計を第1分割領域数とし
て求める。そして、第1分割領域数計数部36aは、計
数された第1方向分割領域数の情報を区間数分割数比較
判定部40へ送出する。
The first divided area number counting section 36a
Calculates the total number of the first direction divided areas as the first divided area number. Then, the first divided area number counting section 36a sends information on the counted number of first direction divided areas to the section number divided number comparison / determination section 40.

【0130】また、第1黒画素区間数計数部38aは、
第1黒画素区間の数の、全ての第1方向分割領域にわた
っての合計を第1黒画素区間数として求める。そして、
第1黒画素区間数計数部38aは、計数された第1黒画
素区間数の情報を区間数分割数比較判定部40へ送出す
る。
Further, the first black pixel section number counting section 38a
The total number of the first black pixel sections over all the first direction divided areas is determined as the first black pixel section number. And
The first black pixel section number counting section 38 a sends information on the counted first black pixel section number to the section number division number comparison determination section 40.

【0131】また、第2分割領域数計数部36bは、第
2方向分割領域の数の合計を第2分割領域数として求め
る。そして、第2分割領域数計数部36bは、計数され
た第2分割領域数の情報を区間数分割数比較判定部40
へ送出する。
The second divided area number counting section 36b calculates the total number of divided areas in the second direction as the number of second divided areas. Then, the second divided region number counting unit 36b compares the counted information on the number of second divided regions with the section number divided number comparison determination unit 40b.
Send to

【0132】また、第2黒画素区間数計数部38bは、
第2黒画素区間の数の、全ての第2方向分割領域にわた
っての合計を第2黒画素区間数として求める。そして、
第2黒画素区間数計数部38bは、計数された第2黒画
素区間数の情報を区間数分割数比較判定部40へ送出す
る。
Further, the second black pixel section number counting section 38b
The sum of the number of second black pixel sections over all the second direction divided areas is determined as the number of second black pixel sections. And
The second black pixel section number counting section 38 b sends the information on the counted number of second black pixel sections to the section number division number comparison determination section 40.

【0133】また、区間数分割数比較判定部40は、第
1黒画素区間数とこの第1分割領域数とが一致し、か
つ、第2黒画素区間数と第2分割領域数とが不一致の場
合に、行方向を第1方向と判定し、および、第2黒画素
区間数とこの第2分割領域数とが一致し、かつ、第1黒
画素区間数と第1分割領域数とが不一致の場合に、行方
向を第2方向と判定する。
The section number division number comparison / judgment unit 40 determines that the first black pixel section number matches the first division area number, and that the second black pixel section number does not match the second division area number. In the case of, the row direction is determined to be the first direction, and the number of the second black pixel sections is equal to the number of the second divided areas, and the number of the first black pixel sections and the number of the first divided areas are different. If they do not match, the row direction is determined to be the second direction.

【0134】このように、第1判定部201において
は、分割領域の数と分割行の数の合計とを比較すことに
より、文字列が1行だけの場合には、第2判定部202
や第3判定部203で、黒画素区間長のばらつきどうし
や平均白画素区間長どうしを比較するまでもなく、行方
向判定を行なうことができる。
As described above, the first determination unit 201 compares the number of divided areas with the total number of divided lines, and when the character string is only one line, the second determination unit 202
In addition, the third determination unit 203 can determine the row direction without having to compare variations in black pixel section lengths and average white pixel section lengths.

【0135】(第2判定部の構成について)次に、図5
を参照して、この第2判定部202の構成について説明
する。図5は、第2判定部202の構成の説明に供する
機能ブロック図である。尚、第2判定部202の動作に
ついては、後述の(第2判定部の動作について)の欄に
おいて詳細に説明する。
(Regarding the Configuration of the Second Judgment Unit) Next, FIG.
The configuration of the second determination unit 202 will be described with reference to FIG. FIG. 5 is a functional block diagram for explaining the configuration of the second determination unit 202. The operation of the second determination unit 202 will be described later in detail in the section (Operation of the second determination unit).

【0136】この第2判定部202は、行方向の判定の
手がかりの一つとして、行の高さや行の幅のばらつきに
着目することによって、射影分布における黒画素区間長
のばらつきによる行方向の判定を行なう。そして、この
第2判定部202は、第1ばらつき算出部42a、第2
ばらつき算出部42bおよびばらつき比較判定部44を
具えている。
As one of the clues for the determination of the row direction, the second determination unit 202 pays attention to the variation in the row height and the row width. Make a decision. Then, the second determination unit 202 includes a first variation calculation unit 42a and a second
A variation calculation unit 42b and a variation comparison determination unit 44 are provided.

【0137】そして、この第1ばらつき算出部42a
は、第1黒画素区間の各々の長さをそれぞれ第1黒画素
区間長として、当該第1黒画素区間長のばらつきを算出
する。そして、第1ばらつき算出部42aは、算出され
た第1黒画素区間長のばらつきの情報をばらつき比較判
定部44へ送出する。
The first variation calculator 42a
Calculates the variation of the first black pixel section length, using each length of the first black pixel section as the first black pixel section length. Then, the first variation calculation unit 42a sends information on the calculated variation of the first black pixel section length to the variation comparison determination unit 44.

【0138】また、第2ばらつき算出部42bは、第2
黒画素区間の各々の長さをそれぞれ第2黒画素区間長と
して、当該第2黒画素区間長のばらつきを算出する。そ
して、第2ばらつき算出部42bは、算出された第2黒
画素区間長のばらつきの情報をばらつき比較判定部44
へ送出する。
The second variation calculator 42b calculates the second
The length of each black pixel section is defined as a second black pixel section length, and the variation of the second black pixel section length is calculated. Then, the second variation calculation unit 42b compares the information on the variation of the calculated second black pixel section length with the variation comparison determination unit 44.
Send to

【0139】ばらつき比較判定部44は、第1黒画素区
間長のばらつきと第2黒画素区間長のばらつきとを比較
して、当該第1黒画素区間長のばらつきと当該第2黒画
素区間長のばらつきとの比率が第3基準値以上の場合
に、ばらつきの小さい方の黒画素区間長が得られた射影
分布の走査方向を行方向と判定する。
The variation comparison / determination section 44 compares the variation in the first black pixel section length with the variation in the second black pixel section length, and determines the variation in the first black pixel section length and the variation in the second black pixel section length. When the ratio with respect to the variation is equal to or more than the third reference value, the scanning direction of the projection distribution from which the black pixel section length with the smaller variation is obtained is determined as the row direction.

【0140】このように、第1黒画素区間長のばらつき
と第2黒画素区間長のばらつきとを比較すれば、行方向
の判定の確実化を図ることができる。
As described above, by comparing the variation in the first black pixel section length with the variation in the second black pixel section length, the determination in the row direction can be assured.

【0141】(第3判定部の構成について)次に、図6
を参照して、この第3判定部203の構成について説明
する。図6は、第3判定部203の構成の説明に供する
機能ブロック図である。尚、第3判定部203の動作に
ついては、後述の(第3判定部の動作について)の欄に
おいて詳細に説明する。
(Regarding Configuration of Third Judgment Unit) Next, FIG.
The configuration of the third determination unit 203 will be described with reference to FIG. FIG. 6 is a functional block diagram for explaining the configuration of the third determination unit 203. The operation of the third determination unit 203 will be described later in detail in the section (Operation of the third determination unit).

【0142】この第3判定部203は、上記の第2判定
部202において第1黒画素区間長のばらつきと第2黒
画素区間長のばらつきとの比率が第3基準値未満の場合
に、行方向の判定のさらなる手がかりの一つとして、行
間隔と文字間隔に着目することによって、射影分布にお
ける黒画素区間どうしの間隔の平均による行方向の判定
を行なう。そして、この第3判定部203は、第1平均
白画素区間長算出部(第1平均値算出部)46a、第2
平均白画素区間長算出部(第2平均値算出部)46bお
よび平均値比較判定部48を具えている。
When the ratio of the variation in the first black pixel section length to the variation in the second black pixel section length is less than the third reference value in the second determination section 202, As one of the clues to determine the direction, the line direction is determined by averaging the intervals between black pixel sections in the projection distribution by focusing on the line interval and the character interval. The third determination unit 203 includes a first average white pixel section length calculation unit (first average value calculation unit) 46a and a second average white pixel section length calculation unit 46a.
An average white pixel section length calculation unit (second average value calculation unit) 46b and an average value comparison determination unit 48 are provided.

【0143】そして、この第1平均白画素区間長算出部
46aは、第1方向射影分布において隣り合った第1黒
画素区間どうしの間の第1白画素区間が1箇所の場合に
は、当該第1白画素区間の長さを第1平均白画素区間長
とし、かつ、この第1白画素区間が複数箇所の場合に
は、当該第1白画素区間の各々の長さの相加平均を第1
平均白画素区間長として算出する。そして、この第1平
均白画素区間長算出部46aは、算出された第1白画素
区間長を平均値比較判定部48へ送出する。
When the first average white pixel section length calculating section 46a has one first white pixel section between adjacent first black pixel sections in the first direction projection distribution, the first average white pixel section length calculation section 46a determines whether When the length of the first white pixel section is a first average white pixel section length, and when there are a plurality of first white pixel sections, the arithmetic average of the respective lengths of the first white pixel section is calculated. First
It is calculated as the average white pixel section length. Then, the first average white pixel section length calculation unit 46a sends the calculated first white pixel section length to the average value comparison determination unit 48.

【0144】また、第2平均白画素区間長算出部46b
は、第2方向射影分布において隣り合った第2黒画素区
間どうしの間の第2白画素区間が1箇所の場合には、当
該第2白画素区間の長さを第2平均白画素区間長とし、
かつ、この第2白画素区間が複数箇所の場合には、当該
第2白画素区間の各々の長さの相加平均を第2平均白画
素区間長として算出する。そして、この第2平均白画素
区間長算出部46bは、算出された第2白画素区間長を
平均比較判定部48へ送出する。
The second average white pixel section length calculator 46b
In the case where there is one second white pixel section between adjacent second black pixel sections in the second direction projection distribution, the length of the second white pixel section is set to the second average white pixel section length. age,
In addition, when there are a plurality of second white pixel sections, the arithmetic mean of the lengths of the second white pixel sections is calculated as the second average white pixel section length. Then, the second average white pixel section length calculation unit 46b sends the calculated second white pixel section length to the average comparison determination unit 48.

【0145】また、平均比較判定部48は、第1平均白
画素区間長と第2平均白画素区間長とを比較して、より
大きな平均白画素区間長の得られた射影分布の走査方向
を行方向と判定する。
The average comparison / determination section 48 compares the first average white pixel section length with the second average white pixel section length, and determines the scanning direction of the projection distribution having the larger average white pixel section length. Judge as line direction.

【0146】前述のように、行間隔は、一般に文字間隔
よりも広い。従って、第1平均白画素区間長と第2平均
白画素区間長とのうちの、より大きな平均白画素区間長
の方が行間の空白に対応する。従って、第1平均白画素
区間長と第2平均白画素区間長とを比較して行方向を判
定すれば、第1黒画素区間長のばらつきと第2黒画素区
間長のばらつきとの比率が小さい場合(例えば、文字間
隔が固定ピッチの場合)であっても、行方向判定の確実
化を図ることができる。
As described above, the line spacing is generally wider than the character spacing. Therefore, of the first average white pixel section length and the second average white pixel section length, the larger average white pixel section length corresponds to a blank between rows. Therefore, if the row direction is determined by comparing the first average white pixel section length with the second average white pixel section length, the ratio of the variation of the first black pixel section length to the variation of the second black pixel section length is determined. Even in a small case (for example, when the character interval is a fixed pitch), it is possible to ensure the determination of the line direction.

【0147】(第1修正部の構成について)次に、図7
を参照して、第1修正部24aの構成について説明す
る。図7は、第1修正部の構成の説明に供する機能ブロ
ック図である。第1修正部24aは、第1統合修正部9
0aと第1分割修正部92aとを具えている。第1修正
部24aに入力された情報は、第1統合修正部90aお
よび第1分割修正部92aへそれぞれ入力される。ま
た、第1統合修正部90aおよび第1分割修正部92a
の出力は、それぞれ第1分割行接続部26aへ送出され
る。
(Regarding the Configuration of the First Correction Unit) Next, FIG.
The configuration of the first correction unit 24a will be described with reference to FIG. FIG. 7 is a functional block diagram for explaining the configuration of the first correction unit. The first correction unit 24a includes the first integrated correction unit 9
0a and a first division correction unit 92a. The information input to the first correction unit 24a is input to the first integrated correction unit 90a and the first division correction unit 92a, respectively. Further, the first integrated correction unit 90a and the first division correction unit 92a
Are sent to the first divided row connection unit 26a.

【0148】尚、この第1統合修正部90aは、この発
明の第1の行切出し修正装置の実施の形態でもある。ま
た、この第1分割修正部92aは、この発明の第2の行
切出し修正装置の実施の形態でもある。
Note that the first integrated correction unit 90a is also an embodiment of the first line segmentation correction device of the present invention. The first division correction unit 92a is also an embodiment of the second line segmentation correction device of the present invention.

【0149】(第1統合修正部の構成について)次に、
図8を参照して、第1統合修正部90aの構成について
説明する。図8は、第1統合修正部90aの構成の説明
に供する機能ブロック図である。第1統合修正部90a
は、切り出された第1分割行の高さ若しくは幅と行間隔
とに着目して、本来1つの分割行として切り出されるべ
きところを誤って2つの分割行として切り出された分割
行を発見する。そして、第1統合修正部90aは、その
2つの分割行を1つの分割行として切り出すことによ
り、第1分割行の行切出しの修正を行なう。
(Regarding Configuration of First Integrated Correction Unit)
With reference to FIG. 8, the configuration of the first integrated correction unit 90a will be described. FIG. 8 is a functional block diagram for explaining the configuration of the first integrated correction unit 90a. First integrated correction unit 90a
Focuses on the height or width and the line interval of the first divided line, and finds a divided line that is erroneously cut out as two divided lines where it should be originally cut out as one divided line. Then, the first integrated correction unit 90a corrects the line extraction of the first divided line by cutting out the two divided lines as one divided line.

【0150】そのために、第1統合修正部90aは、第
1平均黒画素区間長算出部120a、第1候補区間選択
部122a、第1統合区間長検出部124a、第2統合
区間長検出部124b、第1統合区間長誤差算出部12
5a、第2統合区間長誤差算出部125b、第1選択統
合区間選択部126a、第1白画素区間長検出部128
aおよび第1統合部130aを具えている。
For this purpose, the first integrated correcting section 90a includes a first average black pixel section length calculating section 120a, a first candidate section selecting section 122a, a first integrated section length detecting section 124a, and a second integrated section length detecting section 124b. , First integrated section length error calculator 12
5a, a second integrated section length error calculating section 125b, a first selected integrated section selecting section 126a, a first white pixel section length detecting section 128
a and the first integration unit 130a.

【0151】そして、この第1平均黒画素区間長算出部
120aは、第1分割行行切出し部18aにおいて切り
出された第1分割行の第1黒画素区間の長さ(第1黒画
素区間長)の相加平均を第1平均黒画素区間長として求
める。そして、この第1平均黒画素区間長算出部120
aは、第1平均黒画素区間長の情報を第1候補区間選択
部122aへ送出する。
The first average black pixel section length calculation section 120a calculates the length of the first black pixel section (first black pixel section length) of the first division row cut out by the first division row / line extraction section 18a. ) Is determined as the first average black pixel section length. Then, the first average black pixel section length calculation unit 120
a sends out the information of the first average black pixel section length to the first candidate section selection unit 122a.

【0152】また、第1候補区間選択部122aは、第
1平均黒画素区間長と第1黒画素区間長とを比較して、
第1黒画素区間のうち、第1平均黒画素区間長に対する
第1黒画素区間長の比率が第6基準値よりも小さな第1
黒画素区間を第1候補区間として選択する。そして、第
1候補区間選択部122aは、選択された第1候補区間
の情報を第1および第2統合区間長検出部124aおよ
び124bにそれぞれ送出する。尚、この第6基準値
は、例えば1未満で0よりも大きな任意好適な値(例え
ば0.5程度)を設定すると良い。
The first candidate section selection unit 122a compares the first average black pixel section length with the first black pixel section length,
In the first black pixel section, the ratio of the first black pixel section length to the first average black pixel section length is smaller than the sixth reference value.
A black pixel section is selected as a first candidate section. Then, the first candidate section selection unit 122a sends information on the selected first candidate section to the first and second integrated section length detection units 124a and 124b, respectively. The sixth reference value may be set to any suitable value (for example, about 0.5) that is less than 1 and greater than 0, for example.

【0153】また、第1統合区間長検出部124aは、
この第1候補区間の一方の側の直近の第1黒画素区間で
ある第1候補黒画素区間とこの第1候補区間とを一つの
連続した黒画素区間とした場合の当該黒画素区間を第1
統合区間とし、当該第1統合区間の長さ(第1統合区間
長)を求める。そして、この第1統合区間長検出部12
4aは、求められた第1統合区間長の情報を第1統合区
間長誤差算出部125aへ送出する。
Further, the first integrated section length detecting section 124a
A first candidate black pixel section which is a first black pixel section nearest to one side of the first candidate section, and the black pixel section when the first candidate section is defined as one continuous black pixel section. 1
As an integrated section, the length of the first integrated section (first integrated section length) is obtained. Then, the first integrated section length detection unit 12
4a sends the obtained information of the first integrated section length to the first integrated section length error calculating section 125a.

【0154】また、第1統合区間長誤差算出部125a
は、第1統合区間の長さと第1平均黒画素区間長との差
の大きさを第1統合区間長誤差として算出する。そし
て、この第1統合区間長誤差算出部125aは、算出さ
れた第1統合区間長誤差を第1選択統合区間選択部12
6aへ送出する。
The first integrated section length error calculator 125a
Calculates the magnitude of the difference between the length of the first integrated section and the first average black pixel section length as the first integrated section length error. Then, the first integrated section length error calculating section 125a uses the calculated first integrated section length error as the first selected integrated section selecting section 12a.
6a.

【0155】また、第2統合区間長検出部124bは、
この第1候補区間の他方の側の直近の第1黒画素区間で
ある第2候補黒画素区間とこの第1候補区間とを1つの
連続した黒画素区間とした場合の当該黒画素区間を第2
統合区間とし、当該第2統合区間の長さ(第2統合区間
長)を求める。そして、この第2統合区間長検出部12
4bは、求められた第2統合区間長の情報を第2統合区
間長誤差算出部125bへ送出する。
Further, the second integrated section length detecting section 124b
When the second candidate black pixel section, which is the nearest first black pixel section on the other side of the first candidate section, and this first candidate section are defined as one continuous black pixel section, 2
As an integrated section, the length of the second integrated section (second integrated section length) is obtained. Then, the second integrated section length detecting unit 12
4b sends the obtained information on the second integrated section length to the second integrated section length error calculating section 125b.

【0156】また、第2統合区間長誤差算出部125b
は、第2統合区間の長さと第1平均黒画素区間長との差
の大きさを第2統合区間長誤差として算出する。そし
て、この第2統合区間長誤差算出部125bは、算出さ
れた第2統合区間長誤差を第1選択統合区間選択部12
6aへ送出する。
The second integrated section length error calculator 125b
Calculates the magnitude of the difference between the length of the second integrated section and the first average black pixel section length as the second integrated section length error. Then, the second integrated section length error calculating section 125b calculates the calculated second integrated section length error by the first selected integrated section selecting section 12b.
6a.

【0157】また、第1選択統合区間選択部126a
は、第1統合区間長と第2統合区間長とを比較して、長
さの短い方の統合区間を第1選択統合区間として選択す
る。そして、第1選択統合区間選択部126aは、選択
された第1選択統合区間の情報を第1白画素区間長検出
部128aへ送出する。
Also, the first selection integrated section selection section 126a
Compares the first integrated section length with the second integrated section length and selects the shorter integrated section as the first selected integrated section. Then, the first selected integrated section selection unit 126a sends information on the selected first selected integrated section to the first white pixel section length detection unit 128a.

【0158】また、第1白画素区間長検出部128a
は、この第1選択統合区間のうちの、第1候補区間と当
該第1候補区間の直近の第1黒画素区間との間の第1白
画素区間の長さを求める。そして、第1白画素区間長検
出部128aは、求められた第1白画素区間の長さの情
報を第1統合部130aへ送出する。
Also, the first white pixel section length detecting section 128a
Calculates the length of the first white pixel section between the first candidate section and the first black pixel section immediately adjacent to the first candidate section in the first selection integration section. Then, the first white pixel section length detection unit 128a sends the obtained information on the length of the first white pixel section to the first integration unit 130a.

【0159】また、第1統合部130aは、この第1白
画素区間の長さと第7基準値とを比較して、当該第1白
画素区間の長さが当該第7基準値よりも短い場合に、第
1選択統合区間を1つの連続した第1黒画素区間とする
ことにより、行切出しの修正を行なう。尚、この第7基
準値は、任意好適な値を設定すると良い。例えば、白画
素区間の長さの平均値よりも小さい値(例えば、平均値
の半分程度の長さ)を第7基準値として設定しても良
い。
The first integration section 130a compares the length of the first white pixel section with the seventh reference value, and determines that the length of the first white pixel section is shorter than the seventh reference value. Then, the line selection is corrected by setting the first selected integrated section as one continuous first black pixel section. The seventh reference value may be set to any suitable value. For example, a value smaller than the average value of the length of the white pixel section (for example, about half the average value) may be set as the seventh reference value.

【0160】尚、第1白画素区間の長さが第7基準値以
上の場合には、第1選択統合区間が本来1行ではない可
能性が高いため、その第1候補区間の行切出を第1選択
統合区間の行切出しへ修正する処理は行なわない。
If the length of the first white pixel section is equal to or longer than the seventh reference value, it is highly likely that the first selected integrated section is not originally one line, so the line is cut out from the first candidate section. Is corrected to the line segmentation of the first selected integrated section.

【0161】(第1分割修正部の構成について)次に、
図9を参照して、第1分割修正部92aの構成について
説明する。図9は、第1分割修正部92aの構成の説明
に供する機能ブロック図である。第1分割修正部92a
は、切り出された第1分割行の高さ若しくは幅に着目し
て、本来2つの分割行として切り出されるべきところを
誤って1つの分割行として切り出された分割行を発見す
る。そして、第1分割修正部92aは、その分割行を2
つの分割行として切り出すことにより、第1分割行の行
切出しの修正を行なう。
(Regarding Configuration of First Division Correction Unit)
With reference to FIG. 9, the configuration of the first division correction unit 92a will be described. FIG. 9 is a functional block diagram for explaining the configuration of the first division correction unit 92a. First division correction unit 92a
Focuses on the height or width of the first divided line, and finds a divided line that is erroneously cut out as one divided line where it should be originally cut out as two divided lines. Then, the first division correction unit 92a adds the divided row to 2
By cutting out as one divided line, the line cutout of the first divided line is corrected.

【0162】そのために、第1分割修正部92aは、第
1平均黒画素区間長算出部131a、第1分割候補区間
選択部132a、第1位置抽出部134a、第2位置抽
出部134b、最寄第1位置抽出部136a、最寄第2
位置抽出部136b、第1分割部138aおよび第2分
割部138bを具えている。
For this purpose, the first division correction section 92a includes a first average black pixel section length calculation section 131a, a first division candidate section selection section 132a, a first position extraction section 134a, a second position extraction section 134b, First position extraction unit 136a, nearest second
A position extracting unit 136b, a first dividing unit 138a, and a second dividing unit 138b are provided.

【0163】そして、この第1平均黒画素区間長算出部
131aは、第1分割行切出し部18aにおいて切り出
された第1分割行の第1黒画素区間の長さ(第1黒画素
区間長)の相加平均を第1平均黒画素区間長として求め
る。そして、第1平均黒画素区間長算出部131aは、
求められた第1平均黒画素区間長の情報を第1分割候補
区間選択部132aへ送出する。
The first average black pixel section length calculation section 131a calculates the length of the first black pixel section (first black pixel section length) of the first division row cut out by the first division row extraction section 18a. Is determined as a first average black pixel section length. Then, the first average black pixel section length calculation unit 131a calculates
The obtained information on the first average black pixel section length is sent to the first division candidate section selection unit 132a.

【0164】また、第1分割候補区間選択部132a
は、第1平均黒画素区間長と第1黒画素区間長とを比較
して、第1黒画素区間のうち、第1平均黒画素区間長に
対する第1黒画素区間長の比率が第11基準値よりも大
きな第1黒画素区間を第1分割候補区間として選択す
る。そして、第1分割候補区間選択部132aは、選択
された第1分割候補区間の情報を第1および第2位置抽
出部134aおよび134bへ送出する。尚、この第1
1基準値は、例えば1以上の任意好適な値(例えば1.
5〜2程度)を設定すると良い。
Further, the first division candidate section selection section 132a
Compares the first average black pixel section length with the first black pixel section length, and determines that the ratio of the first black pixel section length to the first average black pixel section length in the first black pixel section is equal to an eleventh standard. A first black pixel section larger than the value is selected as a first division candidate section. Then, the first division candidate section selection unit 132a sends information on the selected first division candidate section to the first and second position extraction units 134a and 134b. In addition, this first
One reference value is, for example, one or more arbitrary suitable values (for example, 1.
About 5 to 2).

【0165】また、第1位置抽出部134aは、走査線
のうち第1分割候補区間の中央付近を走査する走査線上
で黒画素の検出される位置のうち、第1方向に沿って最
も一方寄りの位置を第1位置として抽出する。そして、
第1位置抽出部134aは、抽出された第1位置の情報
を最寄第1位置抽出部136aへ送出する。
In addition, the first position extracting unit 134a is the most one-side position along the first direction among the positions where black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section in the scanning line. Is extracted as the first position. And
The first position extracting unit 134a sends information on the extracted first position to the nearest first position extracting unit 136a.

【0166】また、最寄第1位置抽出部136aは、第
1位置のうち、第1方向に沿って最も他方寄りの第1位
置を最寄第1位置として抽出する。そして、最寄第1位
置抽出部136aは、抽出された最寄第1位置の情報を
第1および第2分割部138aおよび138bへ送出す
る。
The nearest first position extracting section 136a extracts the first position closest to the other side in the first direction among the first positions as the nearest first position. Then, the nearest first position extracting unit 136a sends the extracted information on the nearest first position to the first and second dividing units 138a and 138b.

【0167】また、第2位置抽出部134bは、走査線
のうち第1分割候補区間の中央付近を走査する走査線上
で黒画素の検出される位置のうち、第2方向に沿って最
も他方寄りの位置を第2位置として抽出する。そして、
第2位置抽出部134bは、抽出された第2位置の情報
を最寄第2位置抽出部136bへ送出する。
In addition, the second position extracting unit 134b moves the other position along the second direction along the second direction among the positions where black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section in the scanning line. Is extracted as the second position. And
The second position extracting unit 134b sends the information on the extracted second position to the nearest second position extracting unit 136b.

【0168】また、最寄第2位置抽出部136bは、第
2位置のうち、第2方向に沿って最も一方寄りの第2位
置を最寄第2位置として抽出する。そして、最寄第2位
置抽出部136bは、抽出された最寄第2位置の情報を
第1および第2分割部138aおよび138bへ送出す
る。
The nearest second position extracting unit 136b extracts the second position closest to the first position along the second direction from the second positions as the nearest second position. Then, the nearest second position extracting unit 136b sends the extracted information on the nearest second position to the first and second dividing units 138a and 138b.

【0169】また、第1分割部138aは、最寄第1位
置と最寄第2位置とを比較して、この最寄第1位置がこ
の最寄第2位置よりも他方側である場合またはこの最寄
第1位置とこの最寄第2位置とが第2方向に沿った同一
直線上に位置する場合に、第1分割候補区間を、当該第
1分割候補区間の中央で2つに分割させて2つの分割黒
画素区間を生成することにより、行切出しの修正を行な
う。
The first division 138a compares the nearest first position with the nearest second position, and determines whether the nearest first position is on the other side of the nearest second position or When the nearest first position and the nearest second position are located on the same straight line along the second direction, the first division candidate section is divided into two at the center of the first division candidate section. By generating two divided black pixel sections, the line segmentation is corrected.

【0170】また、第2分割部138bは、最寄第1位
置と最寄第2位置とを比較して、この最寄第1位置がこ
の最寄第2位置よりも一方側である場合に、この最寄第
1位置とこの最寄第2位置との中間を通りかつ第2方向
に沿った分割線で第1分割候補区間を分割することによ
り、一方側の一方分割領域および他方側の他方分割領域
を生成し、一方分割領域を最寄第2位置が得られた走査
線によって分割して2つの分割黒画素区間を生成し、か
つ、他方分割領域を最寄第1位置が得られた走査線によ
って分割して2つの分割黒画素区間を生成することによ
り行切出しの修正を行なう。
The second division 138b compares the nearest first position with the nearest second position, and determines that the nearest first position is one side of the nearest second position. By dividing the first division candidate section by a division line that passes through the middle between the nearest first position and the nearest second position and extends in the second direction, the one division area on one side and the other division area on the other side are divided. The other divided area is generated, and one divided area is divided by the scanning line from which the nearest second position is obtained to generate two divided black pixel sections, and the other divided area is obtained as the nearest first position. The line segmentation is performed by dividing the scan line into two divided black pixel sections, thereby correcting the line segmentation.

【0171】(第2修正部の構成について)次に、図1
0を参照して、第2修正部24bの構成について説明す
る。図10は、第2修正部の構成の説明に供する機能ブ
ロック図である。第2修正部24bは、第2統合修正部
90bと第2分割修正部92bとを具えている。第2修
正部24bに入力された情報は、第2統合修正部90b
および第2分割修正部92bへそれぞれ入力される。ま
た、第2統合修正部90bおよび第2分割修正部92b
の出力は、それぞれ第2分割行接続部26bへ送出され
る。
(Regarding the Configuration of the Second Correction Unit) Next, FIG.
The configuration of the second correction unit 24b will be described with reference to FIG. FIG. 10 is a functional block diagram for explaining the configuration of the second correction unit. The second correction unit 24b includes a second integrated correction unit 90b and a second division correction unit 92b. The information input to the second correction unit 24b is transmitted to the second integrated correction unit 90b.
And the second division correction unit 92b. Further, a second integrated correction unit 90b and a second division correction unit 92b
Are sent to the second divided row connection unit 26b.

【0172】尚、この第2統合修正部90bは、この発
明の第1の行切出し修正装置の実施の形態でもある。ま
た、この第2分割修正部92bは、この発明の第2の行
切出し修正装置の実施の形態でもある。
Note that the second integrated correction unit 90b is also an embodiment of the first line segmentation correction device of the present invention. The second division correction unit 92b is also an embodiment of the second line segmentation correction device of the present invention.

【0173】(第2統合修正部の構成について)次に、
図11を参照して、第2統合修正部90bの構成につい
て説明する。図11は、第2統合修正部90bの構成の
説明に供する機能ブロック図である。第2統合修正部9
0bは、切り出された第2分割行の高さ若しくは幅と行
間隔とに着目して、本来1つの分割行として切り出され
るべきところを誤って2つの分割行として切り出された
分割行を発見する。そして、第2統合修正部90bは、
その2つの分割行を1つの分割行として切り出すことに
より、第2分割行の行切出しの修正を行なう。
(Regarding Configuration of Second Integrated Correction Unit)
With reference to FIG. 11, the configuration of the second integrated correction unit 90b will be described. FIG. 11 is a functional block diagram for explaining the configuration of the second integrated correction unit 90b. Second integrated correction unit 9
0b focuses on the height or width and the line interval of the cut-out second divided line, and finds a divided line that is erroneously cut out as two divided lines where it should originally be cut out as one divided line. . Then, the second integrated correction unit 90b
By cutting out the two divided lines as one divided line, the line extraction of the second divided line is corrected.

【0174】そのために、第2統合修正部90bは、第
2平均黒画素区間長算出部120b、第2候補区間選択
部122b、第3統合区間長検出部124c、第4統合
区間長検出部124d、第3統合区間長誤差算出部12
5c、第4統合区間長誤差算出部125d、第2選択統
合区間選択部126b、第2白画素区間長検出部128
bおよび第2統合部130bを具えている。
For this purpose, the second integrated correcting section 90b includes a second average black pixel section length calculating section 120b, a second candidate section selecting section 122b, a third integrated section length detecting section 124c, and a fourth integrated section length detecting section 124d. , The third integrated section length error calculator 12
5c, fourth integrated section length error calculating section 125d, second selected integrated section selecting section 126b, second white pixel section length detecting section 128
b and a second integration unit 130b.

【0175】そして、この第2平均黒画素区間長算出部
120bは、第2分割行切出し部18bにおいて切り出
された第2分割行の第2黒画素区間の長さ(第2黒画素
区間長)の相加平均を第2平均黒画素区間長として求め
る。そして、この第2平均黒画素区間長算出部120b
は、第2平均黒画素区間長の情報を第2候補区間選択部
122bへ送出する。
The second average black pixel section length calculation section 120b calculates the length of the second black pixel section (second black pixel section length) of the second division row cut out by the second division row extraction section 18b. Is determined as a second average black pixel section length. Then, the second average black pixel section length calculation unit 120b
Sends information on the second average black pixel section length to the second candidate section selection unit 122b.

【0176】また、第2候補区間選択部122bは、第
2平均黒画素区間長と第2黒画素区間長とを比較して、
第2黒画素区間のうち、第2平均黒画素区間長に対する
第2黒画素区間長の比率が第8基準値よりも小さな第2
黒画素区間を第2候補区間として選択する。そして、第
2候補区間選択部122bは、選択された第2候補区間
の情報を第3および第4統合区間長検出部124cおよ
び124dにそれぞれ送出する。尚、この第8基準値
は、上記の第6基準値と同様に、例えば1未満で0より
も大きな任意好適な値(例えば0.5程度)を設定する
と良い。また、第8基準値と第6基準値とは互いに等し
くとも良く、また、互いに異なる値であっても良い。
The second candidate section selection unit 122b compares the second average black pixel section length with the second black pixel section length, and
In the second black pixel section, the ratio of the second black pixel section length to the second average black pixel section length is smaller than the eighth reference value.
The black pixel section is selected as the second candidate section. Then, the second candidate section selection unit 122b sends information on the selected second candidate section to the third and fourth integrated section length detection units 124c and 124d, respectively. The eighth reference value may be set to any suitable value (for example, about 0.5) smaller than 1 and larger than 0, for example, similarly to the above-mentioned sixth reference value. The eighth reference value and the sixth reference value may be equal to each other, or may be different values.

【0177】また、第3統合区間長検出部124cは、
この第2候補区間の一方の側の直近の第2黒画素区間で
ある第2候補黒画素区間とこの第2候補区間とを一つの
連続した黒画素区間とした場合の当該黒画素区間を第3
統合区間とし、当該第3統合区間の長さ(第3統合区間
長)を求める。そして、この第3統合区間長検出部12
4cは、求められた第3統合区間長の情報を第3統合区
間長誤差算出部125cへ送出する。
Further, the third integrated section length detecting section 124c
A second candidate black pixel section, which is the second black pixel section closest to one side of the second candidate section, and the black pixel section when the second candidate section is defined as one continuous black pixel section. 3
As an integrated section, the length of the third integrated section (third integrated section length) is obtained. Then, the third integrated section length detecting unit 12
4c sends the information on the obtained third integrated section length to the third integrated section length error calculating section 125c.

【0178】また、第3統合区間長誤差算出部125c
は、第3統合区間の長さと第2平均黒画素区間長との差
を第3統合区間長誤差として算出する。そして、第3統
合区間長誤差算出部125cは、算出された第3統合区
間長誤差を、第2選択統合区間選択部126bへ送出す
る。
The third integrated section length error calculating section 125c
Calculates the difference between the length of the third integrated section and the second average black pixel section length as the third integrated section length error. Then, the third integrated section length error calculating section 125c sends out the calculated third integrated section length error to the second selected integrated section selecting section 126b.

【0179】また、第4統合区間長検出部124dは、
この第2候補区間の他方の側の直近の第2黒画素区間で
ある第4候補黒画素区間とこの第2候補区間とを1つの
連続した黒画素区間とした場合の当該黒画素区間を第4
統合区間とし、当該第4統合区間の長さ(第4統合区間
長)を求める。そして、この第4統合区間長検出部12
4dは、求められた第4統合区間長の情報を第4統合区
間長誤差算出部125dへ送出する。
Further, the fourth integrated section length detecting section 124d
When the fourth candidate black pixel section, which is the second black pixel section nearest to the other side of the second candidate section, and this second candidate section are defined as one continuous black pixel section, 4
As an integrated section, the length of the fourth integrated section (fourth integrated section length) is obtained. Then, the fourth integrated section length detector 12
4d sends the obtained information on the fourth integrated section length to the fourth integrated section length error calculating unit 125d.

【0180】また、第4統合区間長誤差算出部125d
は、第4統合区間の長さと第2平均黒画素区間長との差
を第4統合区間長誤差として算出する。そして、第4統
合区間長誤差算出部125dは、算出された第4統合区
間長誤差を、第2選択統合区間選択部126bへ送出す
る。
The fourth integrated section length error calculating section 125d
Calculates the difference between the length of the fourth integrated section and the second average black pixel section length as the fourth integrated section length error. Then, the fourth integrated section length error calculating section 125d sends the calculated fourth integrated section length error to the second selected integrated section selecting section 126b.

【0181】また、第2選択統合区間選択部126b
は、第3統合区間長誤差と第4統合区間長誤差とを比較
して、誤差の小さい方の統合区間を第2選択統合区間と
して選択する。そして、第2選択統合区間選択部126
bは、選択された第2選択統合区間の情報を第2白画素
区間長検出部128bへ送出する。
The second selection integrated section selection section 126b
Compares the third integrated section length error with the fourth integrated section length error, and selects the integrated section having the smaller error as the second selected integrated section. Then, the second selection integrated section selection unit 126
b sends the information of the selected second selected integrated section to the second white pixel section length detecting unit 128b.

【0182】また、第2白画素区間長検出部128b
は、この第2選択統合区間のうちの、第2候補区間と当
該第2候補区間の直近の第2黒画素区間との間の第2白
画素区間の長さを求める。そして、第2白画素区間長検
出部128bは、求められた第2白画素区間の長さの情
報を第2統合部130bへ送出する。
The second white pixel section length detecting section 128b
Calculates the length of the second white pixel section between the second candidate section and the second black pixel section immediately adjacent to the second candidate section in the second selection integration section. Then, the second white pixel section length detection unit 128b sends the obtained information on the length of the second white pixel section to the second integration unit 130b.

【0183】また、第2統合部130bは、この第2白
画素区間の長さと第9基準値とを比較して、当該第2白
画素区間の長さが当該第9基準値よりも短い場合に、第
2選択統合区間を1つの連続した第2黒画素区間とする
ことにより、行切出しの修正を行なう。尚、この第9基
準値は、上記の第7基準値と同様に、任意好適な値を設
定すると良い。例えば、第9基準値と第7基準値とは互
いに等しくとも良く、また、互いに異なっていても良
い。
The second integration section 130b compares the length of the second white pixel section with the ninth reference value, and determines that the length of the second white pixel section is shorter than the ninth reference value. Next, the line selection is corrected by setting the second selected integrated section as one continuous second black pixel section. The ninth reference value may be set to any suitable value, similarly to the above-described seventh reference value. For example, the ninth reference value and the seventh reference value may be equal to each other, or may be different from each other.

【0184】尚、第2白画素区間の長さが第9基準値以
上の場合には、第2選択統合区間が本来1行ではない可
能性が高いため、その第2候補区間の行切出を第2選択
統合区間の行切出しへ修正する処理は行なわない。
If the length of the second white pixel section is equal to or longer than the ninth reference value, it is highly likely that the second selected integrated section is not originally one line, so the line is cut out from the second candidate section. Is corrected to the line segmentation of the second selected integrated section.

【0185】(第2分割修正部の構成について)次に、
図12を参照して、第2分割修正部92bの構成につい
て説明する。図12は、第2分割修正部92bの構成の
説明に供する機能ブロック図である。第2統合修正部9
2bは、切り出された第2分割行の高さ若しくは幅に着
目して、本来2つの分割行として切り出されるべきとこ
ろを誤って1つの分割行として切り出された分割行を発
見する。そして、第2分割修正部92bは、その分割行
を2つの分割行として切り出すことにより、第1分割行
の行切出しの修正を行なう。
(Regarding the Configuration of the Second Division Correction Unit)
With reference to FIG. 12, the configuration of the second division correction unit 92b will be described. FIG. 12 is a functional block diagram for explaining the configuration of the second division correction unit 92b. Second integrated correction unit 9
2b focuses on the height or width of the cut-out second divided line, and finds a divided line that is erroneously cut out as one divided line where it should be cut out as two divided lines. Then, the second division correction unit 92b corrects the line division of the first division line by cutting out the division line as two division lines.

【0186】そのために、第2分割修正部92bは、第
2平均黒画素区間長算出部131b、第2分割候補区間
選択部132b、第3位置抽出部134c、第4位置抽
出部134d、最寄第3位置抽出部136c、最寄第4
位置抽出部136d、第3分割部138cおよび第4分
割部138cを具えている。
For this purpose, the second division correction section 92b includes a second average black pixel section length calculation section 131b, a second division candidate section selection section 132b, a third position extraction section 134c, a fourth position extraction section 134d, Third position extracting unit 136c, nearest fourth position
A position extracting unit 136d, a third dividing unit 138c, and a fourth dividing unit 138c are provided.

【0187】そして、この第2平均黒画素区間長算出部
131bは、第2分割行切出し部18bにおいて切り出
された第2分割行の第2黒画素区間の長さ(第2黒画素
区間長)の相加平均を第2平均黒画素区間長として求め
る。そして、第2平均黒画素区間長算出部131bは、
求められた第2平均黒画素区間長の情報を第2分割候補
区間選択部132bへ送出する。
The second average black pixel section length calculator 131b calculates the length of the second black pixel section (second black pixel section length) of the second divided row cut out by the second divided row cutout section 18b. Is determined as a second average black pixel section length. Then, the second average black pixel section length calculation unit 131b calculates
The obtained information on the second average black pixel section length is sent to the second division candidate section selection section 132b.

【0188】また、第2分割候補区間選択部132b
は、第2平均黒画素区間長と第2黒画素区間長とを比較
して、第2黒画素区間のうち、第2平均黒画素区間長に
対する第2黒画素区間長の比率が第16基準値よりも大
きな第2黒画素区間を第2分割候補区間として選択す
る。そして、第2分割候補区間選択部132bは、選択
された第2分割候補区間の情報を第3および第4位置抽
出部134cおよび134dへ送出する。尚、この第1
6基準値は、上記の第11基準値と同様に、任意好適な
値を設定すると良い。
The second division candidate section selection section 132b
Compares the second average black pixel section length with the second black pixel section length, and determines that the ratio of the second black pixel section length to the second average black pixel section length in the second black pixel section is a sixteenth reference. A second black pixel section larger than the value is selected as a second division candidate section. Then, the second division candidate section selection unit 132b sends information on the selected second division candidate section to the third and fourth position extraction units 134c and 134d. In addition, this first
As the sixth reference value, any suitable value may be set similarly to the above-described eleventh reference value.

【0189】また、第3位置抽出部134cは、走査線
のうち第2分割候補区間の中央付近を走査する走査線上
で黒画素の検出される位置のうち、第1方向に沿って最
も一方寄りの位置を第3位置として抽出する。そして、
第3位置抽出部134cは、抽出された第3位置の情報
を最寄第3位置抽出部136cへ送出する。
Further, the third position extracting section 134c is the most one-side position along the first direction among the positions where black pixels are detected on a scanning line that scans the vicinity of the center of the second division candidate section in the scanning line. Is extracted as the third position. And
The third position extracting unit 134c sends information on the extracted third position to the nearest third position extracting unit 136c.

【0190】また、最寄第3位置抽出部136cは、第
3位置のうち、第1方向に沿って最も他方寄りの第3位
置を最寄第3位置として抽出する。そして、最寄第3位
置抽出部136cは、抽出された最寄第3位置の情報を
第3および第4分割部138cおよび138dへ送出す
る。
Further, the nearest third position extracting unit 136c extracts the third position closest to the other side in the first direction among the third positions as the nearest third position. Then, the nearest third position extracting unit 136c sends information on the extracted nearest third position to the third and fourth dividing units 138c and 138d.

【0191】また、第4位置抽出部134dは、走査線
のうち第2分割候補区間の中央付近を走査する走査線上
で黒画素の検出される位置のうち、第2方向に沿って最
も他方寄りの位置を第4位置として抽出する。そして、
第4位置抽出部134dは、抽出された第4位置の情報
を最寄第4位置抽出部136dへ送出する。
Further, the fourth position extracting section 134d detects the position of the black pixel on the scanning line that scans the vicinity of the center of the second division candidate section in the scanning line, and is located closest to the other side in the second direction. Is extracted as the fourth position. And
The fourth position extracting unit 134d sends information on the extracted fourth position to the nearest fourth position extracting unit 136d.

【0192】また、最寄第4位置抽出部136dは、第
4位置のうち、第2方向に沿って最も一方寄りの第4位
置を最寄第4位置として抽出する。そして、最寄第4位
置抽出部136dは、抽出された最寄第4位置の情報を
第3および第4分割部138cおよび138dへ送出す
る。
The fourth nearest position extraction unit 136d extracts the fourth position closest to the first position along the second direction from the fourth positions as the nearest fourth position. Then, the nearest fourth position extracting unit 136d sends information on the extracted nearest fourth position to the third and fourth dividing units 138c and 138d.

【0193】また、第3分割部138cは、最寄第3位
置と最寄第4位置とを比較して、この最寄第3位置がこ
の最寄第4位置よりも他方側である場合またはこの最寄
第3位置とこの最寄第4位置とが第1方向に沿った同一
直線上に位置する場合に、第2分割候補区間を、当該第
2分割候補区間の中央で2つに分割させて2つの分割黒
画素区間を生成することにより、行切出しの修正を行な
う。
The third division 138c compares the nearest third position with the nearest fourth position, and determines whether the nearest third position is on the other side of the nearest fourth position or When the nearest third position and the nearest fourth position are located on the same straight line along the first direction, the second division candidate section is divided into two at the center of the second division candidate section. By generating two divided black pixel sections, the line segmentation is corrected.

【0194】また、第4分割部138dは、最寄第3位
置と最寄第4位置とを比較して、この最寄第3位置がこ
の最寄第4位置よりも一方側である場合に、この最寄第
3位置とこの最寄第4位置との中間を通りかつ第2方向
に沿った分割線で第2分割候補区間を分割することによ
り、一方側の一方分割領域および他方側の他方分割領域
を生成し、一方分割領域を最寄第4位置が得られた走査
線によって分割して2つの分割黒画素区間を生成し、か
つ、他方分割領域を最寄第3位置が得られた走査線によ
って分割して2つの分割黒画素区間を生成することによ
り行切出しの修正を行なう。
The fourth division 138d compares the nearest third position with the nearest fourth position, and determines that the nearest third position is one side of the nearest fourth position. By dividing the second division candidate section by a division line passing through the middle between the nearest third position and the nearest fourth position and along the second direction, the one divided area on one side and the other divided area on the other side are divided. The other divided area is generated, one divided area is divided by the scanning line at which the nearest fourth position is obtained to generate two divided black pixel sections, and the other divided area is obtained at the nearest third position. The line segmentation is performed by dividing the scan line into two divided black pixel sections, thereby correcting the line segmentation.

【0195】(動作について)次に、図13を参照し
て、この実施の形態の行切出し装置10の動作、この発
明の行切出し方法、この発明の第1および第2の行切出
し修正方法の例について併せて詳細に説明する。図13
は、この実施の形態の行切出し装置10の全体的な動作
の流れの説明に供する流れ図である。
(Operation) Next, with reference to FIG. 13, the operation of the line extracting apparatus 10 of this embodiment, the line extracting method of the present invention, and the first and second line extracting and correcting methods of the present invention will be described. Examples will also be described in detail. FIG.
3 is a flowchart for explaining the overall operation flow of the line segmentation device 10 of the present embodiment.

【0196】また、図13においては、切替S2のステ
ップから終了に到るまで、行方向が事前に判明している
場合の行切出し処理の流れを実線で示す(行方向が第1
方向の場合と第2方向の場合との2通りの処理の流れを
それぞれ示す。)。また、行方向が事前に不明である場
合の行切出し処理の流れを破線で示す。
In FIG. 13, the flow of the line cutout processing when the line direction is known in advance from the step of switching S2 to the end is shown by a solid line (the line direction is the first line).
Two types of processing flows, one for the direction and one for the second direction, are shown. ). The broken line shows the flow of the line cutout process when the line direction is unknown in advance.

【0197】(行方向が不明である場合の動作の全体的
な流れについて)ここでは、先ず、事前に行方向が不明
である場合の行切出し装置10の動作の全体的な流れに
ついて説明する。行方向が不明である場合とは、例え
ば、文書画像60の情報に当該文書画像の行方向を示す
情報が何も付与されていない場合、若しくは、文書画像
60の情報に行方向を示す情報が付与されていてもその
付与された情報が確認できなかった場合が該当する。
(Overall Flow of Operation When Row Direction is Unknown) First, the overall flow of the operation of the line segmenting apparatus 10 when the row direction is unknown in advance will be described. The case where the line direction is unknown is, for example, a case where no information indicating the line direction of the document image is added to the information of the document image 60, or the information indicating the line direction is included in the information of the document image 60. This applies to the case where the assigned information could not be confirmed even if it was assigned.

【0198】行切出し装置10に文書画像60が入力さ
れると、制御部28は、先ず、行方向確認切替部12を
起動させる。起動された行方向確認切替部12の行方向
確認部12aは、文書画像60の情報に、当該文書画像
60の行方向を示す情報が付与されているか確認する。
この場合は、文書画像60には、行方向を示す情報が付
与されていないとする。従って、行方向確認部12a
は、行方向が不明という確認結果を切替部12bに、文
書画像60の情報と共に出力する(図13のS1)。
When the document image 60 is input to the line segmenting device 10, the control unit 28 first activates the line direction confirmation switching unit 12. The activated line direction confirmation switching unit 12 of the activated line direction confirmation switching unit 12 confirms whether information indicating the line direction of the document image 60 is added to the information of the document image 60.
In this case, it is assumed that the document image 60 is not provided with information indicating the row direction. Therefore, the row direction checking unit 12a
Outputs the confirmation result that the line direction is unknown to the switching unit 12b together with the information of the document image 60 (S1 in FIG. 13).

【0199】そして、行方向確認部12aから行方向が
不明であるという確認結果を受けた切替部12bは、図
13において破線で示すように、文書画像60の情報を
第1および第2方向分割領域生成部14aおよび14b
の両方へ送出する(図13のS2)。
When the switching unit 12b receives the confirmation result that the line direction is unknown from the line direction confirmation unit 12a, the switching unit 12b divides the information of the document image 60 into the first and second direction as shown by the broken line in FIG. Area generating units 14a and 14b
(S2 in FIG. 13).

【0200】第1方向分割領域生成部14aは、文書画
像60を分割して、第1分割領域を生成する(図13の
S3)。生成された第1分割領域の情報は、第1方向射
影分布作成部16aへ送出される。
The first direction divided area generating section 14a divides the document image 60 to generate a first divided area (S3 in FIG. 13). The generated information of the first divided area is sent to the first direction projection distribution creating unit 16a.

【0201】次に、第1方向射影分布作成部16aは、
各第1分割領域について第1方向射影分布をそれぞれ作
成する(図13のS4)。生成された第1方向射影分布
の情報は、第1分割行切出し部18aへ送出される。
Next, the first direction projection distribution creating unit 16a
A first direction projection distribution is created for each first divided region (S4 in FIG. 13). The generated information of the first direction projection distribution is sent to the first divided line cutout unit 18a.

【0202】次に第1分割行切出し部18aは、各第1
分割領域について第1方向射影分布に基づいて、それぞ
れ第1分割行を切り出す(図13のS5)。切り出され
た第1分割行の情報(例えば、第1黒画素区間の位置、
数、長さ)は、行方向判定部20へ送出される。
Next, the first divided row cutout section 18a
First divided rows are cut out for each divided area based on the first direction projection distribution (S5 in FIG. 13). Information of the first divided row (for example, the position of the first black pixel section,
(Number, length) are sent to the row direction determination unit 20.

【0203】一方、第1方向分割領域生成部14bは、
文書画像60を分割して、第2分割領域を生成する(図
13のS6)。生成された第2分割領域の情報は、第2
方向射影分布作成部16bへ送出される。
On the other hand, the first direction divided area generation section 14b
The document image 60 is divided to generate a second divided area (S6 in FIG. 13). The information of the generated second divided area is the second divided area.
It is sent to the direction projection distribution creating unit 16b.

【0204】次に、第2方向射影分布作成部16bは、
各第2分割領域について第2方向射影分布をそれぞれ作
成する(図13のS7)。生成された第2方向射影分布
の情報は、第2分割行切出し部18bへ送出される。
Next, the second direction projection distribution creating section 16b
A second direction projection distribution is created for each second divided region (S7 in FIG. 13). The generated information on the second direction projection distribution is sent to the second divided line cutout unit 18b.

【0205】次に第2分割行切出し部18bは、各第2
分割領域について第2方向射影分布に基づいて、それぞ
れ第2分割行を切り出す(図13のS8)。切り出され
た第2分割行の情報(例えば、第2黒画素区間の位置、
数、長さ)は、行方向判定部20へ送出される。
Next, the second divided line cutout unit 18b
A second divided row is cut out for each divided area based on the second direction projection distribution (S8 in FIG. 13). Information of the cut-out second divided row (for example, the position of the second black pixel section,
(Number, length) are sent to the row direction determination unit 20.

【0206】行方向判定部20は、第1分割行の情報お
よび第2分割行の情報とに基づいて、文書画像60の行
方向の判定を行なう(図13のS9)。行方向の判定結
果は、切替出力部22へ送出される。
The line direction determining section 20 determines the line direction of the document image 60 based on the information on the first divided line and the information on the second divided line (S9 in FIG. 13). The determination result in the row direction is sent to the switching output unit 22.

【0207】切替出力部22は、行方向の判定結果が第
1方向である場合は、第1分割行切出し部18aで切り
出された第1分割行の情報を第1修正部24aへ送出す
る。また、切替出力部22は、行方向の判定結果が第2
方向である場合は、第2分割行切出し部18bで切り出
された第2分割行の情報を第2修正部24bへ送出する
(図13のS10)。
When the determination result of the row direction is the first direction, the switching output section 22 sends the information of the first divided row extracted by the first divided row extracting section 18a to the first correction section 24a. Further, the switching output unit 22 determines that the row direction determination result is the second
In the case of the direction, the information of the second divided line extracted by the second divided line extraction unit 18b is sent to the second correction unit 24b (S10 in FIG. 13).

【0208】そして、行方向の判定結果が第1方向であ
る場合には、第1修正部24aは、切り出された分割行
の修正を必要に応じて行なう(図13のS11)。修正
された第1分割行の情報は、第1分割行接続部26aへ
送出される。
If the row direction is determined to be in the first direction, the first correction unit 24a corrects the cut-out divided lines as necessary (S11 in FIG. 13). The corrected information of the first divided row is sent to the first divided row connecting unit 26a.

【0209】そして、第1分割行接続部26aでは、第
1分割行どうしを接続して行の切出しを行なう(図13
のS12)。
Then, the first divided row connecting section 26a connects the first divided rows to each other and cuts out a row (FIG. 13).
S12).

【0210】一方、行方向の判定結果が第2方向である
場合には、第2修正部24bは、切り出された分割行の
修正を必要に応じて行なう(図13のS13)。修正さ
れた第2分割行の情報は、第2分割行接続部26bへ送
出される。
On the other hand, if the row direction is determined to be in the second direction, the second correction unit 24b corrects the cut-out divided lines as necessary (S13 in FIG. 13). The corrected information on the second divided row is sent to the second divided row connecting unit 26b.

【0211】そして、第2分割行接続部26bでは、第
2分割行どうしを接続して行の切出しを行なう(図13
のS14)。
Then, the second divided row connection section 26b connects the second divided rows to each other and cuts out a row (FIG. 13).
S14).

【0212】このようにして、行方向が事前に不明であ
る場合の行切出しの動作を終了する。
In this way, the line cutting operation when the line direction is unknown in advance is ended.

【0213】(行方向が第1方向である場合の動作の全
体的な流れについて)次に、行方向が事前に第1方向で
あると分かっている場合の行切出し装置10の動作につ
いて説明する。
(Overall Flow of Operation when Row Direction is First Direction) Next, the operation of the line segmenting device 10 when the row direction is known in advance to be the first direction will be described. .

【0214】行切出し装置10に文書画像60が入力さ
れると、制御部28は、先ず、行方向確認切替部12を
起動させる。起動された行方向確認切替部12の行方向
確認部12aは、文書画像60の情報に、当該文書画像
60の行方向を示す情報が付与されているか確認する。
この場合は、文書画像60に、行方向が第1方向である
ことを示す情報が付与されているものする。従って、行
方向確認部12aは、行方向が第1方向であるという確
認結果を切替部12bに、文書画像60の情報と共に出
力する(図13のS1)。
[0214] When the document image 60 is input to the line segmentation device 10, the control unit 28 first activates the line direction confirmation switching unit 12. The activated line direction confirmation switching unit 12 of the activated line direction confirmation switching unit 12 confirms whether information indicating the line direction of the document image 60 is added to the information of the document image 60.
In this case, information indicating that the row direction is the first direction is added to the document image 60. Therefore, the line direction confirmation unit 12a outputs a confirmation result that the line direction is the first direction to the switching unit 12b together with the information of the document image 60 (S1 in FIG. 13).

【0215】そして、行方向確認部12aから行方向が
第1方向であるという確認結果を受けた切替部12b
は、図13において紙面右寄りの実線Iで示すように、
文書画像60の情報を第1方向分割領域生成部14aへ
送出する(図13のS2)。
The switching unit 12b receives the result of the confirmation that the row direction is the first direction from the row direction confirmation unit 12a.
Is indicated by a solid line I on the right side of FIG.
The information of the document image 60 is sent to the first direction divided area generation unit 14a (S2 in FIG. 13).

【0216】次に、第1方向分割領域生成部14aは、
文書画像60を分割して、第1分割領域を生成する(図
13のS3)。生成された第1分割領域の情報は、第1
方向射影分布作成部16aへ送出される。
Next, the first direction divided area generation unit 14a
The document image 60 is divided to generate a first divided area (S3 in FIG. 13). The information of the generated first divided area is the first divided area.
It is sent to the direction projection distribution creating unit 16a.

【0217】次に、第1方向射影分布作成部16aは、
各第1分割領域について第1方向射影分布をそれぞれ作
成する(図13のS4)。生成された第1方向射影分布
の情報は、第1分割行切出し部18aへ送出される。
Next, the first direction projection distribution creating unit 16a
A first direction projection distribution is created for each first divided region (S4 in FIG. 13). The generated information of the first direction projection distribution is sent to the first divided line cutout unit 18a.

【0218】次に第1分割行切出し部18aは、各第1
分割領域について第1方向射影分布に基づいて、それぞ
れ第1分割行を切り出す(図13のS5)。そして、行
方向が第1方向である場合には、切り出された第1分割
行の情報(例えば、第1黒画素区間の位置、数、長さ)
は、第1修正部24aへ送出される。
Next, the first divided line cutout section 18a
First divided rows are cut out for each divided area based on the first direction projection distribution (S5 in FIG. 13). If the row direction is the first direction, information on the cut-out first divided row (for example, the position, number, and length of the first black pixel section)
Is sent to the first correction unit 24a.

【0219】次に、第1修正部24aは、切り出された
分割行の修正を必要に応じて行なう(図13のS1
1)。修正された第1分割行の情報は、第1分割行接続
部26aへ送出される。
Next, the first correction unit 24a corrects the cut-out divided lines as necessary (S1 in FIG. 13).
1). The corrected information of the first divided row is sent to the first divided row connecting unit 26a.

【0220】次に、第1分割行接続部26aでは、第1
分割行どうしを接続して行の切出しを行なう(図13の
S12)。
Next, the first divided row connecting section 26a
Rows are cut out by connecting the divided rows (S12 in FIG. 13).

【0221】このようにして、行方向が第1方向である
ことが事前に分かっている場合の行切出しの動作を終了
する。
In this manner, the line cutting operation in the case where it is known in advance that the row direction is the first direction ends.

【0222】(行方向が第2方向である場合の動作の全
体的な流れについて)次に、行方向が事前に第2方向で
あると分かっている場合の行切出し装置10の動作につ
いて説明する。
(Overall Flow of Operation when Row Direction is Second Direction) Next, the operation of the line segmenting device 10 when the row direction is known in advance to be the second direction will be described. .

【0223】行切出し装置10に文書画像60が入力さ
れると、制御部28は、先ず、行方向確認切替部12を
起動させる。起動された行方向確認切替部12の行方向
確認部12aは、文書画像60の情報に、当該文書画像
60の行方向を示す情報が付与されているか確認する。
この場合は、文書画像60に、行方向が第2方向である
ことを示す情報が付与されているものする。従って、行
方向確認部12aは、行方向が第2方向であるという確
認結果を切替部12bに、文書画像60の情報と共に出
力する(図13のS1)。
When the document image 60 is input to the line segmentation device 10, the control unit 28 first activates the line direction confirmation switching unit 12. The activated line direction confirmation switching unit 12 of the activated line direction confirmation switching unit 12 confirms whether information indicating the line direction of the document image 60 is added to the information of the document image 60.
In this case, information indicating that the row direction is the second direction is added to the document image 60. Therefore, the line direction confirmation unit 12a outputs a confirmation result that the line direction is the second direction to the switching unit 12b together with the information of the document image 60 (S1 in FIG. 13).

【0224】そして、行方向確認部12aから行方向が
第2方向であるという確認結果を受けた切替部12b
は、図13において紙面左寄りの実線IIで示すよう
に、文書画像60の情報を第2方向分割領域生成部14
bへ送出する(図13のS2)。
The switching unit 12b receives the result of the confirmation from the row direction confirmation unit 12a that the row direction is the second direction.
13, the information of the document image 60 is divided by the second direction divided area generation unit 14 as indicated by a solid line II on the left side of the paper of FIG.
b (S2 in FIG. 13).

【0225】次に、第2方向分割領域生成部14bは、
文書画像60を分割して、第2分割領域を生成する(図
13のS6)。生成された第2分割領域の情報は、第2
方向射影分布作成部16bへ送出される。
Next, the second direction divided area generation unit 14b
The document image 60 is divided to generate a second divided area (S6 in FIG. 13). The information of the generated second divided area is the second divided area.
It is sent to the direction projection distribution creating unit 16b.

【0226】次に、第2方向射影分布作成部16bは、
各第2分割領域について第2方向射影分布をそれぞれ作
成する(図13のS7)。生成された第2方向射影分布
の情報は、第2分割行切出し部18bへ送出される。
Next, the second direction projection distribution creating section 16b
A second direction projection distribution is created for each second divided region (S7 in FIG. 13). The generated information on the second direction projection distribution is sent to the second divided line cutout unit 18b.

【0227】次に第2分割行切出し部18bは、各第2
分割領域について第2方向射影分布に基づいて、それぞ
れ第2分割行を切り出す(図13のS8)。そして、行
方向が第2方向である場合には、切り出された第2分割
行の情報(例えば、第2黒画素区間の位置、数、長さ)
は、第2修正部24bへ送出される。
Next, the second divided line cutout section 18b
A second divided row is cut out for each divided area based on the second direction projection distribution (S8 in FIG. 13). If the row direction is the second direction, information on the cut-out second divided row (for example, the position, number, and length of the second black pixel section)
Is sent to the second correction unit 24b.

【0228】次に、第2修正部24bは、切り出された
分割行の修正を必要に応じて行なう(図13のS1
3)。修正された第2分割行の情報は、第2分割行接続
部26bへ送出される。
Next, the second correction section 24b corrects the cut-out divided lines as necessary (S1 in FIG. 13).
3). The corrected information on the second divided row is sent to the second divided row connecting unit 26b.

【0229】次に、第2接続部26bでは、第2分割行
どうしを接続して行の切出しを行なう(図13のS1
4)。
Next, in the second connection section 26b, the second divided rows are connected to each other to cut out the rows (S1 in FIG. 13).
4).

【0230】このようにして、行方向が第2方向である
ことが事前に分かっている場合の行切出しの動作を終了
する。
In this way, the line cutting operation when the line direction is known in advance to be the second direction ends.

【0231】(行切出しの対象について)以下、図14
に示す文書画像60の行切出しを行なう場合の各ステッ
プの動作についてそれぞれ説明する。この文書画像60
の行方向は横方向である。すなわち、この文書画像60
には、横書きの文字列62が10行含まれている。この
文字列62にはそれぞれ全角文字および半角文字が含ま
れている。また、各文字列62の文字間隔は固定ピッチ
ではなく、可変ピッチ(プロポーショナル)とする。ま
た、図14においては、各文字列に含まれる各文字をそ
れぞれ、ハッチングを付した円で模式的に示す。例え
ば、全角文字64aを正円で示し、かつ、半角文字64
bを縦長の楕円で示す。
(Regarding Line Cutting Object) Hereinafter, FIG.
The operation of each step when line extraction of the document image 60 shown in FIG. This document image 60
Is a horizontal direction. That is, the document image 60
Contains ten horizontal character strings 62. The character string 62 includes full-width characters and half-width characters, respectively. The character spacing of each character string 62 is not fixed pitch but variable pitch (proportional). In FIG. 14, each character included in each character string is schematically shown by a hatched circle. For example, full-width characters 64a are indicated by a perfect circle, and half-width characters 64a are
b is indicated by a vertically long ellipse.

【0232】また、図14においては、紙面の横方向に
X軸をとり、紙面の縦方向にY軸をとる。以下、X軸方
向を水平方向とも称する。また、Y軸方向を垂直方向と
も称する。
In FIG. 14, the X axis is taken in the horizontal direction on the paper surface and the Y axis is taken in the vertical direction on the paper surface. Hereinafter, the X-axis direction is also referred to as a horizontal direction. Further, the Y-axis direction is also referred to as a vertical direction.

【0233】また、この文書画像60には、図2に示し
た文字領域設定部32において文字領域66が設定され
る。そして、文字領域66が設定された文書画像60
が、行切出し装置10へ入力される。
In the document image 60, a character area 66 is set in the character area setting section 32 shown in FIG. Then, the document image 60 in which the character area 66 is set
Is input to the line segmentation device 10.

【0234】(文書画像の分割処理について)次に、文
書画像60を対象として、文書画像の分割処理の例につ
いて説明する。
(Regarding Document Image Division Processing) Next, an example of document image division processing for the document image 60 will be described.

【0235】文書画像60の行方向が不明である場合ま
たは行方向が第1方向である場合に、制御部28は、第
1方向分割領域生成部14aを起動する。起動された第
1方向分割領域生成部14aは、図15の(A)に示す
ように、第2方向(縦方向)に沿った分割線A−Aおよ
び分割線B−Bによって、文書画像60の文字領域66
を分割する(図13のS3)。また、文字領域66を分
割することにより、文字領域66中の各文字列(行)6
2もそれぞれ分割される。尚、文字領域66を分割すれ
ば、結果的に文書画像60も分割されることになる。
If the line direction of the document image 60 is unknown or the line direction is the first direction, the control unit 28 activates the first direction divided area generation unit 14a. As shown in FIG. 15A, the activated first direction divided area generation unit 14a generates the document image 60 by using the dividing line AA and the dividing line BB along the second direction (vertical direction). Character area 66
Is divided (S3 in FIG. 13). Further, by dividing the character area 66, each character string (line) 6 in the character area 66 is divided.
2 is also divided respectively. When the character area 66 is divided, the document image 60 is also divided as a result.

【0236】そして、図15の(A)に示すように、こ
の分割により、この実施の形態では、この第2方向と直
交する第1方向、すなわち横方向に沿って並んだ3つの
第1方向分割領域(水平方向分割領域)68が生成され
る。ここでは、水平方向分割領域68として、第1分割
領域68a、第2分割領域68bおよび第3分割領域6
8cをそれぞれ生成する。
As shown in FIG. 15A, in this embodiment, in this embodiment, three first directions arranged along the first direction orthogonal to the second direction, that is, along the horizontal direction, are obtained. A divided area (horizontal divided area) 68 is generated. Here, as the horizontal division area 68, the first division area 68a, the second division area 68b, and the third division area 6
8c respectively.

【0237】また、行方向が不明である場合または行方
向第2方向である場合に、制御部28は、第2方向分割
領域生成部14bを起動する。起動された第2方向分割
領域生成部14bは、図15の(B)に示すように、第
1方向(横方向)に沿った分割線にC−C、分割線D−
Dおよび分割線E−Eによって文書画像60の文書領域
66を分割する(図13のS6)。
If the row direction is unknown or the row direction is the second direction, the control unit 28 activates the second direction divided area generation unit 14b. As shown in FIG. 15B, the activated second direction divided area generation unit 14b sets the dividing line along the first direction (horizontal direction) to C-C and the dividing line D-
The document area 66 of the document image 60 is divided by D and the dividing line EE (S6 in FIG. 13).

【0238】そして、図15の(B)に示すように、こ
の実施の形態では、この分割により、この第1方向と直
交する第2方向、すなわち縦方向に沿って並んだ4つの
第2方向分割領域(垂直分割領域)70が生成される。
ここでは、垂直分割領域70として、第4分割領域70
a、第5分割領域70b、第6分割領域70cおよび第
7分割領域70dをそれぞれ生成する。
In this embodiment, as shown in FIG. 15B, this division makes it possible to form four second directions orthogonal to the first direction, that is, four second directions arranged along the vertical direction. A divided area (vertical divided area) 70 is generated.
Here, the fourth divided area 70 is used as the vertical divided area 70.
a, the fifth divided area 70b, the sixth divided area 70c, and the seventh divided area 70d are respectively generated.

【0239】また、この実施の形態においては、文字領
域66を3つの分割領域に水平分割したが、この分割数
は、任意好適な値(自然数)とすることができる。例え
ば、分割数は、文書画像の文字領域の解像度、文字領域
の面積といった条件にじて、適宜設定すると良い。
In this embodiment, the character area 66 is horizontally divided into three divided areas, but the number of divisions can be set to any suitable value (natural number). For example, the number of divisions may be set as appropriate according to conditions such as the resolution of the character area of the document image and the area of the character area.

【0240】例えば、文字領域66の水平方向(X軸方
向、横方向)に沿った幅をWaとし、最大幅がWth以
下の水平分割領域を生成する場合、水平方向の分割数n
を下記の(1)によって求めても良い。
For example, when the width of the character area 66 along the horizontal direction (X-axis direction, horizontal direction) is defined as Wa and a horizontal divided area whose maximum width is equal to or smaller than Wth is generated, the number of divisions n in the horizontal direction is n.
May be obtained by the following (1).

【0241】 n=(Wa+Wth)/Wth・・・(1) 但し、上記の(1)式においては、除算の商を整数で表
し、除算のあまりを切り捨てるものとする。
N = (Wa + Wth) / Wth (1) In the above equation (1), the quotient of the division is represented by an integer, and the remainder of the division is discarded.

【0242】そして、文字領域66を均等にn分割する
場合には、各水平分割領域の幅をWa/n画素(ドッ
ト)とすると良い。
When the character area 66 is equally divided into n, the width of each horizontal division area is preferably set to Wa / n pixels (dots).

【0243】また、例えば、文字領域を垂直方向(Y軸
方向、縦方向)に沿った高さをHaとし、最大高さがH
th以下の垂直分割領域を生成する場合、垂直方向の分
割数mを下記の(2)式によって求めても良い。
Also, for example, the height along the vertical direction (Y-axis direction, vertical direction) of the character area is defined as Ha, and the maximum height is defined as H.
When generating a vertical division area equal to or less than th, the number m of divisions in the vertical direction may be obtained by the following equation (2).

【0244】 m=(Ha+Hth)/Hth・・・(2) 但し、上記の(2)式においては、除算のあまりを切り
捨てて、除算の商を整数で表すものとする。
M = (Ha + Hth) / Hth (2) In the above equation (2), the remainder of the division is rounded down, and the quotient of the division is represented by an integer.

【0245】そして、文字領域66を均等にm分割する
場合には、各垂直分割領域の高さをHa/m画素(ドッ
ト)とすると良い。
When the character area 66 is equally divided into m, the height of each vertical division area is preferably set to Ha / m pixels (dots).

【0246】また、この発明では、文字領域66は必ず
しも均等に分割しなくとも良い。また、この発明では、
文字領域66を設定せずに文書画像60を分割しても良
い。
In the present invention, the character area 66 does not necessarily need to be divided evenly. In the present invention,
The document image 60 may be divided without setting the character area 66.

【0247】(射影分布の作成処理について)次に、射
影分布の作成処理についてより詳細に説明する。行方向
が不明である場合若しくは行方向が第1方向である場
合、制御部28は、第1方向射影分布作成部16aを起
動する。起動された第1方向射影分布作成部16aは、
第1方向分割領域(水平分割領域)68の各々につい
て、第1方向(水平方向)を主走査方向とし第2方向
(垂直方向)を副走査方向として当該第1方向分割領域
を走査して走査線毎に累積黒画素数を検出することによ
り第1方向射影分布(水平射影分布)72を作成する
(図13のS4)。
(Regarding Projection Distribution Creation Processing) Next, the projection distribution creation processing will be described in more detail. When the row direction is unknown or the row direction is the first direction, the control unit 28 activates the first direction projection distribution creation unit 16a. The activated first direction projection distribution creating unit 16a
For each of the first direction divided regions (horizontal divided regions) 68, scanning is performed by scanning the first direction divided region with the first direction (horizontal direction) as the main scanning direction and the second direction (vertical direction) as the sub-scanning direction. The first direction projection distribution (horizontal projection distribution) 72 is created by detecting the cumulative number of black pixels for each line (S4 in FIG. 13).

【0248】この実施の形態においては、第1方向分割
領域68のうちの第1分割領域68aについて第1方向
射影分布72を作成する。ここで、図16の(A)に、
第1分割領域68aおよびその第1方向射影分布72を
示す。この第1方向射影分布72は、走査線毎の累積黒
画素数をヒストグラムで表したものである。従って、射
影分布の高さは、累積黒画素数を相対的に表す。
In this embodiment, the first direction projection distribution 72 is created for the first divided area 68a of the first direction divided area 68. Here, FIG.
The first divided area 68a and its first direction projection distribution 72 are shown. The first direction projection distribution 72 represents the cumulative number of black pixels for each scanning line in a histogram. Therefore, the height of the projection distribution relatively indicates the cumulative number of black pixels.

【0249】また、この第1方向射影分布72は、文書
画像60の行方向に沿って走査して得られたものであ
る。このため、第1方向射影分布72には、複数の互い
に独立した射影ブロック74が含まれる。第1方向射影
分布72は、第1方向射影分布作成部16aの内部メモ
リに格納される。
The first direction projection distribution 72 is obtained by scanning the document image 60 along the row direction. For this reason, the first direction projection distribution 72 includes a plurality of mutually independent projection blocks 74. The first direction projection distribution 72 is stored in the internal memory of the first direction projection distribution creating unit 16a.

【0250】また、行方向が不明である場合若しくは行
方向が第2方向である場合、制御部28は、第2方向射
影分布作成部14bを起動する。起動された第2方向射
影分布作成部16bは、第2方向分割領域(垂直分割領
域)70の各々について、第2方向(垂直方向)を主走
査方向とし第1方向(水平方向)を副走査方向として第
2方向分割領域を走査して走査線毎に累積黒画素数を検
出することにより第2方向射影分布(垂直射影分布)7
8を作成する(図13のS7)。
When the row direction is unknown or when the row direction is the second direction, the control unit 28 activates the second direction projection distribution creating unit 14b. The activated second direction projection distribution creating unit 16b sets the second direction (vertical direction) to the main scanning direction and sets the first direction (horizontal direction) to the sub-scanning for each of the second direction divided areas (vertical divided areas) 70. The second direction projection distribution (vertical projection distribution) 7 is obtained by scanning the second direction divided area as the direction and detecting the cumulative number of black pixels for each scanning line.
8 (S7 in FIG. 13).

【0251】この実施の形態においては、第2方向分割
領域70のうちの第4分割領域70aについて第2方向
射影分布78を作成する。ここで、図16の(B)に、
第1分割領域70aおよびその第2方向射影分布78を
示す。この第2方向射影分布78は、走査線毎の累積黒
画素数をヒストグラムで表したものである。従って、射
影分布の高さは、累積黒画素数を相対的に表す。
In this embodiment, the second direction projection distribution 78 is created for the fourth divided area 70a of the second direction divided area 70. Here, FIG.
The first divided region 70a and its second direction projection distribution 78 are shown. The second direction projection distribution 78 represents the cumulative number of black pixels for each scanning line in a histogram. Therefore, the height of the projection distribution relatively indicates the cumulative number of black pixels.

【0252】また、この第2方向射影分布78は、文書
画像60の行方向を横断する方向に走査して得られたも
のである。従って、第2方向射影分布78は、不規則に
連続した射影となる。第2方向射影分布78のデータ
は、第2方向射影分布作成部16b内部のメモリに格納
される。
The second direction projection distribution 78 is obtained by scanning the document image 60 in a direction crossing the row direction. Therefore, the second direction projection distribution 78 is an irregularly continuous projection. The data of the second direction projection distribution 78 is stored in a memory inside the second direction projection distribution creating unit 16b.

【0253】(分割行の切出し処理について)次に、分
割行の切出し処理についてより詳細に説明する。
(Regarding the process of extracting a divided line) Next, the process of extracting a divided line will be described in more detail.

【0254】行方向が不明である場合若しくは行方向が
第1方向である場合、制御部28は、第1分割行切出し
部18aを起動する。起動された第1分割行切出し部1
8aは、第1方向射影分布72の各々において第1基準
値(例えば1画素)以上の累積黒画素数が第2方向(垂
直方向)に沿って連続する区間をそれぞれ第1黒画素区
間とする。そして、第1分割行切出し部18aは、この
第1黒画素区間がそれぞれ得られる走査領域をそれぞれ
第1分割行として分割行切出しを行なう(図13のS
5)。
When the row direction is unknown or when the row direction is the first direction, the control unit 28 activates the first divided row cutout unit 18a. Activated first divided line cutout unit 1
8a, a section in which the cumulative number of black pixels equal to or more than a first reference value (for example, one pixel) in each of the first direction projection distributions 72 is continuous in the second direction (vertical direction) is defined as a first black pixel section. . Then, the first divided line cutout unit 18a performs divided line cutout with the scanning regions in which the first black pixel sections are obtained as first divided lines (S in FIG. 13).
5).

【0255】その結果、第1方向射影分布72における
各射影ブロック74の得られた各副走査区間は、それぞ
れ、各文字列62が分割線A−Aによって分割されて生
成した分割行76に対応する。図16の(A)では、切
り出された10行の各分割行76をそれぞれ矩形枠76
で模式的に示す。尚、この分割行の切出しは、全ての第
1分割領域68について行なう。
As a result, each sub-scanning section obtained from each projection block 74 in the first direction projection distribution 72 corresponds to a divided line 76 generated by dividing each character string 62 by the dividing line AA. I do. In FIG. 16A, each of the 10 divided lines 76 cut out is defined by a rectangular frame 76.
Are shown schematically. The extraction of the divided rows is performed for all the first divided areas 68.

【0256】また、行方向が不明である場合若しくは行
方向が第2方向である場合、制御部28は、第2分割行
切出し部18bを起動する。起動された第2分割行切出
し部18bは、第2方向射影分布78の各々において第
2基準値(例えば1画素)以上の累積黒画素数が第1方
向(水平方向)に沿って連続する区間をそれぞれ第2黒
画素区間とする。そして、第2分割行切出し部18b
は、この第2黒画素区間がそれぞれ得られる走査領域を
それぞれ第2分割行として分割行切出しを行なう(図1
3のS8)。
When the row direction is unknown or the row direction is the second direction, the control unit 28 activates the second divided row cutout unit 18b. The activated second divided line cutout unit 18b is a section in which the cumulative number of black pixels equal to or more than the second reference value (for example, one pixel) is continuous along the first direction (horizontal direction) in each of the second direction projection distributions 78. Are each a second black pixel section. Then, the second divided line cutout unit 18b
Performs segmented line segmentation using the scanning area in which each of the second black pixel sections is obtained as a second segmented row (FIG. 1).
3 S8).

【0257】この第2方向射影分布78は、図16の
(B)においてa、b、cおよびdの符号でそれぞれ示
す部位で途切れている。そして、図16の(B)では、
第4分割領域70aに含まれる文字列62を、第2方向
射影分布78の射影が途切れた各部位で分割して生成し
た各分割行80を矩形枠80で模式的に示す。各分割行
80は、互いに第1方向(水平方向)に並んでおり、か
つ、それぞれ複数の文字列62の一部分ずつを含んでい
る。図16の(B)では、5つの分割行80を生成した
例を示す。
The second direction projection distribution 78 is interrupted at portions indicated by reference numerals a, b, c, and d in FIG. 16B. Then, in FIG. 16B,
Each divided line 80 generated by dividing the character string 62 included in the fourth divided region 70a at each part where the projection of the second direction projection distribution 78 is interrupted is schematically shown by a rectangular frame 80. Each divided line 80 is arranged in the first direction (horizontal direction) with each other, and includes a part of each of the plurality of character strings 62. FIG. 16B shows an example in which five divided rows 80 are generated.

【0258】以下、第1分割領域68a中の分割行76
を水平分割行76と称し、第4分割領域70a中の分割
行78を垂直分割行80と称する。
Hereinafter, the divided row 76 in the first divided area 68a
Is referred to as a horizontal divided row 76, and the divided row 78 in the fourth divided area 70a is referred to as a vertical divided row 80.

【0259】また、この実施の形態においては、図13
のS3〜S5のステップと、S6〜S8のステップとを
互いに並列に処理しても良い。
In this embodiment, FIG.
Steps S3 to S5 and steps S6 to S8 may be processed in parallel with each other.

【0260】(行方向判定部の動作について)次に、文
書画像60の行方向が事前に不明である場合の行方向判
定部の動作例について詳細に説明する。
(Regarding Operation of Line Direction Judgment Unit) Next, an example of operation of the line direction judgment unit when the line direction of the document image 60 is unknown in advance will be described.

【0261】行方向判定部20における行方向判定の動
作(図13のS9)について、図17を参照して説明す
る。図17は、行方向判定部20の動作の説明に供する
流れ図である。以下、行方向判定部20を構成する第1
判定部201、第2判定部202および第3判定部20
3の動作について順次に説明する。
The operation (S9 in FIG. 13) of the row direction determination in the row direction determination section 20 will be described with reference to FIG. FIG. 17 is a flowchart for explaining the operation of the row direction determination unit 20. Hereinafter, the first part of the row direction determination unit 20 will be described.
Determination unit 201, second determination unit 202, and third determination unit 20
Operation 3 will be described sequentially.

【0262】(第1判定部の動作について)先ず、第1
判定部201の動作の一例として、図14に示した、複
数の行を含む文書画像60の判定を行なう場合の動作に
ついて説明する。
(Regarding the Operation of the First Judgment Unit) First, the first
As an example of the operation of the determination unit 201, an operation when the document image 60 including a plurality of lines is determined as illustrated in FIG. 14 will be described.

【0263】制御部28は、先ず、行方向判定部20の
第1判定部201を起動する。そして、制御部28は、
起動された第1判定部201へ、第1分割行切出し部1
8aおよび第2分割行切出し部18bから、それぞれ第
1射影分布および第2射影分布のデータを送る。
The control unit 28 first activates the first determination unit 201 of the row direction determination unit 20. Then, the control unit 28
To the activated first determination unit 201, the first divided line cutout unit 1
8a and the data of the first projection distribution and the second projection distribution, respectively, are sent from the second divided row cutout unit 18b.

【0264】第1方向射影分布作成部16aにおいて
は、全ての分割領域68について第1方向射影分布72
を作成した。従って、第1判定部201の第1分割領域
数計数部36aは、生成された分割領域68の数の合計
である第1分割領域数nを「3」と計数する。
In the first direction projection distribution creating section 16a, the first direction projection distribution 72
It was created. Therefore, the first divided region number counting unit 36a of the first determination unit 201 counts the first divided region number n, which is the total number of the generated divided regions 68, as “3”.

【0265】また、各分割領域の第1方向射影分布72
には、前述のように、それぞれ10個の射影ブロック7
4が含まれる。各射影ブロック74は、第1方向射影分
布72において第1基準値(ここでは1画素)以上の累
積黒画素の射影が第1方向に連続した第1黒画素区間で
ある。従って、第1判定部201の第1黒画素区間数計
数部38aは、第1方向射影分布における黒画素区間の
数の、全ての分割領域にわたっての合計である第1黒画
素区間数Nhを「30(10×3)」と計数する。
The first direction projection distribution 72 of each divided area
As described above, each of the ten projection blocks 7
4 is included. Each projection block 74 is a first black pixel section in which the projection of the accumulated black pixels of the first reference value (here, one pixel) or more in the first direction projection distribution 72 is continuous in the first direction. Therefore, the first black pixel section number counting unit 38a of the first determination unit 201 sets the first black pixel section number Nh, which is the sum of the number of black pixel sections in the first direction projection distribution over all the divided regions, to " 30 (10 × 3) ”.

【0266】また、第2方向射影分布作成部16bにお
いては、全ての分割領域70について第2方向射影分布
78を作成した。従って、第1判定部201の第2分割
領域数計数部36bは、分割領域の数の合計である第2
分割領域数mを「4」と計数する。
In the second direction projection distribution creating section 16b, the second direction projection distribution 78 is created for all the divided areas 70. Therefore, the second divided region number counting unit 36b of the first determination unit 201 calculates the second divided region number that is the total number of divided regions.
The number m of divided areas is counted as “4”.

【0267】また、各分割領域の第2方向射影分布78
には、それぞれ5つの第2黒画素区間が含まれていると
する。例えば、前述のように、第4分割領域70aの第
2方向射影分布78は、a、b、cおよびdの4箇所で
途切れている。この4箇所で途切れた5つの射影分布の
各々は、いずれも、第2方向射影分布78において第2
基準値(ここでは1画素)以上の累積黒画素数の射影が
第1方向(横方向)に連続する第2黒画素区間である。
ここでは、そのほかの第2分割領域の第2方向射影分布
においても、同じ数の黒画素区間が含まれているものと
する。従って、第1判定部201の第2黒画素区間数計
数部38bは、各第2黒画素区間の数の全ての分割領域
にわたっての合計である第2黒画素区間数Mvを「20
(5×4)」と計数する。
In addition, the second direction projection distribution 78 of each divided area
Each include five second black pixel sections. For example, as described above, the second direction projection distribution 78 of the fourth divided region 70a is interrupted at four positions a, b, c, and d. Each of the five projection distributions interrupted at the four locations is the second projection distribution 78 in the second direction projection distribution 78.
This is a second black pixel section in which the projection of the cumulative number of black pixels equal to or more than the reference value (here, one pixel) is continuous in the first direction (lateral direction).
Here, it is assumed that the same number of black pixel sections are included in the second direction projection distribution of the other second divided areas. Therefore, the second black pixel section number counting section 38b of the first determination section 201 sets the second black pixel section number Mv, which is the sum of the number of each second black pixel section over all divided regions, to "20".
(5 × 4) ”.

【0268】尚、これら第1分割領域数計数部36a、
第2分割領域数計数部36b、第1黒画素区間数計数部
38aおよび第2黒画素区間数計数部38bの処理の順
序は限定されない。
The first divided area number counting section 36a,
The order of the processes of the second divided region number counting section 36b, the first black pixel section number counting section 38a, and the second black pixel section number counting section 38b is not limited.

【0269】次に、第1判定部201の区間数分割数比
較判定部40において、第1黒画素区間数Nhと第1分
割領域数nとを比較し、かつ第2黒画素区間数Mvと第
2分割領域数mとを比較する(図17のS1およびS
2)。
Next, the section number division number comparison judgment section 40 of the first judgment section 201 compares the first black pixel section number Nh with the first division area number n, and compares the second black pixel section number Mv with the second black pixel section number Mv. Compare the number m of the second divided areas (S1 and S1 in FIG. 17).
2).

【0270】この実施例では、先ず、n=Nhかつm≠
Mvであるか否かを判断する(図17のS1)。そし
て、n=Nhかつm≠Mvである場合(Y)には、この
文書画像60を横書きと判定する。これに対して、n=
Nhかつm≠Mvでない場合(N)には、次のS2のス
テップへ進む。
In this embodiment, first, n = Nh and m ≠
It is determined whether it is Mv (S1 in FIG. 17). If n = Nh and m ≠ Mv (Y), the document image 60 is determined to be horizontally written. On the other hand, n =
If Nh and m ≠ Mv are not satisfied (N), the process proceeds to the next step S2.

【0271】ステップS2においては、n≠Nhかつm
=Mvであるか否かを判断する(図17のS2)。そし
て、n≠Nhかつm=Mvである場合(Y)には、この
文書画像60を縦書きと判定する。これに対して、n≠
Nhかつm=Mvでない場合(N)には、次のS3およ
びS4のステップへ進む。
In step S2, n ≠ Nh and m
= Mv (S2 in FIG. 17). If n ≠ Nh and m = Mv (Y), the document image 60 is determined to be vertically written. On the other hand, n ≠
If Nh and m = Mv are not satisfied (N), the process proceeds to the next steps S3 and S4.

【0272】ここでは、第1黒画素区間数Nh(10)
と第1分割領域数n(1)とは一致せず、かつ、第2黒
画素区間数Mv(5)と第2分割領域数m(1)とも一
致しない。このため、この場合は、第1判定部201で
は、行方向を判定することができない。
Here, the first black pixel section number Nh (10)
Does not match the first divided area number n (1), and does not match the second black pixel section number Mv (5) and the second divided area number m (1). Therefore, in this case, the first determination unit 201 cannot determine the row direction.

【0273】そこで、制御部28は、次のステップS3
およびS4の処理へ進むため、行方向判定部20のうち
の第2判定部202に判定を行なわせる。
Then, the control unit 28 executes the next step S3
In order to proceed to steps S4 and S4, the second determination unit 202 of the row direction determination unit 20 makes a determination.

【0274】(文字列が1行の場合の第1判定部の動作
例について)この実施の形態において行方向の判定の対
象とした文書画像60には、上述のように、複数の行が
含まれている。このため、第1判定部201において
は、文書画像60の行方向を判定しない。
(Example of Operation of First Judgment Unit in Case of One Line of Character String) As described above, the document image 60 subjected to the judgment of the line direction in this embodiment includes a plurality of lines. Have been. Therefore, the first determination unit 201 does not determine the line direction of the document image 60.

【0275】そこで、第1判定部201の動作の一層の
理解を図るため、1行の文字列のみが含まれている文書
画像の行方向の判定を行なう動作例について説明する。
ここでは、図18の(A)に、文書画像の文字領域50
に横書きの文字列52が1行のみ含まれている例を示
す。また、図18では、便宜的に、文字列52の領域に
斜線を付して示す。以下、この実施の形態では、横方向
を第1方向、縦方向を第2方向として説明する。
In order to better understand the operation of the first determination unit 201, an example of the operation of determining the line direction of a document image including only one line of character string will be described.
Here, the character area 50 of the document image is shown in FIG.
Shows an example in which the horizontal character string 52 includes only one line. In FIG. 18, the area of the character string 52 is indicated by hatching for convenience. Hereinafter, in this embodiment, the horizontal direction will be described as a first direction, and the vertical direction will be described as a second direction.

【0276】先ず、図18の(B)に示すように、上述
の第1方向分割領域生成部14aにおいて、この文字領
域50を縦方向の分割線A−Aおよび分割線B−Bによ
って3分割する場合について説明する。この分割の結
果、横方向に順次に並んだ第1分割領域50a、第2分
割領域50bおよび第3分割領域50cが生成される。
また、この分割の結果、文字列52も、第1分割行52
a、第2分割行52bおよび第3分割行52cに分割さ
れる。この第1分割行52aは、第1分割領域50aに
含まれる。また、第2分割行52bは、第2分割領域5
0bに含まれる。また、第3分割行52cは、第3分割
領域50cに含まれる。
First, as shown in FIG. 18B, in the above-described first direction divided area generating section 14a, the character area 50 is divided into three parts by a vertical dividing line AA and a dividing line BB. Will be described. As a result of this division, a first divided region 50a, a second divided region 50b, and a third divided region 50c are sequentially arranged in the horizontal direction.
As a result of this division, the character string 52 is also changed to the first divided line 52.
a, a second divided row 52b and a third divided row 52c. The first divided row 52a is included in the first divided area 50a. In addition, the second divided row 52b includes the second divided area 5
0b. The third divided row 52c is included in the third divided area 50c.

【0277】そして、上述の第1方向射影分布作成部1
6aにおいて、この3つの分割領域のうちの例えば、第
1分割領域50aおよび第2分割領域50bの2つの分
割領域について横方向の射影分布(第1方向射影分布)
をそれぞれ作成する。
Then, the above-described first direction projection distribution creating section 1
In 6a, a horizontal projection distribution (first direction projection distribution) is applied to two of the three divided regions, for example, a first divided region 50a and a second divided region 50b.
Is created respectively.

【0278】ここで、図18の(C)に、第1分割領域
50aを示す。この第1分割領域50aには、第1分割
行52aが1行だけ含まれている。そして、第1分割領
域50aの右側に、第1分割領域50aを横方向に走査
して得られた第1方向射影分布54aを示す。この第1
方向射影分布54aは、第1分割行52aに対応した1
つのブロック状の射影である。このブロック状の射影は
1つの黒画素区間56aに対応する。従って、1つの分
割領域50aにつき1つの黒画素区間56aが得られ
る。
Here, FIG. 18C shows the first divided area 50a. The first divided area 50a includes only one first divided row 52a. Then, on the right side of the first divided region 50a, a first direction projection distribution 54a obtained by scanning the first divided region 50a in the horizontal direction is shown. This first
The direction projection distribution 54a is the one corresponding to the first divided row 52a.
One block-shaped projection. This block-shaped projection corresponds to one black pixel section 56a. Therefore, one black pixel section 56a is obtained for one divided region 50a.

【0279】また、図18の(D)に、第2分割領域5
0bを示す。この第2分割領域50bには、第2分割行
52bが1行だけ含まれている。そして、第2分割領域
50bの右側に、第2分割領域50bを横方向に走査し
て得られた第1方向射影分布54bを示す。この第1方
向射影分布54bは、第2分割行52bに対応した1つ
のブロック状の射影である。このブロック状の射影は1
つの黒画素区間56bに対応する。従って、1つの分割
領域50bにつき1つの黒画素区間56bが得られる。
FIG. 18D shows the second divided area 5.
0b is indicated. The second divided area 50b includes only one second divided row 52b. The first direction projection distribution 54b obtained by scanning the second divided region 50b in the horizontal direction is shown on the right side of the second divided region 50b. The first direction projection distribution 54b is one block-shaped projection corresponding to the second divided row 52b. This block-shaped projection is 1
One black pixel section 56b. Therefore, one black pixel section 56b is obtained for one divided region 50b.

【0280】そして、前述のように、分割領域数は、3
つである。従って、この第1分割領域数計数部36a
は、分割領域の数の合計である第1分割領域数を「3」
と計数する。
Then, as described above, the number of divided areas is 3
One. Therefore, the first divided area number counting section 36a
Sets the first number of divided areas, which is the total number of divided areas, to "3".
Is counted.

【0281】また、前述のように、第1分割領域50a
の第1方向射影分布54aの黒画素区間56aの数は
「1」である。また、第2分割領域50bの第1方向射
影分布54bの黒画素区間56bの数も「1」である。
また、第3分割領域50cの第1方向射影分布54cの
黒画素区間56cの数も「1」である。
Further, as described above, the first divided area 50a
The number of black pixel sections 56a of the first direction projection distribution 54a is “1”. Further, the number of black pixel sections 56b of the first direction projection distribution 54b of the second divided area 50b is also “1”.
Further, the number of black pixel sections 56c of the first direction projection distribution 54c of the third divided area 50c is also “1”.

【0282】従って、第1黒画素区間数計数部38a
は、第1方向射影分布における黒画素区間の数の、全て
の分割領域にわたっての合計である第1黒画素区間数を
「3」(=1+1+1)と計数する。
Therefore, the first black pixel section number counting section 38a
Counts the number of first black pixel sections, which is the sum of the number of black pixel sections in the first direction projection distribution over all divided regions, as “3” (= 1 + 1 + 1).

【0283】次に、図19の(A)に示すように、上述
の第2方向分割領域生成部12bにおいて、図18の
(A)に示した文字領域50を横方向の分割線C−Cお
よび分割線D−Dによって3分割する場合について説明
する。この分割の結果、縦方向に順次に並んだ第4分割
領域50d、第5分割領域50eおよび第6分割領域5
0fの3つの分割領域が生成される。そして、文字列5
2は、第5分割領域50eに含まれる。
Next, as shown in FIG. 19A, in the above-described second direction divided area generating section 12b, the character area 50 shown in FIG. The case where the image is divided into three by the dividing line DD will be described. As a result of this division, the fourth divided region 50d, the fifth divided region 50e, and the sixth divided region 5 sequentially arranged in the vertical direction
Three divided areas of 0f are generated. And the character string 5
2 is included in the fifth divided region 50e.

【0284】そして、上述の第1方向射影分布作成部1
6aにおいて、この3つの分割領域について縦方向の射
影分布(第2方向射影分布)をそれぞれ作成する。
The first direction projection distribution creating unit 1 described above
In step 6a, a vertical projection distribution (second direction projection distribution) is created for each of the three divided regions.

【0285】ここで、図19の(B)に、第4分割領域
50dを示す。第4分割領域50dには、文字列52が
含まれていない。従って、第4分割領域50dを縦方向
に走査しても、射影分布は得られない。従って、第4分
割領域50dからは黒画素区間は得られない。また、第
6分割領域50fからも同様に、黒画素区間は得られな
い。
Here, FIG. 19B shows a fourth divided region 50d. The character string 52 is not included in the fourth divided area 50d. Therefore, even if the fourth divided region 50d is scanned in the vertical direction, a projected distribution cannot be obtained. Therefore, a black pixel section cannot be obtained from the fourth divided area 50d. Similarly, a black pixel section cannot be obtained from the sixth divided area 50f.

【0286】また、図19の(C)に、第5分割領域5
0eを示す。第5分割領域50eには、文字列52がそ
のまま含まれる。そして、第5分割領域50eの下側
に、第5分割領域50eを縦方向に走査して得られた第
2方向射影分布54eを示す。この第2方向射影分布5
4eは、1つの連続した射影である。この射影は、1つ
の黒画素区間56eに対応する。従って、1つの分割領
域50eにつき1つの黒画素区間56eが得られる。
FIG. 19C shows the fifth divided area 5.
0e. The character string 52 is directly included in the fifth divided area 50e. The second direction projection distribution 54e obtained by scanning the fifth divided area 50e in the vertical direction is shown below the fifth divided area 50e. This second direction projection distribution 5
4e is one continuous projection. This projection corresponds to one black pixel section 56e. Therefore, one black pixel section 56e is obtained for one divided region 50e.

【0287】そして、この第2分割領域数計数部36b
は、分割領域の数の合計である第2分割領域数を「3」
と計数する。
Then, the second divided area number counting section 36b
Sets the number of second divided areas, which is the total number of divided areas, to "3"
Is counted.

【0288】また、前述のように、第4および第6分割
領域50dおよび50fの黒画素区間の数はいずれも
「0」である。また、第5分割領域50eの第2方向射
影分布54eの黒画素区間56eの数は「1」である。
As described above, the number of black pixel sections in the fourth and sixth divided areas 50d and 50f is "0". The number of black pixel sections 56e in the second direction projection distribution 54e of the fifth divided region 50e is “1”.

【0289】従って、第2黒画素区間数計数部38b
は、第2方向射影分布における黒画素区間の数の、全て
の分割領域にわたっての合計である第2黒画素区間数を
「1」(=0+1+0)と計数する。
Therefore, the second black pixel section number counting section 38b
Counts the number of second black pixel sections, which is the sum of the number of black pixel sections in the second direction projection distribution over all the divided regions, as “1” (= 0 + 1 + 0).

【0290】次に、区間数分割数比較判定部40におい
て、行方向を判定する。ここでは、、第1黒画素区間数
(3)と第1分割領域数(3)とが一致し、かつ、第2
黒画素区間数(1)と第2分割領域数(3)とが一致し
ないので、行方向を第1方向、すなわち横方向と判定す
る。
Next, the section number division number comparison judgment section 40 judges the row direction. Here, the first black pixel section number (3) matches the first divided area number (3), and the second black pixel section number (3) matches the second black pixel section number (3).
Since the number of black pixel sections (1) does not match the number of second divided areas (3), the row direction is determined to be the first direction, that is, the horizontal direction.

【0291】このように、文書画像の文字領域に文字列
が1行のみ含まれている場合には、行方向と直交する分
割線によって分割された各分割領域に、分割行が1つず
つ含まれる。その結果、この場合には、分割領域の数
と、各分割領域にそれぞれ含まれる分割行の数の合計と
が一致する。これに対して、行方向に沿った分割線によ
って文字領域を分割した場合には、分割領域の数と、分
割行の数の合計とは一致しない。例えば、複数の分割領
域が生成されても、分割行の数の合計は1つのままとな
る。従って、文字列が1行だけ場合には、分割領域の数
と分割行の数の合計とを比較すれば、黒画素区間長のば
らつきや白画素区間長の平均値を比較するまでもなく、
行方向を判定することができる。
As described above, when only one line of a character string is included in the character region of the document image, one divided line is included in each divided region divided by the dividing line orthogonal to the line direction. It is. As a result, in this case, the number of divided areas matches the total number of divided rows included in each divided area. On the other hand, when the character area is divided by the dividing line along the line direction, the number of divided areas does not match the total number of divided lines. For example, even if a plurality of divided areas are generated, the total number of divided rows remains one. Therefore, when the character string has only one line, if the number of divided regions and the total number of divided lines are compared, it is not necessary to compare the variation of the black pixel section length and the average value of the white pixel section length.
The row direction can be determined.

【0292】従って、文書画像中の文字列が1行だけ場
合には、第1判定部201において分割領域の数と分割
行の数の合計とを比較することにより、第2判定部20
2で後述のように黒画素区間長のばらつきを比較した
り、第3判定部203で後述のように白画素区間長の平
均値を比較するまでもなく、行方向の判定精度の向上を
図ることができる。
Therefore, when the character string in the document image is only one line, the first judgment unit 201 compares the number of divided areas with the total number of divided lines, thereby making the second judgment unit 20.
2, it is not necessary to compare the variation of the black pixel section length as described later, or to compare the average value of the white pixel section length as described later in the third determination unit 203, thereby improving the determination accuracy in the row direction. be able to.

【0293】尚、上記の動作例においては、2つの第1
方向分割領域と2つの第2方向分割領域についてそれぞ
れ射影分布を作成したが、例えば、全ての分割領域につ
いて射影分布を作成しても良い。また、1つの第1方向
分割領域と1つの第2方向分割領域についてのみ射影分
布を作成しても良い。
In the operation example described above, the two first
Although the projection distribution is created for each of the direction divided areas and the two second direction divided areas, for example, the projection distribution may be created for all divided areas. Further, the projection distribution may be created only for one first direction divided region and one second direction divided region.

【0294】また、例えば、第2分割領域50bと第5
分割領域50eのみについて射影分布を作成した場合
は、第1分割領域数および第2分割領域数はいずれも
「1」となる。そして、第1黒画素区間数および第2黒
画素区間数はいずれも「1」となる。この場合は、第1
分割領域数「1」と第1黒画素区間数「1」とが等し
く、かつ、第2分割領域数「1」と第2黒画素区間数
「1」とが等しいので、区間数分割数比較判定部40に
おける判定条件が満たされない。従って、この場合は、
区間数分割数比較判定部40は行方向を判定しない。そ
の場合は、第2判定部202で行方向の判定を試みる。
Further, for example, the second divided area 50b and the fifth divided area 50b
When the projection distribution is created only for the divided region 50e, both the first divided region number and the second divided region number are “1”. Then, both the first black pixel section number and the second black pixel section number are “1”. In this case, the first
Since the number of divided areas “1” is equal to the number of first black pixel sections “1”, and the number of second divided areas “1” is equal to the number of second black pixel sections “1”, the number of divided sections is compared. The determination condition in the determination unit 40 is not satisfied. Therefore, in this case,
The section number division number comparison determination unit 40 does not determine the row direction. In that case, the second determination unit 202 attempts to determine the row direction.

【0295】(第2判定部の動作について)次に、第2
判定部の動作について説明する。
(Regarding the Operation of the Second Judgment Unit)
The operation of the determination unit will be described.

【0296】次に、制御部28は、判定部20の第2判
定部202を起動する。そして、制御部28は、起動さ
れた第2判定部202へ第1分割行切出し部18aおよ
び第2分割行切出し部18bから、それぞれ第1射影分
布および第2射影分布のデータを送る。
Next, the control unit 28 activates the second judgment unit 202 of the judgment unit 20. Then, the control unit 28 sends the data of the first projection distribution and the data of the second projection distribution to the activated second determination unit 202 from the first divided line cutout unit 18a and the second divided line cutout unit 18b, respectively.

【0297】(第1ばらつき算出部の動作について)先
ず、図20の(A)を参照して、第2判定部202の第
1ばらつき算出部42aの動作について説明する。図2
0の(A)は、第1ばらつき算出部42aの説明に供す
る図であり、図16の(A)に示された第1分割領域6
8aの一部分およびその部分に対応する第1方向射影分
72の部分を示す。
(Regarding the Operation of the First Variation Calculation Unit) First, the operation of the first variation calculation unit 42a of the second determination unit 202 will be described with reference to FIG. FIG.
(A) of FIG. 0 is a diagram provided for explanation of the first variation calculation unit 42a, and the first divided area 6 shown in (A) of FIG.
8A shows a portion of the portion 8a and a portion of the first direction projection 72 corresponding to the portion.

【0298】図20の(A)においては、第1分割領域
68a中の分割行76を、紙面の上側から順に、第1分
割行76a、第2分割行76b、第3分割行76c・・
・第10分割行76jとする。また、第1分割行76
a、第2分割行76b、第3分割行76c・・・第10
分割行76jをそれぞれ走査して得られた射影ブロック
74をそれぞれ第1射影ブロック74a、第2射影ブロ
ック74b、第3射影ブロック74c・・・第10射影
ブロック74jとする。尚、図20の(A)において
は、第4〜第9射影ブロックの図示を省略する。
In FIG. 20A, the divided rows 76 in the first divided area 68a are arranged in order from the upper side of the drawing sheet into a first divided row 76a, a second divided row 76b, a third divided row 76c,.
-The tenth divided row 76j is used. Also, the first divided row 76
a, second divided row 76b, third divided row 76c... tenth
The projection blocks 74 obtained by scanning the divided rows 76j are referred to as first projection blocks 74a, second projection blocks 74b, third projection blocks 74c,..., Tenth projection blocks 74j. In FIG. 20A, illustration of the fourth to ninth projection blocks is omitted.

【0299】そして、第1ばらつき算出部42aは、先
ず、第1方向射影分布72を形成する累積黒画素数のう
ち、第1基準値(例えば1画素)以上の累積黒画素数が
第2方向(垂直方向)に沿って連続しているとき、その
連続する区間82を第1黒画素区間として、当該第1黒
画素区間82の長さ(第1黒画素区間長)を求める。こ
こでは、第1射影ブロック74a,第2射影ブロック7
4b,第3射影ブロック74c・・・第10射影ブロッ
ク74jに対応する各黒画素区間82の第1黒画素区間
長をそれぞれH(1)、H(2)、H(3)・・・H
(10)として求める。
The first variation calculator 42a first determines that the cumulative number of black pixels equal to or greater than the first reference value (for example, one pixel) in the cumulative number of black pixels forming the first direction projection distribution 72 When it is continuous along (vertical direction), the continuous section 82 is defined as a first black pixel section, and the length of the first black pixel section 82 (first black pixel section length) is obtained. Here, the first projection block 74a and the second projection block 7
4b, third projection block 74c... The first black pixel section length of each black pixel section 82 corresponding to the tenth projection block 74j is H (1), H (2), H (3).
Determined as (10).

【0300】また、第1黒画素区間長のデータは、例え
ば、文書画像60において各射影ブロック74の端が得
られる位置をXY座標を求め、各射影ブロック74の副
走査方向に沿った両端のXY座標の距離(この場合はY
座標の値の差)として表しても良い。また、第1黒画素
区間長のデータは、例えば、各射影ブロック74の副走
査方向に沿った両端間の画素数で表示しても良い。
The data of the first black pixel section length is obtained, for example, by obtaining the XY coordinates of the position where the end of each projection block 74 is obtained in the document image 60, and calculating the XY coordinates of the end of each projection block 74 in the sub-scanning direction. XY coordinate distance (in this case, Y
(Difference in coordinate values). Further, the data of the first black pixel section length may be represented by, for example, the number of pixels between both ends of each projection block 74 along the sub-scanning direction.

【0301】また、第1基準値を1画素とした場合に
は、各第1黒画素区間長は、それぞれ各射影ブロック7
4の副走査方向の長さと一致する。各射影ブロック74
の副走査方向の長さは、それぞれ各分割行76の高さと
一致する。これに対して、第1基準値を2画素以上の値
とした場合(例えば数画素とした場合)には、各第1黒
画素区間長は、それぞれ各射影ブロック74の副走査方
向の長さよりも若干短くなる傾向がある。しかし、この
場合でも、黒画素区間長と、射影ブロックの副走査方向
の長さおよび分割行76の高さとは、実質的に対応して
いる。第1基準値は、任意好適な画素数(自然数)を取
ることができる。
When the first reference value is set to one pixel, each first black pixel section length corresponds to each projection block 7.
4 in the sub-scanning direction. Each projection block 74
In the sub-scanning direction respectively correspond to the height of each divided row 76. On the other hand, when the first reference value is a value of two or more pixels (for example, several pixels), each first black pixel section length is longer than the length of each projection block 74 in the sub-scanning direction. Also tend to be slightly shorter. However, also in this case, the length of the black pixel section substantially corresponds to the length of the projection block in the sub-scanning direction and the height of the divided row 76. The first reference value can take any suitable number of pixels (natural number).

【0302】尚、各第1黒画素区間長を既に求めてある
場合、例えば、第1方向射影分布作成部16aで各第1
黒画素区間長を既に求めてある場合には、第1ばらつき
算出部42aで改めて各第1黒画素区間長を求める必要
はない。
When the first black pixel section lengths have already been obtained, for example, the first direction projection distribution creating section 16a sets the first black pixel section lengths.
When the black pixel section length has already been obtained, it is not necessary for the first variation calculation section 42a to newly obtain each first black pixel section length.

【0303】次に、第1ばらつき算出部42aは、第1
黒画素区間長のばらつきを算出する(図17のS3)。
第1黒画素区間長のばらつきの算出あたっては、第1ば
らつき算出部42aは、先ず、各黒画素区間82の黒画
素区間長の相加平均値を算出する。黒画素区間の相加平
均値Hhは、下記の(3)式で与えられる。
Next, the first variation calculating section 42a calculates the first
The variation of the black pixel section length is calculated (S3 in FIG. 17).
In calculating the variation of the first black pixel section length, the first variation calculation unit 42a first calculates the arithmetic mean of the black pixel section length of each black pixel section 82. The arithmetic mean value Hh in the black pixel section is given by the following equation (3).

【0304】 Hh={H(1)+H(2)+H(3)+・・・+H(10)}/Nh・・・ (3) 但し、Nhは、黒画素区間82の数を表し、この実施の
形態ではNh=10である。また、複数の分割領域68
について第1方向射影分布72を作成した場合には、第
1方向射影分布72を作成した各分割領域68にそれぞ
れ含まれる黒画素区間82の数の合計が、Nhとなる。
例えば、2つの分割領域68について第1方向射影分布
72を作成した場合には、黒画素区間82の数の合計は
Nh=20となる。
Hh = {H (1) + H (2) + H (3) +... + H (10)} / Nh (3) where Nh represents the number of black pixel sections 82. In the embodiment, Nh = 10. Further, a plurality of divided areas 68
In the case where the first direction projection distribution 72 is created, the total number of black pixel sections 82 included in each of the divided regions 68 in which the first direction projection distribution 72 is created is Nh.
For example, when the first direction projection distribution 72 is created for two divided regions 68, the total number of black pixel sections 82 is Nh = 20.

【0305】次に、第1ばらつき算出部42aは、各黒
画素区間長と相加平均値Hhとの差の和を黒画素区間の
数で割った値を第1画素区間長のばらつきEhとして算
出する(図17のS4)。
Next, the first variation calculator 42a calculates a value obtained by dividing the sum of the difference between each black pixel section length and the arithmetic mean value Hh by the number of black pixel sections as the first pixel section length variation Eh. It is calculated (S4 in FIG. 17).

【0306】第1黒画素区間長のばらつきEhは、下記
の(4)式で与えられる。
The variation Eh of the first black pixel section length is given by the following equation (4).

【0307】 Eh={Σ|H(i)−Hm|}/Nh・・・(4) 但し、上記の(4)式中の「Σ」は、i=1〜Nhの場
合の和を表す。
Eh = {Σ | H (i) −Hm |} / Nh (4) where “Σ” in the above equation (4) represents the sum when i = 1 to Nh. .

【0308】尚、この実施の形態においては、第1黒画
素区間長のばらつきEhを上記の(4)式で与えたが、
第1黒画素区間長のばらつきはこれに限定されるもので
はない。この発明では、第1黒画素区間長のばらつきと
して、例えば、分散や標準偏差を求めても良い。
In this embodiment, the variation Eh of the first black pixel section length is given by the above equation (4).
The variation in the first black pixel section length is not limited to this. In the present invention, for example, a variance or a standard deviation may be obtained as the variation of the first black pixel section length.

【0309】(第2ばらつき算出部の動作について)次
に、図20(B)を参照して、第2判定部202の第2
ばらつき算出部42bの動作について説明する。図20
の(B)は、第2ばらつき算出部42bの説明に供する
図であり、図16の(B)に示された第4分割領域70
aおよび第2方向射影分78を示す。
(Regarding the Operation of the Second Variation Calculation Unit) Next, referring to FIG.
The operation of the variation calculator 42b will be described. FIG.
(B) of FIG. 16 is a diagram provided for explanation of the second variation calculation unit 42b, and the fourth divided area 70 shown in (B) of FIG.
a and the second direction projection 78 are shown.

【0310】図20の(B)においては、第4分割領域
70a中の分割行80を、紙面の左側から順に、第1分
割行80a、第2分割行80b、第3分割行80c、第
4分割行80dおよび第5分割量80eとする。また、
第1分割行80a、第2分割行80b、第3分割行80
c、第4分割行80dおよび第5分割行80eをそれぞ
れ走査して得られた射影78部分をそれぞれ第1射影7
8a、第2射影78b、第3射影78c、第4射影78
dおよび第5射影78eとする。
In FIG. 20 (B), the divided rows 80 in the fourth divided area 70a are arranged in order from the left side of the page, as a first divided row 80a, a second divided row 80b, a third divided row 80c, and a fourth divided row 80c. A divided row 80d and a fifth divided amount 80e are set. Also,
First divided row 80a, second divided row 80b, third divided row 80
c, a projection 78 obtained by scanning the fourth divided row 80d and the fifth divided row 80e, respectively.
8a, second projection 78b, third projection 78c, fourth projection 78
d and the fifth projection 78e.

【0311】そして、第2ばらつき算出部42bは、先
ず、第2方向射影分布78を形成する累積黒画素数のう
ち、第2基準値(例えば1画素)以上の累積黒画素数が
第1方向(水平方向)に沿って連続しているとき、その
連続する区間84を第2黒画素区間として、当該第2黒
画素区間84の長さ(第2黒画素区間長)を求める。こ
こでは、第1射影78a、第2射影78b、第3射影7
8c、第4射影78dおよび第5射影78eに対応する
各黒画素区間84の第2黒画素区間長をそれぞれW
(1)、W(2)、W(3)、W(4)およびW(5)
として求める。
[0311] Then, the second variation calculation unit 42b first determines, among the cumulative black pixels forming the second direction projection distribution 78, the cumulative number of black pixels equal to or more than the second reference value (for example, one pixel) in the first direction. When it is continuous along the (horizontal direction), the continuous section 84 is defined as a second black pixel section, and the length of the second black pixel section 84 (second black pixel section length) is obtained. Here, the first projection 78a, the second projection 78b, and the third projection 7
8c, the second black pixel section length of each black pixel section 84 corresponding to the fourth projection 78d and the fifth projection 78e is W
(1), W (2), W (3), W (4) and W (5)
Asking.

【0312】また、第2黒画素区間長のデータは、例え
ば、各射影78の端の位置をXY座標を求め、各射影7
8の副走査方向に沿った両端のXY座標の距離(この場
合はX座標の値の差)として表しても良い。また、第2
黒画素区間長のデータは、例えば、各射影78の副走査
方向に沿った両端間の画素数で表示しても良い。
The data of the second black pixel section length is obtained, for example, by calculating the XY coordinates of the position of the end of each projection 78,
8 may be expressed as the distance between the XY coordinates at both ends along the sub-scanning direction (in this case, the difference between the X coordinate values). Also, the second
The data of the black pixel section length may be displayed by, for example, the number of pixels between both ends of each projection 78 along the sub-scanning direction.

【0313】尚、各第2黒画素区間長を既に求めてある
場合、例えば、第2方向射影分布作成部16bで各第2
黒画素区間長を既に求めてある場合には、第2ばらつき
算出部42bで改めて各第2黒画素区間長を求める必要
はない。
If the length of each second black pixel section has already been determined, for example, the second direction projection distribution creating unit 16b may use
If the black pixel section length has already been determined, it is not necessary for the second variation calculation section 42b to determine each second black pixel section length again.

【0314】次に、第2ばらつき算出部42bは、第2
黒画素区間長のばらつきを算出する(図17のS5)。
第2黒画素区間長のばらつきの算出あたっては、第2ば
らつき算出部42bは、先ず、各黒画素区間84の黒画
素区間長の相加平均値を算出する。黒画素区間の相加平
均値Wvは、下記の(5)式で与えられる。
Next, the second variation calculator 42b calculates the second
The variation of the black pixel section length is calculated (S5 in FIG. 17).
In calculating the variation of the second black pixel section length, the second variation calculation unit 42b first calculates the arithmetic mean of the black pixel section length of each black pixel section 84. The arithmetic mean value Wv of the black pixel section is given by the following equation (5).

【0315】 Wv={W(1)+W(2)+W(3)+W(4)+W(5)}/Nw・・・ (5) 但し、Nwは、黒画素区間84の数を表し、この実施の
形態ではNw=5である。また、複数の分割領域70に
ついて第2方向射影分布78を作成した場合には、第1
方向射影分布78を作成した各分割領域70にそれぞれ
含まれる黒画素区間84の数の合計がNwとなる。
Wv = {W (1) + W (2) + W (3) + W (4) + W (5)} / Nw (5) where Nw represents the number of black pixel sections 84. In the embodiment, Nw = 5. When the second direction projection distribution 78 is created for a plurality of divided areas 70, the first
The total number of black pixel sections 84 included in each of the divided areas 70 for which the directional projection distribution 78 is created is Nw.

【0316】次に、第2ばらつき算出部42bは、各第
2黒画素区間長と相加平均値Wvとの差の和を黒画素区
間の数で割った値を第2画素区間長のばらつきEvとし
て算出する(図17のS6)。
Next, the second variation calculation section 42b calculates a value obtained by dividing the sum of the difference between each second black pixel section length and the arithmetic mean value Wv by the number of black pixel sections, and calculates the variation of the second pixel section length. It is calculated as Ev (S6 in FIG. 17).

【0317】第2黒画素区間長のばらつきEvは、下記
の(6)式で与えられる。
The variation Ev of the second black pixel section length is given by the following equation (6).

【0318】 Ev={Σ|W(j)−Wv|}/Nw・・・(6) 但し、上記の(6)式中の「Σ」は、j=1〜Nwの場
合の和を表す。
Ev = {Σ | W (j) −Wv |} / Nw (6) where “Σ” in the above equation (6) represents the sum when j = 1 to Nw. .

【0319】尚、この実施の形態においては、第2黒画
素区間長のばらつきEvを上記の(6)式で与えたが、
第2黒画素区間長のばらつきはこれに限定されるもので
はない。この発明では、第2黒画素区間長のばらつきと
して、例えば、分散や標準偏差を求めても良い。
In this embodiment, the variation Ev of the second black pixel section length is given by the above equation (6).
The variation of the second black pixel section length is not limited to this. In the present invention, for example, a variance or a standard deviation may be obtained as the variation of the second black pixel section length.

【0320】また、この実施の形態においては、第1お
よび第2黒画素区間のばらつきをそれぞれ求めるための
処理を図17のS3〜S6のステップの順に従って行な
ったが、この発明では、S3およびS5のステップの処
理と、S4およびS6のステップの処理とは個別に独立
して行なうことができる。従って、この発明では、S3
〜S6のステップについては、S3およびS4のステッ
プを順次に行なう点とS5およびS6のステップを順次
に行なう点とを除いては、処理の順序は限定されない。
例えば、S5のステップを行なった後にS3のステップ
行なっても良い。また、例えば、S5およびS6のステ
ップの処理を順次に行なった後に、S3およびS4のス
テップの処理を順次に行なっても良い。
Further, in this embodiment, the processing for obtaining the variation in the first and second black pixel sections is performed in the order of steps S3 to S6 in FIG. The processing in step S5 and the processing in steps S4 and S6 can be performed independently and independently. Therefore, in the present invention, S3
The order of processing is not limited to steps S6 to S6, except that steps S3 and S4 are sequentially performed and steps S5 and S6 are sequentially performed.
For example, the step of S3 may be performed after the step of S5 is performed. Further, for example, after the processes of steps S5 and S6 are sequentially performed, the processes of steps S3 and S4 may be sequentially performed.

【0321】(ばらつき比較判定部の動作について)次
に、第2判定部20のばらつき比較判定部44の動作に
ついて説明する。ばらつき比較判定部44は、第1黒画
素区間長のばらつきEhと、第2黒画素区間長のばらつ
きとEvを比較して、第1黒画素区間長のばらつきEh
と第2黒画素区間長のばらつきEvとの比率が第3基準
値P以上の場合に、ばらつきの小さい方の黒画素区間長
が得られた走査方向を行方向と判定する(図17のS7
およびS8)。尚、この基準値Pの値は任意好適な値を
設定することができる。また、P=1の場合には、Eh
とEvとの大小を比較することと同等になる。
(Operation of Variation Comparison Determining Unit) Next, the operation of the variation comparison determining unit 44 of the second determining unit 20 will be described. The variation comparison determination unit 44 compares the variation Eh of the first black pixel section length with the variation Ev of the second black pixel section length to determine the variation Eh of the first black pixel section length.
If the ratio of the variation of the black pixel section length to the second black pixel section length Ev is equal to or greater than the third reference value P, the scanning direction in which the black pixel section length of the smaller variation is obtained is determined as the row direction (S7 in FIG. 17).
And S8). The value of the reference value P can be set to any suitable value. When P = 1, Eh
This is equivalent to comparing the magnitudes of Ev and Ev.

【0322】この実施の形態では、先ず、下記の(7)
式が満たされるか否かを判断する(図17のS7)。そ
して、下記の(7)式が満たされた場合には、文書画像
60を横書きと判定する。これに対して、下記の(7)
式が満たされない場合には、次のS8のステップへ進
む。
In this embodiment, first, the following (7)
It is determined whether the formula is satisfied (S7 in FIG. 17). When the following expression (7) is satisfied, the document image 60 is determined to be horizontally written. In contrast, the following (7)
If the expression is not satisfied, the process proceeds to the next step S8.

【0323】Eh・P<Ev・・・(7) ステップS8においては、下記の(8)式が満たされる
か否かを算段する(図17のS8)。そして、下記の
(8)式が満たされる場合には、文書画像60を縦書き
と判定する。これに対して、下記の(8)式が満たされ
ない場合には、次のS9およびS10のステップへ進
む。
Eh · P <Ev (7) In step S8, it is calculated whether the following equation (8) is satisfied (S8 in FIG. 17). When the following expression (8) is satisfied, the document image 60 is determined to be vertically written. On the other hand, if the following equation (8) is not satisfied, the process proceeds to the next steps S9 and S10.

【0324】Ev・P<Eh・・・(8) ここでは、文書画像60は横書きであるため、第1黒画
素区間長のばらつきEhにくらべて、第2黒画素区間長
のばらつきEvが大きくなる。その結果、この場合に
は、通常、上記の(7)式が満たされる。
Ev · P <Eh (8) Here, since the document image 60 is written horizontally, the variation Ev of the second black pixel section length is larger than the variation Eh of the first black pixel section length. Become. As a result, in this case, the above equation (7) is usually satisfied.

【0325】ところで、図20の(B)に示したよう
に、各行の文字間隔が固定ピッチである場合には、第1
黒画素区間長のばらつきと第2黒画素区間長のばらつき
とがどちらも小さいため、上記の(7)式および(8)
式のどちらも満たされない場合がある。その場合には、
制御部28は、ステップS9およびS10へ進むため、
行方向判定部20のうちの第2判定部202に判定を行
なわせる。
By the way, as shown in FIG. 20B, when the character spacing in each line is a fixed pitch, the first
Since both the variation in the black pixel section length and the variation in the second black pixel section length are small, the above equations (7) and (8) are used.
Neither of the expressions may be satisfied. In that case,
The control unit 28 proceeds to steps S9 and S10,
The second determination unit 202 of the row direction determination unit 20 makes a determination.

【0326】(第3判定部の動作について)次に、制御
部28は、行方向判定部20の第3判定部203を起動
し、起動された第3判定部203へ第1分割行切出し部
18aおよび第2分割行切出し部18bから、それぞれ
第1射影分布および第2射影分布のデータを送る。
(Regarding the operation of the third determination unit) Next, the control unit 28 activates the third determination unit 203 of the row direction determination unit 20 and sends the first divided line cutout unit to the activated third determination unit 203. The data of the first projection distribution and the data of the second projection distribution are sent from the segmented line extraction unit 18a and the second divided line segmentation unit 18b, respectively.

【0327】(第1平均値算出部の動作について)この
第1平均値算出部46aは、先ず、第1方向射影分布7
2において隣り合った第1黒画素区間82どうしの間の
第1白画素区間86の長さ(第1白画素区間長)をそれ
ぞれ求める。
(Regarding the Operation of the First Average Value Calculating Unit) The first average value calculating unit 46a
In step 2, the length (first white pixel section length) of the first white pixel section 86 between adjacent first black pixel sections 82 is determined.

【0328】ここでは、図20の(A)に示すように、
第1射影ブロック74aの黒画素区間と第2射影ブロッ
ク74bの黒画素区間との間の第1白画素区間の区間長
をSh(1)として求める。また、第2射影ブロック7
4bと第3射影ブロック74cとの間の第1白画素区間
の区間長をSh(2)として求める。同様にして、他の
白画素区間の区間長Sh(3)、Sh(4)、Sh
(5)、Sh(6)、Sh(第17)、Sh(8)およ
びSh(9)を求める。
In this case, as shown in FIG.
The section length of the first white pixel section between the black pixel section of the first projection block 74a and the black pixel section of the second projection block 74b is determined as Sh (1). Also, the second projection block 7
The section length of the first white pixel section between 4b and the third projection block 74c is obtained as Sh (2). Similarly, the section lengths Sh (3), Sh (4), and Sh of other white pixel sections
(5), Sh (6), Sh (17th), Sh (8) and Sh (9) are obtained.

【0329】尚、各第1白画素区間長を既に求めてある
場合、例えば、第1方向射影分布作成部16aで各白画
素区間長を既に求めてある場合には、第1平均値算出部
46aで改めて各白画素区間長を求める必要はない。
When the first white pixel section length has already been obtained, for example, when the first direction projection distribution creation section 16a has already obtained each white pixel section length, the first average value calculation section It is not necessary to newly calculate each white pixel section length in 46a.

【0330】次に、第1平均値出部46aは、第1白画
素区間長の平均値Shmを算出する(図17のS9)。
第1白画素区間長の平均値の算出にあたっては、第1平
均値算出部46aは、第1白画素区間86の各々の長さ
の相加平均を第1平均値として算出する。第1平均値S
hmは、下記の(9)式で与えられる。
Next, the first average value output unit 46a calculates the average value Shm of the first white pixel section length (S9 in FIG. 17).
In calculating the average value of the first white pixel section length, the first average value calculation unit 46a calculates the arithmetic mean of the lengths of the first white pixel sections 86 as the first average value. First average value S
hm is given by the following equation (9).

【0331】 Shm={Sh(1)+Sh(2)+Sh(3)+・・・+Sh(9)}/( Nh−n)・・・(9) 但し、Nh−nは、白画素区間86の数の合計を表す。
この実施の形態ではNh−n=9となる。すなわち、N
hは、前述のように第1黒画素区間82の数を表し、n
は、第1方向射影分布72を作成した分割領域68の数
(この実施の形態ではn=1)を表す。また、例えば、
2つの分割領域68について第1方向射影分布72を作
成して、この2つの分割領域68を合わせた白画素区間
の相加平均値を算出する場合には、n=2となる。すな
わち、Nh−nは、それぞれの分割領域68における第
1黒画素区間82の数から、それぞれ1を引いた値を足
し合わせた値となる。
Shm = {Sh (1) + Sh (2) + Sh (3) +... + Sh (9)} / (Nh−n) (9) where Nh−n is the white pixel section 86 Represents the sum of the numbers.
In this embodiment, Nh-n = 9. That is, N
h represents the number of the first black pixel sections 82 as described above, and n
Represents the number of divided areas 68 for which the first direction projection distribution 72 has been created (n = 1 in this embodiment). Also, for example,
In the case where the first direction projection distribution 72 is created for the two divided regions 68 and the arithmetic mean value of the white pixel section combining the two divided regions 68 is calculated, n = 2. That is, Nh-n is a value obtained by adding a value obtained by subtracting 1 from the number of the first black pixel sections 82 in each divided area 68.

【0332】尚、第1方向射影分布において黒画素区間
どうしの間の白画素区間が1箇所だけの場合には、その
白画素区間の区間長を第1平均値とする。
In the case where there is only one white pixel section between black pixel sections in the first direction projection distribution, the section length of the white pixel section is set as a first average value.

【0333】(第2平均値算出部の動作について)ま
た、第2平均値算出部46bは、隣り合った第2黒画素
区間どうしの間隔をそれぞれ第2白画素区間長として求
める。
(Regarding the Operation of the Second Average Value Calculation Unit) The second average value calculation unit 46b obtains the interval between adjacent second black pixel sections as the second white pixel section length.

【0334】ここでは、図20の(B)に示すように、
第1射影78aと第2射影78bとの間の、図20の
(B)においてaで示す部分の第2白画素区間長をSw
(1)として求める。また、第2射影78bと第3射影
78cとの間の、図20の(B)においてbで示す部分
の第2白画素区間長をSw(2)として求める。また、
第3射影78cと第4射影78dとの間の、図20の
(B)においてcで示す部分第2白画素区間長をSw
(3)として求める。また、第4射影78dと第5射影
78eとの間の、、図20の(B)においてdで示す部
分第2白画素区間長をSw(4)として求める。これら
の第2白画素区間長Sw(1)〜Sw(4)は、図20
の(B)においては、いずれも1画素分程度である。
In this case, as shown in FIG.
The second white pixel section length of the portion indicated by a in FIG. 20B between the first projection 78a and the second projection 78b is Sw.
Determined as (1). In addition, the length of the second white pixel section between the second projection 78b and the third projection 78c, which is indicated by b in FIG. 20B, is determined as Sw (2). Also,
The partial second white pixel section length indicated by c in FIG. 20B between the third projection 78c and the fourth projection 78d is Sw.
Determined as (3). In addition, the partial second white pixel section length indicated by d in FIG. 20B between the fourth projection 78d and the fifth projection 78e is obtained as Sw (4). These second white pixel section lengths Sw (1) to Sw (4) are shown in FIG.
In (B), each pixel is about one pixel.

【0335】尚、各第2白画素区間長を既に求めてある
場合、例えば、第2方向射影分布作成部16bで各第2
白画素区間長を既に求めてある場合には、第2平均値出
部46bで改めて各第2白画素区間長を求める必要はな
い。
If the length of each second white pixel section has already been obtained, for example, the second direction projection distribution creating unit 16b may use
If the white pixel section length has already been obtained, it is not necessary to newly calculate each second white pixel section length in the second average value output section 46b.

【0336】次に、第2平均値出部46bは、第2白画
素区間長の平均値Swmを算出する(図17のS1
0)。第2白画素区間長の平均値の算出にあたっては、
第2平均値算出部46bは、各第2白画素区間88の白
画素区間長の相加平均値を第2平均値として算出する。
第2平均値Swmは、下記の(10)式で与えられる。
Next, the second average value output section 46b calculates the average value Swm of the second white pixel section length (S1 in FIG. 17).
0). In calculating the average value of the second white pixel section length,
The second average value calculator 46b calculates an arithmetic average of the white pixel section length of each second white pixel section 88 as a second average value.
The second average value Swm is given by the following equation (10).

【0337】 Swm={Sw(1)+Sw(2)+Sw(3)+Sw(4)}/(Nw−m )・・・(10) 但し、Nw−mは、第2白画素区間88の数を表し、こ
の実施の形態ではNw−m=4である。すなわち、Nw
は、前述のように第2黒画素区間84の数を表し、m
は、第2方向射影分布78を求めた第2方向分割領域7
0の数(この実施の形態ではm=1)を表す。
Swm = {Sw (1) + Sw (2) + Sw (3) + Sw (4)} / (Nw-m) (10) where Nw-m is the number of the second white pixel sections 88. In this embodiment, Nw−m = 4. That is, Nw
Represents the number of the second black pixel sections 84 as described above, and m
Is the second direction divided area 7 in which the second direction projection distribution 78 is obtained.
Represents the number 0 (m = 1 in this embodiment).

【0338】尚、第2方向射影分布において黒画素区間
どうしの間の白画素区間が1箇所だけの場合には、その
白画素区間の区間長を第2平均値とする。
In the case where there is only one white pixel section between black pixel sections in the second direction projection distribution, the section length of the white pixel section is set to a second average value.

【0339】尚、この実施の形態では、S7のステップ
の次にS8のステップへ進んだ例について説明したが、
S8のステップの次にS7のステップへ進んでも良い。
In this embodiment, an example in which the process proceeds to step S8 after step S7 has been described.
After step S8, the process may proceed to step S7.

【0340】(平均値比較判定部の動作について)次
に、平均値比較判定部48の動作について説明する。平
均値比較判定部48では、第1平均値Shmと第2平均
値Swmとを比較して、より大きな平均値の白画素区間
長の得られた射影分布の走査方向を行方向と判定する
(図17のS11)。
(Regarding the operation of the average value comparing and judging unit) Next, the operation of the average value comparing and judging unit 48 will be described. The average value comparison determination unit 48 compares the first average value Shm and the second average value Swm, and determines the scanning direction of the projection distribution obtained with the white pixel section length of the larger average value as the row direction ( S11 in FIG. 17).

【0341】そして、この実施の形態では、Shm≧S
wmが成立する場合(Y)には、文書画像60を横書き
と判定する。これに対して、Shm≧Swmが成立しな
い場合(N)には、文書画像60を縦書きと判定する。
In this embodiment, Shm ≧ S
If wm is satisfied (Y), it is determined that the document image 60 is written horizontally. On the other hand, if Shm ≧ Swm is not satisfied (N), the document image 60 is determined to be vertically written.

【0342】この場合は、Shm>Swmとなる。従っ
て、平均値比較判定部48は、第1方向射影分布72が
得られた走査方向、すなわち水平方向を行方向と判定す
る。従って、文書画像60は横書きであると判定され
る。
In this case, Shm> Swm. Therefore, the average value comparison determination unit 48 determines the scanning direction in which the first direction projection distribution 72 is obtained, that is, the horizontal direction as the row direction. Therefore, the document image 60 is determined to be horizontally written.

【0343】尚、この実施の形態においては、平均比較
判定部において第1平均値Shmと第2平均値Swmと
を比較して行方向を判定したが、第1白画素区間の長さ
と第2白画素区間の長さとを利用して行方向を判定する
にあたっては、平均値を用いる場合に限定する必要はな
い。例えば、特定の白画素区間どうし、例えば、最大の
第1白画素区間長と最大の第2白画素区間長とを比較し
て行方向を判定しても良い。また、例えば、特定の第1
および第2白画素区間の長さどうしを比較して行方向を
判定しても良い。
In this embodiment, the row direction is determined by comparing the first average value Shm and the second average value Swm in the average comparison / determination section. However, the length of the first white pixel section and the second In determining the row direction by using the length of the white pixel section, it is not necessary to limit to the case of using the average value. For example, the row direction may be determined by comparing specific white pixel sections, for example, by comparing the maximum first white pixel section length with the maximum second white pixel section length. Also, for example, a specific first
Alternatively, the row direction may be determined by comparing the lengths of the second white pixel sections.

【0344】(統合修正の動作例)次に、1つの分割行
が誤って2つの分割行として切り出された場合の修正方
法の例について説明する。
(Example of Operation of Integration Correction) Next, an example of a correction method in the case where one divided row is erroneously cut out as two divided rows will be described.

【0345】図22の(A)および(B)に、修正対象
の分割行をそれぞれ示す。図22の(A)には、横書き
の分割行150の例を示す。この分割行150は、
「二」、「吉」および「合」の3文字が含まれている。
そして、この3文字の形は、いずれも上下に部首が分離
したものとなっている。このため、分割行切出しのプロ
セスにおいて、1つの分割行として切り出されるべきこ
の分割行150は、誤って、上下に分離した2つの分割
行、すなわち、上側の分割行150aと下側の分割行1
50bとして切り出されてしまっている。
FIGS. 22A and 22B show the divided rows to be corrected. FIG. 22A shows an example of a horizontally divided line 150. This division row 150 is
It contains three characters, "two", "kichi" and "go".
Each of these three characters has a vertically separated radical. For this reason, in the process of separating the divided lines, the divided line 150 to be cut out as one divided line is erroneously divided into two divided lines, that is, an upper divided line 150a and a lower divided line 1a.
It has been cut out as 50b.

【0346】また、図22の(B)には、縦書きの分割
行152の例を示す。この分割行152は、「八」、
「北」および「札」の3文字が含まれている。そして、
この3文字の形は、いずれも左右に部首が分離したもの
となっている。このため、分割行切出しのプロセスにお
いて、1つの分割行として切り出されるべきこの分割行
152は、誤って、左右に分離した2つの分割行、すな
わち、右側の分割行152aと左側の分割行152bと
して切り出されてしまっている。
FIG. 22 (B) shows an example of a vertically divided line 152. This division line 152 is "eight",
It contains three characters, “north” and “tag”. And
Each of these three characters has a radically separated left and right radical. For this reason, in the process of separating the divided lines, the divided line 152 to be cut out as one divided line is erroneously divided into two divided lines, that is, the right divided line 152a and the left divided line 152b. It has been cut out.

【0347】また、ここでは、第1方向を水平方向(紙
面横方向、X軸に沿った方向)とし、第2方向を垂直方
向(紙面縦方向、Y軸に沿った方向)とする。従って、
図22の(A)に示された横書きの分割行150の統合
修正の処理は、第1統合修正部90aにおいて行なわれ
る。また、図22の(B)に示された縦書きに分割行の
統合修正の処理は、第2統合修正部90bにおいて行な
われる。尚、第1方向を垂直方向、第2方向を水平方向
と入れ替えれば、第1および第2統合修正部90aおよ
び90bにおける処理内容も入れ替わることになる。
Here, the first direction is defined as a horizontal direction (horizontal direction on the paper, a direction along the X-axis), and the second direction is defined as a vertical direction (vertical direction on the paper, a direction along the Y-axis). Therefore,
The process of integrating and correcting the horizontally written divided row 150 shown in FIG. 22A is performed by the first integrated correcting unit 90a. The process of integrating and correcting the vertically divided lines shown in FIG. 22B is performed by the second integrated correcting unit 90b. If the first direction is changed to the vertical direction and the second direction is changed to the horizontal direction, the processing contents of the first and second integrated correction units 90a and 90b are also changed.

【0348】(水平分割行の統合修正について)先ず、
図21を参照して、図22の(A)に示した水平分割行
150の統合修正方法の一例について説明する。図21
は、水平分割行の統合修正方法の説明に供する流れ図で
ある。
(Regarding the Correction of Integration of Horizontal Split Lines) First,
With reference to FIG. 21, an example of the method of integrating and correcting the horizontally divided rows 150 shown in FIG. FIG.
9 is a flowchart for explaining a method of integrating and correcting horizontal divided rows.

【0349】一般に、誤って2つに切り出された水平分
割行の高さは、適切に切り出された他の分割行に比べて
低く、他の分割行の半分程度である。さらに、この誤っ
て切り出された2つの分割行どうしの行間隔は、一般
に、他の分割行どうしの行間隔間に比べて狭い。従っ
て、切り出された分割行の高さ若しくは幅と行間隔とに
着目すれば、本来1つの分割行として切り出されるべき
ところを誤って2つの分割行として切り出された分割行
を発見して、分割行切出しの修正が可能となる。
In general, the height of a horizontally divided row that is erroneously cut into two is lower than that of another appropriately divided row, and is about half that of the other divided rows. Furthermore, the line interval between the two erroneously extracted divided lines is generally smaller than the line interval between the other divided lines. Therefore, if attention is paid to the height or width and the line interval of the cut-out divided lines, a divided line that is supposed to be cut out as one divided line by mistake is found as two divided lines, and the divided line is divided. Modification of line segmentation is possible.

【0350】そこで、この実施の形態においては、水平
分割行の統合修正を行なうにあたり、先ず、第1平均黒
画素区間長算出部120aにおいて、第1分割行切出し
部18aにおいて切り出された第1分割行の第1黒画素
区間の長さ(第1黒画素区間長)の相加平均を第1平均
黒画素区間長として求める(図21のS1)。第1分割
行が水平分割行である場合、第1分割行の第1黒画素区
間長は、水平分割行の高さを表す。そして、この場合、
第1平均区間長Hhは、水平分割行の高さの平均値を表
す。
Therefore, in the present embodiment, when performing the integrated correction of the horizontal divided rows, first, in the first average black pixel section length calculating section 120a, the first divided row extracted by the first divided row extracting section 18a The arithmetic mean of the length of the first black pixel section (first black pixel section length) of the row is obtained as the first average black pixel section length (S1 in FIG. 21). When the first divided row is a horizontal divided row, the first black pixel section length of the first divided row indicates the height of the horizontal divided row. And in this case,
The first average section length Hh represents an average value of the heights of the horizontal divided rows.

【0351】次に、各水平分割行について、誤って切り
出されたものか否かを順次に調べるために、第1候補区
間選択部122aに、水平分割行の通し番号を便宜的に
与えるパラメータiを用意する。そして、このパラメー
タiに1を代入する(図21のS2)。
Next, in order to sequentially check whether or not each horizontally divided row is erroneously cut out, a parameter i for conveniently giving the serial number of the horizontally divided row is supplied to the first candidate section selecting unit 122a. prepare. Then, 1 is substituted for the parameter i (S2 in FIG. 21).

【0352】このパラメータiの最大値は、水平分割行
の総数Nhとなる。
The maximum value of the parameter i is the total number Nh of horizontal divided rows.

【0353】次に、第1候補区間選択部122aにおい
て、この第1平均黒画素区間長と第1黒画素区間長とを
比較する。そして、第1黒画素区間のうち、第1平均黒
画素区間長Hhに対する第1黒画素区間長Hh(i)の
比率が第6基準値Q(例えば0.5)よりも小さな第1
黒画素区間を第1候補区間として選択する(図21のS
3)。
Next, the first candidate section selector 122a compares the first average black pixel section length with the first black pixel section length. In the first black pixel section, the ratio of the first black pixel section length Hh (i) to the first average black pixel section length Hh is smaller than the sixth reference value Q (for example, 0.5).
A black pixel section is selected as a first candidate section (S in FIG. 21).
3).

【0354】ここでは、各水平分割行の高さと平均値と
を順次に比較する。そして、ある水平分割行の高さが平
均値に対して一定の割合よりも低い場合、例えば高さH
h(i)の1/Q倍(例えば2倍)の値が平均値Hhよ
りも低い場合に、その水平分割行は、誤って分割された
可能性が高い。このため、その水平分割行を統合修正対
象の候補としての第1候補区間として選択する。
Here, the height and average value of each horizontal divided row are sequentially compared. If the height of a certain horizontal divided row is lower than a certain ratio with respect to the average, for example, the height H
When the value of 1 / Q times (for example, twice) of h (i) is lower than the average value Hh, it is highly likely that the horizontal divided row is erroneously divided. Therefore, the horizontal divided row is selected as a first candidate section as a candidate for integration correction.

【0355】そして、この実施の形態では、図22の
(A)に示した分割行150aを第1候補区間として選
択する。
In this embodiment, the divided row 150a shown in FIG. 22A is selected as the first candidate section.

【0356】尚、各水平分割行の高さと平均値とを順次
に比較する場合、高さが条件を満たさない場合には、順
次に図21のS4のステップへ進む。S4のステップに
おいては、パラメータiが、Nh未満であるか否かを判
断する。すなわち、全ての分割行について高さと平均値
とを比較しか否かを判断する。
When the height of each horizontal divided row is sequentially compared with the average value, and if the height does not satisfy the condition, the process sequentially proceeds to step S4 in FIG. In step S4, it is determined whether or not the parameter i is smaller than Nh. That is, it is determined whether or not only the height and the average value are compared for all the divided rows.

【0357】そして、パラメータiがNh未満でない場
合、すなわち、全ての水平分割行についてその高さと平
均値とを比較したと判断した場合には、水平分割行の統
合処理を終了する。
If the parameter i is not less than Nh, that is, if it is determined that the height and the average value have been compared for all the horizontal divided rows, the integration processing of the horizontal divided rows is ended.

【0358】また、パラメータiがNh未満である場
合、すなわち、その高さと平均値とを比較していない水
平分割行がまだ残っていると判断した場合には、図21
のS5の処理へ進む。
If the parameter i is less than Nh, that is, if it is determined that there is still a horizontal division row whose height has not been compared with the average value, FIG.
To S5.

【0359】このS5の処理においては、パラメータi
の値を1増加させる(インクリメントする。)。そし
て、図21のS3の処理へ進んで、次のパラメータi+
1に対応する水平分割行についてその高さと平均値とを
比較する。
In the process of S5, the parameter i
Is incremented by one (increment). Then, the process proceeds to S3 in FIG. 21, and the next parameter i +
The height and the average value of the horizontal divided row corresponding to 1 are compared.

【0360】ところで、この第1候補区間として抽出さ
れた水平分割行150aの両側には、それぞれ分割行が
存在している。このため、この両側の2つの分割行のう
ちのどちらの分割行を第1候補区間と統合して修正すべ
きかを決定する必要がある。この決定の方法について、
後述のS6〜S10のステップにおいて説明する。
By the way, divided rows exist on both sides of the horizontal divided row 150a extracted as the first candidate section. For this reason, it is necessary to determine which of the two divided rows on both sides should be modified by integrating with the first candidate section. For how to make this decision,
This will be described in steps S6 to S10 described later.

【0361】ここで、上述の図21のS3のステップに
おいて第1候補区間として選択された分割行150aに
対する統合修正処理の理解を容易にするために、図23
の(A)を供す。図23の(A)は、水平分割行150
aの統合修正処理の説明に供する図である。
Here, in order to facilitate understanding of the integration correction processing for the divided row 150a selected as the first candidate section in the step S3 in FIG. 21, FIG.
(A). FIG. 23A shows a horizontal division row 150.
It is a figure offered to explanation of unification correction processing of a.

【0362】次に、第1統合区間長検出部124aにお
いて、先ず、第1候補区間である水平分割行150a
の、一方の側の直近の第1黒画素区間を第1候補黒画素
区間154とする。ここでは、水平分割行150aの、
紙面上方の直近の第1黒画素区間を第1候補黒画素区間
154とする。そして、この第1候補黒画素区間154
と水平分割行150aとを一つの連続した黒画素区間と
した場合の当該黒画素区間を第1統合区間とする。そし
て、この第1統合区間156の長さHtを求める(図2
1のS6)。
Next, in the first integrated section length detecting section 124a, first, the horizontal division row 150a which is the first candidate section
The first nearest black pixel section on one side is referred to as a first candidate black pixel section 154. Here, in the horizontal divided row 150a,
The nearest first black pixel section above the plane of the paper is defined as a first candidate black pixel section 154. Then, the first candidate black pixel section 154
The black pixel section when the horizontal division row 150a and the horizontal divided row 150a are one continuous black pixel section is defined as a first integrated section. Then, the length Ht of the first integrated section 156 is obtained (FIG. 2).
1 S6).

【0363】この第1統合区間156の長さHtは、図
23の(A)に示すように、第1候補区間である水平分
割行150aの長さと第1候補黒画素区間154の長さ
との合計に、水平分割行150aと第1候補黒画素区間
154との間の第1白画素区間158の長さStを加え
た長さである。
As shown in FIG. 23A, the length Ht of the first integrated section 156 is the length of the horizontal divided row 150a, which is the first candidate section, and the length of the first candidate black pixel section 154. The total length is obtained by adding the length St of the first white pixel section 158 between the horizontal divided row 150a and the first candidate black pixel section 154.

【0364】次に、第1統合区間長誤差算出部125a
において、第1統合区間156の長さHtと第1平均黒
画素区間長Hhとの差の大きさEtを第1統合区間長誤
差として求める(図21のS7)。
Next, the first integrated section length error calculating section 125a
, The magnitude Et of the difference between the length Ht of the first integrated section 156 and the first average black pixel section length Hh is determined as the first integrated section length error (S7 in FIG. 21).

【0365】この第1統合区間長誤差Etは、下記の
(11)式で与えられる。
The first integrated section length error Et is given by the following equation (11).

【0366】Et=|Ht−Hh|・・・(11) また、第2統合区間長検出部124bにおいて、先ず、
第1候補区間である水平分割行150aの、他方の側の
直近の第1黒画素区間を第2候補黒画素区間とする。こ
こでは、水平分割行150aの、紙面下方の直近の第1
黒画素区間である水平分割行150bを第2候補黒画素
区間150bとする。そして、この第2候補黒画素区間
150bと水平分割行150aとを一つの連続した黒画
素区間とした場合の当該黒画素区間を第2統合区間16
0とする。そして、この第2統合区間160の長さHb
を求める(図21のS8)。
Et = | Ht−Hh | (11) In the second integrated section length detecting unit 124b, first,
The nearest first black pixel section on the other side of the horizontal division row 150a that is the first candidate section is defined as a second candidate black pixel section. Here, the nearest first row below the horizontal plane of the horizontal divided row 150a is shown.
The horizontal divided row 150b that is a black pixel section is defined as a second candidate black pixel section 150b. When the second candidate black pixel section 150b and the horizontal divided row 150a are defined as one continuous black pixel section, the black pixel section is referred to as a second integrated section 16
Set to 0. Then, the length Hb of the second integrated section 160
(S8 in FIG. 21).

【0367】この第2統合区間160の長さHbは、図
23の(A)に示すように、第1候補区間である水平分
割行150aの長さと第2候補黒画素区間150bの長
さとの合計に、水平分割行150aと第2候補黒画素区
間150bとの間の第2白画素区間162の長さSbを
加えた長さである。
As shown in FIG. 23A, the length Hb of the second integrated section 160 is equal to the length of the horizontal divided row 150a, which is the first candidate section, and the length of the second candidate black pixel section 150b. The total length is the sum of the length Sb of the second white pixel section 162 between the horizontal divided row 150a and the second candidate black pixel section 150b.

【0368】次に、第2統合区間長誤差算出部125b
において、第2統合区間160の長さHbと第1平均黒
画素区間長Hhとの差の大きさEbを第2統合区間長誤
差として求める(図21のS9)。
Next, the second integrated section length error calculating section 125b
, The magnitude Eb of the difference between the length Hb of the second integrated section 160 and the first average black pixel section length Hh is determined as a second integrated section length error (S9 in FIG. 21).

【0369】この第2統合区間長誤差Ebは、下記の
(12)式で与えられる。
The second integrated section length error Eb is given by the following equation (12).

【0370】Eb=|Hb−Hh|・・・(12) 次に、第1選択統合区間選択部126aにおいて、第1
統合区間長誤差Etと第2統合区間長誤差Ebとを比較
する。そして、誤差の小さい方の統合区間を第1選択統
合区間として選択する(図21のS10)。
Eb = | Hb−Hh | (12) Next, the first selected integrated section selection unit 126a
The integrated section length error Et and the second integrated section length error Eb are compared. Then, the integrated section having the smaller error is selected as the first selected integrated section (S10 in FIG. 21).

【0371】また、実施の形態では第1統合区間長誤差
Etと第2統合区間長誤差Ebとが等しい場合には、第
2統合区間長誤差Ebを第1選択統合区間として選択す
ることとする。
In the embodiment, when the first integrated section length error Et is equal to the second integrated section length error Eb, the second integrated section length error Eb is selected as the first selected integrated section. .

【0372】そして、この実施の形態では、第2統合区
間長誤差Ebが第1統合区間長誤差Etよりも短い。す
なわち、Eb<Etである。従って、この実施の形態で
は、第2統合区間長誤差Ebを第1選択統合区間として
選択する(図21のS10において「Y」の場合に対応
する。)。
In this embodiment, the second integrated section length error Eb is shorter than the first integrated section length error Et. That is, Eb <Et. Therefore, in this embodiment, the second integrated section length error Eb is selected as the first selected integrated section (corresponding to the case of “Y” in S10 of FIG. 21).

【0373】次に、この第1選択統合区間としての第2
統合区間160のうちの、第1候補区間150aと当該
第1候補区間150aの直近の第1黒画素区間(この場
合は、第2候補黒画素区間150b)との間の第2白画
素区間162の長さSbを求める(図21のS11)。
Next, the second selected integrated section
In the integrated section 160, a second white pixel section 162 between the first candidate section 150a and a first black pixel section immediately adjacent to the first candidate section 150a (in this case, a second candidate black pixel section 150b). Is obtained (S11 in FIG. 21).

【0374】ところで、1行を誤って2つの行に分割し
て切り出した場合には、一般に、分割された2つの行の
間の白画素区間の長さが比較的短い。これに対して、適
切に切り出された分割行どうしの間の白画素区間は、そ
の長さが比較的長い。従って、この白画素区間の長さが
比較的長い場合には、当該白画素区間の両側の分割行
は、誤って分割された分割行でない可能性が高い。そこ
で、次のS12のステップにおいては、白画素区間の長
さを基準値と比較する。
When one line is erroneously divided into two lines and cut out, the length of the white pixel section between the two divided lines is generally relatively short. On the other hand, the length of the white pixel section between appropriately cut out divided rows is relatively long. Therefore, when the length of the white pixel section is relatively long, there is a high possibility that the divided rows on both sides of the white pixel section are not erroneously divided rows. Therefore, in the next step S12, the length of the white pixel section is compared with a reference value.

【0375】次に、この第2白画素区間162の長さS
bと第7基準値Rとを比較する(図21のS12)。
Next, the length S of the second white pixel section 162
b is compared with the seventh reference value R (S12 in FIG. 21).

【0376】この実施の形態では、Sb<Rとなるの
で、次のS13のステップへ進む(図21のS12の
「Y」の場合に対応する。)。また、Sb≧Rの場合、
すなわち、図21のS12の「N」の場合には、第1選
択統合区間が本来1行ではない可能性が高い。このた
め、その第1候補区間についての行切出しへ修正は行な
わずに、S4のステップへ進む。
In this embodiment, since Sb <R, the flow advances to the next step S13 (corresponding to the case of “Y” in S12 in FIG. 21). When Sb ≧ R,
That is, in the case of “N” in S12 of FIG. 21, there is a high possibility that the first selected integrated section is not originally one line. For this reason, the process proceeds to step S4 without correcting the line segmentation for the first candidate section.

【0377】次に、当該第2白画素区間162の長さS
bが当該第7基準値Rよりも短い場合に、第1選択統合
区間としての第2統合区間160を1つの連続した第1
黒画素区間とすることにより、行切出しの修正を行なう
(図21のS13)。
Next, the length S of the second white pixel section 162 is calculated.
When b is shorter than the seventh reference value R, the second integrated section 160 as the first selected integrated section is set as one continuous first integrated section.
The line segmentation is corrected by setting the black pixel section (S13 in FIG. 21).

【0378】この実施の形態では、2つの水平分割行1
50aおよび150bを含む第2統合区間160を1つ
の水平分割行150として切り出すことにより修正す
る。この水平分割行150には、「二」、「吉」および
「合」の3文字が含まれている。
In this embodiment, two horizontal divided rows 1
The correction is performed by cutting out the second integrated section 160 including 50a and 150b as one horizontal divided row 150. This horizontal division line 150 includes three characters of "two", "kichi" and "go".

【0379】尚、この実施の形態においては該当しなか
ったが、S10において、Et<Ebの場合には、第1
選択統合区間として第1統合区間156を選択する。そ
して、その場合は、この第1統合区間156について、
S14〜S16のステップの処理を行なう。
Although not applicable in this embodiment, if Et <Eb in S10, the first
The first integrated section 156 is selected as the selected integrated section. Then, in this case, for the first integrated section 156,
The process of steps S14 to S16 is performed.

【0380】その場合、先ず、第1白画素区間158の
長さStを検出する(図21のS14)。
In this case, first, the length St of the first white pixel section 158 is detected (S14 in FIG. 21).

【0381】次に、第1白画素区間158の長さStと
第7基準値Rとを比較する(図21のS15)。尚、S
t≧Rの場合には、S4のステップへ進む。
Next, the length St of the first white pixel section 158 is compared with the seventh reference value R (S15 in FIG. 21). Note that S
If t ≧ R, the process proceeds to step S4.

【0382】次に、第1白画素区間158の長さStが
当該第7基準値Rよりも短い場合(S15の「Y」の場
合に対応する。)に、第1選択統合区間としての第1統
合区間156を1つの連続した第1黒画素区間として統
合することにより、行切出しの修正を行なう(図21の
S16)。
Next, when the length St of the first white pixel section 158 is shorter than the seventh reference value R (corresponding to the case of “Y” in S15), the first selected integrated section as the first selected integrated section. The line segmentation is corrected by integrating one integrated section 156 as one continuous first black pixel section (S16 in FIG. 21).

【0383】(垂直分割行の統合修正について)次に、
図24を参照して、図22の(B)に示した垂直分割行
152の統合修正方法の一例について説明する。図24
は、垂直分割行の統合修正方法の説明に供する流れ図で
ある。
(Regarding the Correction of Vertically Split Lines)
With reference to FIG. 24, an example of a method of integrating and correcting the vertically divided rows 152 shown in FIG. 22B will be described. FIG.
8 is a flowchart provided for describing a method of integrating and correcting vertical divided rows.

【0384】一般に、誤って2つに分離されて切り出さ
れた垂直分割行の幅は、適切に切り出された他の分割行
に比べて狭く、他の分割行の半分程度である。さらに、
この誤って切り出された2つの分割行どうしの行間隔
は、一般に、他の分割行どうしの行間隔間に比べて狭
い。従って、切り出された分割行の幅若しくは幅と行間
隔とに着目すれば、本来1つの垂直分割行として切り出
されるべきところを誤って2つの垂直分割行として切り
出された分割行を発見して、分割行切出しの修正が可能
となる。
In general, the width of a vertically divided row that is erroneously divided into two and cut out is narrower than that of another appropriately cut out divided row, and is about half that of the other divided rows. further,
The line interval between two erroneously cut out divided lines is generally smaller than the line interval between the other divided lines. Therefore, if attention is paid to the width or the width and the line spacing of the cut-out divided lines, a divided line that is erroneously cut out as two vertical divided lines where the original cut-out line should be cut out as one vertical divided line is found. It is possible to correct the split line segmentation.

【0385】そこで、この実施の形態においては、垂直
分割行の統合修正を行なうにあたり、先ず、第2平均黒
画素区間長算出部120bにおいて、第2分割行切出し
部18bにおいて切り出された第2分割行(垂直分割
行)の第2黒画素区間の長さ(第2黒画素区間長)の相
加平均を第2平均黒画素区間長として求める(図24の
S1)。
Therefore, in this embodiment, in performing the integrated correction of the vertically divided rows, first, in the second average black pixel section length calculating section 120b, the second divided row extracted by the second divided row extracting section 18b The arithmetic mean of the length (second black pixel section length) of the second black pixel section of the row (vertical divided row) is determined as the second average black pixel section length (S1 in FIG. 24).

【0386】第2分割行が垂直分割行である場合、第2
分割行の第2黒画素区間長は、垂直分割行の幅を表す。
そして、この場合、第2平均区間長Wvは、垂直分割行
の幅の平均値を表す。
When the second divided row is a vertical divided row, the second divided row
The second black pixel section length of the divided row indicates the width of the vertical divided row.
Then, in this case, the second average section length Wv represents an average value of the widths of the vertically divided rows.

【0387】次に、各垂直分割行について、誤って切り
出されたものか否かを順次に調べるために、第2候補区
間選択部122bに、垂直分割行の通し番号を便宜的に
与えるパラメータjを用意する。そして、このパラメー
タjに1を代入する(図24のS2)。
Next, in order to sequentially check whether or not each vertically divided row is erroneously cut out, a parameter j for giving the serial number of the vertically divided row to the second candidate section selection unit 122b for convenience is given to the second candidate section selection unit 122b. prepare. Then, 1 is substituted for this parameter j (S2 in FIG. 24).

【0388】このパラメータjの最大値は、垂直分割行
の総数Nvとなる。
The maximum value of the parameter j is the total number Nv of the vertically divided rows.

【0389】次に、第2候補区間選択部122bにおい
て、この第2平均黒画素区間長と第2黒画素区間長とを
比較する。そして、第2黒画素区間のうち、第2平均黒
画素区間長Wvに対する第2黒画素区間長Wv(j)の
比率が第8基準値Q(例えば0.5)よりも小さな第2
黒画素区間を第2候補区間として選択する(図24のS
3)。
Next, the second candidate section selector 122b compares the second average black pixel section length with the second black pixel section length. Then, in the second black pixel section, the ratio of the second black pixel section length Wv (j) to the second average black pixel section length Wv is smaller than the eighth reference value Q (for example, 0.5).
The black pixel section is selected as the second candidate section (S in FIG. 24).
3).

【0390】ここでは、各垂直分割行の幅と平均値とを
順次に比較する。そして、ある垂直分割行の幅が平均値
に対して一定の割合よりも狭い場合、例えば幅Wv
(j)の1/Q倍(例えば2倍)の値が平均値Wvより
も低い場合に、その垂直分割行は、誤って分割された可
能性が高い。このため、その垂直分割行を統合修正対象
の候補としての第2候補区間として選択する。
Here, the width of each vertical divided row and the average value are sequentially compared. When the width of a certain vertical divided row is smaller than a certain ratio with respect to the average value, for example, the width Wv
If the value of 1 / Q (for example, twice) of (j) is lower than the average value Wv, it is highly likely that the vertically divided row is erroneously divided. Therefore, the vertically divided row is selected as a second candidate section as a candidate for integration correction.

【0391】そして、この実施の形態では、図22の
(B)に示した分割行152aを第2候補区間として選
択する。
In this embodiment, the divided row 152a shown in FIG. 22B is selected as a second candidate section.

【0392】尚、各垂直分割行の幅と平均値とを順次に
比較する場合、幅が条件を満たさない場合には、順次に
図24のS4のステップへ進む。S4のステップにおい
ては、パラメータjが、Nv未満であるか否かを判断す
る。すなわち、全ての分割行について幅と平均値とを比
較しか否かを判断する。
When sequentially comparing the width of each vertical divided row with the average value, if the width does not satisfy the condition, the flow sequentially advances to step S4 in FIG. In step S4, it is determined whether or not the parameter j is smaller than Nv. That is, it is determined whether or not only the width and the average value are compared for all the divided rows.

【0393】そして、パラメータjがNv未満でない場
合、すなわち、全ての垂直分割行についてその幅と平均
値とを比較したと判断した場合には、垂直分割行の統合
処理を終了する。
If the parameter j is not less than Nv, that is, if it is determined that the width and the average value have been compared for all the vertically divided rows, the integration processing of the vertically divided rows is ended.

【0394】また、パラメータjがNv未満である場
合、すなわち、その幅と平均値とを比較していない垂直
分割行がまだ残っていると判断した場合には、図24の
S5の処理へ進む。
If the parameter j is smaller than Nv, that is, if it is determined that there is still a vertically divided row whose width has not been compared with the average value, the process proceeds to S5 in FIG. .

【0395】このS5の処理においては、パラメータj
の値を1増加させる(インクリメントする。)。そし
て、図24のS3の処理へ進んで、次のパラメータj+
1に対応する垂直分割行についてその幅と平均値とを比
較する。
In the process of S5, the parameter j
Is incremented by one (increment). Then, the process proceeds to S3 in FIG. 24, where the next parameter j +
The width and the average value of the vertical division row corresponding to 1 are compared.

【0396】ところで、この第2候補区間として抽出さ
れた垂直分割行152aの両側には、それぞれ分割行が
存在している。このため、この両側の2つの分割行のう
ちのどちらの分割行を第2候補区間と統合して修正すべ
きかを決定する必要がある。この決定の方法について、
後述のS6〜S10のステップにおいて説明する。
By the way, divided rows exist on both sides of the vertical divided row 152a extracted as the second candidate section. Therefore, it is necessary to determine which of the two divided rows on both sides is to be modified by integrating with the second candidate section. For how to make this decision,
This will be described in steps S6 to S10 described later.

【0397】ここで、上述の図24のS3のステップに
おいて第2候補区間として選択された分割行152aに
対する統合修正処理の理解を容易にするために、図23
の(B)を供す。図23の(B)は、垂直分割行152
bの統合修正処理の説明に供する図である。
Here, in order to facilitate understanding of the integration correction processing for the divided row 152a selected as the second candidate section in the step S3 of FIG. 24, FIG.
(B). FIG. 23B shows a vertical division row 152.
FIG. 13B is a diagram provided for explanation of an integrated correction process of FIG.

【0398】次に、第3統合区間長検出部124cにお
いて、先ず、第2候補区間である垂直分割行152a
の、一方の側の直近の第2黒画素区間を第3候補黒画素
区間164とする。ここでは、垂直分割行152aの、
紙面左側の直近の第2黒画素区間を第3候補黒画素区間
164とする。そして、この第3候補黒画素区間164
と垂直分割行152aとを一つの連続した黒画素区間と
した場合の当該黒画素区間を第3統合区間166とす
る。そして、この第3統合区間166の長さWlを求め
る(図24のS6)。
Next, in the third integrated section length detecting section 124c, first, the vertical division row 152a as the second candidate section
The second black pixel section nearest to one side is referred to as a third candidate black pixel section 164. Here, the vertical division row 152a
The nearest second black pixel section on the left side of the paper is referred to as a third candidate black pixel section 164. Then, the third candidate black pixel section 164
The black pixel section when the vertical division row 152a and the vertical divided row 152a are one continuous black pixel section is referred to as a third integrated section 166. Then, the length Wl of the third integrated section 166 is determined (S6 in FIG. 24).

【0399】この第3統合区間166の長さWlは、図
23の(B)に示すように、第2候補区間である垂直分
割行152aの長さと第3候補黒画素区間164の長さ
との合計に、垂直分割行152aと第3候補黒画素区間
164との間の第3白画素区間168の長さS1を加え
た長さである。
The length Wl of the third integrated section 166 is, as shown in FIG. 23B, the length of the vertical divided row 152a which is the second candidate section and the length of the third candidate black pixel section 164. The total length is the sum of the length S1 of the third white pixel section 168 between the vertical divided row 152a and the third candidate black pixel section 164.

【0400】次に、第2統合区間長誤差算出部125b
において、第3統合区間166の長さWlと第2平均黒
画素区間長Wvとの差の大きさElを第3統合区間長誤
差として求める(図24のS7)。
Next, the second integrated section length error calculating section 125b
24, the magnitude El of the difference between the length Wl of the third integrated section 166 and the second average black pixel section length Wv is determined as the third integrated section length error (S7 in FIG. 24).

【0401】この第3統合区間長誤差Elは、下記の
(13)式で与えられる。
The third integrated section length error El is given by the following equation (13).

【0402】El=|Wl−Wv|・・・(13) また、第4統合区間長検出部124dにおいて、先ず、
第2候補区間である垂直分割行152aの、他方の側の
直近の第2黒画素区間を第2候補黒画素区間とする。こ
こでは、垂直分割行152aの、紙面右側の直近の第2
黒画素区間である垂直分割行152bを第2候補黒画素
区間152bとする。そして、この第2候補黒画素区間
152bと垂直分割行152aとを一つの連続した黒画
素区間とした場合の当該黒画素区間を第4統合区間17
0とする。そして、この第4統合区間170の長さWr
を求める(図24のS8)。
El = | Wl−Wv | (13) In the fourth integrated section length detecting section 124d, first,
The nearest second black pixel section on the other side of the vertical division row 152a that is the second candidate section is defined as a second candidate black pixel section. Here, the second divided line 152a on the right side of the drawing in the vertical divided row 152a
The vertical divided row 152b that is a black pixel section is defined as a second candidate black pixel section 152b. Then, when the second candidate black pixel section 152b and the vertical divided row 152a are defined as one continuous black pixel section, the black pixel section is referred to as a fourth integrated section 17.
Set to 0. The length Wr of the fourth integrated section 170
(S8 in FIG. 24).

【0403】この第4統合区間170の長さWrは、図
23の(B)に示すように、第2候補区間である垂直分
割行152aの長さと第4候補黒画素区間152bの長
さとの合計に、垂直分割行152aと第4候補黒画素区
間152bとの間の第4白画素区間172の長さSrを
加えた長さである。
The length Wr of the fourth integrated section 170 is, as shown in FIG. 23B, the length of the vertical divided row 152a which is the second candidate section and the length of the fourth candidate black pixel section 152b. The total length is obtained by adding the length Sr of the fourth white pixel section 172 between the vertical divided row 152a and the fourth candidate black pixel section 152b.

【0404】次に、第2統合区間長誤差算出部125b
において、第4統合区間170の長さWrと第2平均黒
画素区間長Wvとの差の大きさErを第4統合区間長誤
差として求める(図24のS9)。
Next, the second integrated section length error calculating section 125b
, The magnitude Er of the difference between the length Wr of the fourth integrated section 170 and the second average black pixel section length Wv is determined as the fourth integrated section length error (S9 in FIG. 24).

【0405】この第4統合区間長誤差Erは、下記の
(14)式で与えられる。
The fourth integrated section length error Er is given by the following equation (14).

【0406】Er=|Wr−Wv|・・・(14) 次に、第2選択統合区間長選択部126bにおいて、第
3統合区間長誤差Elと第4統合区間長誤差Erとを比
較する。そして、誤差の小さい方の統合区間を第2選択
統合区間として選択する(図24のS10)。
Er = | Wr−Wv | (14) Next, the second integrated section length error El is compared with the fourth integrated section length error Er in the second integrated section length selecting section 126b. Then, the integrated section having the smaller error is selected as the second selected integrated section (S10 in FIG. 24).

【0407】また、実施の形態では第3統合区間長誤差
Elと第4統合区間長誤差Erとが等しい場合には、第
4統合区間長誤差Erを第2選択統合区間として選択す
ることとする。
In the embodiment, when the third integrated section length error El is equal to the fourth integrated section length error Er, the fourth integrated section length error Er is selected as the second selected integrated section. .

【0408】そして、この実施の形態では、第4統合区
間長誤差Erが第3統合区間長誤差Elよりも短い。す
なわち、Er<Elである。従って、この実施の形態で
は、第3統合区間長誤差Erを第2選択統合区間として
選択する(図24のS10において「Y」の場合に対応
する。)。
[0408] In this embodiment, the fourth integrated section length error Er is shorter than the third integrated section length error El. That is, Er <El. Therefore, in this embodiment, the third integrated section length error Er is selected as the second selected integrated section (corresponding to the case of “Y” in S10 of FIG. 24).

【0409】次に、この第2選択統合区間としての第4
統合区間170のうちの、第2候補区間152aと当該
第2候補区間152aの直近の第2黒画素区間(この場
合は、第2候補黒画素区間152b)との間の第4白画
素区間172の長さSrを求める(図24のS11)。
[0409] Next, the fourth selected integrated section is referred to as the fourth selected integrated section.
The fourth white pixel section 172 between the second candidate section 152a and the second black pixel section immediately adjacent to the second candidate section 152a (in this case, the second candidate black pixel section 152b) in the integrated section 170. Is determined (S11 in FIG. 24).

【0410】ところで、1行を誤って2つの行に分割し
て切り出した場合には、一般に、分割された2つの行の
間の白画素区間の長さが比較的短い。これに対して、適
切に切り出された分割行どうしの間の白画素区間は、そ
の長さが比較的長い。従って、この白画素区間の長さが
比較的長い場合には、当該白画素区間の両側の分割行
は、誤って分割された分割行でない可能性が高い。そこ
で、次のS12のステップにおいては、白画素区間の長
さを基準値と比較する。
When one line is erroneously divided into two lines and cut out, the length of the white pixel section between the two divided lines is generally relatively short. On the other hand, the length of the white pixel section between appropriately cut out divided rows is relatively long. Therefore, when the length of the white pixel section is relatively long, there is a high possibility that the divided rows on both sides of the white pixel section are not erroneously divided rows. Therefore, in the next step S12, the length of the white pixel section is compared with a reference value.

【0411】次に、この第4白画素区間172の長さS
rと第9基準値Rとを比較する(図24のS12)。
Next, the length S of the fourth white pixel section 172
r is compared with the ninth reference value R (S12 in FIG. 24).

【0412】この実施の形態では、Sr<Rとなるの
で、次のS13のステップへ進む(図24のS12の
「Y」の場合に対応する。)。また、Sr≧Rの場合、
すなわち、図24のS12の「N」の場合には、第2選
択統合区間が本来1行ではない可能性が高い。このた
め、その第2候補区間についての行切出しへ修正は行な
わずに、S4のステップへ進む。
In this embodiment, since Sr <R, the process proceeds to the next step S13 (corresponding to the case of “Y” in S12 in FIG. 24). Also, when Sr ≧ R,
That is, in the case of “N” in S12 of FIG. 24, there is a high possibility that the second selected integrated section is not originally one line. For this reason, the process proceeds to step S4 without correcting the line segmentation for the second candidate section.

【0413】次に、当該第4白画素区間172の長さS
rが当該第9基準値Rよりも短い場合に、第2選択統合
区間としての第4統合区間170を1つの連続した第2
黒画素区間とすることにより、行切出しの修正を行なう
(図24のS13)。
Next, the length S of the fourth white pixel section 172 is calculated.
When r is shorter than the ninth reference value R, the fourth integrated section 170 as the second selected integrated section is set as one continuous second integrated section.
Correction of line segmentation is performed by setting a black pixel section (S13 in FIG. 24).

【0414】この実施の形態では、2つの垂直分割行1
52aおよび152aを含む第4統合区間170を1つ
の垂直分割行152として切り出すことにより修正す
る。この垂直分割行152には、「八」、「北」および
「礼」の3文字が含まれている。
In this embodiment, two vertically divided rows 1
The fourth integrated section 170 including 52a and 152a is corrected by cutting it out as one vertical divided row 152. This vertical division line 152 includes three characters of “eight”, “north”, and “thanks”.

【0415】尚、この実施の形態においては該当しなか
ったが、S10において、El<Erの場合には、第2
選択統合区間として第3統合区間166を選択する。そ
して、その場合は、この第3統合区間166について、
S14〜S16のステップの処理を行なう。
[0415] Although this is not applicable in this embodiment, if El <Er in S10, the second
The third integrated section 166 is selected as the selected integrated section. Then, in this case, for the third integrated section 166,
The process of steps S14 to S16 is performed.

【0416】その場合、先ず、第3白画素区間168の
長さS1を検出する(図24のS14)。
In this case, first, the length S1 of the third white pixel section 168 is detected (S14 in FIG. 24).

【0417】次に、第3白画素区間168の長さS1と
第9基準値Rとを比較する(図24のS15)。尚、S
1≧Rの場合には、S4のステップへ進む。
Next, the length S1 of the third white pixel section 168 is compared with the ninth reference value R (S15 in FIG. 24). Note that S
If 1 ≧ R, the process proceeds to step S4.

【0418】次に、第3白画素区間168の長さS1が
当該第9基準値Rよりも短い場合(S15の「Y」の場
合に対応する。)に、第2選択統合区間としての第3統
合区間166を1つの連続した第2黒画素区間として統
合することにより、行切出しの修正を行なう(図24の
S16)。
Next, when the length S1 of the third white pixel section 168 is shorter than the ninth reference value R (corresponding to the case of “Y” in S15), the second selection integration section is used. The line segmentation is corrected by integrating the three integrated sections 166 as one continuous second black pixel section (S16 in FIG. 24).

【0419】(分割修正の動作例)次に、1つの分割行
が誤って2つの分割行として切り出された場合の修正方
法の例について説明する。
(Operation Example of Division Correction) Next, an example of a correction method in the case where one divided row is cut out as two divided rows by mistake will be described.

【0420】図26の(A)および(B)に、修正対象
の横書きの水平分割行の例をそれぞれ示す。図26の
(A)には、行間隔が狭く、2つの分割行どうしの一部
分が重なっているために、上下2つの分割行が1つの分
割行として誤って切り出された水平分割行180を示
す。この水平分割行180の上寄りには「symbo
l」の文字列が含まれており、下寄りには「calcu
late」の文字列が含まれている。そして、この「s
ymbol」の文字列の2文字目の「y」と、「cal
culate」の文字列の3文字目の「l」とが一部分
で互いに重なっている。そして、この「symbol」
の文字列と「calculate」の文字列とは、個別
の分割行としてそれぞれ切り出されるべきものである。
FIGS. 26A and 26B show examples of horizontally divided horizontal lines to be corrected. FIG. 26A shows a horizontal divided line 180 in which the upper and lower divided lines are erroneously cut out as one divided line because the line interval is narrow and a part of the two divided lines overlaps. . In the upper part of the horizontal division line 180, "symbo"
l ”, and“ calcu ”
rate ". And this "s
ymbol ", the second character" y "of the character string, and" cal "
The third character “l” of the character string “culate” partially overlaps with each other. And this "symbol"
And the character string "calculate" are to be cut out as individual divided lines.

【0421】また、図26の(B)には、文書画像の行
方向が走査方向に対して斜めとなっているために、射影
分布における上下2つの行のそれぞれの黒画素区間が連
続して、上下2つの分割行が1つの分割行として誤って
切り出された水平分割行182を示す。この水平分割行
182の上寄りには「symbol」の文字列が含まれ
ており、下寄りには「calculate」の文字列が
含まれている。そして、これらの文字列は、矩形枠で輪
郭を示した分割行182に対して、いずれも右上りに傾
斜している。
In FIG. 26B, since the row direction of the document image is oblique to the scanning direction, each black pixel section of the upper and lower two rows in the projection distribution is continuous. The horizontal divided row 182 in which the upper and lower divided rows are erroneously cut out as one divided row is shown. The upper part of the horizontal divided line 182 contains the character string “symbol”, and the lower part thereof contains the character string of “calculate”. Each of these character strings is inclined to the upper right with respect to the divided row 182 whose outline is indicated by a rectangular frame.

【0422】また、ここでは、第1方向を水平方向(紙
面横方向、X軸に沿った方向)とし、第2方向を垂直方
向(紙面縦方向、Y軸に沿った方向)とする。従って、
図26の(A)に示された横書きの水平分割行180の
分割修正の処理は、第1分割修正部92aにおいて行な
われる。また、第2方向を水平方向とすれば、この水平
分割行180の分割修正の処理を、第2分割修正部92
bにおいて行なうことになる。
In this case, the first direction is the horizontal direction (horizontal direction on the paper, the direction along the X axis), and the second direction is the vertical direction (vertical direction on the paper, the direction along the Y axis). Therefore,
The process of dividing and correcting the horizontally divided horizontal row 180 shown in FIG. 26A is performed by the first dividing and correcting unit 92a. If the second direction is the horizontal direction, the process of correcting the division of the horizontal divided row 180 is performed by the second
b.

【0423】(水平分割行の分割修正 その1)先ず、
図25を参照して、図26の(A)に示した水平分割行
180の分割修正方法の一例について説明する。図25
は、水平分割行の分割修正方法の説明に供する流れ図で
ある。
(Partial Correction of Horizontal Divided Lines 1) First,
With reference to FIG. 25, an example of the division correction method of the horizontal division row 180 shown in FIG. 26A will be described. FIG.
9 is a flowchart for explaining a division correction method of a horizontally divided row.

【0424】一般に、誤って2つの水平分割行が1つの
水平分割行として切り出された場合、その誤って切り出
された水平分割行の高さは、適切に切り出された他の水
平分割行に比べて高く、他の分割行の2倍程度となる。
従って、切り出された分割行の高さに着目すれば、本来
2の分割行として切り出されるべきところを誤って1つ
の分割行として切り出された分割行を発見して、分割行
切出しの修正が可能となる。
In general, when two horizontal divided lines are erroneously cut out as one horizontal divided line, the height of the erroneously cut out horizontal divided line is larger than that of another appropriately divided horizontal divided line. And is about twice as high as other divided rows.
Therefore, if attention is paid to the height of the cut-out divided lines, it is possible to find a divided line that is erroneously cut out as one divided line where it should originally be cut out as two divided lines, and correct the divided line cut-out. Becomes

【0425】そこで、この実施の形態においては、水平
分割行の分割修正を行なうにあたり、先ず、第1平均黒
画素区間長算出部131aにおいて、第1分割行切出し
部18aにおいて切り出された第1分割行の第1黒画素
区間の長さ(第1黒画素区間長)の相加平均を第1平均
黒画素区間長として求める(図25のS1)。第1分割
行が水平分割行である場合、第1分割行の第1黒画素区
間長は、水平分割行の高さを表す。そして、この場合、
第1平均区間長Hhは、水平分割行の高さの平均値を表
す。
Therefore, in this embodiment, in performing the division correction of the horizontal division line, first, in the first average black pixel section length calculation unit 131a, the first division line extracted by the first division line extraction unit 18a The arithmetic mean of the length of the first black pixel section (first black pixel section length) of the row is determined as the first average black pixel section length (S1 in FIG. 25). When the first divided row is a horizontal divided row, the first black pixel section length of the first divided row indicates the height of the horizontal divided row. And in this case,
The first average section length Hh represents an average value of the heights of the horizontal divided rows.

【0426】次に、各水平分割行について、その水平分
割行が誤って切り出されたものか否かを順次に調べるた
めに、第1分割候補区間選択部132aにおいて、水平
分割行の通し番号を便宜的に与えるパラメータiを用意
する。そして、このパラメータiに1を代入する(図2
5のS2)。
Next, in order to sequentially check whether or not each horizontally divided row is erroneously cut out, the first division candidate section selecting unit 132a determines the serial number of the horizontally divided row for convenience. A parameter i to be given is prepared. Then, 1 is substituted for this parameter i (FIG. 2).
5 S2).

【0427】このパラメータiの最大値は、水平分割行
の総数Nhとなる。
The maximum value of this parameter i is the total number Nh of horizontal divided rows.

【0428】次に、第1分割候補区間選択部132aに
おいて、この第1平均黒画素区間長と第1黒画素区間長
とを比較する。そして、第1黒画素区間のうち、第1平
均黒画素区間長Hhに対する第1黒画素区間長Hh
(i)の比率が第11基準値U(例えば2)よりも小さ
な第1黒画素区間を第1候補区間として選択する(図2
5のS3)。
Next, the first division candidate section selector 132a compares the first average black pixel section length with the first black pixel section length. Then, of the first black pixel sections, the first black pixel section length Hh with respect to the first average black pixel section length Hh
The first black pixel section in which the ratio of (i) is smaller than the eleventh reference value U (for example, 2) is selected as the first candidate section (FIG. 2).
5 S3).

【0429】ここでは、各水平分割行の高さと平均値と
を順次に比較する。そして、ある水平分割行の高さが平
均値に対して一定の割合よりも低い場合、例えば高さH
h(i)の1/Q倍(例えば1/2倍)の値が平均値H
hよりも高い場合に、その水平分割行は、本来2つの分
割行が1つの分割行に誤って分割された可能性が高い。
このため、その水平分割行を分割修正対象の候補として
の第1候補区間として選択する。
Here, the height of each horizontal divided row and the average value are sequentially compared. If the height of a certain horizontal divided row is lower than a certain ratio with respect to the average, for example, the height H
The value of 1 / Q times (for example, 1/2 times) of h (i) is the average value H
If h is higher than h, it is highly likely that the two divided lines were originally incorrectly divided into one divided line.
For this reason, the horizontal divided row is selected as a first candidate section as a candidate for division correction.

【0430】そして、この実施の形態では、図26の
(A)に示した分割行180を第1候補区間として選択
する。
Then, in this embodiment, the divided row 180 shown in FIG. 26A is selected as the first candidate section.

【0431】尚、各水平分割行の高さと平均値とを順次
に比較する場合、高さが条件を満たさない場合には、順
次に図25のS4のステップへ進む。S4のステップに
おいては、パラメータiが、Nh未満であるか否かを判
断する。すなわち、全ての分割行について高さと平均値
とを比較したか否かを判断する。
When the height and average value of each horizontal divided row are sequentially compared, and if the height does not satisfy the condition, the process proceeds to step S4 in FIG. 25 sequentially. In step S4, it is determined whether or not the parameter i is smaller than Nh. That is, it is determined whether the height and the average value have been compared for all the divided rows.

【0432】そして、パラメータiがNh未満でない場
合、すなわち、全ての水平分割行についてその高さと平
均値とを比較したと判断した場合には、水平分割行の統
合処理を終了する。
If the parameter i is not less than Nh, that is, if it is determined that the height and the average value have been compared for all the horizontal divided rows, the process of integrating the horizontal divided rows is ended.

【0433】また、パラメータiがNh未満である場
合、すなわち、その高さと平均値とを比較していない水
平分割行がまだ残っていると判断した場合には、図25
のS5の処理へ進む。
If the parameter i is less than Nh, that is, if it is determined that there is still a horizontal division row whose height has not been compared with the average value, FIG.
To S5.

【0434】このS5の処理においては、パラメータi
の値を1増加させる(インクリメントする。)。そし
て、図25のS3の処理へ進んで、次のパラメータi+
1に対応する水平分割行についてその高さと平均値とを
比較する。
In the process of S5, the parameter i
Is incremented by one (increment). Then, the process proceeds to S3 in FIG. 25, where the next parameter i +
The height and the average value of the horizontal divided row corresponding to 1 are compared.

【0435】次に、後述の第1位置および第2位置を求
める際の走査範囲を決めるため、以下のS6〜S8の処
理を行なう。また、この処理の様子を図27の(A)〜
(C)に示す。
Next, the following steps S6 to S8 are performed in order to determine a scanning range for obtaining a first position and a second position described later. The state of this processing is shown in FIGS.
It is shown in (C).

【0436】先ず、水平分割行180の上端から、平均
の高さの半分であるHh/2(平均黒画素区間長の半
分)の距離だけ下がった位置に予備上限Yhsを設定す
る。この予備上限Yhsは、Y座標で与えられる。ま
た、水平分割行180の下端から、平均高さの半分であ
るHh/2の距離だけ上がった位置に予備下限Yheを
設定する。この予備下限Yheは、Y座標で与えられ
る。(図25のS6)(図27の(A))。
First, a preliminary upper limit Yhs is set at a position lower than the upper end of the horizontal divided row 180 by a distance of Hh / 2 (half the average black pixel section length) which is half the average height. This preliminary upper limit Yhs is given by the Y coordinate. Further, a preliminary lower limit Yhe is set at a position higher than the lower end of the horizontal divided row 180 by a distance of Hh / 2 which is half of the average height. This preliminary lower limit Yhe is given by the Y coordinate. (S6 in FIG. 25) ((A) in FIG. 27).

【0437】次に、水平分割行180のうち、予備上限
Yhsと予備下限Yheとの間の範囲の部分を、X軸方
向を走査方向としY軸方向を副走査方向として走査し
て、各走査線毎の累積黒画素数を検出して部分射影分布
178を作成する。そして、部分射影分布178のうち
で、累積黒画素数が最小となる最小位置Ydを求める。
この最小位置Ydは、Y座標で与えられる(図25のS
7)(図27の(B))。
Next, a portion of the horizontal divided row 180 between the preliminary upper limit Yhs and the preliminary lower limit Yhe is scanned by using the X-axis direction as the scanning direction and the Y-axis direction as the sub-scanning direction. The partial projection distribution 178 is created by detecting the cumulative number of black pixels for each line. Then, in the partial projection distribution 178, the minimum position Yd at which the cumulative number of black pixels is minimum is obtained.
This minimum position Yd is given by the Y coordinate (S in FIG. 25).
7) ((B) of FIG. 27).

【0438】次に、水平分割行180の最小位置Ydか
ら、平均高さの半分であるHh/2の距離だけ上がった
位置に上限Ydsを設定する。この上限Ydsは、Y座
標で与えられる。また、水平分割行180の最小位置Y
dから、平均高さの半分であるHh/2の距離だけ下が
った位置に下限Ydeを設定する。この下限Ydeは、
Y座標で与えられる(図25のS8)(図27の
(C))。
Next, an upper limit Yds is set at a position higher than the minimum position Yd of the horizontal divided row 180 by a distance of Hh / 2 which is half of the average height. This upper limit Yds is given by the Y coordinate. Also, the minimum position Y of the horizontal divided row 180
A lower limit Yde is set at a position lower than d by a distance of Hh / 2 which is half of the average height. This lower limit Yde is
It is given by the Y coordinate (S8 in FIG. 25) ((C) in FIG. 27).

【0439】このようにして、第1および第2位置を求
める際の走査範囲の上限Ydsおよび下限Ydeが決定
される。以下、図28の(A)および(B)を参照し
て、この走査範囲の中で第1および第2位置を検出する
処理について説明する。
In this manner, the upper limit Yds and the lower limit Yde of the scanning range for determining the first and second positions are determined. Hereinafter, with reference to FIGS. 28A and 28B, a process of detecting the first and second positions in the scanning range will be described.

【0440】次に、第1位置抽出部134aにおいて、
走査線のうち第1分割候補区間の中央付近を走査する走
査線上で黒画素の検出される位置のうち、第1方向に沿
って最も一方寄りの位置を第1位置として求める。そし
て、最寄第1位置抽出部136aにおいて、第1位置の
うち、第1方向に沿って最も他方寄りの第1位置を最寄
第1位置として求める(図25のS9)。
Next, in the first position extracting section 134a,
Among the positions where the black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines, the position closest to one side along the first direction is determined as the first position. Then, in the nearest first position extracting unit 136a, the first position closest to the other side in the first direction among the first positions is determined as the nearest first position (S9 in FIG. 25).

【0441】この実施の形態においては、図28の紙面
の左寄りを「一方寄り」とし、紙面の右寄りを「他方寄
り」とする。従って、第1位置は、上限Ydsおよび下
限Ydeとの間の走査範囲を左から右へ走査して、各走
査線毎に、最初に黒画素が検出される位置となる。ま
た、最寄第1位置は、第1位置のうちの最も右寄りの位
置となる。
In this embodiment, the left side of the sheet of FIG. 28 is referred to as “one-sided”, and the right side of the sheet of FIG. 28 is referred to as “the other side”. Therefore, the first position is a position where the scanning range between the upper limit Yds and the lower limit Yde is scanned from left to right, and a black pixel is first detected for each scanning line. Further, the nearest first position is the rightmost position among the first positions.

【0442】そして、この実施の形態では、最寄第1位
置を検出して、その座標(Xr、Yr)を得る(図28
の(A))。
In this embodiment, the nearest first position is detected, and its coordinates (Xr, Yr) are obtained (FIG. 28).
(A)).

【0443】次に、第2位置抽出部134bにおいて、
走査線のうち第1分割候補区間の中央付近を走査する走
査線上で黒画素の検出される位置のうち、第2方向に沿
って最も他方寄りの位置を第2位置として求める。そし
て、最寄第2位置抽出部136bにおいて、第2位置の
うち、第2方向に沿って最も一方寄りの第2位置を最寄
第2位置として求める(図25のS10)。
Next, in the second position extracting section 134b,
Of the positions where black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines, the position closest to the other side in the second direction is determined as the second position. Then, the nearest second position extracting unit 136b obtains, as the nearest second position, the second position closest to the first position along the second direction among the second positions (S10 in FIG. 25).

【0444】この実施の形態においては、第2位置は、
上限Ydsおよび下限Ydeとの間の走査範囲を右から
左へ走査して、各走査線毎に、最初に黒画素が検出され
る位置となる。また、最寄第2位置は、第2位置のうち
の最も左寄りの位置となる。
In this embodiment, the second position is
The scanning range between the upper limit Yds and the lower limit Yde is scanned from right to left, and a position where a black pixel is first detected is set for each scanning line. The second closest position is the leftmost position among the second positions.

【0445】そして、この実施の形態では、最寄第2位
置を検出して、その座標(Xl、Yl)を得る(図28
の(A))。
In this embodiment, the nearest second position is detected, and its coordinates (X1, Y1) are obtained (FIG. 28).
(A)).

【0446】次に、最寄第1位置と最寄第2位置とを比
較する(図25のS11)。そして、この最寄第1位置
(Xr、Yr)のX座標(Xr)がこの最寄第2位置
(Xl、Yl)のX座標(Xl)よりも一方側(左側)
である場合(すなわちXr<Xl)、または、この最寄
第1位置のx座標(Xl)とこの最寄第2位置のX座標
(Xr)とが第2方向に沿った同一直線上に位置する場
合(すなわちXr=Xl)に該当するか否かを判断す
る。すなわち、Xr≦Xlを満足するか否かを判断す
る。
Next, the first nearest position and the second nearest position are compared (S11 in FIG. 25). The X coordinate (Xr) of the nearest first position (Xr, Yr) is one side (left side) of the X coordinate (Xl) of the nearest second position (Xl, Yl).
(That is, Xr <Xl), or the x coordinate (Xl) of the nearest first position and the X coordinate (Xr) of the nearest second position are located on the same straight line along the second direction. Is determined (ie, Xr = X1). That is, it is determined whether or not Xr ≦ X1 is satisfied.

【0447】そして、Xr≦Xlの場合に、第1分割部
138aにおいて、第1分割候補区間を、当該第1分割
候補区間の中央で2つに分割させて2つの分割黒画素区
間を生成することにより、行切出しの修正を行なう(図
25のS12)。
If Xr ≦ X1, the first division section 138a divides the first division candidate section into two at the center of the first division candidate section to generate two divided black pixel sections. Thus, the line cutout is corrected (S12 in FIG. 25).

【0448】水平分割行180においては、Xr<Xl
である。従って、ここでは、水平分割行180を最小位
置Ydに沿った分割線によって、上下に強制的に2分割
する(図28の(B))。この分割によって、2つの水
平分割行180aおよび180bが生成される。上側の
水平分割行180aには、「symbol」の文字列が
含まれる。また、下側の水平分割行180bには、「c
alculate」の文字列が含まれる。
In the horizontal division line 180, Xr <Xl
It is. Therefore, here, the horizontal divided row 180 is forcibly divided vertically into two by a dividing line along the minimum position Yd ((B) in FIG. 28). This division generates two horizontal divided rows 180a and 180b. The upper horizontal divided line 180a includes the character string “symbol”. The lower horizontal divided row 180b includes “c
Calculate ”is included.

【0449】このように、図26の(A)に示された水
平分割行のように、分割行どうしが近接しているために
誤って統合されて切り出された分割行の行切出しを修正
する場合の多くは、このように、水平分割行を強制的に
上下に2分割することによって行切出しの修正を行なう
ことができる。
In this manner, as in the case of the horizontal divided row shown in FIG. 26A, the cutout of a divided row that is erroneously integrated and cut out because the divided rows are close to each other is corrected. In many cases, the line segmentation can be corrected by forcibly dividing the horizontal divided line into two in the vertical direction.

【0450】(水平分割行の分割修正 その2)次に、
図25を参照して、図26の(B)に示した水平分割行
182の分割修正方法の一例について説明する。この場
合、図25のS11までの処理内容は、前述の、図26
の(A)についての分割修正の場合の処理内容と同様で
あるので、その詳細な説明を省略する。
(Partial Correction of Horizontal Divided Lines Part 2)
With reference to FIG. 25, an example of the division correction method of the horizontal division row 182 shown in FIG. 26B will be described. In this case, the processing contents up to S11 in FIG.
(A) is the same as the processing content in the case of the division correction, and a detailed description thereof will be omitted.

【0451】ここでは、分割候補黒画素区間としての水
平分割行182を求めた後、後述の第1位置および第2
位置を求める際の走査範囲を決めるため、以下のS6〜
S8の処理を行なう。また、この処理の様子を図29の
(A)〜(C)に示す。
Here, after a horizontal division row 182 as a division candidate black pixel section is obtained, a first position and a second position
In order to determine the scanning range when obtaining the position, the following S6 to
The processing of S8 is performed. The state of this processing is shown in FIGS.

【0452】先ず、水平分割行182の上端から、平均
の高さの半分であるHh/2(平均黒画素区間長の半
分)の距離だけ下がった位置に予備上限Yhsを設定す
る。この予備上限Yhsは、Y座標で与えられる。ま
た、水平分割行180の下端から、平均高さの半分であ
るHh/2の距離だけ上がった位置に予備下限Yheを
設定する。この予備下限Yheは、Y座標で与えられ
る。(図25のS6)(図29の(A))。
First, a preliminary upper limit Yhs is set at a position lower than the upper end of the horizontal divided row 182 by a distance of Hh / 2 (half the average black pixel section length) which is half the average height. This preliminary upper limit Yhs is given by the Y coordinate. Further, a preliminary lower limit Yhe is set at a position higher than the lower end of the horizontal divided row 180 by a distance of Hh / 2 which is half of the average height. This preliminary lower limit Yhe is given by the Y coordinate. (S6 in FIG. 25) ((A) in FIG. 29).

【0453】次に、水平分割行182のうち、予備上限
Yhsと予備下限Yheとの間の範囲の部分を、X軸方
向を走査方向としY軸方向を副走査方向として走査し
て、各走査線毎の累積黒画素数を検出して部分射影分布
を176を作成する。そして、部分射影分布176のう
ちで、累積黒画素数が最小となる最小位置Ydを求め
る。この最小位置Ydは、Y座標で与えられる(図25
のS7)(図29の(B))。
Next, in the horizontal divided row 182, a portion in the range between the preliminary upper limit Yhs and the preliminary lower limit Yhe is scanned by using the X-axis direction as the scanning direction and the Y-axis direction as the sub-scanning direction. A partial projection distribution 176 is created by detecting the cumulative number of black pixels for each line. Then, in the partial projection distribution 176, the minimum position Yd at which the cumulative number of black pixels is minimum is obtained. This minimum position Yd is given by the Y coordinate (FIG. 25)
S7) (FIG. 29B).

【0454】次に、水平分割行180の最小位置Ydか
ら。平均高さの半分であるHh/2の距離だけ上がった
位置に上限Ydsを設定する。この上限Ydsは、Y座
標で与えられる。また、水平分割行180の最小位置Y
dから、平均高さの半分であるHh/2の距離だけ下が
った位置に下限Ydeを設定する。この下限Ydeは、
Y座標で与えられる(図25のS8)(図29の
(C))。
Next, from the minimum position Yd of the horizontal divided row 180. An upper limit Yds is set at a position raised by a distance of Hh / 2 which is half of the average height. This upper limit Yds is given by the Y coordinate. Also, the minimum position Y of the horizontal divided row 180
A lower limit Yde is set at a position lower than d by a distance of Hh / 2 which is half of the average height. This lower limit Yde is
It is given by the Y coordinate (S8 in FIG. 25) ((C) in FIG. 29).

【0455】このようにして、第1および第2位置を求
める際の走査範囲の上限Ydsおよび下限Ydeが決定
される。以下、図30の(A)および(B)を参照し
て、この走査範囲の中で第1および第2位置を検出する
処理について説明する。
[0455] In this manner, the upper limit Yds and the lower limit Yde of the scanning range for determining the first and second positions are determined. Hereinafter, with reference to FIGS. 30A and 30B, a process of detecting the first and second positions within the scanning range will be described.

【0456】次に、第1位置抽出部134aにおいて、
走査線のうち第1分割候補区間の中央付近を走査する走
査線上で黒画素の検出される位置のうち、第1方向に沿
って最も一方寄りの位置を第1位置として求める。そし
て、最寄第1位置抽出部136aにおいて、第1位置の
うち、第1方向に沿って最も他方寄りの第1位置を最寄
第1位置として求める(図25のS9)。
Next, in the first position extracting section 134a,
Among the positions where the black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines, the position closest to one side along the first direction is determined as the first position. Then, in the nearest first position extracting unit 136a, the first position closest to the other side in the first direction among the first positions is determined as the nearest first position (S9 in FIG. 25).

【0457】この実施の形態においては、図30の紙面
の左寄りを「一方寄り」とし、紙面の右寄りを「他方寄
り」とする。従って、第1位置は、上限Ydsおよび下
限Ydeとの間の走査範囲を左から右へ走査して、各走
査線毎に、最初に黒画素が検出される位置となる。ま
た、最寄第1位置は、第1位置のうちの最も右寄りの位
置となる。
In this embodiment, the left side of FIG. 30 is referred to as “one-sided”, and the right side of FIG. 30 is referred to as “other-side”. Therefore, the first position is a position where the scanning range between the upper limit Yds and the lower limit Yde is scanned from left to right, and a black pixel is first detected for each scanning line. Further, the nearest first position is the rightmost position among the first positions.

【0458】そして、この実施の形態では、最寄第1位
置を検出して、その座標(Xr、Yr)を得る(図30
の(A))。
In this embodiment, the nearest first position is detected, and its coordinates (Xr, Yr) are obtained (FIG. 30).
(A)).

【0459】次に、第2位置抽出部134bにおいて、
走査線のうち第1分割候補区間の中央付近を走査する走
査線上で黒画素の検出される位置のうち、第2方向に沿
って最も他方寄りの位置を第2位置として求める。そし
て、最寄第2位置抽出部136bにおいて、第2位置の
うち、第2方向に沿って最も一方寄りの第2位置を最寄
第2位置として求める(図25のS10)。
Next, in the second position extracting section 134b,
Of the positions where black pixels are detected on the scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines, the position closest to the other side in the second direction is determined as the second position. Then, the nearest second position extracting unit 136b obtains, as the nearest second position, the second position closest to the first position along the second direction among the second positions (S10 in FIG. 25).

【0460】この実施の形態においては、第2位置は、
上限Ydsおよび下限Ydeとの間の走査範囲を左から
右へ走査して、各走査線毎に、最初に黒画素が検出され
る位置となる。また、最寄第2位置は、第2位置のうち
の最も左寄りの位置となる。
[0460] In this embodiment, the second position is:
The scanning range between the upper limit Yds and the lower limit Yde is scanned from left to right, and for each scanning line, a position where a black pixel is detected first is set. The second closest position is the leftmost position among the second positions.

【0461】そして、この実施の形態では、最寄第2位
置を検出して、その座標(Xl、Yl)を得る(図30
の(A))。
In this embodiment, the nearest second position is detected, and its coordinates (X1, Y1) are obtained (FIG. 30).
(A)).

【0462】次に、最寄第1位置と最寄第2位置とを比
較する。(図25のS11)。そして、この最寄第1位
置(Xr、Yr)のX座標(Xr)がこの最寄第2位置
(Xl、Yl)のX座標(Xl)よりも他方側(右側)
である場合(すなわちXl<Xr)であるか否かを判断
する。ここでは、図30の(A)に示すようにXl<X
rを満足する。
Next, the first nearest position and the second nearest position are compared. (S11 in FIG. 25). The X coordinate (Xr) of the nearest first position (Xr, Yr) is on the other side (right side) of the X coordinate (Xl) of the nearest second position (Xl, Yl).
Is determined (ie, Xl <Xr). Here, as shown in FIG. 30A, Xl <X
r is satisfied.

【0463】そして、Xl<Xrの場合に、第2分割部
138bにおいて、この最寄第1位置とこの最寄第2位
置との中間を通りかつ第2方向に沿った分割線で第1分
割候補区間としての水平分割行182を分割する。ここ
では、X座標が(Xr+Xl)/2の位置で水平分割行
182を左右に2分割する。
If Xl <Xr, the second dividing section 138b makes a first division by a dividing line passing through the middle between the nearest first position and the nearest second position and extending in the second direction. The horizontal division row 182 as a candidate section is divided. Here, the horizontal division row 182 is divided into two at the position where the X coordinate is (Xr + X1) / 2.

【0464】この分割によって、一方側(左側)の第一
方分割領域184および他方側(右側)の他方分割領域
186を生成する。
By this division, a first divided region 184 on one side (left side) and another divided region 186 on the other side (right side) are generated.

【0465】そして、この一方分割領域184を最寄第
2位置(Xr、Yr)が得られた走査線によってさらに
分割して2つの分割黒画素区間184aおよび184b
を生成する。すなわち、一方分割領域184をYrの位
置で上下に2分割する。この分割によって、左上分割行
184aおよび左下分割行184bが生成される。
Then, the one divided area 184 is further divided by the scanning line from which the nearest second position (Xr, Yr) is obtained, and divided into two divided black pixel sections 184a and 184b.
Generate That is, the one divided region 184 is vertically divided into two at the position of Yr. By this division, an upper left divided row 184a and a lower left divided row 184b are generated.

【0466】また、他方分割領域186を最寄第1位置
(Xl、Yl)が得られた走査線によってさらに分割し
て2つの分割黒画素区間186aおよび186bを生成
する。すなわち、他方分割領域186をYlの位置で上
下に2分割する。この分割によって、右上分割行186
aおよび右下分割行186bが生成される。
The other divided area 186 is further divided by the scanning line from which the nearest first position (X1, Y1) has been obtained to generate two divided black pixel sections 186a and 186b. That is, the other divided area 186 is vertically divided into two at the position of Yl. By this division, the upper right division line 186
a and the lower right split row 186b are generated.

【0467】このようにして合計4つの分割黒画素区間
を生成することにより行切出しの修正を行なう(図25
のS13)(図30の(B))。
The line segmentation is corrected by generating a total of four divided black pixel sections in this manner (FIG. 25).
S13) ((B) of FIG. 30).

【0468】このように、図26の(B)に示された水
平分割行のように、文書画像の行方向が走査方向に対し
て傾斜しているために誤って統合されて切り出された分
割行の行切出しを修正する場合の多くは、このように、
分割行を4分割することによって行切出しの修正を行な
うことができる。
As described above, as in the case of the horizontal division line shown in FIG. 26B, the division direction erroneously integrated and cut out because the line direction of the document image is inclined with respect to the scanning direction. In many cases where you want to fix line breaks,
The line segmentation can be corrected by dividing the divided line into four.

【0469】尚、左上分割行184aと右上分割行18
6aとは、分割行の接続の処理の際に、互いに接続され
る。また、左下分割行184bと右下分割行186bと
は、分割行の連結の処理の際に、互いに接続される。
The upper left divided row 184a and the upper right divided row 18
6a are connected to each other in the process of connecting the divided rows. Further, the lower left divided row 184b and the lower right divided row 186b are connected to each other at the time of the processing of linking the divided rows.

【0470】(分割行の接続の動作例について)次に、
分割行の接続の動作例について説明する。
(Example of operation of connection of divided rows)
An operation example of the connection of the divided rows will be described.

【0471】(水平分割行の接続の動作について)先
ず、図31の(A)および(B)を参照して、水平分割
行どうしの連結の例について説明する。ここでは、水平
方向を第1方向、垂直方向を第2方向とする。また、図
31の(A)および(B)では、それぞれ水平方向にX
軸をとり、垂直方向にY軸をとっている。
(Regarding Operation of Connecting Horizontally Divided Rows) First, an example of connection between horizontally divided rows will be described with reference to FIGS. 31 (A) and 31 (B). Here, the horizontal direction is a first direction, and the vertical direction is a second direction. Also, in FIGS. 31A and 31B, X
The axis is taken and the Y axis is taken in the vertical direction.

【0472】図31の(A)には、互いに隣接する分割
領域にそれぞれ含まれる2つの水平分割行190aおよ
び190bをそれぞれ示す。この水平分割行190aお
よび190bどうしは、第1黒画素区間の一部分どうし
が重なっている。すなわち、水平分割行190aと19
0bとは、互いに少しずれて隣接している。
[0472] Fig. 31A shows two horizontal divided rows 190a and 190b included in divided areas adjacent to each other, respectively. In the horizontal divided rows 190a and 190b, portions of the first black pixel section overlap each other. That is, the horizontal division rows 190a and 19
0b are adjacent to each other with a slight shift.

【0473】そして、第1分割行接続部26aでは、水
平分割行190aと190bとの互いに重なっている第
1黒画素区間の長さKhが、第4基準値Vよりも長い場
合に、その水平分割行どうしを接続する。この第4基準
値Vの値は、例えば。水平分割行の高さの平均の半分程
度とすると良い。ここでは、Kh>Vを満たしているの
で、水平分割行190aおよび190bどうしを接続す
る。
In the first divided row connection section 26a, when the length Kh of the first black pixel section overlapping the horizontal divided rows 190a and 190b is longer than the fourth reference value V, the horizontal Connect the split lines. The value of the fourth reference value V is, for example, It is preferable that the height be about half of the average height of the horizontal divided rows. Here, since Kh> V is satisfied, the horizontal divided rows 190a and 190b are connected to each other.

【0474】この接続によって、図31の(B)に示す
ように、行190が生成される。尚、図31の(B)に
おいては、便宜的に、行190の輪郭を、水平分割行1
90aおよび190bの輪郭よりも一回り大きく示して
ある。しかし、実際には、行190の輪郭は、水平分割
行190aおよび190bの輪郭と一致する。
With this connection, a row 190 is generated as shown in FIG. In FIG. 31B, for the sake of convenience, the outline of the row 190 is divided into the horizontal divided row 1
It is shown slightly larger than the contours of 90a and 190b. However, in practice, the contour of row 190 matches the contour of horizontal split rows 190a and 190b.

【0475】(垂直分割行の接続の動作について)次
に、図32の(A)および(B)を参照して、垂直分割
行どうしの連結の例について説明する。ここでは、水平
方向を第2方向、垂直方向を第1方向とする。また、図
32の(A)および(B)では、それぞれ水平方向にX
軸をとり、垂直方向にY軸をとっている。
(Regarding Operation of Connecting Vertically Divided Rows) Next, an example of connection between vertically divided rows will be described with reference to FIGS. 32 (A) and 32 (B). Here, the horizontal direction is a second direction, and the vertical direction is a first direction. Also, in FIGS. 32A and 32B, X is set in the horizontal direction.
The axis is taken and the Y axis is taken in the vertical direction.

【0476】図32の(A)には、互いに隣接する分割
領域にそれぞれ含まれる2つの垂直分割行192aおよ
び192bをそれぞれ示す。この垂直分割行192aお
よび192bどうしは、第2黒画素区間の一部分どうし
が重なっている。すなわち、垂直分割行192aと19
2bとは、互いに少しずれて隣接している。
FIG. 32A shows two vertical divided rows 192a and 192b included in divided areas adjacent to each other. In the vertical divided rows 192a and 192b, parts of the second black pixel section overlap each other. That is, the vertical divided rows 192a and 19
2b are adjacent to each other with a slight shift.

【0477】そして、第2分割行接続部26bでは、垂
直分割行192aと192bとの互いに重なっている第
2黒画素区間の長さKwが、第5基準値Vよりも長い場
合に、その垂直分割行どうしを接続する。この第5基準
値Vの値は、例えば。垂直分割行の高さの平均の半分程
度とすると良い。ここでは、Kw>Vを満たしているの
で、垂直分割行192aおよび192bどうしを接続す
る。
In the second divided row connection section 26b, when the length Kw of the second black pixel section overlapping the vertical divided rows 192a and 192b is longer than the fifth reference value V, Connect the split lines. The value of the fifth reference value V is, for example, It is preferable to set the height to about half of the average height of the vertical divided rows. Here, since Kw> V is satisfied, the vertically divided rows 192a and 192b are connected to each other.

【0478】この接続によって、図32の(B)に示す
ように、行192が生成される。尚、図32の(B)に
おいては、便宜的に、行192の輪郭を、垂直分割行1
92aおよび192b輪郭よりも一回り大きく示してあ
る。しかし、実際には、行192の輪郭は、垂直分割行
192aおよび192bの輪郭と一致する。
With this connection, a row 192 is generated as shown in FIG. In FIG. 32B, for the sake of convenience, the outline of the row 192 is divided into the vertical division row 1
It is shown slightly larger than the contours 92a and 192b. However, in practice, the contour of row 192 matches the contour of vertical split rows 192a and 192b.

【0479】上述した各実施の形態では、この発明を特
定の条件で構成した例についてのみ説明したが、この発
明は多くの変更および変形を行うことができる。例え
ば、上述した実施の形態では、横方向を第1方向とし、
かつ、縦方向を第2方向として説明したが、この発明で
は、例えば、縦方向を第2方向とし、かつ、横方向を第
1方向としても良い。また、第1方向および第2方向は
互いに直交していれば良く、必ずしも文書画像の文書領
域の縦方向および横方向に沿っていなくとも良い。
In each of the embodiments described above, only examples in which the present invention is configured under specific conditions have been described. However, the present invention can be subjected to many changes and modifications. For example, in the embodiment described above, the horizontal direction is the first direction,
Although the vertical direction has been described as the second direction, in the present invention, for example, the vertical direction may be the second direction, and the horizontal direction may be the first direction. Further, the first direction and the second direction need only be orthogonal to each other, and need not necessarily be along the vertical direction and the horizontal direction of the document area of the document image.

【0480】また、上述した実施の形態においては、射
影分布における黒画素区間を求めるための第1および第
2基準値をそれぞれ1画素としたが、この発明では、第
1および第2基準値として任意好適な自然数をとること
ができ、例えば数画素を基準値としても良い。また、第
1基準値と第2基準値とは互いに異なっても良い。
In the above-described embodiment, the first and second reference values for obtaining the black pixel section in the projection distribution are each one pixel. However, in the present invention, the first and second reference values are used as the first and second reference values. Any suitable natural number can be taken. For example, several pixels may be used as the reference value. Further, the first reference value and the second reference value may be different from each other.

【0481】また、上述した実施の形態においては、第
1方向分割領域と第2方向分割領域とを同数生成した
が、この発明では、第1方向分割領域の数と第2方向分
割領域の数とは必ずしも同数でなくとも良い。
In the above-described embodiment, the same number of the first direction divided areas and the second direction divided areas are generated. However, in the present invention, the number of the first direction divided areas and the number of the second direction divided areas are different. Are not necessarily the same.

【0482】また、上述した実施の形態においては、第
1修正部24aおよび第2修正部24bを設けたが、こ
の発明の行切出し装置および方法は、これらの修正部を
設けていない場合にも適用することができる。
In the above-described embodiment, the first correction unit 24a and the second correction unit 24b are provided. However, the line segmenting apparatus and method of the present invention can be used even when these correction units are not provided. Can be applied.

【0483】また、上述した実施の形態においては、行
方向確認切替部12を設けたが、この発明の行切出し装
置は、行方向確認切替部12を設けない場合にも適用す
ることができる。その場合は、例えば、オペレータが、
行方向の情報を確認して文書画像の情報の送出先を切り
替えても良い。
Although the line direction confirmation switching unit 12 is provided in the above-described embodiment, the line segmenting device of the present invention can be applied to a case where the line direction confirmation switching unit 12 is not provided. In that case, for example, the operator
The transmission destination of the document image information may be switched by checking the information in the row direction.

【0484】また、上述した実施の形態においては、切
替出力部22を設けたが、この発明の行切出し装置は、
切替出力部22を設けない場合にも適用することができ
る。その場合は、例えば、オペレータが、行方向判定の
結果を確認して文書画像の送出先を切り替えても良い。
Although the switching output unit 22 is provided in the above-described embodiment, the line segmenting device according to the present invention
The present invention can be applied to a case where the switching output unit 22 is not provided. In this case, for example, the operator may switch the transmission destination of the document image after confirming the result of the line direction determination.

【0485】[0485]

【発明の効果】【The invention's effect】

(行切出し方法および行切出し装置)この発明の行切出
し方法および行切出し装置によれば、文書画像の行方向
が不明である場合に、行切出しの処理の一環のプロセス
において得られた第1方向射影分布に基づいて切り出さ
れた第1分割行の情報と、行切出しの処理の一環のプロ
セスにおいて得られた第2方向射影分布に基づいて切り
出された第2分割行の情報とを用いて、行方向を判定す
る。そして、行方向が判定された後は、判定された行方
向に対応する分割行どうしの接続を行なって行の切出し
を行なう。従って、この発明によれば、文書画像の行方
向が不明である場合でも、事前に行切出しとは個別に行
方向を判定する処理行なうことなく、行切出しの処理の
プロセスで得られた情報を用いて行方向を判定して、行
切出しを行なうことができる。
(Line cutting method and line cutting device) According to the line cutting method and line cutting device of the present invention, when the line direction of a document image is unknown, the first direction obtained in a process as a part of the line cutting process. Using the information of the first divided row cut out based on the projection distribution and the information of the second divided row cut out based on the second direction projection distribution obtained in the process of part of the row cutout processing, Determine the row direction. After the row direction is determined, the divided rows corresponding to the determined row direction are connected to each other to cut out the row. Therefore, according to the present invention, even when the line direction of a document image is unknown, the information obtained in the line cutout process can be obtained without performing the process of determining the line direction separately from the line cutout in advance. The row direction can be determined by using this to perform line segmentation.

【0486】(第1の行切出し修正方法および第1の行
切出し修正装置)また、この発明の第1の行切出し修正
方法および第1の行切出し修正装置によれば、1つの行
が誤って2つの行として切り出されてしまった場合の行
切出しの修正を行なうことができる。
(First Line Cutout Correction Method and First Line Cutout Correction Device) In addition, according to the first line cutout correction method and the first line cutout correction device of the present invention, one line is incorrectly set. Correction of line cutout when cut out as two lines can be performed.

【0487】(第2の行切出し修正方法および第2の行
切出し修正装置)また、この発明の第2の行切出し修正
方法および第2の行切出し修正装置によれば、2つの個
別の行が誤って1つの行として切り出されてしまった場
合の行切出しの修正を行なうことができる。
(Second line cutout correcting method and second line cutout correcting device) According to the second line cutout correcting method and the second line cutout correcting device of the present invention, two individual lines are It is possible to correct the line cutout when it is cut out as one line by mistake.

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

【図1】実施の形態の行切出し装置の構成の説明に供す
る機能ブロック図である。
FIG. 1 is a functional block diagram for explaining a configuration of a line segmentation device according to an embodiment;

【図2】文字認識装置の構成の説明に供する機能ブロッ
ク図である。
FIG. 2 is a functional block diagram for explaining the configuration of a character recognition device.

【図3】行方向判定部の構成の説明に供する機能ブロッ
ク図である。
FIG. 3 is a functional block diagram for explaining a configuration of a row direction determination unit.

【図4】第1判定部の構成の説明に供する機能ブロック
図である。
FIG. 4 is a functional block diagram for explaining a configuration of a first determination unit;

【図5】第2判定部の構成の説明に供する機能ブロック
図である。
FIG. 5 is a functional block diagram for explaining a configuration of a second determination unit;

【図6】第3判定部の構成の説明に供する機能ブロック
図である。
FIG. 6 is a functional block diagram for explaining a configuration of a third determination unit;

【図7】第1修正部の構成の説明に供する機能ブロック
図である。
FIG. 7 is a functional block diagram for explaining a configuration of a first correction unit;

【図8】第1統合修正部の構成の説明に供する機能ブロ
ック図である。
FIG. 8 is a functional block diagram for explaining a configuration of a first integrated correction unit;

【図9】第1分割修正部の構成の説明に供する機能ブロ
ック図である。
FIG. 9 is a functional block diagram for explaining the configuration of a first division correction unit.

【図10】第2修正部の構成の説明に供する機能ブロッ
ク図である。
FIG. 10 is a functional block diagram for explaining a configuration of a second correction unit;

【図11】第2統合修正部の構成の説明に供する機能ブ
ロック図である。
FIG. 11 is a functional block diagram for explaining a configuration of a second integrated correction unit;

【図12】第2分割修正部の構成の説明に供する機能ブ
ロック図である。
FIG. 12 is a functional block diagram for explaining a configuration of a second division correction unit.

【図13】行切出し装置の動作の説明に供する流れ図で
ある。
FIG. 13 is a flowchart for explaining the operation of the line cutout device;

【図14】判定対象の文書画像である。FIG. 14 is a document image to be determined.

【図15】(A)および(B)は、分割領域の説明に供
する図である。
FIGS. 15A and 15B are diagrams for explaining a divided area; FIGS.

【図16】(A)および(B)は、分割領域およびその
射影分布の説明に供する図である。
FIGS. 16A and 16B are diagrams for explaining a divided region and its projection distribution.

【図17】判定部の動作の説明に供する流れ図である。FIG. 17 is a flowchart for explaining the operation of a determination unit;

【図18】(A)〜(D)は、第1判定部の動作の説明
(第1方向)に供する図である。
FIGS. 18A to 18D are views for explaining the operation of the first determination unit (first direction).

【図19】(A)〜(C)は、第1判定部の動作の説明
(第2方向)に供する図である。
FIGS. 19A to 19C are diagrams for explaining the operation of the first determination unit (second direction).

【図20】(A)および(B)は、分割領域の黒画素区
間長および白画素区間長のばらつきの算出の説明に供す
る図である。
FIGS. 20A and 20B are diagrams for explaining the calculation of the variation of the black pixel section length and the white pixel section length of the divided area.

【図21】水平分割行の統合修正の動作の説明に供する
流れ図である。
FIG. 21 is a flowchart for explaining the operation of integrating and correcting horizontal divided rows.

【図22】(A)および(B)は、統合修正の対象例で
ある。
FIGS. 22A and 22B are examples of a target of integrated correction;

【図23】(A)および(B)は、統合修正方法の説明
に供する図である。
FIGS. 23A and 23B are diagrams for explaining an integrated correction method;

【図24】垂直分割行の統合修正の動作の説明に供する
流れ図である。
FIG. 24 is a flowchart for explaining the operation of integrating and correcting vertical divided rows.

【図25】水平分割行の分割修正の動作の説明に供する
流れ図である。
FIG. 25 is a flowchart for explaining the operation of dividing and correcting a horizontally divided row.

【図26】(A)および(B)は、分割修正の対象例で
ある。
FIGS. 26A and 26B are examples of target of division correction.

【図27】(A)〜(C)は、第1の分割修正例の説明
に供する図(その1)である。
FIGS. 27A to 27C are diagrams (part 1) for describing a first modification example of division;

【図28】(A)および(B)は、図27の(C)に続
く、第1の分割修例の説明に供する図(その2)であ
る。
FIGS. 28A and 28B are diagrams (part 2) for explaining the first modification example following FIG. 27C;

【図29】(A)〜(C)は、第2の分割修例の説明に
供する図(その1)である。
FIGS. 29A to 29C are diagrams (part 1) for describing a second modification example;

【図30】(A)および(B)は、図29の(C)に続
く、第2の分割修正例の説明に供する図(その2)であ
る。
FIGS. 30A and 30B are diagrams (part 2) for explaining the second modification example following FIG. 29C;

【図31】(A)および(B)は、水平分割行の接続の
説明に供する図である。
FIGS. 31A and 31B are diagrams for explaining connection of horizontal divided rows.

【図32】(A)および(B)は、垂直分割行の接続の
説明に供する図である。
FIGS. 32A and 32B are diagrams for explaining connection of a vertically divided row.

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

10:行切出し装置 12:行方向確認切替部 12a:行方向確認部 12b:切替部 14a:第1方向分割領域生成部 14b:第2方向分割領域生成部 16a:第1方向射影分布作成部 16b:第2方向射影分布作成部 18a:第1分割行切出し部 18b:第2分割行切出し部 20:行方向判定部 22:切替出力部 24a:第1修正部 24b:第2修正部 26a:第1分割行接続部 26b:第2分割行接続部 28:制御部 30:スキャナ 31:イメージメモリ 32:文字領域設定部 33:文字切出し部 34:文字認識部 36a:第1分割領域数計数部 36b:第2分割領域数計数部 38a:第1黒画素区間数計数部 38b:第2黒画素区間数計数部 40:区間数分割数比較判定部 42a:第1ばらつき算出部 42b:第2ばらつき算出部 44:ばらつき比較判定部 46a:第1平均値算出部 46b:第2平均値算出部 48:平均値比較判定部 50:文字領域 50a:第1分割領域 50b:第2分割領域 50c:第3分割領域 50d:第4分割領域 50e:第5分割領域 50f:第6分割領域 52:文字列、行 52a:第1分割行 52b:第2分割行 52c:第3分割行 54a、54b:第1方向射影分布 54e:第2方向射影分布 56a、56b:黒画素区間 60:文書画像 62:文字列、行 64a:全角文字 64b:半角文字 66:文字領域 68:第1方向分割領域 68a:第1分割領域 68b:第2分割領域 68c:第3分割領域 70:第2方向分割領域 70a:第4分割領域 70b:第5分割領域 70c:第6分割領域 70d:第7分割領域 72:第1方向射影分布 74:射影ブロック 74a:第1射影ブロック 74b:第2射影ブロック 74c:第3射影ブロック 74j:第10射影ブロック 76:分割行、水平分割行 78:第2方向射影分布 78a:第1射影 78b:第2射影 78c:第3射影 78d:第4射影 78e:第5射影 80:分割行、垂直分割行 82:第1黒画素区間 84:第2黒画素区間 86:第1白画素区間 88:第2白画素区間 90a:第1統合修正部 90b:第2統合修正部 92a:第1分割修正部 92b:第2分割修正部 120a:第1平均黒画素区間長算出部 120b:第2平均黒画素区間長算出部 122a:第1候補区間選択部 122b:第2候補区間選択部 124a:第1統合区間長検出部 124b:第2統合区間長検出部 124c:第3統合区間長検出部 124d:第4統合区間長検出部 125a:第1統合区間長誤差算出部 125b:第2統合区間長誤差算出部 125c:第3統合区間長誤差算出部 125d:第4統合区間長誤差算出部 126a:第1選択統合区間長選択部 126b:第2選択統合区間長選択部 128a:第1白画素区間長検出部 128b:第2白画素区間長検出部 130a:第1統合部 130b:第2統合部 131a:第1平均黒画素区間長算出部 131b:第2平均黒画素区間長算出部 132a:第1分割候補区間選択部 132b:第2分割候補区間選択部 134a:第1位置抽出部 134b:第2位置抽出部 134c:第3位置抽出部 134d:第4位置抽出部 136a:最寄第1位置抽出部 136b:最寄第2位置抽出部 136c:最寄第3位置抽出部 136d:最寄第4位置抽出部 138a:第1分割部 138b:第2分割部 138c:第3分割部 138d:第4分割部 150、150a、150b:分割行 152、152a、152b:分割行 154:第1候補黒画素区間 156:第1統合区間 158:第1白画素区間 160:第2統合区間 162:第2白画素区間 164:第3候補黒画素区間 166:第3統合区間 168:第3白画素区間 170:第4統合区間 172:第4白画素区間 176、178:部分射影分布 180、180a、180b、182、182a、18
2b:水平分割行 184:一方分割領域 184a:左上分割行 184b:左下分割行 186:他方分割領域 186a:右上分割行 186b:右下分割行 190:水平行 190a、190b:水平分割行 192:垂直行 192a、192b:垂直分割行 201:第1判定部 202:第2判定部 203:第3判定部
10: Line segmentation device 12: Line direction confirmation switching unit 12a: Line direction confirmation unit 12b: Switching unit 14a: First direction division region generation unit 14b: Second direction division region generation unit 16a: First direction projection distribution generation unit 16b : Second direction projection distribution creating unit 18a: first divided line segmenting unit 18b: second divided line segmenting unit 20: line direction determining unit 22: switching output unit 24a: first modifying unit 24b: second modifying unit 26a: second 1-divided line connection unit 26b: second divided-line connection unit 28: control unit 30: scanner 31: image memory 32: character area setting unit 33: character cutout unit 34: character recognition unit 36a: first division region number counting unit 36b : Second black area section counting section 38a: first black pixel section number counting section 38b: second black pixel section number counting section 40: section number division number comparison determination section 42a: first variation calculation section 42b: second frame Fluctuation calculation unit 44: Variation comparison determination unit 46a: First average value calculation unit 46b: Second average value calculation unit 48: Average value comparison determination unit 50: Text area 50a: First division area 50b: Second division area 50c : Third divided area 50d: Fourth divided area 50e: Fifth divided area 50f: Sixth divided area 52: Character string, line 52a: First divided line 52b: Second divided line 52c: Third divided line 54a, 54b : First direction projection distribution 54e: second direction projection distribution 56a, 56b: black pixel section 60: document image 62: character string, line 64a: full-width character 64b: half-width character 66: character area 68: first direction division area 68a : First divided area 68b: Second divided area 68c: Third divided area 70: Second divided area 70a: Fourth divided area 70b: Fifth divided area 70c: Sixth divided area 70d: Seventh Split area 72: Projection distribution in the first direction 74: Projection block 74a: First projection block 74b: Second projection block 74c: Third projection block 74j: Tenth projection block 76: Split row, horizontal split row 78: Second direction Projection distribution 78a: First projection 78b: Second projection 78c: Third projection 78d: Fourth projection 78e: Fifth projection 80: Split row, vertical split row 82: First black pixel section 84: Second black pixel section 86 : First white pixel section 88: second white pixel section 90a: first integrated correction section 90b: second integrated correction section 92a: first division correction section 92b: second division correction section 120a: first average black pixel section length Calculator 120b: Second average black pixel section length calculator 122a: First candidate section selector 122b: Second candidate section selector 124a: First integrated section length detector 124b: Second integrated section length detector Section 124c: third integrated section length detecting section 124d: fourth integrated section length detecting section 125a: first integrated section length error calculating section 125b: second integrated section length error calculating section 125c: third integrated section length error calculating section 125d : 4th integrated section length error calculating section 126a: 1st selected integrated section length selecting section 126b: 2nd selected integrated section length selecting section 128a: 1st white pixel section length detecting section 128b: 2nd white pixel section length detecting section 130a : 1st integration section 130b: 2nd integration section 131a: 1st average black pixel section length calculation section 131b: 2nd average black pixel section length calculation section 132a: 1st division candidate section selection section 132b: 2nd division candidate section selection Unit 134a: first position extraction unit 134b: second position extraction unit 134c: third position extraction unit 134d: fourth position extraction unit 136a: nearest first position extraction unit 136b: second nearest position Extraction unit 136c: Nearest third position extraction unit 136d: Nearest fourth position extraction unit 138a: First division unit 138b: Second division unit 138c: Third division unit 138d: Fourth division unit 150, 150a, 150b: Division row 152, 152a, 152b: Division row 154: First candidate black pixel section 156: First integration section 158: First white pixel section 160: Second integration section 162: Second white pixel section 164: Third candidate black Pixel section 166: Third integrated section 168: Third white pixel section 170: Fourth integrated section 172: Fourth white pixel section 176, 178: Partial projection distribution 180, 180a, 180b, 182, 182a, 18
2b: horizontal divided line 184: one-side divided region 184a: upper left divided line 184b: lower left divided line 186: other divided region 186a: upper right divided line 186b: lower right divided line 190: horizontal line 190a, 190b: horizontal divided line 192: vertical Rows 192a and 192b: Vertically divided rows 201: First determination unit 202: Second determination unit 203: Third determination unit

Claims (27)

【特許請求の範囲】[Claims] 【請求項1】 (a1)文書画像の行方向が不明である
場合および前記文書画像の行方向が第1方向である場合
に、第2方向に沿った分割線によって前記文書画像を分
割することにより、該第2方向と直交する第1方向に沿
って並んだ複数の第1方向分割領域を生成するプロセス
と、 (b1)前記第1方向分割領域が生成された場合に、当
該第1方向分割領域の各々を、前記第1方向に沿って走
査して、走査毎の累積黒画素数を検出し、当該累積黒画
素数の前記第2方向に沿った分布を求めることにより第
1方向射影分布を作成するプロセスと、 (c1)前記第1方向射影分布が作成された場合に、当
該第1方向射影分布の各々において第1基準値以上の累
積黒画素数が前記第2方向に沿って連続する区間をそれ
ぞれ第1黒画素区間として、当該第1黒画素区間が得ら
れる走査領域をそれぞれ第1分割行として分割行切出し
を行なうプロセスと、 (a2)文書画像の行方向が不明である場合および該文
書画像の行方向が第2方向である場合に、前記第1方向
に沿った分割線によって文書画像を分割することによ
り、前記第2方向に沿って並んだ複数の第2方向分割領
域を生成するプロセスと、 (b2)前記第2方向分割領域が生成された場合に、当
該第2方向分割領域の各々を、前記第2方向に沿って走
査して、走査毎の累積黒画素数を検出し、当該累積黒画
素数の前記第1方向に沿った分布を求めることにより第
2方向射影分布を作成するプロセスと、 (c2)前記第2方向射影分布が作成された場合に、当
該第2方向射影分布の各々において第2基準値以上の累
積黒画素数が前記第1方向に沿って連続する区間をそれ
ぞれ第2黒画素区間として、当該第2黒画素区間が得ら
れる走査領域をそれぞれ第2分割行として分割行切出し
を行なうプロセスと、 (d)前記文書画像の行方向が不明である場合に、前記
第1方向射影分布と前記第2方向射影分布とに基づい
て、前記文書画像の行方向を判定するプロセスと、 (e1)前記文書画像の行方向が前記第1方向である場
合に、前記第1方向で互いに隣接する前記第1方向分割
領域にそれぞれ含まれる前記分割行どうしであって、当
該分割行を走査して得られた前記第1黒画素区間の少な
くとも一部分どうしが重なっている分割行どうしを接続
して行切出しを行なうプロセスと、 (e2)前記文書画像の行方向が前記第2方向である場
合に、前記第2方向で互いに隣接する前記第2方向分割
領域にそれぞれ含まれる前記分割行どうしであって、当
該分割行を走査して得られた前記第2黒画素区間の少な
くとも一部分どうしが重なっている分割行どうしを接続
して行切出しを行なうプロセスとを含むことを特徴とす
る行切出し方法。
(A1) dividing the document image by a dividing line along a second direction when the line direction of the document image is unknown and when the line direction of the document image is the first direction. A process of generating a plurality of first direction divided regions arranged along a first direction orthogonal to the second direction, and (b1) when the first direction divided regions are generated, the first direction Each of the divided areas is scanned in the first direction, the number of cumulative black pixels for each scan is detected, and the distribution of the cumulative number of black pixels along the second direction is determined to project in the first direction. And (c1) when the first direction projection distribution is created, the cumulative number of black pixels equal to or greater than a first reference value in each of the first direction projection distributions along the second direction. Each continuous section is defined as a first black pixel section, A process in which a scanning area where the first black pixel section is obtained is used as a first divided line to perform divided line segmentation; (a2) When the line direction of the document image is unknown, and when the line direction of the document image is the second direction A process of generating a plurality of second-direction divided regions arranged along the second direction by dividing the document image by dividing lines along the first direction; and When a two-way divided area is generated, each of the second-directional divided areas is scanned along the second direction to detect the cumulative number of black pixels for each scan, and A process of creating a second direction projection distribution by obtaining a distribution along the first direction; and (c2) when the second direction projection distribution is created, a second reference in each of the second direction projection distributions. The cumulative number of black pixels A process in which a continuous section along the first direction is defined as a second black pixel section, and a scanning region in which the second black pixel section is obtained is defined as a second divided row, and a divided line is cut out; A process of determining a line direction of the document image based on the first direction projection distribution and the second direction projection distribution when a line direction of the image is unknown; (e1) a line direction of the document image Is the first direction, wherein the divided rows included in the first direction divided areas adjacent to each other in the first direction are the first blacks obtained by scanning the divided rows. (E2) adjacent to each other in the second direction when the row direction of the document image is the second direction, and connecting the divided rows in which at least some of the pixel sections overlap each other. You The divided rows included in the second direction divided area are connected to each other, and at least a part of the second black pixel sections obtained by scanning the divided rows are overlapped with each other. A line segmentation process.
【請求項2】 請求項1に記載の行切出し方法におい
て、前記(d)のプロセスを行なうにあたり、 前記第1黒画素区間の各々の長さをそれぞれ第1黒画素
区間長として、当該第1黒画素区間長のばらつきを算出
するプロセスと、 前記第2黒画素区間の各々の長さをそれぞれ第2黒画素
区間長として、当該第2黒画素区間長のばらつきを算出
するプロセスと、 前記第1黒画素区間長のばらつきと前記第2黒画素区間
長のばらつきとを比較して、当該第1黒画素区間長のば
らつきと当該第2黒画素区間長のばらつきとの比率が第
3基準値以上の場合に、ばらつきの小さい方の黒画素区
間長が得られた射影分布の走査方向を行方向と判定する
プロセスとを含むことを特徴とする行切出し方法。
2. The line segmentation method according to claim 1, wherein in performing the process (d), the length of each of the first black pixel sections is defined as a first black pixel section length. A process of calculating the variation of the length of the black pixel section; a process of calculating the variation of the length of the second black pixel section by setting each length of the second black pixel section as a second black pixel section length; By comparing the variation in the length of one black pixel section with the variation in the length of the second black pixel section, the ratio between the variation in the length of the first black pixel section and the variation in the length of the second black pixel section is determined by a third reference value. A method for determining the scanning direction of the projection distribution from which the black pixel section length with the smaller variation is obtained as the row direction.
【請求項3】 請求項2に記載の行切出し方法におい
て、前記(d)のプロセスを行なうにあたり、 前記第1黒画素区間長のばらつきと前記第2黒画素区間
長のばらつきとの比率が前記第3基準未満の場合に、 前記第1方向射影分布において隣り合った前記第1黒画
素区間どうしの間の第1白画素区間の長さと、前記第2
方向射影分布において隣り合った前記第2黒画素区間ど
うしの間の第2白画素区間の長さとを利用して、行方向
を判定するプロセスを含むことを特徴とする行切出し方
法。
3. The line segmentation method according to claim 2, wherein in performing the process (d), the ratio of the variation in the first black pixel section length to the variation in the second black pixel section length is set to In a case where the distance is less than a third criterion, a length of a first white pixel section between the first black pixel sections adjacent to each other in the first direction projection distribution;
A line segmentation method including a process of determining a row direction using a length of a second white pixel section between adjacent second black pixel sections in a directional projection distribution.
【請求項4】 請求項1に記載の行切出し方法におい
て、前記(d)のプロセスを行なうにあたり、 前記第1方向射影分布において隣り合った前記第1黒画
素区間どうしの間の第1白画素区間の長さと、前記第2
方向射影分布において隣り合った前記第2黒画素区間ど
うしの間の第2白画素区間の長さとを利用して、行方向
を判定するプロセスを含むことを特徴とする行切出し方
法。
4. The line segmentation method according to claim 1, wherein in performing the process (d), the first white pixel between the first black pixel sections adjacent to each other in the first direction projection distribution. The length of the section and the second
A line segmentation method including a process of determining a row direction using a length of a second white pixel section between adjacent second black pixel sections in a directional projection distribution.
【請求項5】 請求項3または4に記載の行切出し方法
において、 前記第1白画素区間が1箇所の場合には、当該第1白画
素区間の長さを第1平均白画素区間長とし、かつ、前記
第1白画素区間が複数箇所の場合には、当該第1白画素
区間の各々の長さの相加平均を第1平均白画素区間長と
して算出するプロセスと、 前記第2白画素区間が1箇所の場合には、当該第2白画
素区間の長さを第2平均白画素区間長とし、かつ、前記
第2白画素区間が複数箇所の場合には、当該第2白画素
区間の各々の長さの相加平均を第2平均白画素区間長と
して算出するプロセスと、および、 前記第1平均白画素区間長と前記第2平均白画素区間長
とを比較して、より大きな平均白画素区間長の得られた
射影分布の走査方向を行方向と判定するプロセスとを含
むことを特徴とする行切出し方法。
5. The line segmentation method according to claim 3, wherein when the first white pixel section is one, the length of the first white pixel section is defined as a first average white pixel section length. And when there are a plurality of first white pixel sections, a process of calculating an arithmetic mean of the lengths of the first white pixel sections as a first average white pixel section length; When there is one pixel section, the length of the second white pixel section is set to the second average white pixel section length, and when there are a plurality of the second white pixel sections, the second white pixel section A process of calculating an arithmetic mean of each length of the section as a second average white pixel section length, and comparing the first average white pixel section length with the second average white pixel section length, Determining the scanning direction of the obtained projection distribution having a large average white pixel section length as the row direction. A line segmentation method characterized by the following.
【請求項6】 請求項1に記載の行切出し方法におい
て、前記(d)のプロセスを行なうにあたり、 前記第1方向分割領域の数の合計を第1分割領域数とし
て求めるプロセスと、 前記第1黒画素区間の数の、全ての前記第1方向分割領
域にわたっての合計を第1黒画素区間数として求めるプ
ロセスと、 前記第2方向分割領域の数の合計を第2分割領域数とし
て求めるプロセスと、 前記第2黒画素区間の数の、全ての前記第2方向分割領
域にわたっての合計を第2黒画素区間数として求めるプ
ロセスと、 前記第1黒画素区間数と該第1分割領域数とが一致し、
かつ、前記第2黒画素区間数と前記第2分割領域数とが
不一致の場合に、前記行方向を前記第1方向と判定する
プロセスと、 前記第2黒画素区間数と該第2分割領域数とが一致し、
かつ、前記第1黒画素区間数と前記第1分割領域数とが
不一致の場合に、前記行方向を前記第2方向と判定する
プロセスとを含むことを特徴とする行切出し方法。
6. The line segmentation method according to claim 1, wherein in performing the process (d), a process of obtaining a total number of the first direction divided regions as a first divided region number; A process of calculating the total number of black pixel sections over all of the first direction divided areas as a first black pixel section number; and a process of calculating the total number of the second direction divided areas as a second divided area number. A process of calculating the total number of the second black pixel sections over all of the second direction divided areas as a second black pixel section number; and the first black pixel section number and the first divided area number are: Matches,
A process of determining the row direction as the first direction when the number of the second black pixel sections does not match the number of the second divided areas; The number matches,
Determining a row direction as the second direction when the number of the first black pixel sections and the number of the first divided areas do not match.
【請求項7】 請求項1に記載の行切出し方法におい
て、 前記(e1)のプロセスにおいて、前記分割領域に含ま
れる前記第1方向分割行の前記第1黒画素区間の一部分
が、当該分割領域と隣接する他の1つの分割領域に含ま
れる2つの第1分割行の前記第1黒画素区間の一部分と
それぞれ重なっている場合、重なっている区間の長さが
第4基準値よりも長い分割行どうしを接続し、 前記(e2)のプロセスにおいて、前記分割領域に含ま
れる前記第2方向分割行の前記第2黒画素区間の一部分
が、当該分割領域と隣接する他の1つの分割領域に含ま
れる2つの第2分割行の前記第2黒画素区間の一部分と
それぞれ重なっている場合、重なっている区間の長さが
第5基準値よりも長い分割行どうしを接続することを特
徴とする行切出し方法。
7. The line segmentation method according to claim 1, wherein in the step (e1), a part of the first black pixel section of the first direction divided row included in the divided area is divided into the divided area. And a part of the first black pixel section of two first divided rows included in another adjacent divided area, the length of the overlapping section is longer than the fourth reference value. In the process (e2), a part of the second black pixel section of the second direction divided row included in the divided area is connected to another divided area adjacent to the divided area. In a case where each of the second black pixel sections of the two included second divided rows overlaps with a part of the second black pixel section, the divided rows whose overlapping section lengths are longer than a fifth reference value are connected. Line segmentation method.
【請求項8】 請求項1に記載の行切出し方法におい
て、前記(e1)のプロセスを行なう前に、 前記(c1)のプロセスにおいて切り出された前記第1
分割行の第1黒画素区間の長さ(以下、第1黒画素区間
長とも称する。)の相加平均を第1平均黒画素区間長と
して求めるプロセスと、 該第1平均黒画素区間長と前記第1黒画素区間長とを比
較して、前記第1黒画素区間のうち、前記第1平均黒画
素区間長に対する第1黒画素区間長の比率が第6基準値
よりも小さな第1黒画素区間を第1候補区間として選択
するプロセスと、 該第1候補区間の一方の側の直近の第1黒画素区間であ
る第1候補黒画素区間と該第1候補区間とを一つの連続
した黒画素区間とした場合の当該黒画素区間を第1統合
区間とし、当該第1統合区間の長さを求めるプロセス
と、 該第1統合区間の長さと前記第1平均黒画素区間長との
差の大きさを第1統合区間長誤差として求めるプロセス
と、 該第1候補区間の他方の側の直近の第1黒画素区間であ
る第2候補黒画素区間と該第1候補区間とを1つの連続
した黒画素区間とした場合の当該黒画素区間を第2統合
区間とし、当該第2統合区間の長さを求めるプロセス
と、 該第2統合区間の長さと前記第1平均黒画素区間長との
差の大きさを第2統合区間長誤差として求めるプロセス
と、 前記第1統合区間長誤差と前記第2統合区間長誤差とを
比較して、誤差の小さい方の統合区間を第1選択統合区
間として選択するプロセスと、 該第1選択統合区間のうちの、前記第1候補区間と当該
第1候補区間の直近の第1黒画素区間との間の第1白画
素区間の長さを求めるプロセスと、 該第1白画素区間の長さと第7基準値とを比較して、当
該第1白画素区間の長さが当該第7基準値よりも短い場
合に、前記第1選択統合区間を1つの連続した第1黒画
素区間とすることにより、行切出しの修正を行なうプロ
セスとを含むことを特徴とする行切出し方法。
8. The line cutting method according to claim 1, wherein the first (c1) process is performed before the (e1) process.
A process of calculating an arithmetic mean of the length of a first black pixel section (hereinafter also referred to as a first black pixel section length) of a divided row as a first average black pixel section length; The first black pixel section length is compared with the first black pixel section length, and the ratio of the first black pixel section length to the first average black pixel section length in the first black pixel section is smaller than a sixth reference value. A process of selecting a pixel section as a first candidate section; and a first candidate black pixel section that is the nearest first black pixel section on one side of the first candidate section and the first candidate section being one continuous A process for determining the length of the first integrated section, with the black pixel section as the first integrated section when the black pixel section is set, and the difference between the length of the first integrated section and the first average black pixel section length The size of the first candidate section, and the other of the first candidate section In the case where the second candidate black pixel section, which is the nearest first black pixel section on the side of, and the first candidate section are defined as one continuous black pixel section, the black pixel section is referred to as a second integrated section. A process of determining the length of the second integrated section; a process of determining the magnitude of the difference between the length of the second integrated section and the first average black pixel section length as a second integrated section length error; A process of comparing a long error with the second integrated section length error and selecting an integrated section having a smaller error as a first selected integrated section; and a first candidate section of the first selected integrated section. A process of calculating the length of a first white pixel section between the first white pixel section and the first black pixel section immediately adjacent to the first candidate section; comparing the length of the first white pixel section with a seventh reference value; When the length of the first white pixel section is shorter than the seventh reference value, the first selection is performed. Correcting the line cutout by setting the integrated section as one continuous first black pixel section.
【請求項9】 請求項1に記載の行切出し方法におい
て、前記(e2)のプロセスを行なう前に、 前記(c2)のプロセスにおいて切り出された前記第2
分割行の第2黒画素区間の長さ(以下、第2黒画素区間
長とも称する。)の相加平均を第2平均黒画素区間長と
して求めるプロセスと、 前記第2平均黒画素区間長と前記第2黒画素区間長とを
比較して、前記第2黒画素区間のうち、前記第2平均黒
画素区間長に対する第2黒画素区間長の比率が第8基準
値よりも小さな第2黒画素区間を第2候補区間として選
択するプロセスと、 該第2候補区間の一方の側の直近の第2黒画素区間であ
る第3候補黒画素区間と該第2候補区間とを一つの連続
した黒画素区間とした場合の当該黒画素区間を第3統合
区間とし、当該第3統合区間の長さを求めるプロセス
と、 該第3統合区間の長さと前記第2平均黒画素区間長との
差の大きさを第3統合区間長誤差として算出するプロセ
スと、 該第2候補区間の他方の側の直近の第2黒画素区間であ
る第4候補黒画素区間と該第2候補区間とを1つの連続
した黒画素区間とした場合の当該黒画素区間を第4統合
区間とし、当該第4統合区間の長さを求めるプロセス
と、 該第4統合区間の長さと前記第2平均黒画素区間長との
差の大きさを第4統合区間長誤差として算出するプロセ
スと、 前記第3統合区間長誤差と前記第4統合区間長誤差とを
比較して、誤差の小さい方の統合区間を第2選択統合区
間として選択するプロセスと、 該第2選択統合区間のうちの、前記第2候補区間と当該
第2候補区間の直近の第2黒画素区間との間の第2白画
素区間の長さを求めるプロセスと、 該第2白画素区間の長さと第9基準値とを比較して、当
該第2白画素区間の長さが当該第10基準値よりも短い
場合に、前記第2選択統合区間を1つの連続した第2黒
画素区間とすることにより、行切出しの修正を行なうプ
ロセスとを含むことを特徴とする行切出し方法。
9. The method according to claim 1, wherein before performing the process (e2), the second process is performed in the process (c2).
A process of calculating an arithmetic mean of the length of a second black pixel section (hereinafter, also referred to as a second black pixel section length) of a divided row as a second average black pixel section length; The second black pixel section length is compared with the second black pixel section length, and the ratio of the second black pixel section length to the second average black pixel section length in the second black pixel section is smaller than an eighth reference value. A process of selecting a pixel section as a second candidate section; and a third candidate black pixel section, which is the nearest second black pixel section on one side of the second candidate section, and the second candidate section A process for determining the length of the third integrated section, where the black pixel section is a third integrated section when the black pixel section is set, and a difference between the length of the third integrated section and the second average black pixel section length Calculating the size of the second candidate section as a third integrated section length error; When the fourth candidate black pixel section, which is the nearest second black pixel section on the other side, and the second candidate section are defined as one continuous black pixel section, the black pixel section is referred to as a fourth integrated section. A process of calculating the length of the fourth integrated section; a process of calculating the difference between the length of the fourth integrated section and the second average black pixel section length as a fourth integrated section length error; Comparing the integrated section length error with the fourth integrated section length error and selecting the integrated section having the smaller error as the second selected integrated section; and selecting the second selected integrated section of the second selected integrated section. A process of determining the length of the second white pixel section between the candidate section and the second black pixel section immediately adjacent to the second candidate section; and comparing the length of the second white pixel section with the ninth reference value. When the length of the second white pixel section is shorter than the tenth reference value, Correcting the line cutout by setting the second selected integrated section as one continuous second black pixel section.
【請求項10】 請求項1に記載の行切出し方法におい
て、 前記(c1)のプロセスにおいて切り出された前記第1
分割行の第1黒画素区間の長さ(以下、第1黒画素区間
長とも称する。)の相加平均を第1平均黒画素区間長と
して求めるプロセスと、 前記第1平均黒画素区間長と前記第1黒画素区間長とを
比較して、前記第1黒画素区間のうち、前記第1平均黒
画素区間長に対する第1黒画素区間長の比率が第11基
準値よりも大きな第1黒画素区間を第1分割候補区間と
して選択するプロセスと、 前記走査線のうち前記第1分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第1方向に沿って最も一方寄りの位置を第1位置として
求めるプロセスと、 前記第1位置のうち、前記第1方向に沿って最も他方寄
りの第1位置を最寄第1位置として求めるプロセスと、 前記走査線のうち前記第1分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第2方向に沿って最も前記他方寄りの位置を第2位置と
して求めるプロセスと、 前記第2位置のうち、前記第2方向に沿って最も前記一
方寄りの第2位置を最寄第2位置として求めるプロセス
と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記他方側である
場合および該最寄第1位置と該最寄第2位置とが前記第
2方向に沿った同一直線上に位置する場合に、前記第1
分割候補区間を、当該第1分割候補区間の中央で2つに
分割させて2つの分割黒画素区間を生成することによ
り、行切出しの修正を行なうプロセスと、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記一方側である
場合に、該最寄第1位置と該最寄第2位置との中間を通
りかつ前記第2方向に沿った分割線で前記第1分割候補
区間を分割することにより、前記一方側の第一方分割領
域および前記他方側の他方分割領域を生成し、前記一方
分割領域を前記最寄第2位置が得られた走査線によって
分割して2つの分割黒画素区間を生成し、かつ、前記他
方分割領域を前記最寄第1位置が得られた走査線によっ
て分割して2つの分割黒画素区間を生成することにより
行切出しの修正を行なうプロセスとを含むことを特徴と
する行切出し方法。
10. The line cutout method according to claim 1, wherein the first cutout in the process (c1) is performed.
A process of calculating an arithmetic mean of the length of a first black pixel section (hereinafter, also referred to as a first black pixel section length) of a divided row as a first average black pixel section length; The first black pixel section length is compared with the first black pixel section length, and the ratio of the first black pixel section length to the first average black pixel section length in the first black pixel section is greater than an eleventh reference value. A process of selecting a pixel section as a first division candidate section; and a step of selecting a pixel section as a first division candidate section along the first direction at a position where a black pixel is detected on a scanning line that scans a center of the first division candidate section. A process for obtaining a position closest to the other side as a first position, a process for obtaining a first position closest to the other side along the first direction as the closest first position among the first positions, and the scanning line. Run around the center of the first division candidate section A process of determining, as a second position, a position closest to the other side along the second direction among positions where black pixels are detected on a scanning line to be inspected; and a process along the second direction among the second positions. A process for determining the second position closest to the one side as the closest second position, comparing the closest first position with the closest second position, and determining that the closest first position is the closest second position. When the second position is closer to the other side than the second position and when the nearest first position and the nearest second position are located on the same straight line along the second direction, the first
A process of correcting the line segmentation by dividing the division candidate section into two in the center of the first division candidate section to generate two divided black pixel sections; Comparing the nearest second position with the nearest second position, if the nearest first position is closer to the one side than the nearest second position, the intermediate position between the nearest first position and the nearest second position; And dividing the first candidate division section with a division line along the second direction, thereby generating the first one division area on one side and the other division area on the other side, and The nearest second position is divided by the obtained scanning line to generate two divided black pixel sections, and the other divided area is divided by the scanning line from which the nearest first position is obtained. Process of correcting line segmentation by generating two divided black pixel sections And a line segmentation method.
【請求項11】 請求項1に記載の行切出し方法におい
て、 前記(c2)のプロセスにおいて切り出された前記第2
分割行の第2黒画素区間の長さ(以下、第2黒画素区間
長とも称する。)の相加平均を第2平均黒画素区間長と
して求めるプロセスと、 前記第2平均黒画素区間長と前記第2黒画素区間長とを
比較して、前記第2黒画素区間のうち、前記第2平均黒
画素区間長に対する第2黒画素区間長の比率が第12基
準値よりも大きな第2黒画素区間を第2分割候補区間と
して選択するプロセスと、 前記走査線のうち前記第2分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第2方向に沿って最も一方寄りの位置を第3位置として
求めるプロセスと、 前記第3位置のうち、前記第2方向に沿って最も他方寄
りの第3位置を最寄第3位置として求めるプロセスと、 前記走査線のうち前記第2分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第1方向に沿って最も前記他方寄りの位置を第4位置と
して求めるプロセスと、 前記第4位置のうち、前記第1方向に沿って最も前記一
方寄りの第4位置を最寄第4位置として求めるプロセス
と、 前記最寄第3位置と前記最寄第4位置とを比較して、該
最寄第3位置が該最寄第4位置よりも前記他方側である
場合に、前記第2分割候補区間を、当該第2分割候補区
間の中央で2つに分割させて2つの分割黒画素区間を生
成することにより、行切出しの修正を行なうプロセス
と、 前記最寄第3位置と前記最寄第4位置とを比較して、該
最寄第3位置が該最寄第4位置よりも前記一方側である
場合および該最寄第3位置と該最寄第4位置とが前記第
1方向に沿った同一直線上に位置する場合に、該最寄第
3位置と該最寄第4位置との中間を通りかつ前記第1方
向に沿った分割線で前記第2分割候補区間を分割するこ
とにより、前記一方側の第一方分割領域および前記他方
側の他方分割領域を生成し、前記一方分割領域を前記最
寄第4位置が得られた走査線によって分割して2つの分
割黒画素区間を生成し、かつ、前記他方分割領域を前記
最寄第3位置が得られた走査線によって分割して2つの
分割黒画素区間を生成することにより行切出しの修正を
行なうプロセスとを含むことを特徴とする行切出し方
法。
11. The line cutting method according to claim 1, wherein the second line cut in the process (c2).
A process of calculating an arithmetic mean of the length of a second black pixel section (hereinafter, also referred to as a second black pixel section length) of a divided row as a second average black pixel section length; The second black pixel section length is compared with the second black pixel section length, and the ratio of the second black pixel section length to the second average black pixel section length in the second black pixel section is larger than a twelfth reference value. Selecting a pixel section as a second division candidate section; and selecting a pixel section as a second division candidate section along the second direction at a position where a black pixel is detected on a scanning line that scans the vicinity of the center of the second division candidate section. A process of obtaining a position closest to the other side as a third position, a process of obtaining a third position closest to the other side along the second direction among the third positions as a closest third position, Of the second division candidate section A process of determining a position closest to the other side along the first direction as a fourth position among positions where black pixels are detected on a scanning line to be inspected, and a process along the first direction among the fourth positions. A process of determining the fourth position closest to the one side as the closest fourth position, and comparing the third closest position with the fourth closest position to determine that the third position is the closest fourth position. When the second division candidate section is located on the other side than the four positions, the second division candidate section is divided into two at the center of the second division candidate section to generate two divided black pixel sections, whereby line segmentation is performed. Comparing the closest third position and the closest fourth position with each other to determine whether the third closest position is closer to the one side than the fourth closest position and When the third position and the nearest fourth position are located on the same straight line along the first direction. Dividing the second division candidate section by a division line passing through an intermediate point between the third nearest position and the fourth nearest position and along the first direction, whereby the first one of the first sides is divided. Generating a divided region and the other divided region on the other side, dividing the one divided region by a scanning line from which the nearest fourth position is obtained, to generate two divided black pixel sections, and Correcting the line segmentation by dividing the region by the scanning line from which the closest third position is obtained to generate two divided black pixel sections.
【請求項12】 文書画像の行方向に実質的に沿った第
1方向に沿って該文書画像を走査して走査毎に累積黒画
素数を検出し、当該累積黒画素数の該第1方向と直交す
る第2方向に沿った分布を求めることにより射影分布を
作成し、 前記射影分布において第13基準値以上の累積黒画素数
の射影部分が前記第2方向に連続する各黒画素区間が得
られる走査領域をそれぞれ1つの行領域として行切出し
を行なった後に、行切出しの修正を行なうにあたり、 切り出された前記行領域の黒画素区間の長さ(以下、黒
画素区間長とも称する。)の相加平均を平均黒画素区間
長として求めるプロセスと、 前記平均値と前記黒画素区間長とを比較して、前記黒画
素区間のうち、前記平均値に対する黒画素区間長の比率
が第14基準値よりも小さな黒画素区間を候補区間とし
て選択するプロセスと、 該候補区間の一方の側の直近の黒画素区間である第1候
補黒画素区間と該候補区間とを一つの連続した黒画素区
間とした場合の当該黒画素区間を第1統合区間とし、当
該第1統合区間の長さを求めるプロセスと、 該第1統合区間の長さと前記平均値との差を第1統合区
間長誤差として算出するプロセスと、 該候補区間の他方の側の直近の黒画素区間である第2候
補黒画素区間と該候補区間とを1つの連続した黒画素区
間とした場合の当該黒画素区間を第2統合区間とし、当
該第2統合区間の長さを求めるプロセスと、 該第2統合区間の長さと前記平均黒画素区間長との差を
第2統合区間長誤差として算出するプロセスと、 前記第1統合区間長誤差と前記第2統合区間長誤差とを
比較して、誤差の小さい方の統合区間を選択統合区間と
して選択するプロセスと、 前記選択統合区間のうちの前記候補区間と当該候補区間
の直近の黒画素区間との間の白画素区間の長さを求める
プロセスと、 前記白画素区間の長さと第15基準値とを比較して、当
該白画素区間の長さが当該第15基準値よりも短い場合
に、前記選択統合区間を1つの連続した黒画素区間とす
ることにより、行切出しの修正を行なうプロセスとを含
むことを特徴とする行切出し修正方法。
12. The document image is scanned in a first direction substantially along a line direction of the document image, and a cumulative number of black pixels is detected for each scan. A projection distribution is created by calculating a distribution along a second direction orthogonal to the following. In the projection distribution, each black pixel section in which a projection portion having a cumulative number of black pixels equal to or greater than a thirteenth reference value is continuous in the second direction is After performing line segmentation with each of the obtained scanning regions as one line region, when performing line segmentation correction, the length of the black pixel section of the segmented line area (hereinafter also referred to as black pixel section length). Calculating the arithmetic mean of the average black pixel section length as the average black pixel section length; and comparing the average value with the black pixel section length to determine that the ratio of the black pixel section length to the average value in the black pixel section is 14th. Black pixel area smaller than the reference value And selecting the interval as a candidate section, and selecting the first candidate black pixel section, which is the nearest black pixel section on one side of the candidate section, and the black when the candidate section is regarded as one continuous black pixel section. Setting a pixel section as a first integrated section and calculating a length of the first integrated section; calculating a difference between the length of the first integrated section and the average value as a first integrated section length error; When the second candidate black pixel section, which is the nearest black pixel section on the other side of the candidate section, and the candidate section are defined as one continuous black pixel section, the black pixel section is referred to as a second integrated section. A process of calculating the length of the second integrated section; a process of calculating a difference between the length of the second integrated section and the average black pixel section length as a second integrated section length error; By comparing the error with the second integrated section length error, A process of selecting a smaller integrated section as a selected integrated section; and a process of determining a length of a white pixel section between the candidate section and the nearest black pixel section of the candidate section in the selected integrated section; The length of the white pixel section is compared with a fifteenth reference value. If the length of the white pixel section is shorter than the fifteenth reference value, the selected integrated section is regarded as one continuous black pixel section. And a process for correcting the line segmentation.
【請求項13】 文書画像の行方向に実質的に沿った第
1方向を主走査方向とし、該第1方向と直交する第2方
向を副走査方向として、該文書画像を走査して走査線毎
に累積黒画素数を検出することにより射影分布を作成
し、 前記射影分布において第16基準値以上の累積黒画素数
の射影部分が前記第2方向に連続する各黒画素区間が得
られる走査領域をそれぞれ1つの行領域として行切出し
を行なった後に、行切出しの修正を行なうにあたり、 切り出された前記行領域の黒画素区間の長さ(以下、黒
画素区間長とも称する。)の平均値を求めるプロセス
と、 前記平均値と前記黒画素区間長とを比較して、前記黒画
素区間のうち、前記平均値に対する黒画素区間長の比率
が第17基準値よりも大きな黒画素区間を分割候補区間
として選択するプロセスと、 前記走査線のうち前記分割候補区間の中央付近を走査す
る走査線上で黒画素の検出される位置のうち、前記第1
方向に沿って最も一方寄りの位置を第1位置として求め
るプロセスと、 前記第1位置のうち、前記第1方向に沿って最も他方寄
りの第1位置を最寄第1位置として求めるプロセスと、 前記走査線のうち前記分割候補区間の中央付近を走査す
る走査線上で黒画素の検出される位置のうち、前記第2
方向に沿って最も前記他方寄りの位置を第2位置として
求めるプロセスと、 前記第2位置のうち、前記第2方向に沿って最も前記一
方寄りの第2位置を最寄第2位置として求めるプロセス
と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記他方側である
場合および該最寄第1位置と該最寄第2位置とが前記第
2方向に沿った同一直線上に位置する場合に、前記分割
候補区間を、当該分割候補区間の中央で2つに分割させ
て2つの分割黒画素区間を生成することにより、行切出
しの修正を行なうプロセスと、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記一方側である
場合に、該最寄第1位置と該最寄第2位置との中間を通
りかつ前記第2方向に沿った分割線で前記第1分割候補
区間を分割することにより、前記一方側の一方分割領域
および前記他方側の他方分割領域を生成し、前記一方分
割領域を前記最寄第2位置が得られた走査線によって分
割して2つの分割黒画素区間を生成し、かつ、前記他方
分割領域を前記最寄第1位置が得られた走査線によって
分割して2つの分割黒画素区間を生成することにより行
切出しの修正を行なうプロセスとを含むことを特徴とす
る行切出し修正方法。
13. A scanning line for scanning the document image by setting a first direction substantially along a line direction of the document image as a main scanning direction and a second direction orthogonal to the first direction as a sub-scanning direction. A projection distribution is created by detecting the cumulative number of black pixels for each scan, and a black pixel section in which the projected portion of the cumulative black number of pixels equal to or larger than a 16th reference value is continuous in the second direction in the projection distribution is obtained. After performing line segmentation with each region as one line region, when performing line segmentation correction, the average value of the lengths of black pixel sections (hereinafter, also referred to as black pixel section lengths) of the segmented line areas. And comparing the average value with the black pixel section length to divide the black pixel section of the black pixel section in which the ratio of the black pixel section length to the average value is greater than a seventeenth reference value. Select as a candidate section And a process in which a black pixel is detected on a scan line that scans the vicinity of the center of the division candidate section in the scan line.
A process of determining a position closest to one side along a direction as a first position; a process of obtaining a first position closest to the other side along the first direction among the first positions as a first position; Among positions where black pixels are detected on a scanning line that scans the vicinity of the center of the division candidate section in the scanning line, the second
A process of obtaining the position closest to the other side along the direction as a second position, and a process of obtaining the second position closest to the side along the second direction among the second positions as the closest second position Comparing the nearest first position with the nearest second position, and determining whether the nearest first position is on the other side of the nearest second position, and When the nearest second position is located on the same straight line along the second direction, the division candidate section is divided into two at the center of the division candidate section to form two divided black pixel sections. Generating a line segmentation correction process, comparing the nearest first position with the nearest second position, and comparing the nearest first position with the nearest second position, Side, passes through the middle between the nearest first position and the nearest second position, and By dividing the first division candidate section by a division line along the direction, the one divided region on the one side and the other divided region on the other side are generated, and the one second divided region is defined by the nearest second position. Two divided black pixel sections are generated by dividing by the obtained scanning line, and two divided black pixel sections are generated by dividing the other divided area by the scanning line from which the nearest first position is obtained. And performing a process of correcting the line cutout.
【請求項14】 文書画像の行方向が不明である場合お
よび前記文書画像の行方向が第1方向である場合に、該
第1方向と直交する第2方向に沿った分割線によって前
記文書画像を分割することにより、該第1方向に沿って
並んだ複数の第1方向分割領域を生成する第1方向分割
領域生成部と、 前記第1方向分割領域が生成された場合に、当該第1方
向分割領域の各々を、前記第1方向に沿って走査して、
走査毎の累積黒画素数を検出し、当該累積黒画素数の前
記第2方向に沿った分布を求めることにより第1方向射
影分布を作成する第1方向射影分布作成部と、 前記第1方向射影分布が作成された場合に、当該第1方
向射影分布の各々において第1基準値以上の累積黒画素
数が前記第2方向に沿って連続する区間をそれぞれ第1
黒画素区間として、当該第1黒画素区間が得られる走査
領域をそれぞれ第1分割行として分割行切出しを行なう
第1分割行切出し部と、 文書画像の行方向が不明である場合および該文書画像の
行方向が第2方向である場合に、第1方向に沿った分割
線によって文書画像を分割することにより、該第1方向
と直交する第2方向に沿って並んだ複数の第2方向分割
領域を生成する第2方向分割領域生成部と、 前記第2方向分割領域が生成された場合に 当該第2方
向分割領域の各々を、前記第2方向に沿って走査して、
走査毎の累積黒画素数を検出し、当該累積黒画素数の前
記第1方向に沿った分布を求めることにより第2方向射
影分布を作成する第2方向射影分布作成部と、 前記第2方向射影分布が作成された場合に、当該第2方
向射影分布の各々において第2基準値以上の累積黒画素
数が前記第1方向に沿って連続する区間をそれぞれ第2
黒画素区間として、当該第2黒画素区間が得られる走査
領域をそれぞれ第2分割行として分割行切出しを行なう
第2分割行切出し部と、 前記文書画像の行方向が不明である場合に、前記第1方
向射影分布と前記第2方向射影分布とに基づいて、前記
文書画像の行方向を判定する行方向判定部と、 前記文書画像の行方向が前記第1方向である場合に、前
記第1方向で互いに隣接する前記第1方向分割領域にそ
れぞれ含まれる前記分割行どうしであって、当該分割行
を走査して得られた前記第1黒画素区間の少なくとも一
部分どうしが重なっている分割行どうしを接続して行切
出しを行なう第1分割行接続部と、 前記文書画像の行方向が前記第2方向である場合に、前
記第2方向で互いに隣接する前記第2方向分割領域にそ
れぞれ含まれる前記分割行どうしであって、当該分割行
を走査して得られた前記第2黒画素区間の少なくとも一
部分どうしが重なっている分割行どうしを接続して行切
出しを行なう第2分割行接続部とを具えてなることを特
徴とする行切出し装置。
14. When the line direction of the document image is unknown and when the line direction of the document image is the first direction, the document image is divided by a dividing line along a second direction orthogonal to the first direction. A first direction divided region generating unit that generates a plurality of first direction divided regions arranged along the first direction by dividing the first direction divided region. Scanning each of the direction divided areas along the first direction,
A first direction projection distribution creation unit for creating a first direction projection distribution by detecting a cumulative number of black pixels for each scan and obtaining a distribution of the cumulative number of black pixels along the second direction; When the projection distribution is created, in each of the first direction projection distributions, a section in which the cumulative number of black pixels equal to or greater than the first reference value is continuous along the second direction is defined as a first section.
As a black pixel section, a first divided line cutout unit that performs a divided line cutout using a scanning area in which the first black pixel section is obtained as a first divided line, and a case where the line direction of the document image is unknown and the document image When the row direction is a second direction, by dividing the document image by a dividing line along the first direction, a plurality of second direction divisions arranged along a second direction orthogonal to the first direction A second direction divided area generating unit that generates an area; and, when the second direction divided area is generated, scanning each of the second direction divided areas along the second direction.
A second direction projection distribution creating unit that detects a cumulative number of black pixels for each scan and obtains a distribution of the cumulative number of black pixels along the first direction to create a second direction projection distribution; When the projection distribution is created, in each of the second direction projection distributions, a section in which the cumulative number of black pixels equal to or more than the second reference value is continuous along the first direction is defined as a second section.
As a black pixel section, a second divided line cutout unit that performs a divided line cutout using a scanning area in which the second black pixel section is obtained as a second divided line, and, when the line direction of the document image is unknown, A line direction determining unit configured to determine a line direction of the document image based on a first direction projection distribution and the second direction projection distribution, wherein the line direction of the document image is the first direction; The divided rows included in the first direction divided areas adjacent to each other in one direction, wherein the divided rows at least partially overlap the first black pixel section obtained by scanning the divided rows. A first divided line connecting unit that connects lines to each other to separate lines, and includes, when the line direction of the document image is the second direction, the second direction divided regions adjacent to each other in the second direction. Said A second divided row connection unit that connects divided rows in which at least a part of the second black pixel section obtained by scanning the divided row overlaps with each other, and cuts out the rows. A line cutting device characterized by being provided.
【請求項15】 請求項14に記載の行切出し装置にお
いて、前記行方向判定部は、 前記第1黒画素区間の各々の長さをそれぞれ第1黒画素
区間長として、当該第1黒画素区間長のばらつきを算出
する第1ばらつき算出部と、 前記第2黒画素区間の各々の長さをそれぞれ第2黒画素
区間長として、当該第2黒画素区間長のばらつきを算出
する第2ばらつき算出部と、 前記第1黒画素区間長のばらつきと前記第2黒画素区間
長のばらつきとを比較して、当該第1黒画素区間長のば
らつきと当該第2黒画素区間長のばらつきとの比率が第
3基準値以上の場合に、ばらつきの小さい方の黒画素区
間長が得られた射影分布の走査方向を行方向と判定する
ばらつき比較判定部とを具えてなることを特徴とする行
切出し装置。
15. The line segmenting device according to claim 14, wherein the row direction determination unit sets each length of the first black pixel section as a first black pixel section length, the first black pixel section. A first variation calculation unit that calculates a variation in length; and a second variation calculation that calculates a variation in the length of the second black pixel section by setting each length of the second black pixel section as a second black pixel section length. And comparing the variation of the first black pixel section length with the variation of the second black pixel section length to determine a ratio between the variation of the first black pixel section length and the variation of the second black pixel section length. And a variation comparison / determination unit that determines the scanning direction of the projection distribution from which the black pixel section length with smaller variation is obtained as the row direction when is equal to or greater than the third reference value. apparatus.
【請求項16】 請求項15に記載の行切出し装置にお
いて、前記行方向判定部は、 前記第1黒画素区間長のばらつきと前記第2黒画素区間
長のばらつきとの比率が前記第3基準値未満の場合に、 前記第1方向射影分布において隣り合った前記第1黒画
素区間どうしの間の第1白画素区間の長さと、前記第2
方向射影分布において隣り合った前記第2黒画素区間ど
うしの間の第2白画素区間の長さとを利用して、行方向
を判定することを特徴とする行切出し装置。
16. The line segmentation device according to claim 15, wherein the row direction determination unit determines that a ratio of the variation of the first black pixel section length to the variation of the second black pixel section length is the third reference. If the value is less than the value, the length of the first white pixel section between the first black pixel sections adjacent to each other in the first direction projection distribution;
A row segmentation apparatus, wherein a row direction is determined using a length of a second white pixel section between adjacent second black pixel sections in a directional projection distribution.
【請求項17】 請求項14に記載の行切し出装置にお
いて、前記行方向判定部は、 前記第1方向射影分布において隣り合った前記第1黒画
素区間どうしの間の第1白画素区間の長さと、前記第2
方向射影分布において隣り合った前記第2黒画素区間ど
うしの間の第2白画素区間の長さとを利用して、行方向
を判定することを特徴とする行切出し装置。
17. The line segmenting device according to claim 14, wherein the line direction determination unit is configured to determine a first white pixel section between the first black pixel sections adjacent to each other in the first direction projection distribution. The length of the second
A row segmentation apparatus, wherein a row direction is determined using a length of a second white pixel section between adjacent second black pixel sections in a directional projection distribution.
【請求項18】 請求項16または17に記載の行切出
し装置において、前記行方向判定部は、 前記第1白画素区間が1箇所の場合には、当該第1白画
素区間の長さを第1平均白画素区間長とし、かつ、前記
第1白画素区間が複数箇所の場合には、当該第1白画素
区間の各々の長さの相加平均を第1平均白画素区間長と
して算出する第1平均白画素区間長算出部と、 前記第2白画素区間が1箇所の場合には、当該第2白画
素区間の長さを第2平均白画素区間長とし、かつ、前記
第2白画素区間が複数箇所の場合には、当該第2白画素
区間の各々の長さの相加平均を第2平均白画素区間長と
して算出する第2平均白画素区間長算出部と、 前記第1平均白画素区間長と前記第2平均白画素区間長
とを比較して、より大きな平均値の白画素区間の得られ
た射影分布の走査方向を行方向と判定する平均値比較判
定部とを具えてなることを特徴とする行切出し装置。
18. The line segmentation device according to claim 16, wherein the row direction determination unit determines the length of the first white pixel section when the number of the first white pixel section is one. If one average white pixel section length is used and the first white pixel section is plural, an arithmetic average of the respective lengths of the first white pixel section is calculated as the first average white pixel section length. A first average white pixel section length calculation unit, wherein, when the number of the second white pixel sections is one, the length of the second white pixel section is set to a second average white pixel section length; When there are a plurality of pixel sections, a second average white pixel section length calculation unit that calculates an arithmetic mean of the lengths of the second white pixel sections as a second average white pixel section length; The average white pixel section length is compared with the second average white pixel section length to obtain a white pixel section having a larger average value. An average value comparing and judging unit for judging the scanning direction of the projection distribution obtained as the row direction.
【請求項19】 請求項14に記載の行切出し装置にお
いて、前記行方向判定部は、 前記第1方向分割領域の数の合計を第1分割領域数とし
て求める第1分割領域数計数部と、 前記第1黒画素区間の数の、全ての前記第1方向分割領
域にわたっての合計を第1黒画素区間数として求める第
1黒画素区間数計数部と、 前記第2方向分割領域の数の合計を第2分割領域数とし
て求める第2分割領域数計数部と、 前記第2黒画素区間の数の、全ての前記第2方向分割領
域にわたっての合計を第2黒画素区間数として求める第
2黒画素区間数計数部と、 前記第1黒画素区間数と該第1分割領域数とが一致し、
かつ、前記第2黒画素区間数と前記第2分割領域数とが
不一致の場合に、前記行方向を前記第1方向と判定し、
または、前記第2黒画素区間数と該第2分割領域数とが
一致し、かつ、前記第1黒画素区間数と前記第1分割領
域数とが不一致の場合に、前記行方向を前記第2方向と
判定する区間数分割数比較判定部と、を具えてなること
を特徴とする行切出し装置。
19. The line segmentation device according to claim 14, wherein the line direction determining unit calculates a total number of the first direction divided regions as a first divided region number, and a first divided region number counting unit. A first black pixel section number counting unit that calculates a total number of the first black pixel sections over all the first direction divided areas as a first black pixel section number; and a total number of the second direction divided areas. As the number of second divided areas, and a second black section that calculates the sum of the number of the second black pixel sections over all of the second direction divided areas as the number of second black pixel sections. A pixel section number counting unit, wherein the first black pixel section number and the first divided area number match,
And when the number of the second black pixel sections does not match the number of the second divided regions, the row direction is determined to be the first direction,
Alternatively, when the number of the second black pixel sections and the number of the second divided areas match and the number of the first black pixel sections does not match the number of the first divided areas, the row direction is changed to the second direction. A line segmentation device comprising: a section number division number comparison determination unit that determines two directions.
【請求項20】 請求項14に記載の行切出し装置にお
いて、 前記第1分割行接続部は、前記分割領域に含まれる前記
第1方向分割行の前記第1黒画素区間の一部分が、当該
分割領域と隣接する他の1つの分割領域に含まれる2つ
の第1分割行の前記第1黒画素区間の一部分とそれぞれ
重なっている場合に、重なっている区間の長さが第4基
準値よりも長い分割行どうしを接続し、 前記第2分割行接続部は、前記分割領域に含まれる前記
第2方向分割行の前記第2黒画素区間の一部分が、当該
分割領域と隣接する他の1つの分割領域に含まれる2つ
の第2分割行の前記第2黒画素区間の一部分とそれぞれ
重なっている場合に、重なっている区間の長さが第5基
準値よりも長い分割行どうしを接続することを特徴とす
る行切出し装置。
20. The line segmenting device according to claim 14, wherein the first divided row connecting unit is configured to determine that a part of the first black pixel section of the first direction divided row included in the divided area is divided by the divided area. When each of the first black pixel sections of two first divided rows included in another divided area adjacent to the area overlaps with a part of the first black pixel section, the length of the overlapping section is larger than the fourth reference value. Connecting the long divided rows with each other, wherein the second divided row connecting unit is configured such that a part of the second black pixel section of the second direction divided row included in the divided area is another one adjacent to the divided area. When overlapping with a part of the second black pixel section of the two second divided rows included in the divided area, connecting the divided rows whose overlapping section is longer than the fifth reference value. A line cutting device characterized by the above-mentioned.
【請求項21】 請求項14に記載の行切出し装置にお
いて、行切出しの修正を行なう第1統合修正部を具え、 該第1統合修正部は、 前記第1分割行切出し部において切り出された前記第1
分割行の第1黒画素区間の長さ(以下、第1黒画素区間
長とも称する。)の相加平均を第1平均黒画素区間長と
して求める第1平均黒画素区間長算出部と、 該第1平均黒画素区間長と前記第1黒画素区間長とを比
較して、前記第1黒画素区間のうち、前記第1平均黒画
素区間長に対する第1黒画素区間長の比率が第6基準値
よりも小さな第1黒画素区間を第1候補区間として選択
する第1候補区間選択部と、 該第1候補区間の一方の側の直近の第1黒画素区間であ
る第1候補黒画素区間と該第1候補区間とを一つの連続
した黒画素区間とした場合の当該黒画素区間を第1統合
区間とし、当該第1統合区間の長さを求める第1統合区
間長検出部と、 該第1統合区間の長さと前記第1平均黒画素区間長との
差の大きさを第1統合区間長誤差として算出する第1統
合区間長誤差算出部と、 該第1候補区間の他方の側の直近の第1黒画素区間であ
る第2候補黒画素区間と該第1候補区間とを1つの連続
した黒画素区間とした場合の当該黒画素区間を第2統合
区間とし、当該第2統合区間の長さを求める第2統合区
間長検出部と、 該第2統合区間の長さと前記第1平均黒画素区間長との
差の大きさを第2統合区間長誤差として算出する第2統
合区間長誤差算出部と、 前記第1統合区間長誤差と前記第2統合区間長誤差とを
比較して、誤差の小さい方の統合区間を第1選択統合区
間として選択する第1選択統合区間選択部と、 該第1選択統合区間のうちの、前記第1候補区間と当該
第1候補区間の直近の第1黒画素区間との間の第1白画
素区間の長さを求める第1白画素区間長検出部と、 該第1白画素区間の長さと第7基準値とを比較して、当
該第1白画素区間の長さが当該第7基準値よりも短い場
合に、前記第1選択統合区間を1つの連続した第1黒画
素区間とすることにより、行切出しの修正を行なう第1
統合部とを具えてなることを特徴とする行切出し装置。
21. The line segmenting apparatus according to claim 14, further comprising a first integrated correcting unit for correcting line segmenting, wherein the first integrated modifying unit is segmented by the first divided line segmenting unit. First
A first average black pixel section length calculation unit that determines an arithmetic mean of the length of the first black pixel section (hereinafter, also referred to as a first black pixel section length) of the divided row as the first average black pixel section length; Comparing the first average black pixel section length with the first black pixel section length, the ratio of the first black pixel section length to the first average black pixel section length in the first black pixel section is the sixth. A first candidate section selection unit that selects a first black pixel section smaller than the reference value as a first candidate section; and a first candidate black pixel that is a first black pixel section closest to one side of the first candidate section. When the section and the first candidate section are set as one continuous black pixel section, the black pixel section is defined as a first integrated section, and a first integrated section length detecting unit that determines the length of the first integrated section; The magnitude of the difference between the length of the first integrated section and the first average black pixel section length is defined as a first integrated section length error. A first integrated section length error calculating unit to calculate, a second candidate black pixel section that is the nearest first black pixel section on the other side of the first candidate section, and the first candidate section as one continuous black A second integrated section length detecting unit for determining the length of the second integrated section, wherein the black pixel section in the case of the pixel section is a second integrated section; and the length of the second integrated section and the first average black pixel A second integrated section length error calculating unit that calculates the magnitude of the difference from the section length as a second integrated section length error, and comparing the first integrated section length error and the second integrated section length error, A first integrated section selection unit that selects an integrated section having a smaller one as a first selected integrated section; and a first candidate section of the first selected integrated section and a first first integrated section closest to the first candidate section. A first white pixel section length detection unit for determining the length of the first white pixel section between the black pixel section and The length of the first white pixel section is compared with a seventh reference value, and when the length of the first white pixel section is shorter than the seventh reference value, the first selected integrated section is connected to one continuous The first black pixel section is used to correct the line segmentation.
A line segmentation device comprising an integration unit.
【請求項22】 請求項14に記載の行切出し装置にお
いて、行切出しの修正を行なう第2統合修正部を具え、 該第2統合修正部は、 前記第2分割行切出し部において切り出された前記第2
分割行の第2黒画素区間の長さ(以下、第2黒画素区間
長とも称する。)の相加平均を第2平均黒画素区間長と
して求める第2黒画素区間長平均値算出部と、 前記第2平均黒画素区間長と前記第2黒画素区間長とを
比較して、前記第2黒画素区間のうち、前記第2平均黒
画素区間長に対する第2黒画素区間長の比率が第8基準
値よりも小さな第2黒画素区間を第2候補区間として選
択する第2候補区間選択部と、 該第2候補区間の一方の側の直近の第2黒画素区間であ
る第3候補黒画素区間と該第2候補区間とを一つの連続
した黒画素区間とした場合の当該黒画素区間を第3統合
区間とし、当該第3統合区間の長さを求める第3統合区
間長抽出部と、 該第3統合区間の長さと前記第2平均黒画素区間長との
差の大きさを第3統合区間長誤差として算出する第3統
合区間長誤差算出部と、 該第2候補区間の他方の側の直近の第2黒画素区間であ
る第4候補黒画素区間と該第2候補区間とを1つの連続
した黒画素区間とした場合の当該黒画素区間を第4統合
区間とし、当該第4統合区間の長さを求める第4統合区
間長抽出部と、 該第4統合区間の長さと前記第2平均黒画素区間長との
差の大きさを第4統合区間長誤差として算出する第4統
合区間長誤差算出部と、 前記第3統合区間長誤差と前記第4統合区間長誤差とを
比較して、誤差の小さい方の統合区間を第2選択統合区
間として選択する第2選択統合区間選択部と、 該第2選択統合区間のうちの、前記第2候補区間と当該
第2候補区間の直近の第2黒画素区間との間の第2白画
素区間の長さを求める第2白画素区間長抽出部と、 該第2白画素区間の長さと第9基準値とを比較して、当
該第2白画素区間の長さが当該第10基準値よりも短い
場合に、前記第2選択統合区間を1つの連続した第2黒
画素区間とすることにより、行切出しの修正を行なう第
2統合部とを具えてなることを特徴とする行切出し装
置。
22. The line segmenting apparatus according to claim 14, further comprising a second integrated correcting unit that corrects line segmenting, wherein the second integrated modifying unit is segmented by the second divided line segmenting unit. Second
A second black pixel section length average value calculation unit that obtains an arithmetic mean of the length of the second black pixel section of the divided row (hereinafter, also referred to as a second black pixel section length) as a second average black pixel section length; Comparing the second average black pixel section length with the second black pixel section length, the ratio of the second black pixel section length to the second average black pixel section length in the second black pixel section is equal to the second average black pixel section length. A second candidate section selection unit that selects a second black pixel section smaller than 8 reference values as a second candidate section, and a third candidate black that is a second black pixel section closest to one side of the second candidate section. When the pixel section and the second candidate section are set as one continuous black pixel section, the black pixel section is defined as a third integrated section, and a third integrated section length extracting unit for calculating the length of the third integrated section is provided. The magnitude of the difference between the length of the third integrated section and the length of the second average black pixel section is determined by a third integrated section length error. A third integrated section length error calculating unit that calculates the fourth candidate black pixel section that is the nearest second black pixel section on the other side of the second candidate section and the second candidate section The black pixel section when the black pixel section is obtained as a fourth integrated section, a fourth integrated section length extracting unit for calculating the length of the fourth integrated section, the length of the fourth integrated section and the second average A fourth integrated section length error calculating unit that calculates the magnitude of the difference from the black pixel section length as a fourth integrated section length error, and comparing the third integrated section length error with the fourth integrated section length error A second selected integrated section selecting unit that selects the integrated section having a smaller error as the second selected integrated section; and, among the second selected integrated sections, the second candidate section and the nearest second candidate section. A second white pixel section length extraction unit for determining the length of the second white pixel section between the second black pixel section and The length of the second white pixel section is compared with a ninth reference value, and if the length of the second white pixel section is shorter than the tenth reference value, the second selected integrated section is defined as one continuous A second integration section that corrects line segmentation by setting the second black pixel section as the segment.
【請求項23】 請求項14に記載の行切出し装置にお
いて、行切出しの修正を行なう第1分割修正部を具え、 該第1分割修正部は、 前記第1分割行切出し部において切り出された前記第1
分割行の第1黒画素区間の長さ(以下、第1黒画素区間
長とも称する。)の相加平均を第1平均黒画素区間長と
して求める第1平均黒画素区間長算出部と、 前記第1平均黒画素区間長と前記第1黒画素区間長とを
比較して、前記第1黒画素区間のうち、前記第1平均黒
画素区間長に対する第1黒画素区間長の比率が第11基
準値よりも大きな第1黒画素区間を第1分割候補区間と
して選択する第1分割候補区間選択部と、 前記走査線のうち前記第1分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第1方向に沿って最も一方寄りの位置を第1位置として
求める第1位置抽出部と、 前記第1位置のうち、前記第1方向に沿って最も他方寄
りの第1位置を最寄第1位置として求める最寄り第1位
置抽出部と、 前記走査線のうち前記第1分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第2方向に沿って最も前記他方寄りの位置を第2位置と
して求める第2位置抽出部と、 前記第2位置のうち、前記第2方向に沿って最も前記一
方寄りの第2位置を最寄第2位置として求める最寄第2
位置抽出部と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記他方側である
場合および該最寄第1位置と該最寄第2位置とが前記第
2方向に沿った同一直線上に位置する場合に、前記第1
分割候補区間を、当該第1分割候補区間の中央で2つに
分割させて2つの分割黒画素区間を生成することによ
り、行切出しの修正を行なう第1分割部と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記一方側である
場合に、該最寄第1位置と該最寄第2位置との中間を通
りかつ前記第2方向に沿った分割線で前記第1分割候補
区間を分割することにより、前記一方側の第一方分割領
域および前記他方側の他方分割領域を生成し、前記一方
分割領域を前記最寄第2位置が得られた走査線によって
分割して2つの分割黒画素区間を生成し、かつ、前記他
方分割領域を前記最寄第1位置が得られた走査線によっ
て分割して2つの分割黒画素区間を生成することにより
行切出しの修正を行なう第2分割部とを具えてなること
を特徴とする行切出し装置。
23. The line segmentation device according to claim 14, further comprising a first division modification unit for modifying line segmentation, wherein the first division modification unit is configured to cut out the first segmented line segmentation unit. First
A first average black pixel section length calculation unit that determines an arithmetic mean of the length of the first black pixel section of the divided row (hereinafter, also referred to as a first black pixel section length) as the first average black pixel section length; Comparing the first average black pixel section length with the first black pixel section length, the ratio of the first black pixel section length to the first average black pixel section length in the first black pixel section is eleventh. A first division candidate section selection unit that selects a first black pixel section larger than a reference value as a first division candidate section; and a black pixel on a scan line that scans the center of the first division candidate section among the scan lines. Among the detected positions, a first position extracting unit that determines a position closest to the one side along the first direction as a first position, and a position closest to the other side along the first direction among the first positions. A nearest first position extracting unit that determines the first position of the first position as the nearest first position; Among the positions where black pixels are detected on a scanning line that scans the vicinity of the center of the first division candidate section among the scanning lines, a position closest to the other side along the second direction is determined as a second position. A two-position extracting unit; and, of the second positions, a nearest second position that determines the closest second position along the second direction as a nearest second position.
A position extracting unit, comparing the nearest first position and the nearest second position, and when the nearest first position is on the other side of the nearest second position, and When the first position and the nearest second position are located on the same straight line along the second direction, the first position
A first division unit that corrects line segmentation by dividing the division candidate section into two in the center of the first division candidate section to generate two divided black pixel sections; And comparing the nearest second position with the nearest second position. If the nearest first position is closer to the one side than the nearest second position, the nearest first position and the nearest second position are compared with each other. By dividing the first division candidate section by a division line passing through the middle of the first direction and along the second direction, thereby generating the first first division area on one side and the other division area on the other side, The divided region is divided by the scanning line from which the nearest second position is obtained to generate two divided black pixel sections, and the other divided region is divided by the scanning line from which the nearest first position is obtained. To correct the line segmentation by generating two divided black pixel sections A line cutting device comprising a split part.
【請求項24】 請求項14に記載の行切出し装置にお
いて、行切出しの修正を行なう第2分割修正部を具え、 該第2分割修正部は、 前記第2分割行切出し部において切り出された前記第2
分割行の第2黒画素区間の長さ(以下、第2黒画素区間
長とも称する。)の相加平均を第2平均黒画素区間長と
して求める第2平均黒画素区間長算出部と、 前記第2平均黒画素区間長と前記第2黒画素区間長とを
比較して、前記第2黒画素区間のうち、前記第2平均黒
画素区間長に対する第2黒画素区間長の比率が第12基
準値よりも大きな第2黒画素区間を第2分割候補区間と
して選択する第2分割候補区間選択部と、 前記走査線のうち前記第2分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第2方向に沿って最も一方寄りの位置を第3位置として
求める第3位置抽出部と、 前記第3位置のうち、前記第2方向に沿って最も他方寄
りの第3位置を最寄第3位置として求める最寄第3位置
抽出部と、 前記走査線のうち前記第2分割候補区間の中央付近を走
査する走査線上で黒画素の検出される位置のうち、前記
第1方向に沿って最も前記他方寄りの位置を第4位置と
して求める第4位置抽出部と、 前記第4位置のうち、前記第1方向に沿って最も前記一
方寄りの第4位置を最寄第4位置として求める最寄第4
位置抽出部と、 前記最寄第3位置と前記最寄第4位置とを比較して、該
最寄第3位置が該最寄第4位置よりも前記他方側である
場合に、前記第2分割候補区間を、当該第2分割候補区
間の中央で2つに分割させて2つの分割黒画素区間を生
成することにより、行切出しの修正を行なう第3分割部
と、 前記最寄第3位置と前記最寄第4位置とを比較して、該
最寄第3位置が該最寄第4位置よりも前記一方側である
場合および該最寄第3位置と該最寄第4位置とが前記第
1方向に沿った同一直線上に位置する場合に、該最寄第
3位置と該最寄第4位置との中間を通りかつ前記第1方
向に沿った分割線で前記第2分割候補区間を分割するこ
とにより、前記一方側の第一方分割領域および前記他方
側の他方分割領域を生成し、前記一方分割領域を前記最
寄第4位置が得られた走査線によって分割して2つの分
割黒画素区間を生成し、かつ、前記他方分割領域を前記
最寄第3位置が得られた走査線によって分割して2つの
分割黒画素区間を生成することにより行切出しの修正を
行なう第4分割部とを具えてなることを特徴とする行切
出し装置。
24. The line segmentation apparatus according to claim 14, further comprising a second division modification unit that modifies the line division, wherein the second division modification unit is configured to extract the line segmented by the second divided line segmentation unit. Second
A second average black pixel section length calculation unit that calculates an arithmetic average of the length of the second black pixel section of the divided row (hereinafter, also referred to as a second black pixel section length) as the second average black pixel section length; Comparing the second average black pixel section length with the second black pixel section length, the ratio of the second black pixel section length to the second average black pixel section length in the second black pixel section is 12th. A second division candidate section selection unit that selects a second black pixel section larger than a reference value as a second division candidate section; and a black pixel on a scan line that scans near the center of the second division candidate section among the scan lines. Among the detected positions, a third position extracting unit that determines a position closest to the one side along the second direction as the third position, and a position closest to the other side along the second direction among the third positions. A third closest position extracting unit that determines the third position of the second position as the third closest position; Of the positions where black pixels are detected on a scanning line that scans the vicinity of the center of the second division candidate section among the scanning lines, the position closest to the other side along the first direction is determined as a fourth position. A four-position extracting unit, and, among the fourth positions, a fourth fourth position that is closest to the one side along the first direction and is determined as a fourth closest position.
A position extracting unit that compares the third closest position with the fourth closest position and, if the third closest position is closer to the other side than the fourth closest position, A third division unit that corrects line segmentation by dividing the division candidate section into two at the center of the second division candidate section to generate two divided black pixel sections; And the nearest fourth position, and when the nearest third position is on the one side of the nearest fourth position, and when the nearest third position and the nearest fourth position are different from each other. When located on the same straight line along the first direction, the second division candidate passes through an intermediate point between the nearest third position and the nearest fourth position and is divided along the first direction. By dividing a section, the first divided region on the one side and the other divided region on the other side are generated, and the one divided region is The second divided position is divided by the scanning line at which the fourth closest position is obtained to generate two divided black pixel sections, and the other divided region is divided by the scanning line at which the third closest position is obtained to generate two divided black pixel sections. A line segmentation device comprising: a fourth segmentation unit that corrects line segmentation by generating a divided black pixel section.
【請求項25】 請求項14に記載の行切出し装置にお
いて、 外部から当該行切出し装置に入力された文書画像の情報
に当該文書画像の行方向を示す情報が付与されているか
否かを確認し、行方向が第1方向であることを示す情報
が付与されている場合には、当該文書画像の情報を前記
第1分割領域生成部へ送出し、行方向が第2方向である
ことを示す情報が付与されている場合には、当該文書画
像の情報を前記第2分割領域生成部へ送出し、または、
行方向を示す情報が非付与の場合には、当該文書画像の
情報を前記第1および第2分割領域生成部へ送出する行
方向確認切替部と、 前記行方向判定部において、行方向が第1方向であると
判定された場合には、前記第1分割行切出し部から得ら
れた情報を出力し、行方向が第2方向であると判定され
た場合には、前記第2分割行切出し部から得られた情報
を出力する切替出力部とを具えてなることを特徴とする
行切出し装置。
25. The line segmenting apparatus according to claim 14, wherein it is determined whether or not information indicating a line direction of the document image is added to information of a document image externally input to the line segmenting device. If the information indicating that the line direction is the first direction is added, the information of the document image is transmitted to the first divided area generation unit, and the information that the line direction is the second direction is indicated. When the information is added, the information of the document image is transmitted to the second divided area generation unit, or
When the information indicating the line direction is non-attached, the line direction confirmation switching unit that sends the information of the document image to the first and second divided region generation units; If the direction is determined to be one direction, the information obtained from the first divided line segmentation unit is output. If the line direction is determined to be the second direction, the second segmented line segmentation is performed. And a switching output unit for outputting information obtained from the unit.
【請求項26】 文書画像の行方向に実質的に沿った第
1方向に沿って該文書画像を走査して走査毎の累積黒画
素数を検出し、当該累積黒画素数の該第1方向と直交す
る第2方向をに沿った分布を求めることにより射影分布
を作成し、当該射影分布において第13基準値以上の累
積黒画素数の射影部分が前記第2方向に連続する各黒画
素区間が得られる走査領域をそれぞれ1つの行領域とし
て行切出しを行なって得られた行の切出しを修正する行
切出し修正装置であって、 切り出された前記行領域の黒画素区間の長さ(以下、黒
画素区間長とも称する。)の相加平均を平均黒画素区間
長として求める平均黒画素区間長算出部と、 前記平均黒画素区間長と前記黒画素区間長とを比較し
て、前記黒画素区間のうち、前記平均黒画素区間長に対
する黒画素区間長の比率が第14基準値よりも小さな黒
画素区間を候補区間として選択する候補区間選択部と、 該候補区間の一方の側の直近の黒画素区間である第1候
補黒画素区間と該候補区間とを一つの連続した黒画素区
間とした場合の当該黒画素区間を第1統合区間とし、当
該第1統合区間の長さを求める第1統合区間長抽出部
と、 該第1統合区間の長さと前記平均黒画素区間長との差の
大きさを第1統合区間長誤差として算出する第1統合区
間長誤差算出部と、 該候補区間の他方の側の直近の黒画素区間である第2候
補黒画素区間と該候補区間とを1つの連続した黒画素区
間とした場合の当該黒画素区間を第2統合区間とし、当
該第2統合区間の長さを求める第2統合区間長抽出部
と、 該第2統合区間の長さと前記平均黒画素区間長との差の
大きさを第2統合区間長誤差として算出する第2統合区
間長誤差算出部と、 前記第1統合区間長誤差と前記第2統合区間長誤差とを
比較して、誤差の小さい方の統合区間を選択統合区間と
して選択する選択統合区間選択部と、 前記選択統合区間のうちの前記候補区間と当該候補区間
の直近の黒画素区間との間の白画素区間の長さを求める
白画素区間長抽出部と、 前記白画素区間の長さと第15基準値とを比較して、当
該白画素区間の長さが当該第15基準値よりも短い場合
に、前記選択統合区間を1つの連続した黒画素区間とす
ることにより、行切出しの修正を行なう統合部とを具え
てなることを特徴とする行切出し修正装置。
26. The document image is scanned in a first direction substantially along a row direction of the document image to detect an accumulated number of black pixels for each scan, and the accumulated number of black pixels in the first direction is detected. And a distribution along a second direction orthogonal to the above is created to form a projection distribution, and in the projection distribution, a projected portion having a cumulative number of black pixels equal to or larger than a thirteenth reference value is continuous in each black pixel section in the second direction. Is a line cutout correction device that corrects the line cutout obtained by performing line cutout with each of the scan regions obtained as one line region, wherein the length of the black pixel section of the cutout line region (hereinafter, referred to as An average black pixel section length calculation unit for calculating an arithmetic mean of the black pixel section length as an average black pixel section length; and comparing the average black pixel section length with the black pixel section length to obtain the black pixel section length. Of the average black pixel section length A candidate section selection unit that selects a black pixel section whose pixel section length ratio is smaller than the fourteenth reference value as a candidate section; and a first candidate black pixel section that is the nearest black pixel section on one side of the candidate section. A first integrated section length extraction unit that determines the black pixel section as a first integrated section when the candidate section is set as one continuous black pixel section; A first integrated section length error calculation unit that calculates the magnitude of the difference between the section length and the average black pixel section length as a first integrated section length error; When a certain second candidate black pixel section and the candidate section are regarded as one continuous black pixel section, the black pixel section is defined as a second integrated section, and a second integrated section length for calculating the length of the second integrated section An extraction unit, which calculates a length of the second integrated section and the average black pixel section length A second integrated section length error calculating section that calculates the size of the second integrated section length error as a second integrated section length error, comparing the first integrated section length error and the second integrated section length error, A selection integration section selection unit that selects a section as a selection integration section; and a white pixel section that calculates the length of a white pixel section between the candidate section of the selection integration section and the nearest black pixel section of the candidate section. A length extracting unit, comparing the length of the white pixel section with a fifteenth reference value, and, when the length of the white pixel section is shorter than the fifteenth reference value, combining the selected integrated section with one continuous A line cutout correction device, comprising: an integration unit that corrects line cutouts by setting black pixel sections.
【請求項27】 文書画像の行方向に実質的に沿った第
1方向に沿って該文書画像を走査して走査毎の累積黒画
素数を検出し、当該累積黒画素数の該第1方向と直交す
る第2方向に沿った分布を求めることにより射影分布を
作成し、当該射影分布において第16基準値以上の累積
黒画素数の射影部分が前記第2方向に連続する各黒画素
区間が得られる走査領域をそれぞれ1つの行領域として
行切出しを行なって得られた行の切出しを修正する行切
出し修正装置であって、 切り出された前記行領域の黒画素区間の長さ(以下、黒
画素区間長とも称する。)の平均黒画素区間長を求める
平均黒画素区間長算出部と、 前記平均黒画素区間長と前記黒画素区間長とを比較し
て、前記黒画素区間のうち、前記平均黒画素区間長に対
する黒画素区間長の比率が第17基準値よりも大きな黒
画素区間を分割候補区間として選択する分割候補区間選
択部と、 前記走査線のうち前記分割候補区間の中央付近を走査す
る走査線上で黒画素の検出される位置のうち、前記第1
方向に沿って最も一方寄りの位置を第1位置として求め
る第1位置抽出部と、 前記第1位置のうち、前記第1方向に沿って最も他方寄
りの第1位置を最寄第1位置として求める最寄第1位置
抽出部と、 前記走査線のうち前記分割候補区間の中央付近を走査す
る走査線上で黒画素の検出される位置のうち、前記第2
方向に沿って最も前記他方寄りの位置を第2位置として
求める第2位置抽出部と、 前記第2位置のうち、前記第2方向に沿って最も前記一
方寄りの第2位置を最寄第2位置として求める最寄第2
位置抽出部と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記他方側である
場合および該最寄第1位置と該最寄第2位置とが前記第
2方向に沿った同一直線上に位置する場合に、前記分割
候補区間を、当該分割候補区間の中央で2つに分割させ
て2つの分割黒画素区間を生成することにより、行切出
しの修正を行なう第1分割部と、 前記最寄第1位置と前記最寄第2位置とを比較して、該
最寄第1位置が該最寄第2位置よりも前記一方側である
場合に、該最寄第1位置と該最寄第2位置との中間を通
りかつ前記第2方向に沿った分割線で前記第1分割候補
区間を分割することにより、前記一方側の一方分割領域
および前記他方側の他方分割領域を生成し、前記一方分
割領域を前記最寄第2位置が得られた走査線によって分
割して2つの分割黒画素区間を生成し、かつ、前記他方
分割領域を前記最寄第1位置が得られた走査線によって
分割して2つの分割黒画素区間を生成することにより行
切出しの修正を行なう第2分割部とを具えてなることを
特徴とする行切出し修正装置。
27. Scanning the document image along a first direction substantially along a line direction of the document image, detecting a cumulative number of black pixels for each scan, and detecting the cumulative number of black pixels in the first direction. A projection distribution is created by calculating a distribution along a second direction orthogonal to the above, and in the projection distribution, a black pixel section in which a projection portion having a cumulative number of black pixels equal to or greater than a 16th reference value is continuous in the second direction is defined. What is claimed is: 1. A line cutout correction device for correcting a line cutout obtained by performing line cutout with each obtained scanning region as one line region, wherein the length of a black pixel section of the cutout line region (hereinafter referred to as black) An average black pixel section length calculation unit for calculating an average black pixel section length of the black pixel section length, and comparing the average black pixel section length with the black pixel section length. Ratio of black pixel section length to average black pixel section length A division candidate section selection unit that selects a black pixel section larger than a seventeenth reference value as a division candidate section; and a position where a black pixel is detected on a scanning line that scans the center of the division candidate section among the scanning lines. Among the first
A first position extracting unit that determines a position closest to one side along the direction as a first position, and among the first positions, a first position closest to the other side along the first direction as a closest first position. A nearest first position extracting unit to be obtained; and a second position among black pixels detected on a scanning line that scans the center of the division candidate section in the scanning line.
A second position extraction unit that determines the position closest to the other side along the direction as a second position; and a second position closest to the one side along the second direction among the second positions. Second nearest location
A position extracting unit, comparing the nearest first position and the nearest second position, and when the nearest first position is on the other side of the nearest second position, and When one position and the nearest second position are located on the same straight line along the second direction, the division candidate section is divided into two at the center of the division candidate section, and two divided black sections are divided. By generating a pixel section, a first division unit that corrects line segmentation is compared with the nearest first position and the nearest second position, and the nearest first position is determined by the nearest first position. Dividing the first candidate segment by a dividing line that passes through the middle between the nearest first position and the nearest second position and extends in the second direction when the first position is closer to the one side than the second position; Thus, the one divided region on the one side and the other divided region on the other side are generated, and the one divided region is And the other divided area is divided by the scanning line from which the nearest first position has been obtained to generate two divided black pixel sections. And a second dividing unit that corrects the line cutout by generating a line cutout.
JP9218913A 1997-07-08 1997-07-08 Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification Withdrawn JPH1125218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9218913A JPH1125218A (en) 1997-07-08 1997-07-08 Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9218913A JPH1125218A (en) 1997-07-08 1997-07-08 Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification

Publications (1)

Publication Number Publication Date
JPH1125218A true JPH1125218A (en) 1999-01-29

Family

ID=16727291

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9218913A Withdrawn JPH1125218A (en) 1997-07-08 1997-07-08 Methods for line segmentation and line segmentation modification and devices for line segmentation and line segmentation modification

Country Status (1)

Country Link
JP (1) JPH1125218A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004151781A (en) * 2002-10-28 2004-05-27 Ricoh Co Ltd Line segmentation device, line segmentation method and program
US7352897B2 (en) 2001-09-27 2008-04-01 Canon Kabushiki Kaisha Method and means for dividing an image into character image lines, and method and apparatus for character image recognition
JP2025009695A (en) * 2023-06-28 2025-01-20 株式会社朝日新聞社 Information processing device, information processing method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7352897B2 (en) 2001-09-27 2008-04-01 Canon Kabushiki Kaisha Method and means for dividing an image into character image lines, and method and apparatus for character image recognition
JP2004151781A (en) * 2002-10-28 2004-05-27 Ricoh Co Ltd Line segmentation device, line segmentation method and program
JP2025009695A (en) * 2023-06-28 2025-01-20 株式会社朝日新聞社 Information processing device, information processing method, and program

Similar Documents

Publication Publication Date Title
CN112507782B (en) Text image recognition method and device
EP0063454B1 (en) Method for recognizing machine encoded characters
US4903311A (en) Character region extracting method and apparatus capable of implementing the method
US7106904B2 (en) Form identification method
JPH07120385B2 (en) Optical reading method
JPH08293001A (en) Image processing apparatus, optical character recognition apparatus and methods thereof
US6275608B1 (en) Image processing method and apparatus and memory medium
JP3936436B2 (en) Table recognition method
US5982952A (en) Optical character reader with tangent detection for detecting tilt of image data
JPH1125217A (en) Methods for line segmentation and line segmentation modification, and devices for line segmentation and line segmentation modification
JP3516541B2 (en) Method and apparatus for recognizing dimension information of construction drawings
JPH07220023A (en) Table recognition method and apparatus thereof
JP3516540B2 (en) Construction drawing recognition method and recognition device
JPH1125213A (en) Method and device for judging row direction
JPH07182459A (en) Table structure extracting device
JP3187895B2 (en) Character area extraction method
JP4080750B2 (en) Character extraction method, character extraction device, and program
JP2988401B2 (en) Stamp recognition device
JPH09185675A (en) Form analysis method
JPH0492992A (en) Character segmenting device
JPH02138674A (en) Document processing method and device
JPH06223224A (en) Method for segmenting line
JP3606218B2 (en) Document classification device, character reading device, authenticity determination device, and methods thereof
JPH06150060A (en) Image tilt detection method and table processing method
JPH04100189A (en) Character segmentation device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20041005