JPH0696275A - Image processor - Google Patents

Image processor

Info

Publication number
JPH0696275A
JPH0696275A JP4243252A JP24325292A JPH0696275A JP H0696275 A JPH0696275 A JP H0696275A JP 4243252 A JP4243252 A JP 4243252A JP 24325292 A JP24325292 A JP 24325292A JP H0696275 A JPH0696275 A JP H0696275A
Authority
JP
Japan
Prior art keywords
rectangle
image
separator
pixels
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4243252A
Other languages
Japanese (ja)
Inventor
Kazuyuki Saito
和之 齋藤
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP4243252A priority Critical patent/JPH0696275A/en
Priority to EP93307181A priority patent/EP0587450B1/en
Priority to DE69333694T priority patent/DE69333694T2/en
Publication of JPH0696275A publication Critical patent/JPH0696275A/en
Priority to US08/574,598 priority patent/US6104832A/en
Priority to US09/606,171 priority patent/US6385338B1/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the processing time at the time of dividing an area, to form a storage area in a small scale, and to improve the accuracy for dividing a complicated area constitution. CONSTITUTION:This device is provided with an image thinning-out part 106 for taking OR of vertical (m) dots and horizontal (n) dots against an input image from an input part 101 and thinning out newly mXn picture elements to one picture element, a labeling part 107 for adding a label by one line each to a black picture element of its thinned-out image, putting the same label to picture elements continued vertically, to the left and the right, and obliquely, and simultaneously, forming a rectangle, and a separator, etc., detecting part 108 for discriminating a rectangle corresponding to a text, a rectangle corresponding to a graphic or a photograph, a rectangle corresponding to a table, a rectangle corresponding to a separator, etc., by using the number of picture elements to width height, and an area of its rectangle, that is, picture element density, etc.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、OCR(光学的文字認
識)装置、複写機、ファクシミリ等の電子装置におい
て、特に入力画像に対して文字領域と、図形、表等の領
域とに分割する画像処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an electronic device such as an OCR (optical character recognition) device, a copying machine or a facsimile, and particularly divides an input image into a character area and an area such as a figure or a table. The present invention relates to an image processing device.

【0002】[0002]

【従来の技術】従来の画像処理装置においては領域分割
手段として、ランレングスの分布を調べ白ラン黒ランの
長さにより文字領域や図形領域等を分割するランレング
ス分析方式を用いたものや、入力画像のフーリェスペク
トルを分析して各種領域に分割するスペクトル分析方式
を用いたものや、特開昭64−15889号公報に記載
されているように垂直および水平方向の射影(ヒストグ
ラム)を交互に繰り返して取り周辺部分の情報から領域
を分割していく射影分析方式を用いたものがある。
2. Description of the Related Art In a conventional image processing apparatus, as a region dividing means, a device using a run length analysis method for examining a distribution of run lengths and dividing a character region, a graphic region or the like according to the length of a white run and a black run, A method that uses a spectrum analysis method that analyzes a Fourier spectrum of an input image and divides it into various regions, and alternately projects vertical and horizontal projections (histograms) as described in JP-A-64-15889. There is a method using a projective analysis method in which an area is repeatedly divided into pieces based on information of a peripheral portion.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上述の
ような従来技術では、演算処理に多大な時間を費やし、
かつ画像の画素に対して処理を行うので記憶領域が大規
模化し、複雑な領域構成の画像に対する分割精度が低い
等の問題点があった。
However, in the above-mentioned prior art, a great deal of time is spent on the arithmetic processing,
In addition, since the pixels of the image are processed, the storage area becomes large in scale, and there is a problem that the division accuracy for an image having a complicated area configuration is low.

【0004】本発明の目的は、上述の点に鑑みて、領域
分割をする際の処理時間の短縮、記憶領域の小規模化、
および複雑な領域構成の分割精度の向上等を図った画像
処理装置を提供することにある。
In view of the above points, an object of the present invention is to shorten the processing time when dividing an area, reduce the size of a storage area,
Another object of the present invention is to provide an image processing device that improves the division accuracy of a complicated area configuration.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、画像を入力する画像入力手段と、該画像
入力手段からの入力画像に対し縦mドット、横nドット
の論理和をとって新たにmXn画素を1画素に間引く画
像間引き手段と、該画像間引き手段で間引かれた画像の
黒画素に対し1行ずつラベルを付加し、上下・左右・斜
めで連続している画素には同一ラベルを付け、同時に矩
形をかたどっていくラベリング手段と、該ラベリング手
段でラベル付けされた前記矩形の幅、高さ、面積、面積
に対する画素の数すなわち画素密度を用いて文章部分に
該当する矩形、図形または写真に該当する矩形、表に該
当する矩形、セパレータに該当する矩形等を区別するセ
パレータ等検出手段とを具備し、該セパレータ等検出手
段の検出結果に基づいて前記入力画像の領域分割を行う
ことを特徴とする。
To achieve the above object, the present invention provides an image input means for inputting an image and a logical sum of vertical m dots and horizontal n dots for an input image from the image input means. A new image thinning means for thinning out mXn pixels to one pixel and a label is added to the black pixels of the image thinned out by the image thinning means, one line at a time, and the pixels are continuous vertically, horizontally and diagonally. Are labeled with the same label, and at the same time, a labeling unit that traces a rectangle is used, and the width, height, area, and the number of pixels with respect to the area of the rectangle labeled by the labeling unit, that is, the pixel density, is used to correspond to the text portion. A rectangle corresponding to a rectangle, a figure or a photograph, a rectangle corresponding to a table, a rectangle corresponding to a separator, and the like, and a separator or the like detection means, and based on the detection result of the separator or the like detection means. And performing segmentation of the input image Te.

【0006】また、本発明は、好ましくは、前記セパレ
ータ等検出手段により区分された文章部分に該当する矩
形の幅と高さの比較から縦書き文章か横書き文章かを推
定する組方向検出手段と、該組方向検出手段で判定され
た組方向と文字サイズを用いて見出し類を検出する見出
し類検出手段と、本来の矩形の大きさを拡張した仮想矩
形を用いて矩形の合併を行う矩形合併手段とをさらに有
することを特徴とすることができる。
Further, the present invention is preferably a set direction detecting means for estimating whether the text is a vertical writing text or a horizontal writing text by comparing the width and height of a rectangle corresponding to the text portion divided by the detecting means such as the separator. , A headline detection means for detecting headlines using the set direction and character size determined by the set direction detection means, and a rectangle merger for performing rectangle merger using a virtual rectangle obtained by expanding the size of the original rectangle It can be characterized by further comprising means.

【0007】[0007]

【作用】本発明では、画像間引き部、ラベリング部等を
有する領域分割手段により、入力画像を矩形データに変
換して文字、図形、表等の領域に分割させる。
In the present invention, the input image is converted into rectangular data by the area dividing means having the image thinning section, the labeling section, etc., and divided into areas such as characters, figures and tables.

【0008】[0008]

【実施例】以下、図面を参照して本発明の実施例を詳細
に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0009】図1は本発明の一実施例の画像処理装置の
概略構成を示す。本図において、101は画像データの
入力部である。102は装置の制御や各部処理の演算を
行う演算処理部(CPU)である。103は後述するフ
ローチャートの制御プログラムや、各種データを記憶し
ておく記憶部である。104は演算処理結果や画像処理
結果、および画像データを出力する出力部である。10
5は領域分割処理全体を行う領域分割部である。
FIG. 1 shows a schematic configuration of an image processing apparatus according to an embodiment of the present invention. In the figure, 101 is an input unit for image data. Reference numeral 102 denotes an arithmetic processing unit (CPU) that controls the apparatus and performs arithmetic processing of each unit. Reference numeral 103 denotes a storage unit that stores a control program of a flowchart described below and various data. An output unit 104 outputs the calculation processing result, the image processing result, and the image data. 10
An area dividing unit 5 performs the entire area dividing process.

【0010】次に、領域分割部105の内部構成につい
て説明する。まず、106は入力画像を間引く、画像間
引き部であり、入力画像に対し縦mドット、横nドット
の論理和をとって新たにmXn画素を1画素に間引く。
107はその間引き画素にラベル付けを行い同時に初期
矩形データを作成するラベリング部であり、画像の黒画
素に対し1行ずつラベルを付加し、上下・左右・斜めで
連続している画素には同一ラベルを付け、同時に矩形を
かたどっていく。108はセパレータや表や図形等を検
出するセパレータ等検出部であり、上記矩形の幅、高
さ、面積、面積に対する画素の数すなわち画素密度を用
いて文字部分(本文)に該当する矩形、図形または写真
に該当する矩形、表に該当する矩形、セパレータに該当
する矩形等を区別する。109は縦書き・横書き等の文
章の組方向を検出する組方向検出部であり、上記文字部
分(本文)に該当する矩形の幅と高さの比較から縦書き
文章か横書き文章かを推定する。110は見出し類を検
出する見出し類検出部であり、上記組方向と文字サイズ
を用いて見出し類を検出する。111は矩形の合併部で
あり、本来の矩形の大きさを拡張した仮想矩形を用いて
矩形の合併を行う。
Next, the internal structure of the area dividing section 105 will be described. First, an image thinning unit 106 thins an input image, and newly thins out mXn pixels to one pixel by taking a logical sum of vertical m dots and horizontal n dots with respect to the input image.
Reference numeral 107 denotes a labeling unit that labels the thinned pixels and at the same time creates initial rectangular data. Labels are added to the black pixels of the image one line at a time, and the same is applied to pixels that are continuous vertically, horizontally, and diagonally. Label and shape the rectangle at the same time. Reference numeral 108 denotes a separator or the like detection unit that detects a separator, a table, a figure, etc., and uses the width, height, area, and the number of pixels per area, that is, the pixel density, to identify a rectangle or figure corresponding to a character portion (text). Alternatively, a rectangle corresponding to a photograph, a rectangle corresponding to a table, a rectangle corresponding to a separator, etc. are distinguished. Reference numeral 109 denotes a set direction detecting unit that detects a set direction of a sentence such as vertical writing or horizontal writing, and estimates a vertical writing sentence or a horizontal writing sentence by comparing the width and height of a rectangle corresponding to the character portion (text). . Reference numeral 110 denotes a headline detection unit for detecting a headline, which detects the headline using the set direction and the character size. Reference numeral 111 denotes a rectangle merging unit, which merges rectangles by using a virtual rectangle obtained by expanding the size of the original rectangle.

【0011】図2のフローチャートは図1の領域分割部
105における画像処理手順を示し、この処理を実行す
る制御プログラムは記憶部103に記憶されている。
The flowchart of FIG. 2 shows an image processing procedure in the area dividing unit 105 of FIG. 1, and a control program for executing this processing is stored in the storage unit 103.

【0012】 ステップS201 まず、画像入力部101から元画像を入力する。Step S 201 First, an original image is input from the image input unit 101.

【0013】 ステップS202 次に、画像間引き部106において、上記の元画像に対
し、縦mドット、横nドットの論理和をとって新たにm
Xn画素を1画素に間引く。ここで、元画像のmXn画
像中に1ドットでも黒画素が有れば間引き画像は黒とな
る。
Step S202 Next, in the image thinning unit 106, the logical sum of vertical m dots and horizontal n dots is added to the original image to newly generate m.
Xn pixels are thinned out to one pixel. Here, if even one dot has a black pixel in the mXn image of the original image, the thinned image is black.

【0014】 ステップS203 次に、ラベリング部107において、上記の間引き画像
の黒画素に対し1行ずつラベルを付加し、上下・左右・
斜めで連続している画素には同一ラベルを付け、同時に
矩形をかたどっていく。
Step S203 Next, in the labeling unit 107, labels are added to the black pixels of the thinned image line by line, and the vertical, horizontal, and horizontal lines are added.
The diagonally continuous pixels are labeled with the same label, and at the same time, the rectangle is modeled.

【0015】図3を例に取ると、最初に検出される画素
Aにはラベル1が付けられ、この画素Aの座標(Xa,
Ya)を矩形の始点と終点とし、画素数を1、矩形を区
別するための矩形ラベルに画素と同じラベル1を付加し
て以上のデータを矩形データとして図4に示すように記
憶部103に記憶する。
Taking FIG. 3 as an example, the first detected pixel A is labeled 1, and the coordinates (Xa, Xa,
Ya) is the start and end points of the rectangle, the number of pixels is 1, and the same label 1 as the pixel is added to the rectangular label for distinguishing the rectangle, and the above data is stored in the storage unit 103 as rectangular data as shown in FIG. Remember.

【0016】次に、左方向に連続画素のない(1行目で
あるのでもちろん上からも連続画素はない)画素Bには
ラベル2が付けられ、この画素Bの座標(Xb,Yb)
を矩形の始点と終点とし、画素数を1、矩形を区別する
ための矩形ラベルに画素と同じラベル2を付加して以上
のデータも矩形データとして図4に示すように記憶部1
03に記憶する。
Next, a label 2 is attached to a pixel B which has no continuous pixel in the left direction (there is no continuous pixel from the top because it is the first row), and the coordinates (Xb, Yb) of this pixel B are given.
Is the starting point and the ending point of the rectangle, the number of pixels is 1, and the same label 2 as the pixel is added to the rectangular label for distinguishing the rectangle, and the above data is also rectangular data as shown in FIG.
Store in 03.

【0017】以上のようにして1行目のラベリングが終
了したら2行目に移る。
When the labeling of the first line is completed as described above, the process moves to the second line.

【0018】2行目の最初の画素Cはラベル1の画素A
と上から連続しているので画素ラベル1を付加し、矩形
ラベル1の矩形データに対し画素数は1加算して計2画
素となり、矩形ラベルは変わらず1のままで、矩形座標
は終点のみを(Xa,Ya)から(Xa,Yc)へと更
新する(始点の座標は変わらない)。
The first pixel C of the second row is the pixel A of label 1.
Since it is continuous from the top, pixel label 1 is added, and the number of pixels is added to the rectangular data of rectangular label 1 by 1 to make a total of 2 pixels, the rectangular label remains 1 and the rectangular coordinate is only the end point. Is updated from (Xa, Ya) to (Xa, Yc) (the coordinates of the starting point do not change).

【0019】次の画素Dは画素Cと左から連続している
のでラベル1を付加し、矩形ラベル1の矩形データに対
し画素数は1加算して計3画素となり、矩形ラベルは変
わらず1のままで、矩形座標は終点のみを(Xa,Y
c)から(Xd,Yc)へと更新する(終点のY座標は
変わらない)。この時、画素Dは画素Bとも斜めに連続
しており、画素Cから連続して来ているので画素Bのラ
ベルをラベル2からラベル1へと変更し、矩形ラベル1
の矩形データに対し、矩形ラベル2の画素数を加算して
計4画素とし、矩形ラベルは変わらず1のままで、矩形
座標は画素A,B,C,Dをすべて含むように終点のみ
を(Xd,Yc)から(Xb,Yd)へと更新する。矩
形ラベル2の矩形データについては矩形ラベルを0とし
て無効とする。
Since the next pixel D is continuous with the pixel C from the left, the label 1 is added, and the number of pixels is added to the rectangular data of the rectangular label 1 by a total of 3 pixels, and the rectangular label remains unchanged 1. As it is, the rectangular coordinates are only for the end point (Xa, Y
Update from (c) to (Xd, Yc) (the Y coordinate of the end point does not change). At this time, the pixel D is diagonally continuous with the pixel B and is continuous from the pixel C. Therefore, the label of the pixel B is changed from label 2 to label 1, and the rectangular label 1
The number of pixels of the rectangular label 2 is added to the rectangular data of 4 to make a total of 4 pixels, the rectangular label remains 1, and the rectangular coordinates include only the end points so as to include all the pixels A, B, C and D. Update from (Xd, Yc) to (Xb, Yd). The rectangular data of the rectangular label 2 is invalidated by setting the rectangular label to 0.

【0020】以上のようにして2行目が終了したら3行
目に移る。
When the second line is completed as described above, the process moves to the third line.

【0021】3行目の最初の画素Eは画素Cと斜めに連
続しているので画素ラベル1を付加し、矩形ラベル1の
矩形データに対し画素数は1加算して計5画素となり、
矩形ラベルは変わらず1のままで、矩形座標は始点を
(Xa,Ya)から(Xe,Ya)へ、および終点を
(Xb,Yd)から(Xb,Ye)へと更新する。すな
わち、このときの記憶部103上の図4の矩形データ
は、矩形ラベルが1、始点座標が(Xe,Ya)、終点
座標が(Xb,Ye)、画素ラベルが1および画素数が
5となる。
Since the first pixel E in the third row is diagonally continuous with the pixel C, the pixel label 1 is added, and the number of pixels is increased by 1 to the rectangular data of the rectangular label 1, resulting in a total of 5 pixels.
The rectangular label remains unchanged at 1, and the rectangular coordinates are updated from the starting point (Xa, Ya) to (Xe, Ya) and the ending point (Xb, Yd) to (Xb, Ye). That is, in the rectangular data of FIG. 4 on the storage unit 103 at this time, the rectangular label is 1, the starting point coordinates are (Xe, Ya), the ending point coordinates are (Xb, Ye), the pixel label is 1, and the number of pixels is 5. Become.

【0022】以下同様にして、全間引き画素に対しラベ
リングと矩形のかたどりを行う。
In the same manner, labeling and rectangular tracing are performed on all thinned pixels.

【0023】 ステップS204 上述のラベリングと矩形のかたどりの後、次にセパレー
タ等検出部108において、文字部分(本文)に該当す
る矩形、図形または写真、表等に該当する矩形、セパレ
ータに該当する矩形等を、上記の矩形の幅W、高さH、
面積S、面積に対する画素の数すなわち画素密度D(こ
れら矩形データを用いて計算することにより容易に求ま
る)を用いて区別する。以下にこの処理の詳細を図5の
フローチャートを参照して説明する。
Step S204 After the above-described labeling and tracing of rectangles, in the separator or the like detection unit 108, next, a rectangle corresponding to a character portion (text), a rectangle corresponding to a figure or a photograph, a table, etc., and a rectangle corresponding to a separator. Etc., the width W, height H of the above rectangle,
The area S and the number of pixels with respect to the area, that is, the pixel density D (which can be easily obtained by calculation using these rectangular data) are used for the discrimination. The details of this processing will be described below with reference to the flowchart of FIG.

【0024】セパレータは、幅Wが閾値Tw1以下でか
つ高さHが幅Wの閾値Tw2倍以上(ステップS50
3)、もしくは幅Wが閾値Tw1より大きくかつ高さH
が幅Wの閾値Tw3倍以上(ステップS504)であれ
ば、縦長セパレータとして記憶部103上の矩形ラベル
を−3として統一し、矩形を構成する画素ラベルは矩形
ラベルとは別にそのまま現在のラベル番号を保持してお
く(ステップS514)。
In the separator, the width W is less than the threshold Tw1 and the height H is more than twice the threshold Tw of the width W (step S50).
3) or the width W is larger than the threshold Tw1 and the height H
Is 3 times the threshold Tw of the width W or more (step S504), the rectangular label on the storage unit 103 is unified as -3 as a vertically long separator, and the pixel label forming the rectangle is the current label number as it is, apart from the rectangular label. Is held (step S514).

【0025】また、幅と高さを入れ替えたものも上記と
同様にして判定し(ステップS505,S506)、該
当する場合は横長セパレータとして矩形ラベルを−3に
変更する。
Also, the case where the width and the height are interchanged is determined in the same manner as described above (steps S505 and S506), and if applicable, the rectangular label is changed to -3 as the horizontally long separator.

【0026】次に、図6に示すように、ステップS50
3〜S506までが否定判定となり、画素密度Dが閾値
Td1以下の時(ステップS507)は、カギ型などの
変形セパレータと見なして矩形ラベルを−3に変更する
(ステップS514)。
Next, as shown in FIG. 6, step S50.
When the pixel density D is equal to or less than the threshold Td1 (step S507), the rectangular label is changed to -3 and the rectangular label is changed to -3 (step S514).

【0027】また、ステップS507が否定となった
が、面積Sが閾値Ts1よりも大きい時(ステップS5
08)は、画素密度Dが閾値Td2未満(ステップS5
09)ならば、表と見なして矩形ラベルを−4に変更し
(ステップS515)、画素密度Dが閾値Td2以上な
らば図形または写真とみなして矩形ラベルを−5に変更
する(ステップS516)。
When step S507 is negative but the area S is larger than the threshold value Ts1 (step S5).
08), the pixel density D is less than the threshold value Td2 (step S5).
If the pixel density D is equal to or larger than the threshold value Td2, the rectangle label is changed to -5 (step S516).

【0028】また、面積Sが閾値Ts1以下でかつ閾値
Ts2以上の時(ステップS510)の画素密度Dが閾
値Td3以上(ステップS511)の矩形や、幅Wおよ
び高さHが共に閾値Tw4以上でかつ画素密度Dが閾値
Td5以上の時(ステップS513)の矩形も図形また
は写真とみなして矩形ラベルを−5に変更する(ステッ
プS516)。
When the area S is less than or equal to the threshold Ts1 and greater than or equal to the threshold Ts2 (step S510), the pixel density D is greater than or equal to the threshold Td3 (step S511), and the width W and height H are both greater than or equal to the threshold Tw4. Further, when the pixel density D is equal to or larger than the threshold value Td5 (step S513), the rectangle is regarded as a figure or a photograph and the rectangle label is changed to -5 (step S516).

【0029】さらに、面積Sが閾値Ts1以下でかつ閾
値Ts2以上の時(ステップS510)で、画素密度D
が閾値Td4未満(ステップS512)の矩形を表とみ
なし、矩形ラベルを−4に変更する(ステップS51
5)。
Further, when the area S is less than or equal to the threshold Ts1 and greater than or equal to the threshold Ts2 (step S510), the pixel density D
Rectangles whose threshold is less than the threshold Td4 (step S512) are regarded as a table, and the rectangle label is changed to -4 (step S51).
5).

【0030】以上のようにして、図形または写真、表等
に該当する矩形、セパレータに該当する矩形等を検出
し、残った矩形を本文(文字部分)として矩形ラベルは
そのまま画素ラベルと同一にしておく(ステップS51
7)。図6は面積Sと画素密度Dにおける上述の閾値と
セパレータ等の区分の関係を示すものである。
As described above, a rectangle corresponding to a figure, a photograph, a table, etc., a rectangle corresponding to a separator, etc. are detected, and the remaining rectangle is used as the text (character portion) and the rectangle label is made the same as the pixel label. Put (Step S51
7). FIG. 6 shows the relationship between the above-mentioned threshold value in the area S and the pixel density D and the division of the separator and the like.

【0031】 ステップS205 次に、組方向検出部109において、縦書き・横書き等
の文章の組方向を検出する。この処理を図7のフローチ
ャートを参照して説明する。
Step S205 Next, the set direction detecting unit 109 detects the set direction of sentences such as vertical writing and horizontal writing. This processing will be described with reference to the flowchart of FIG.

【0032】横書きの文章の場合、本文として残った矩
形は横方向に間引いた画素が連続して横長の矩形になり
やすく、縦書き文章であれば、本文として残った矩形は
縦長になりやすい。そこで、組方向検出部109におい
て、本文の矩形の幅Wと高さHの平均値を算出し(ステ
ップS701)、平均幅Wが平均高さhよりも大きい場
合は横書きの多い章とみなし、平均高さhを1文字の文
字サイズとする(ステップS702,S703)。逆に
平均高さhが平均幅Wよりも大きい場合は縦書きの多い
文章とみなし、平均幅wを1文字の文字サイズとする
(ステップS702,S710)。
In the case of a horizontally written sentence, the rectangle remaining as the body tends to become a horizontally long rectangle with pixels thinned out in the horizontal direction, and in the case of a vertically written sentence, the rectangle remaining as the body tends to become vertically long. Therefore, in the set direction detecting unit 109, the average value of the width W and the height H of the rectangle of the text is calculated (step S701), and when the average width W is larger than the average height h, it is regarded as a chapter with many horizontal writing, The average height h is set to the character size of one character (steps S702 and S703). On the contrary, when the average height h is larger than the average width W, it is regarded as a sentence with many vertical writings, and the average width w is set to the character size of one character (steps S702 and S710).

【0033】次に、図8に示すように、組方向とは逆方
向に矩形のヒストグラムを取り(ステップS704,S
711)、周辺分布の形状から閾値Tk以下の場所を段
落の分かれ目とし(ステップS705,S712)、段
落ごとに組方向と同じ方向に矩形のヒストグラムを取っ
て(ステップS708,S715)、周辺分布の形状か
ら黒画素の連続の長さをその段落内文字の文字サイズと
し、白画素の連続の長さを行ピッチとして検出する(ス
テップS709,S7116)。この検出処理を段落が
終わるまで繰り返す(ステップS706,S713)。
Next, as shown in FIG. 8, a rectangular histogram is created in the direction opposite to the set direction (steps S704, S).
711), from the shape of the marginal distribution, places where the threshold value is equal to or less than the threshold value Tk are set as paragraph breaks (steps S705 and S712), and a rectangular histogram is taken for each paragraph in the same direction as the set direction (steps S708 and S715). From the shape, the continuous length of black pixels is set as the character size of the character in the paragraph, and the continuous length of white pixels is detected as the line pitch (steps S709 and S7116). This detection process is repeated until the paragraph ends (steps S706 and S713).

【0034】 ステップS206 次に、見出し類検出部110において、組方向と文字サ
イズから見出し類を検出する。図9のフローチャートに
示すように、縦書きの場合を例に取ると、本文矩形の中
から矩形の幅Wが文字サイズwの閾値Tm1倍以上大き
い矩形を見出し矩形の候補として検出する(ステップS
905)。さらに、矩形の高さHが文字サイズwの閾値
Tm2倍よりも小さい場合は(ステップS906)、横
書きの文字が連続したものとみなし、見出し類とする
(ステップS908)。
Step S206 Next, the caption detection unit 110 detects captions from the set direction and the character size. As shown in the flowchart of FIG. 9, taking the case of vertical writing as an example, a rectangle in which the width W of the rectangle is larger than the threshold value Tm1 times the character size w by 1 times or more is detected from the body rectangles as a candidate for a heading rectangle (step S).
905). Further, when the height H of the rectangle is smaller than the threshold value Tm2 times the character size w (step S906), it is considered that the horizontally-written characters are continuous and is set as a heading (step S908).

【0035】また、以上のようにして矩形の大きさから
見出しとした矩形の中には本文の文字が結合してしまっ
たものを含む場合があるので、本文矩形と見出し矩形の
距離が閾値T1よりも近いもの(ステップS907)で
は、見出し類から本文に訂正する(ステップS90
9)。
Further, since some of the rectangles used as headings based on the size of the rectangles as described above include characters in which the text of the text is combined, the distance between the text rectangle and the heading rectangle is the threshold value T1. If it is closer (step S907), the heading is corrected to the text (step S90).
9).

【0036】さらに上記の処理によって残った本文矩形
の中で、文字サイズwの範囲に本文および見出し類の矩
形がないものを孤立した矩形として見出しとする(ステ
ップS910〜S913)。
Further, among the body rectangles remaining by the above processing, the body and heading type rectangles having no rectangle in the character size w are set as isolated rectangles (steps S910 to S913).

【0037】 ステップS207 次に、矩形の合併部111において、何の関連もなくば
らばらに存在したままの本文に該当する矩形および見出
し類の矩形を合併する。
Step S207 Next, in the rectangle merging unit 111, the rectangles corresponding to the main text that have been irrelevant and irrelevant to each other and the rectangles of the headings are merged.

【0038】図10に例を示すと、矩形A1と矩形Bと
の合併を考えるとすると、矩形A1に対してX方向に対
してPx、Y方向に対してPyだけ拡張した仮想矩形A
1′を考え、A1′に対してその周囲に接触あるいは内
包する矩形があるか否かをサーチし、矩形Bのように接
触していれば矩形A1と矩形Bを合併して新しく合併矩
形A2を作成し、矩形A1の矩形データを更新すること
で記憶し、矩形Bのデータは無効とする。ただし、この
時Px,Pyは文字サイズと行ピッチから求めた値であ
り、また矩形を合併してできた矩形が図形や表やセパレ
ータ等と接触する場合は、合併すること自体を無効とし
て元の矩形のままとしておく。
Considering an example of FIG. 10, considering the combination of the rectangle A1 and the rectangle B, a virtual rectangle A is obtained by expanding the rectangle A1 by Px in the X direction and Py in the Y direction.
Considering 1 ', it is searched whether or not there is a rectangle surrounding or in contact with A1'. If they are in contact with each other like rectangle B, rectangles A1 and B are merged to newly merge rectangle A2. Is created and stored by updating the rectangular data of the rectangle A1, and the data of the rectangle B is invalidated. However, at this time, Px and Py are values obtained from the character size and the line pitch, and when a rectangle formed by merging rectangles comes into contact with a figure, table, separator, etc., the merging itself is invalidated. The rectangle is left as it is.

【0039】このようにして、最初に見出し類同士を合
併し、次に本文矩形同志を合併していく。この時、本文
同志の合併では、図形や表やセパレータとの接触だけで
なく見出し類との接触も避けるようにし、見出し類と接
触するようであれば、合併自体を無効として元の矩形の
ままとしておく。
In this way, the headlines are first merged, and then the body rectangles are merged. At this time, when merging texts with each other, avoid contact not only with figures, tables, and separators but also with headings. If they do contact headings, the merger itself is invalidated and the original rectangle remains unchanged. I will keep it.

【0040】 ステップS208 最後に、以上のようにして求めた各種領域の矩形データ
を画像データと共に出力部104から外部へ出力する。
Step S208 Finally, the rectangular data of various areas obtained as described above is output from the output unit 104 to the outside together with the image data.

【0041】<他の実施例>上述の図2のステップS2
01の画像入力の際に、多値であるか否かを判断して、
2値画像に変換することで、入力画像がカラー等の多値
画像であっても領域分割処理は可能である。
<Other Embodiments> Step S2 in FIG. 2 described above.
When inputting the image of 01, it is judged whether it is multi-valued,
By converting the image into a binary image, it is possible to perform area division processing even if the input image is a multivalued image such as a color image.

【0042】また、ステップS202の画像間引き処理
において、入力画像の画素数が処理速度を損なわない程
度に十分に少なければ、この画像間引き処理を省略する
ことも可能である。
Further, in the image thinning process of step S202, if the number of pixels of the input image is sufficiently small so as not to impair the processing speed, the image thinning process can be omitted.

【0043】また、ステップS204のセパレータ等の
検出において、セパレータの縦・横違いや、図形や表等
求める時の閾値の違いなどで矩形ラベルを区別すること
で、さらに詳細な領域属性の分類を行うことも可能であ
る。
Further, in the detection of the separator or the like in step S204, by further distinguishing the rectangular labels by the vertical / horizontal difference of the separator, the difference of the threshold value when obtaining figures, tables, etc., it is possible to further classify the area attributes. It is also possible to do so.

【0044】また、同じくステップS204のセパレー
タ等の検出において、最初から文章のみなどのように特
定の属性の画像しか入力しない場合には、このセパレー
タ等の検出処理を省略することも可能である。
Similarly, in the step of detecting the separator or the like in step S204, if only an image having a specific attribute such as only a sentence is input from the beginning, the detecting process of the separator or the like can be omitted.

【0045】また、ステップS205の組方向の検出に
おいて、平均幅、平均高さを求める代わりに、それぞれ
の最多値を求めることによって代替えすることができ
る。
Further, in the detection of the set direction in step S205, instead of obtaining the average width and the average height, the maximum value of each can be obtained for substitution.

【0046】また、同じくステップS205の組方向の
検出において、段落ごとに組方向を再度確認すれば、縦
書き文章と横書き文章が混在の原稿にも正確に処理を行
うことができる。
Similarly, in the detection of the set direction in step S205, if the set direction is confirmed again for each paragraph, it is possible to accurately perform processing on a document in which vertical writing sentences and horizontal writing sentences are mixed.

【0047】また、同じくステップS205の組方向の
検出において、最初から一定の組方向の文章しか入力し
ないならば、組方向を固定値とすることでこの検出処理
を代替えすることができる。
Similarly, in the case of detecting the set direction in step S205, if only the text of a fixed set direction is input from the beginning, this detection process can be replaced by setting the set direction to a fixed value.

【0048】また、ステップS206の見出し類検出に
おいて、最初から見出し類のない画像しか入力しないな
らば、この検出処理を省略することも可能である。
Further, in the heading detection in step S206, if only an image without a heading is input from the beginning, this detection processing can be omitted.

【0049】また、ステップS207の矩形の合併にお
いて、図11に示すように、セパレータ等の矩形と接触
した場合に、さらに実際の間引いた画素とも接触してい
るか否かを確認し、接触していなければ合併を実行する
ことで、傾斜した画像にも対処できる。
In the merge of rectangles in step S207, as shown in FIG. 11, when a rectangle such as a separator is contacted, it is confirmed whether or not it is also in contact with an actually thinned pixel. If it is not, you can deal with skewed images by performing a merge.

【0050】また、同じくステップS207の矩形の合
併において、画像の間引き処理を省略できるような画素
数の少ない画像のときは、この合併処理を省略すること
も可能である。
Similarly, in the rectangle merging in step S207, if the image has a small number of pixels such that the image thinning process can be omitted, the merging process can be omitted.

【0051】また、ステップS208の最後の出力の際
に、各種領域の矩形データを参照して、必要な領域の画
像データのみを出力することも可能であり、これにより
記憶領域のさらなる縮小や、処理時間のさらなる短縮が
図れる。
Further, at the final output of step S208, it is possible to refer to the rectangular data of various areas and output only the image data of the necessary area, which further reduces the storage area, The processing time can be further shortened.

【0052】[0052]

【発明の効果】以上説明したように、本発明によれば、
入力画像の間引き後にさらにラベリングを用いて矩形デ
ータに変換して文字領域、図形または写真、表、セパレ
ータ、見出し類等の領域に分割するようにしたので、既
存の電子部品、回路等の変更無しに、処理時間の短
縮、記憶領域等の小規模化、複雑な領域構成の分割
精度の向上等が得られる効果がある。
As described above, according to the present invention,
After thinning the input image, it is converted to rectangular data using labeling and divided into character areas, figures or photographs, tables, separators, headings, etc., so there is no change in existing electronic parts, circuits, etc. In addition, the processing time can be shortened, the storage area can be downsized, and the division accuracy of the complicated area configuration can be improved.

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

【図1】本発明の一実施例の画像処理装置の概略構成を
示すブロック図である。
FIG. 1 is a block diagram showing a schematic configuration of an image processing apparatus according to an embodiment of the present invention.

【図2】本発明の一実施例の領域分割の画像処理手順の
全体を示すフローチャートである。
FIG. 2 is a flowchart showing an entire image processing procedure of area division according to an embodiment of the present invention.

【図3】本発明の一実施例のラベリング処理の一例を示
す説明図である。
FIG. 3 is an explanatory diagram showing an example of labeling processing according to an embodiment of the present invention.

【図4】本発明の一実施例の記憶部上の矩形データの構
造を示す説明図である。
FIG. 4 is an explanatory diagram showing a structure of rectangular data on a storage unit according to an embodiment of the present invention.

【図5】本発明の一実施例のセパレータ等検出部の処理
手順を示すフローチャートである。
FIG. 5 is a flowchart showing a processing procedure of a detector such as a separator according to an embodiment of the present invention.

【図6】本発明の一実施例の矩形(領域)の属性の密度
Dと面積Sでの切り分けを示す説明図である。
FIG. 6 is an explanatory diagram showing division by attribute density D and area S of a rectangle (region) according to an embodiment of the present invention.

【図7】本発明の一実施例の組方向検出部の処理手順を
示すフローチャートである。
FIG. 7 is a flowchart showing a processing procedure of a set direction detecting unit according to an embodiment of the present invention.

【図8】本発明の一実施例の段落の検出処理の一例を示
す説明図である。
FIG. 8 is an explanatory diagram showing an example of paragraph detection processing according to an embodiment of the present invention.

【図9】本発明の一実施例の見出し類検出部の処理手順
を示すフローチャートである。
FIG. 9 is a flowchart showing a processing procedure of a heading type detection unit according to an embodiment of the present invention.

【図10】本発明の一実施例の矩形の合併処理の一例を
示す説明図である。
FIG. 10 is an explanatory diagram showing an example of rectangle merging processing according to an embodiment of the present invention.

【図11】本発明の他の実施例のセパレータ矩形の合併
処理の一例を示す説明図である。
FIG. 11 is an explanatory diagram showing an example of separator rectangle merging processing according to another embodiment of the present invention.

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

101 入力部 102 演算処理部(CPU) 103 記憶部 104 出力部 105 領域分割部 106 画像間引き部 107 ラベリング部 108 セパレータ等検出部 109 組方向検出部 110 見出し類検出部 111 矩形の合併部 101 input unit 102 arithmetic processing unit (CPU) 103 storage unit 104 output unit 105 area dividing unit 106 image thinning unit 107 labeling unit 108 separator detection unit 109 set direction detection unit 110 heading detection unit 111 rectangular merged unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 画像を入力する画像入力手段と、 該画像入力手段からの入力画像に対し縦mドット、横n
ドットの論理和をとって新たにmXn画素を1画素に間
引く画像間引き手段と、 該画像間引き手段で間引かれた画像の黒画素に対し1行
ずつラベルを付加し、上下・左右・斜めで連続している
画素には同一ラベルを付け、同時に矩形をかたどってい
くラベリング手段と、 該ラベリング手段でラベル付けされた前記矩形の幅、高
さ、面積、面積に対する画素の数すなわち画素密度を用
いて文章部分に該当する矩形、図形または写真に該当す
る矩形、表に該当する矩形、セパレータに該当する矩形
等を区別するセパレータ等検出手段とを具備し、該セパ
レータ等検出手段の検出結果に基づいて前記入力画像の
領域分割を行うことを特徴とする画像処理装置。
1. An image input means for inputting an image, and m dots in the vertical direction and n pixels in the horizontal direction with respect to the input image from the image input means
Image thinning-out means for newly thinning out mXn pixels to one pixel by taking the logical sum of dots, and labels for each line are added to the black pixels of the images thinned out by the image thinning-out means, and vertical, horizontal, diagonally The same label is applied to consecutive pixels, and at the same time, labeling means for tracing a rectangle is used, and the width, height, area, and the number of pixels per area, that is, the pixel density, of the rectangle labeled by the labeling means are used. A rectangle corresponding to a text part, a rectangle corresponding to a figure or a photograph, a rectangle corresponding to a table, a rectangle corresponding to a separator, and the like, and a separator or the like detection means, and based on the detection result of the separator or the like detection means. The image processing apparatus is characterized in that the input image is divided into areas.
【請求項2】 前記セパレータ等検出手段により区分さ
れた文章部分に該当する矩形の幅と高さの比較から縦書
き文章か横書き文章かを推定する組方向検出手段と、 該組方向検出手段で判定された組方向と文字サイズを用
いて見出し類を検出する見出し類検出手段と、 本来の矩形の大きさを拡張した仮想矩形を用いて矩形の
合併を行う矩形合併手段とをさらに有することを特徴と
する請求項1に記載の画像処理装置。
2. A set direction detecting means for estimating a vertically written sentence or a horizontally written sentence by comparing the width and height of a rectangle corresponding to the sentence portion divided by the detecting means such as the separator, and the set direction detecting means. It further has headline detection means for detecting headlines using the determined set direction and character size, and rectangle merging means for merging rectangles using a virtual rectangle that is an extension of the original rectangle size. The image processing apparatus according to claim 1, which is characterized in that.
JP4243252A 1992-09-11 1992-09-11 Image processor Pending JPH0696275A (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP4243252A JPH0696275A (en) 1992-09-11 1992-09-11 Image processor
EP93307181A EP0587450B1 (en) 1992-09-11 1993-09-10 Image processing method and apparatus
DE69333694T DE69333694T2 (en) 1992-09-11 1993-09-10 Method and arrangement for image processing
US08/574,598 US6104832A (en) 1992-09-11 1995-12-18 Image processing method and apparatus
US09/606,171 US6385338B1 (en) 1992-09-11 2000-06-29 Image processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4243252A JPH0696275A (en) 1992-09-11 1992-09-11 Image processor

Publications (1)

Publication Number Publication Date
JPH0696275A true JPH0696275A (en) 1994-04-08

Family

ID=17101108

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4243252A Pending JPH0696275A (en) 1992-09-11 1992-09-11 Image processor

Country Status (1)

Country Link
JP (1) JPH0696275A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0830725A (en) * 1994-07-20 1996-02-02 Canon Inc Device and method for processing image
JPH08181837A (en) * 1994-12-22 1996-07-12 Nec Corp Facsimile equipment and character recognition method for picture signal
US6275608B1 (en) 1995-12-14 2001-08-14 Canon Kabushiki Kaisha Image processing method and apparatus and memory medium
US6535652B2 (en) 1998-02-05 2003-03-18 Canon Kabushiki Kaisha Image retrieval apparatus and method, and computer-readable memory therefor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0830725A (en) * 1994-07-20 1996-02-02 Canon Inc Device and method for processing image
JPH08181837A (en) * 1994-12-22 1996-07-12 Nec Corp Facsimile equipment and character recognition method for picture signal
US6275608B1 (en) 1995-12-14 2001-08-14 Canon Kabushiki Kaisha Image processing method and apparatus and memory medium
US6535652B2 (en) 1998-02-05 2003-03-18 Canon Kabushiki Kaisha Image retrieval apparatus and method, and computer-readable memory therefor

Similar Documents

Publication Publication Date Title
JP3308032B2 (en) Skew correction method, skew angle detection method, skew correction device, and skew angle detection device
US5907631A (en) Document image processing method and system having function of determining body text region reading order
JP3278471B2 (en) Area division method
JP2000105829A (en) Method and device for face parts image detection
CN110390260B (en) Picture scanning piece processing method and device, computer equipment and storage medium
CN111460355B (en) Page analysis method and device
JP4565396B2 (en) Image processing apparatus and image processing program
CN113537184A (en) OCR (optical character recognition) model training method and device, computer equipment and storage medium
JPH0696275A (en) Image processor
JP3099797B2 (en) Character recognition device
JPH06208625A (en) Method and device for processing image
JP2868134B2 (en) Image processing method and apparatus
JP4731748B2 (en) Image processing apparatus, method, program, and storage medium
JP2000090194A (en) Image processing method and image processor
JP3666903B2 (en) Image processing method and apparatus
JPH0830725A (en) Device and method for processing image
JP2014021510A (en) Information processor and information processing method, and, program
JP3278221B2 (en) Image processing method and apparatus
JP3406942B2 (en) Image processing apparatus and method
JPH09269944A (en) Picture processor and method therefor
JP3100825B2 (en) Line recognition method
JP3190794B2 (en) Character segmentation device
JPH04142685A (en) Line recognition system
JP2000207490A (en) Character segmenting device and character segmenting method
JPH09269970A (en) Method for recognizing character and its device