JPH03139783A - Method for segmenting circumscribing rectangle of document image - Google Patents

Method for segmenting circumscribing rectangle of document image

Info

Publication number
JPH03139783A
JPH03139783A JP1278944A JP27894489A JPH03139783A JP H03139783 A JPH03139783 A JP H03139783A JP 1278944 A JP1278944 A JP 1278944A JP 27894489 A JP27894489 A JP 27894489A JP H03139783 A JPH03139783 A JP H03139783A
Authority
JP
Japan
Prior art keywords
circumscribed rectangle
label
mask
information
document image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1278944A
Other languages
Japanese (ja)
Inventor
Kazuhiro Ishikawa
和弘 石川
Sadamasa Hirogaki
広垣 節正
Yutaka Mazaki
裕 真崎
Shuichi Fujikura
秀一 藤倉
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 JP1278944A priority Critical patent/JPH03139783A/en
Publication of JPH03139783A publication Critical patent/JPH03139783A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

PURPOSE:To reduce memory capacity used in processing and to shorten processing time by judging connectivity each time as scanning a binary image with a circumscribing rectangle detecting means, and forming and preserving a circumscribing rectangle sequentially. CONSTITUTION:The method is comprised of a binarization processing means 10 to obtain the binary image by binarizing a multivalue image, and a circumscribing rectangle segmenting means 20 to segment the circumscribing rectangle by inputting the binary image, and the circumscribing rectangle segmenting means 20 is equipped with a mask setting means 21 and the circumscribing rectangle detecting means 22. The mask setting means 21 performs the setting of a mask with arbitrary size by scanning binary image data obtained by binarization. Also, the circumscribing rectangle detecting means 22 generates and preserves the information of the circumscribing rectangle sequentially from, for example, a black picture element and a remarked picture element appearing within the range of the mask generated at the mask setting means 21 as scanning the binary image, therefore, the processing is performed in unit of picture element(unit of line). Thereby, the memory capacity is reduced and the processing time is shortened.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、光学的文字読み取り(OCR) 、領域分割
、文字列抽出、インデックス抽出等の文書処理方式にお
いて、コラム、図、表、行、文字等の種々の要素が含ま
れる文書画像の外接矩形切り出し方法に関するものであ
る。
Detailed Description of the Invention (Field of Industrial Application) The present invention is applicable to document processing methods such as optical character reading (OCR), region segmentation, character string extraction, and index extraction. The present invention relates to a method for cutting out a circumscribed rectangle of a document image containing various elements such as characters.

(従来の技術) 従来、このような分野の技術としては、文献1;吹抜著
rFAX、OAのための画像の信号処理j初版(昭57
−10−20’)日刊工業新聞社、P、5−25、 文献2;特開昭61−103372号公報、文献3;電
子情報通信学会論文誌り、J71−D [12]  (
1988−12)P、2587−2595、 文献4;烏脇著[画像理解のためのディジタル画像処理
(II)J(昭63−2>(株)昭晃堂出版、P、44
−47、 等に記載されるものがあった。
(Prior art) Conventionally, as a technology in this field, there is a document 1: "Image Signal Processing for rFAX and OA" by Fukinuki, first edition (1982).
-10-20') Nikkan Kogyo Shimbun, P, 5-25, Document 2; Japanese Patent Application Laid-Open No. 103372/1983, Document 3; Transactions of the Institute of Electronics, Information and Communication Engineers, J71-D [12] (
1988-12) P, 2587-2595, Reference 4; Karasuwaki [Digital image processing for image understanding (II) J (1988-2> Shokodo Publishing Co., Ltd., P, 44)
-47, etc.

文献1.2には、文書画像を2値化して2値画像を得る
技術が記載され、さらに文献3.4には、文書画像の外
接矩形切り出し方法について記載されている。
Document 1.2 describes a technique for binarizing a document image to obtain a binary image, and Document 3.4 describes a method for cutting out a circumscribed rectangle of a document image.

文献3に記載された方法では、2値化(白:背景色、黒
;文字バタン色)されたディジタル画像(1フレ一ム分
)をメモリに記憶した後、該メモリの左上隅から主走査
方向(或いは副走査方向)に走査し、1つの黒の画素(
境界点)を発見し、その点を始点として順次隣接する境
界点を検出し境界を1周する方法である。特に、この文
献3の方法では、従来の3×3のマスクの代わりに、縦
横の大きさが(2m+1>X (2n+1.>(m。
In the method described in Reference 3, after storing a binarized (white: background color, black: text button color) digital image (one frame worth) in a memory, main scanning is performed from the upper left corner of the memory. direction (or sub-scanning direction), one black pixel (
In this method, a boundary point) is found, and adjacent boundary points are sequentially detected using that point as a starting point to go around the boundary once. In particular, in the method of Document 3, instead of using the conventional 3×3 mask, the vertical and horizontal dimensions are (2m+1>X (2n+1.>(m).

nは正数)の境界追跡マスクを用い、m、nの値を目的
に応じて変えることによって8連結性の概念を拡張した
さまざまなレベルの連結成分の境界追跡を行い、その結
果得られた各領域の最少X。
Using a boundary tracking mask (n is a positive number), we extended the concept of 8-connectivity by changing the values of m and n according to the purpose, and performed boundary tracing of connected components at various levels. Minimum X for each area.

y座標値と最大x、y座標値によって外接矩形化を行い
抽出している。
Circumscribed rectangles are extracted using the y coordinate value and the maximum x and y coordinate values.

また、文献4に記載された方法では、前記と同様に2値
化されたディジタル画像に対して、副走査方向に走査し
つつ主走査方向に走査する過程において、黒の画素の連
結性を見て画素単位に各連結成分のラベル付け(2値画
像からラベル画像を求める処理)を行い、その結果をラ
ベル画像として保存する。そしてそのラベル画像から、
各成分くラベル番号)の最少x、y座標値と最大x、 
y座標値によって外接矩形化して抽出する方法であった
Furthermore, in the method described in Reference 4, the connectivity of black pixels is checked in the process of scanning in the sub-scanning direction and in the main scanning direction for a digital image that has been binarized in the same manner as described above. Then, each connected component is labeled pixel by pixel (processing to obtain a label image from a binary image), and the result is saved as a label image. And from that label image,
The minimum x, y coordinate values and maximum x of each component (label number),
This was a method of extracting a circumscribed rectangle based on the y-coordinate value.

(発明が解決しようとする課題) しかしながら、上記の方法では、次のような課題があっ
た。
(Problems to be Solved by the Invention) However, the above method has the following problems.

(a)  文献3の方法では、連結成分の数が増加する
と、追跡・抽出の処理に非常に時間がかかり、その上、
全画像をメモリに記憶しておかなければならないため、
メモリ容量が増大するという問題があった。
(a) In the method of Reference 3, when the number of connected components increases, the tracking/extraction process takes a very long time.
Since all images must be stored in memory,
There was a problem that the memory capacity increased.

(b)  文献4の方法では、処理を行う上で、1フレ
一ム分のラベル画像を保存する為のメモリを必要とし、
そのメモリ容量が大規模となる。さらに4連結、8連結
のみが参照されており、8連結性の概念を拡張したさま
ざまなレベルの連結成分の抽出が行えないという問題が
あった。
(b) The method in Reference 4 requires memory to store one frame's worth of label images for processing,
Its memory capacity becomes large. Furthermore, only 4-connectivity and 8-connectivity are referenced, and there is a problem in that it is not possible to extract connected components at various levels by expanding the concept of 8-connectivity.

本発明は前記従来技術が持っていた課題として、処理時
間がかかる、メモリの大容量化、及び4連結、8連結の
みしか対応できないという点について解決した文書画像
の外接矩形切り出し方法を提供するものである。
The present invention provides a method for cutting out a circumscribed rectangle of a document image, which solves the problems of the prior art, such as long processing time, large memory capacity, and the fact that only 4-concatenation and 8-concatenation can be supported. It is.

(課題を解決するための手段) 第1の発明は、前記課題を解決するために、文書画像の
外接矩形切り出し方法において、2値化して得られた2
値画像をマスク設定手段に入力し、前記マスク設定手段
により、ある領域内に現れた黒画素は全て同一外接矩形
領域であると判定する為のある領域を示すマスクを任意
に設定した後、外接矩形検出手段により、前記マスク設
定手段で設定したマスクに従って前記2値画像を走査し
ながらその都度連結性を判断し、外接矩形(長方形及び
正方形)を順次形成、保存するようにしたものである。
(Means for Solving the Problems) In order to solve the above-mentioned problems, the first invention provides a method for cutting out a circumscribed rectangle of a document image.
The value image is input to a mask setting means, and after arbitrarily setting a mask indicating a certain area to determine that all black pixels appearing in a certain area are in the same circumscribed rectangular area, the mask setting means The rectangle detection means scans the binary image according to the mask set by the mask setting means, determines connectivity each time, and sequentially forms and stores circumscribed rectangles (rectangles and squares).

第2の発明では、第1の発明において、前記マスク設定
手段は、注目位置より先のまだ走査していない未走査画
素の部分が前記マスクの範囲内に含まれていなければ、
前記マスクの大きさ・形を任意に設定するようにしてい
る。
In a second aspect of the invention, in the first aspect of the invention, if the portion of unscanned pixels beyond the position of interest that has not yet been scanned is not included within the range of the mask,
The size and shape of the mask can be set arbitrarily.

第3の発明では、第1の発明において、前記外接矩形検
出手段は、前記マスクの設定で作成されたマスク範囲内
に現れた黒画素は全て同一外接矩形領域と判別し、前記
2値画像を走査しながら前記外接矩形を順次形成、保存
していく。
In a third invention, in the first invention, the circumscribed rectangle detection means determines that all black pixels appearing within the mask range created by the mask settings are the same circumscribed rectangular area, and converts the binary image into While scanning, the circumscribed rectangles are sequentially formed and saved.

第4の発明では、第1の発明における前記外接矩形検出
手段の実行時に、前記マスクの大きさに対応した外接矩
形情報が保存されているラベル(メモリ位置)をラベル
保存ラインメモリに記憶させ、前記任意に設定したマス
ク内に存在する異なるラベルをラベル保存レジスタに記
憶させ、さらに前記外接矩形情報を外接矩形位置メモリ
に保存させることにより、前記外接矩形を順次形成、保
存していく。
In a fourth invention, when the circumscribed rectangle detection means in the first invention is executed, a label (memory location) in which circumscribed rectangle information corresponding to the size of the mask is stored is stored in a label storage line memory, By storing different labels existing within the arbitrarily set mask in a label storage register and further storing the circumscribed rectangle information in a circumscribed rectangle position memory, the circumscribed rectangles are sequentially formed and saved.

第5の発明では、第4の発明において、前記ラベル保存
ラインメモリは、設定したマスクのnl。
In a fifth invention, in the fourth invention, the label storage line memory stores nl of the set mask.

02分と画像の大きさ分を1つのラベル保存ラインメモ
リとし、前記2値画像の座標値(x、y)に相当する前
記ラベル保存ラインメモリの位置は、所定のラベル保存
ラインメモリの(x−1−nl)としている。
02 minutes and the size of the image are set as one label storage line memory, and the position of the label storage line memory corresponding to the coordinate values (x, y) of the binary image is (x, y) of the predetermined label storage line memory. -1-nl).

第6の発明では、第4の発明における前記ラベル保存ラ
インメモリ及びラベル保存レジスタは、黒画素の場合に
その属する外接矩形情報の記憶されているラベルを保存
し、そうでない場合(白画素の場合)は初期値(0)を
そのまま保存する第7の発明では、第4の発明において
、前記外接矩形検出手段は、前記ラベル保存レジスタに
記憶された異なるラベル番号の個数が2個以上の場合、
前記ラベル保存レジスタに記憶されたa個(但し、aは
任意の数)のラベルに相当する外接矩形情報を1つに統
合し保存する第1のステップと、個数が1.2個以上の
場合、現在の注目位置の座標値(x、y)とそのラベル
番号に相当する外接矩形情報とを統合して同ラベル位置
に保存する第2のステップと、個数が0個の場合、新た
に注目位置の座標値(x、y)の情報を外接矩形情報と
して付加する第3のステップとを、実行するようにして
いる。
In a sixth invention, the label storage line memory and label storage register in the fourth invention store the label stored in the circumscribed rectangle information to which the pixel belongs in the case of a black pixel, and otherwise (in the case of a white pixel) ) stores the initial value (0) as it is, and in the fourth invention, when the number of different label numbers stored in the label storage register is two or more,
a first step of integrating and storing circumscribed rectangle information corresponding to a number of labels (where a is an arbitrary number) stored in the label storage register; and when the number is 1.2 or more; , the second step of integrating the coordinate values (x, y) of the current position of interest and the circumscribed rectangle information corresponding to its label number and saving it at the same label position; A third step of adding information on the coordinate values (x, y) of the position as circumscribed rectangle information is executed.

第8の発明では、第7の発明において、前記ラベル保存
レジスタに記憶されたa個のラベルを小さい順にA1、
A2、……Aaと並びがえ、そのA1のラベル情報とそ
の他のラベル情報とを比較して新しい情報を求め、その
結果をA1のラベルに新たに保存し、統合されたラベル
の情報を消去し、それ以降のラベルの情報を前のラベル
へと移動し、それに対応して前記ラベル保存ラインメモ
リ及びラベル保存レジスタ内の内容も書きかえ、常に最
大ラベルがそのまま外接矩形の個数を示すようにしてい
る。
In an eighth invention, in the seventh invention, the a number of labels stored in the label storage register are sorted in descending order of A1,
Arrange A2, ...Aa, compare the label information of A1 with other label information to find new information, save the result to the label of A1, and delete the information of the integrated label. Then, the information of subsequent labels is moved to the previous label, and the contents of the label storage line memory and label storage register are also rewritten accordingly, so that the maximum label always indicates the number of circumscribed rectangles as it is. ing.

(作用) 第1の発明によれば、以上のように文書画像の外接矩形
切り出し方法を構成したので、マスク設定手段は、2値
化して得られな2値画像データを走査等して任意の大き
さのマスクの設定を行う。
(Function) According to the first invention, since the method for cutting out a circumscribed rectangle of a document image is configured as described above, the mask setting means scans the binary image data that cannot be obtained by binarizing it and generates an arbitrary image. Set the size mask.

外接矩形検出手段は、2値画像を走査しながら、マスク
設定手段で作成したマスクの範囲内に現われた例えば黒
画素と注目画素から、外接矩形の情報を順次作成、保存
していく。これにより、画素単位(ライン単位)で処理
可能となり、メモリ容量の削減化と処理時間の短縮化が
図れる。
While scanning the binary image, the circumscribed rectangle detection means sequentially creates and stores information about the circumscribed rectangle from, for example, black pixels and pixels of interest that appear within the range of the mask created by the mask setting means. This makes it possible to process on a pixel-by-pixel (line-by-line basis), reducing memory capacity and processing time.

第2.第3の発明では、マスク設定手段で、マスクの大
きさ・形を任意に設定することにより、種々の条件(レ
ベル)の外接矩形の抽出が行える。
Second. In the third invention, circumscribed rectangles under various conditions (levels) can be extracted by arbitrarily setting the size and shape of the mask using the mask setting means.

第4〜第8の発明では、ラベル保存ラインメモリ、ラベ
ル保存レジスタ、及び外接矩形位置メモリを用いること
により、外接矩形の抽出処理の単純化及び簡単化が図れ
る。
In the fourth to eighth inventions, by using the label storage line memory, the label storage register, and the circumscribed rectangle position memory, the process for extracting the circumscribed rectangle can be simplified and simplified.

従って、前記課題を解決できるのである。Therefore, the above problem can be solved.

(実施例) 第1図は、本発明の実施例を示すもので、文書画像の外
接矩形切り出し方法を説明するための概略の機能ブロッ
ク図である。
(Embodiment) FIG. 1 shows an embodiment of the present invention, and is a schematic functional block diagram for explaining a method for cutting out a circumscribed rectangle of a document image.

1 この機能ブロックは、多値画像を2値化して2値画像(
白(0);背景パターン色、黒(1);文字パターン色
)を得る2値化処理手段10と、前記2値画像を入力し
て外接矩形を切り出す外接矩形切り出し手段20とで、
構成されている。
1 This functional block binarizes a multivalued image and converts it into a binary image (
A binarization processing means 10 obtains white (0): background pattern color, black (1): character pattern color), and a circumscribed rectangle cutting means 20 inputs the binary image and cuts out a circumscribed rectangle.
It is configured.

2値化処理手段10は、CCD (Charge Co
upled Device )等のイメージセンサを有
し、そのイメージセンサにより情報媒体を走査して多値
画像を得る読取部11を備えている。この読取部11の
出力側には、読み取った多値画像を格納するRAM (
Random Access Memory>等の多値
画像メモリ12と、その多値画像メモリ12内の多値画
像を2値画像に変換する2値化手段13とが、接続され
ている。さらに、2値化手段13の出力側には、その2
値化手段13で変換された2値画像を格納するRAM等
の2値画像メモリ24が接続されている。
The binarization processing means 10 is a CCD (Charge Co.
The image sensor includes a reading unit 11 that scans an information medium using the image sensor to obtain a multivalued image. On the output side of this reading unit 11, there is a RAM (
A multivalued image memory 12 such as Random Access Memory> and a binarization means 13 for converting the multivalued image in the multivalued image memory 12 into a binary image are connected. Further, on the output side of the binarization means 13, the 2
A binary image memory 24 such as a RAM that stores the binary image converted by the value converting means 13 is connected.

外接矩形切り出し手段20は、2値画像メモリ14に格
納された2値画像を走査することにより外接矩形を切り
出すもので、その2値画像のある2 領域範囲内に現われた黒画素は全て同外接矩形領域であ
ると判定する為のそのある領域範囲を設定するマスク設
定手段21を備えている。
The circumscribed rectangle cutting means 20 cuts out a circumscribed rectangle by scanning the binary image stored in the binary image memory 14, and all black pixels appearing within a certain two-area range of the binary image are cut out from the same circumscribed rectangle. A mask setting means 21 is provided for setting a certain area range for determining that the area is a rectangular area.

マスク設定手段21の出力側には、設定したマスク範囲
内に現われた黒画素と注目画素から外接矩形の情報を順
次形成保存する外接矩形検出手段22が接続されている
。さらに、この外接矩形検出手段22には、マスクの大
きさに対応した各黒画素が属する外接矩形情報のメモリ
位置くラベル)を記憶することのできるRAM等のラベ
ル保存ラインメモリ23と、設定したマスク範囲内に現
われた異ラベル番号を記憶することのできるマスクの大
きさ分(実際はかなり少なくてすむ)のラベル保存レジ
スタ24と、順次外接矩形情報を形成、保存していくの
に必要なRAM等の外接矩形位置メモリ25とが、接続
されている。
Connected to the output side of the mask setting means 21 is a circumscribing rectangle detecting means 22 that sequentially forms and stores circumscribing rectangle information from black pixels and pixels of interest that appear within the set mask range. Furthermore, this circumscribed rectangle detection means 22 includes a label storage line memory 23 such as a RAM that can store the circumscribed rectangle information (memory location and label) to which each black pixel belongs corresponding to the size of the mask. A label storage register 24 corresponding to the size of the mask (actually, it can be quite small) capable of storing different label numbers that appear within the mask range, and a RAM necessary to sequentially form and store circumscribed rectangle information. A circumscribed rectangular position memory 25 such as the above is connected.

次に、多値画像の2値化方法(■)、及び外接矩形切り
出し方法(II)〜(I[I)を、第3図〜第7図を参
照しつつ説明する。
Next, the method for binarizing a multivalued image (■) and the methods for cutting out circumscribed rectangles (II) to (I[I) will be explained with reference to FIGS. 3 to 7.

(I>  多値画像の2値化方法 第1図の読取部11は、情報媒体を走査して多値画像を
出力し、それを多値画像メモリ12に格納する。この読
取部11での読み取り解像度は、細かい程良く、8本/
mm以上の解像度が適当である。2値化手段13は、多
値画像メモリ12内の多値画像データを読み込み、その
多値画像データを2値画像に変換し、2値画像メモリ1
4に格納する。この2値画像メモリ14に格納された2
値画像データは、文字バタン画素が黒画素(黒ビット)
、背景バタン画素が白画素(白ビット)で表現される。
(I> Binarization method for multivalued image The reading unit 11 in FIG. 1 scans the information medium to output a multivalued image, and stores it in the multivalued image memory 12. The finer the reading resolution, the better, 8 lines/
A resolution of mm or more is appropriate. The binarization means 13 reads the multivalued image data in the multivalued image memory 12, converts the multivalued image data into a binary image, and converts the multivalued image data into a binary image.
Store in 4. 2 stored in this binary image memory 14
In the value image data, the character slam pixel is a black pixel (black bit)
, background slam pixels are represented by white pixels (white bits).

これらの2値化方法は、例えば文献1.2に記載された
方法等によって実現可能である。
These binarization methods can be realized, for example, by the method described in Document 1.2.

(II)  マスク設定方法 マスク設定手段21では、2値化手段13によって得ら
れた2値画像メモリ14中の2値画像データを走査して
マスクの設定を行う。走査方向1の場合のマスク設定例
を第2図(a)〜(e)に、走査方向2の場合のマスク
設定例を第3図(a)。
(II) Mask setting method The mask setting means 21 scans the binary image data in the binary image memory 14 obtained by the binarizing means 13 to set a mask. Examples of mask settings for scanning direction 1 are shown in FIGS. 2(a) to 2(e), and FIG. 3(a) shows an example of mask settings for scanning direction 2.

(b)に示す。Shown in (b).

2値画像メモリ14中の2値画像データの主走査方向を
、X及びY軸方向のいずれとしても良いが、この実施例
では、第2図(a)及び第3図(b)に示すように、2
値画像データの主走査方向をX軸方向とし、及び副走査
方向をY軸方向とする。また、走査方向を第2図(a)
の走査方向1のように画像の最左上から矢印の方向に走
査しても良いし、第3図(a)の走査方向2のように画
像の最左上から矢印の方向に走査しても良い。
Although the main scanning direction of the binary image data in the binary image memory 14 may be either the X or Y axis direction, in this embodiment, the main scanning direction of the binary image data in the binary image memory 14 is as shown in FIGS. 2(a) and 3(b). ni, 2
The main scanning direction of the value image data is the X-axis direction, and the sub-scanning direction is the Y-axis direction. Also, the scanning direction is shown in Fig. 2(a).
You may scan from the top left of the image in the direction of the arrow, as in scanning direction 1, or you may scan from the top left of the image in the direction of the arrow, as in scanning direction 2 of FIG. 3(a). .

マスク設定手段21では、走査方向1.2の走査方向に
従い、ある領域範囲内に現われた黒画素は全て同外接矩
形領域であると判定する為のマスクの設定を行なう。そ
こで、走査方向1の場合のマスクの設定方法について第
2図(b)〜(e)を用いて、走査方向2の場合のマス
クの設定方法について第3図(b)を用いて説明する。
The mask setting means 21 sets a mask for determining that all black pixels appearing within a certain area are in the same circumscribed rectangular area according to the scanning direction 1.2. Therefore, a mask setting method in the case of scanning direction 1 will be explained using FIGS. 2(b) to 2(e), and a mask setting method in the case of scanning direction 2 will be explained using FIG. 3(b).

第2図(b)〜(e)に示す様に、マスクは任意の大き
さに設定することが出来る。例えば第2図(b)に示す
マスクは4連結、(C)に示すマスクは8連結に相当す
るものである。また第3図5 (b)に示すマスクの設定例は、第2図(C)と同様の
8連結に相当するものである。
As shown in FIGS. 2(b) to 2(e), the mask can be set to any size. For example, the mask shown in FIG. 2(b) corresponds to 4 connections, and the mask shown in FIG. 2(C) corresponds to 8 connections. Further, the example of mask setting shown in FIG. 3(b) corresponds to the same 8-connection as in FIG. 2(C).

これらいずれのマスクの場合においても、注目画素を中
心にマスクを設定するのだが、注目画素より先の(まだ
走査していない)画素の部分はマスクの範囲内に含まな
い様に設定する。
In any of these masks, the mask is set around the pixel of interest, but it is set so that the portion of pixels beyond the pixel of interest (that have not been scanned yet) are not included within the range of the mask.

ここで、次の外接矩形検出手段22では、このマスクの
大きさや形に従って処理を行う為、その処理に必要な情
報について説明する。
Here, since the next circumscribed rectangle detection means 22 performs processing according to the size and shape of this mask, information necessary for the processing will be explained.

まず、注目画素から見たマスク内の画素位置をL1、L
2・・・・・・Lηとし、その画素数を〃、マスクのX
方向の最大画素数をm、x方向の注目画素から左(Xの
小の方向)に見た時の最大画素数をnlとする。同様に
、X方向の注目画素から右(Xの大の方向)に見た時の
最大画素数を02とする。例えば、第2図(C)のマス
クにおいては、1が4 (L1、L2.L3.L4) 
、mが2、nlが1、n2が1となる。
First, the pixel position in the mask as seen from the pixel of interest is L1, L
2...Let Lη be the number of pixels, X of the mask
The maximum number of pixels in the direction is m, and the maximum number of pixels when viewed to the left (in the direction of the small X) from the pixel of interest in the x direction is nl. Similarly, the maximum number of pixels when viewed to the right (the direction of the larger X) from the pixel of interest in the X direction is 02. For example, in the mask of FIG. 2(C), 1 is 4 (L1, L2.L3.L4)
, m is 2, nl is 1, and n2 is 1.

(III)  外接矩形検出方法 外接矩形検出手段22では、マスク設定手段26 1で作成したマスクに従って、そのマスク内に現れた黒
画素は全て同外接矩形領域と判別し、画像を走査しなが
ら外接矩形を順次形成、保存する処理を行う。この処理
手順の一例(i)〜(iii )を、第4図の外接矩形
検出フローチャートに示す。なお、830〜S48は各
ステップを表わす。
(III) Circumscribed rectangle detection method The circumscribed rectangle detection means 22 determines that all black pixels appearing within the mask are in the same circumscribed rectangle according to the mask created by the mask setting means 261, and detects the circumscribed rectangle while scanning the image. Process to form and store sequentially. Examples (i) to (iii) of this processing procedure are shown in the circumscribed rectangle detection flowchart of FIG. Note that 830 to S48 represent each step.

(i) 第4図のステップS30.S31先ず、マスク
設定手段21で作成したマスクの情報を入力しく530
) 、ラベル保存ラインメモリ23とラベル保存レジス
タ24を設定する(S31)。その方法を第5図を用い
て説明する。
(i) Step S30 in FIG. S31 First, input the mask information created by the mask setting means 21 (530).
), the label storage line memory 23 and the label storage register 24 are set (S31). The method will be explained using FIG.

例えば、第5図に示すように、画像の大きさをcols
Xrowsで、マスクを、11 =4 (LL、。
For example, as shown in Figure 5, the size of the image is changed to cols
In Xrows, the mask is 11 = 4 (LL,.

L2.L3.L4) 、rrr−2、n1=1、n21
から成る8連結用のマスク(第2図(C)参照)で設定
した場合、cols+nl (=1>+n2(−1)個
の外接矩形情報のメモリ位置(ラベル)を記憶可能なラ
ベル保存ラインメモリ23をm(=2)個と、N  (
−4)個の異なるラベルを記憶可能なラベル保存レジス
タ24を用意する(実際は、マスク内において隣り合っ
た黒画素が属する外接矩形情報のラベルは同じとなるの
で、ラベル保存レジスタ24に記憶する数はかなり少な
くてすむ)。
L2. L3. L4) , rrr-2, n1=1, n21
When set with an 8-connection mask (see Figure 2 (C)), a label storage line memory that can store cols+nl (=1>+n2(-1) memory locations (labels) of circumscribed rectangle information) is used. m (=2) pieces of 23, and N (
-4) Prepare a label storage register 24 that can store different labels (actually, since the labels of the circumscribed rectangle information to which adjacent black pixels in the mask belong are the same, the number of labels to be stored in the label storage register 24 is ).

ここで、現在の走査ラインの情報をラベル保存ラインメ
モリ2B−1,その前のライン情報をラベル保存ライン
メモリ23−2という様に、走査ラインからm個前の情
報をラベル保存ラインメモリ23−mに保存するものと
する。
Here, information on the current scanning line is stored in the label storage line memory 2B-1, information on the previous line is stored in the label storage line memory 23-2, and so on, information on the mth previous scanning line is stored in the label storage line memory 23-1. It shall be stored in m.

またこれらの関係は、現在の注目位置が第5図にも示す
様に、画像の(x、y)である時、この注目位置の情報
はラベル保存ラインメモリ23−1の(x+n 1 )
に位置する所に保存するものとする。このことは、注目
位置が画像の(1,y)であるとき、マスクに示すL1
、、LJの部分を考慮に入れて処理を簡単化する為であ
る。同様に注目位置が画像の(cols、y)であると
きも、マスクのL3の部分を考慮に入れて処理をする為
である。それ故、cols+nl+n2個の記憶が可能
なラベル保存ラインメモリ23が必要となる。さらに、
マスク内の1  (−4)個のL1、L2、・・・・・
・、 LJ)は、マスク内における位置を示しており、
例えば第5図の場合では、Llはラインメモリ23−2
の(x+n1−1>、L2はラインメモリ23−2の(
x+n1) 、L3はラインメモリ23−2の(x+n
l+1> 、LJはラインメモリ23−1の(x+n1
−1.)という様に表現する。
Furthermore, the relationship between these is that when the current position of interest is (x, y) of the image, as shown in FIG.
shall be stored in a location located at This means that when the position of interest is (1, y) in the image, L1 shown in the mask
,, This is to simplify the processing by taking the LJ portion into consideration. Similarly, when the position of interest is (cols, y) of the image, the L3 portion of the mask is also taken into account in the processing. Therefore, a label storage line memory 23 capable of storing cols+nl+n2 items is required. moreover,
1 (-4) L1, L2 in the mask...
・, LJ) indicates the position within the mask,
For example, in the case of FIG. 5, Ll is the line memory 23-2.
(x+n1-1>, L2 is (x+n1-1>, L2 is (x+n1-1>,
x+n1), L3 is (x+n1) of the line memory 23-2
l+1>, LJ is (x+n1) of line memory 23-1
-1. ).

そして、画像を走査しながら順次外接矩形が形成され、
その情報が外接矩形位置メモリ25に保存される。また
、ラベル保存ラインメモリ23やラベル保存レジスタ2
4には、現在の注目位置を中心に設定したマスク範囲内
において黒画素が存在した場合、外接矩形位置メモリ2
5中の、この黒画素が属する外接矩形情報の保存場所を
示すメモリ位置(ラベル)が記憶されるものとする。
Then, while scanning the image, circumscribed rectangles are sequentially formed,
The information is stored in the circumscribed rectangle position memory 25. In addition, label storage line memory 23 and label storage register 2
4, if a black pixel exists within the mask range set around the current position of interest, the circumscribed rectangle position memory 2
It is assumed that a memory location (label) indicating a storage location of circumscribed rectangle information to which this black pixel belongs in 5 is stored.

以上の点を考慮した上で、第4図のS3]で各メモリの
設定を行う。
After considering the above points, each memory is set in step S3 in FIG. 4.

(ii)  第4図のステップ332〜348次にm個
のラベル保存ラインメモリ(23−19 〜23−m)&二ついて、初期化を行う(S32)。
(ii) Next to steps 332 to 348 in FIG. 4, m label storage line memories (23-19 to 23-m) & two are initialized (S32).

これは各ラベル保存ラインメモリ(cols+n1十n
2個)の各配列に、白画素のラベル情報であるOを初期
値として代入するものである。すなわち、初期値0の場
合は白画素であり、1以上のラベル情報が記述されてい
る場合が黒画素であるということが分る。
This is for each label storage line memory (cols+n1 tenn
O, which is the label information of white pixels, is assigned to each of the (2) arrays as an initial value. That is, if the initial value is 0, it is a white pixel, and if one or more label information is written, it is a black pixel.

全てのラベル保存ラインメモリ23−1〜23mの初期
化が終ると、次に初期値1でyを初期化する(333)
。そして、ラベル保存ラインメモリ23−1の情報をラ
ベル保存ラインメモリ23−2へ、ラベル保存ラインメ
モリ23−2の情報をラベル保存ラインメモリ23−3
へ、ラベル保存ラインメモリ23−(m−1>の情報を
ラベル保存ラインメモリ23〜mへと、各メモリ中の情
報を移動させるラインメモリのシフト(S34)を行う
(なお、ラベル保存ラインメモリ23−1はそのまま)
When all the label storage line memories 23-1 to 23m have been initialized, y is then initialized to the initial value 1 (333).
. Then, the information in the label storage line memory 23-1 is transferred to the label storage line memory 23-2, and the information in the label storage line memory 23-2 is transferred to the label storage line memory 23-3.
Shifting (S34) of the line memory is performed to move the information in each memory to the label storage line memory 23-(m-1>) to the label storage line memory 23-(m-1). 23-1 remains the same)
.

次に、初期値1−でXを初期化する(S35)。Next, X is initialized with an initial value of 1- (S35).

そしてラベル保存ラインメモリ23−1の(X十0 n1、)番目を初期化する(S36)。これは現在の注
目位置のラベル保存ラインメモリ23を初期化するもの
であり、その位置に332と同様に白画素のラベル情報
であるOを初期値として代入するものである。
Then, the (X10 n1,)th label storage line memory 23-1 is initialized (S36). This initializes the label storage line memory 23 at the current position of interest, and similarly to 332, O, which is the label information of the white pixel, is substituted into that position as an initial value.

そして、その時の画像中の注目位W(x、y)が黒画素
か白画素かを判定しく537)、もし黒画素であれば、
m個のラベル保存ラインメモリ23−1〜23−mから
注目位置を中心に設定したマスク範囲内(LL、L2.
・曲・、 L、Ilの位置に相当する部分〉における1
以上(初期値以外)の異なるラベル番号全て(a個)を
ラベル保存レジスタ24に記憶する(S38)。
Then, it is necessary to determine whether the point of interest W (x, y) in the image at that time is a black pixel or a white pixel (537), and if it is a black pixel, then
Within a mask range (LL, L2.
・1 in the part corresponding to the position of L, Il
All (a) different label numbers above (other than the initial value) are stored in the label storage register 24 (S38).

次に、そのラベル保存レジスタ24に記憶された異なる
ラベル番号の個数aが2個以上の場合、ラベル保存レジ
スタ24に記憶されたa個のラベル番号に相当する外接
矩形位置メモリ25に保存されている外接矩形情報を1
つに統合し、保存する(S40)。さらGこ、現在の位
置情報(x、y)とラベル番号に相当する外接矩形位置
メモリ25に保存されている情報を統合し、同ラベル位
置に保存しく841)、その保存したラベル番号をラベ
ル保存ラインメモリ23−1の現在位置(x+nl)に
保存する(843)。
Next, if the number a of different label numbers stored in the label storage register 24 is two or more, the number of different label numbers stored in the label storage register 24 is stored in the circumscribed rectangle position memory 25 corresponding to the a label numbers stored in the label storage register 24. The circumscribed rectangle information is 1
and save it (S40). Furthermore, the current position information (x, y) and the information stored in the circumscribed rectangle position memory 25 corresponding to the label number are integrated and stored at the same label position (841), and the stored label number is added to the label. It is saved at the current position (x+nl) of the save line memory 23-1 (843).

その後、全てのx(cols)について行ったかどうか
を判定しく544) 、もし全てのXについて行ったら
、今度は全てのy(rows)について行ったかどうか
を判定しく545)、もし全てのyについて行ったら、
処理を終了する(346)。
After that, it is determined whether it has been performed for all x (cols) 544), and if it has been performed for all X, then it is determined whether it has been performed for all y (rows) 545). Tara,
The process ends (346).

S45でまだ全てのyについて行っていないと判定され
たら、yの値をインクリメント(増分)しく548)、
S34に戻る。S44でまだ全てのXについて行ってい
ないと判定されたら、Xの値をインクリメントしく54
7)、S36に戻る。
If it is determined in S45 that all y have not been processed yet, the value of y is incremented (548),
Return to S34. If it is determined in S44 that not all X have been processed yet, the value of X is incremented by 54
7), return to S36.

S39で、ラベル保存レジスタ24に記憶された異なる
ラベル番号の個数aが1個ならば、次に841を実行し
、aが0個ならば、新たに(x、y)の座標情報を外接
矩形位置メモリ25に付加しく542)、343を実行
する。また、S37で注目画素(x、y)が白だと判定
されたら、S44を実行する。
In S39, if the number a of different label numbers stored in the label storage register 24 is 1, then 841 is executed, and if a is 0, the coordinate information of (x, y) is newly added to the circumscribing rectangle. In addition to the position memory 25, steps 542) and 343 are executed. Further, if it is determined in S37 that the pixel of interest (x, y) is white, S44 is executed.

(iii )  第4図のステップ840〜843ステ
ツプ340〜84Bの動作について、第6図及び第7図
を参照しつつ、さらに詳細に説明する。
(iii) The operations of steps 840 to 843 and steps 340 to 84B in FIG. 4 will be explained in more detail with reference to FIGS. 6 and 7.

第6図は、第4図における840の動作例を示すフロー
チャートである。
FIG. 6 is a flowchart showing an example of the operation of 840 in FIG.

第6図において、まずラベル保存レジスタ24に記憶さ
れたa個のラベル(A1、A2.・・・・・・。
In FIG. 6, first, a number of labels (A1, A2, etc.) are stored in the label storage register 24.

Aa)を入力する(S50)。初期値2でiを初期化し
た後(S51)、AtとAiのラベルに相当する外接矩
形メモリ25中の外接矩形情報どうしで比較し、最少x
、y座標と最大x、y座標をそれぞれ外接矩形の始点、
終点座標として、その情報をA1のラベルに相当する外
接矩形位置メモリ25に保存する(S52)。次に、全
てのラベル保存ラインメモリ23中のラベルAiなるも
のを、A1のラベルに変更する(853)。そして外接
矩形位置メモリ25のAiのラベルに相当す3 る外接矩形情報を消去しく554)、iがaとなったら
(S55) 、処理を終了する(S56)、また、S5
5で、iがaでなかったら、iの値をインクリメントし
く557) 、S52の処理に戻る。
Aa) is input (S50). After initializing i with the initial value 2 (S51), the circumscribed rectangle information in the circumscribed rectangle memory 25 corresponding to the labels of At and Ai is compared, and the minimum x
, the y coordinate and the maximum x, y coordinates are respectively the starting point of the circumscribed rectangle,
The information is stored as the end point coordinates in the circumscribed rectangle position memory 25 corresponding to the label of A1 (S52). Next, the label Ai in all the label storage line memories 23 is changed to the label A1 (853). Then, the circumscribed rectangle information corresponding to the label of Ai in the circumscribed rectangle position memory 25 is deleted (554), and when i becomes a (S55), the process is terminated (S56).
In step 5, if i is not a, the value of i is incremented (557) and the process returns to step S52.

S54は、外接矩形位置メモリ25のAiのラベルの所
を初期化するということで、これにより、外接矩形情報
が書かれているか、書かれていないかがわかる。なお、
S54によって消去されたラベルの所に、新たに付加さ
れるべく外接矩形情報を保存させても良い。
S54 initializes the label Ai in the circumscribed rectangle position memory 25, and thereby it can be determined whether circumscribed rectangle information has been written or not. In addition,
Circumscribing rectangle information may be saved to be newly added to the label deleted in S54.

第7図は、第4図における840の他の動作例を示すフ
ローチャートである。
FIG. 7 is a flowchart showing another example of the operation of 840 in FIG.

第7図において、まずラベル保存レジスタ24に記憶さ
れたa個のラベルを小さい順にA1、A2、・・・・・
・、Aaと並びかえて入力する(S60)。
In FIG. 7, first, a number of labels stored in the label storage register 24 are sorted in ascending order of A1, A2, etc.
. , Aa and input them (S60).

初期値2でiを初期化した後(S61)、AlとAiの
ラベルに相当する外接矩形位置メモリ25中の外接矩形
情報どうしで比較し、最小x、y座標と最大x、y座標
とをそれぞれ外接矩形の始点。
After initializing i with the initial value 2 (S61), the circumscribed rectangle information in the circumscribed rectangle position memory 25 corresponding to the labels of Al and Ai is compared, and the minimum x, y coordinates and the maximum x, y coordinates are determined. The starting point of each circumscribed rectangle.

4 終点座標として新たに設定し、その情報をA1のラベル
に相当する外接矩形位置メモリ25に保存する(S62
)。全てのラベル保存ラインメモリ23中でラベルAI
なるものをA1のラベルに変更し、Aiより大きいラベ
ルのものはディクリメントする(863)。さらにラベ
ル保存レジスタ24のAi+1.Ai+2.−・・−、
Aaのラベルをディクリメントする(S64)。そして
、外接矩形位置メモリ25のAiのラベル番号に相当す
る外接矩形情報を消去し、Aiの次以降の外接矩形情報
を1つづつ前のラベルへと移動する(S65)。S62
.S63.S64はS65の為の前処理であり、S65
を実行することによって最終的に得られた最大ラベル番
号が、そのまま外接矩形の個数を示すことになる。その
後、jがaとなったら(S66) 、処理を終了する(
S67)。
4 Set new end point coordinates and save the information in the circumscribed rectangle position memory 25 corresponding to the label of A1 (S62
). Label AI in all label storage line memories 23
is changed to the label of A1, and those with labels larger than Ai are decremented (863). Furthermore, Ai+1 of the label storage register 24. Ai+2. −・・−,
The label of Aa is decremented (S64). Then, the circumscribed rectangle information corresponding to the label number of Ai in the circumscribed rectangle position memory 25 is deleted, and the circumscribed rectangle information after Ai is moved one by one to the previous label (S65). S62
.. S63. S64 is preprocessing for S65, and S65
The maximum label number finally obtained by executing will directly indicate the number of circumscribed rectangles. After that, when j becomes a (S66), the process ends (
S67).

S66でまだiがaとならなかったら、iの値をインク
リメントしく568) 、S62の処理に戻る。
If i has not yet become a in S66, the value of i is incremented (568) and the process returns to S62.

第4図の341の処理では、ラベル保存レジス夕24の
A1を入力し、外接矩形位置メモリ25のA1のラベル
番号の外接矩形情報と現在位置(x、y)とを比救し、
最小x、y座標と最大X。
In the process 341 in FIG. 4, A1 in the label storage register 24 is input, and the circumscribed rectangle information of the label number A1 in the circumscribed rectangle position memory 25 is compared with the current position (x, y).
Minimum x, y coordinates and maximum X.

y座標をそれぞれ始点、終点座標としてA1のラベルの
メモリ位置にその情報を保存する(83つでaの値が1
の場合Aa=A1となり、aの値が2以上の場合の84
0でAI、A2.・・・・・・、Aaとラベル番号の小
さい順に並びかえられている〉。
Save the information in the memory location labeled A1 with the y coordinate as the start point and end point coordinate respectively (if the value of a is 1 at 83)
In the case of , Aa = A1, and when the value of a is 2 or more, 84
0 for AI, A2. . . . are rearranged in ascending order of Aa and label number.

第4図の343の処理では、S39でaの値が0となり
、S42の処理を行ったものに関しては、新たに付加し
たラベル番号を、S39でaの値が1、あるいは2個以
上と判別される。S41の処理を行ったものに関しては
、A1の値を、ラベル保存ラインメモリ23−1の現在
位置(x+n1)のところに記憶させる。
In the process of 343 in FIG. 4, the value of a becomes 0 in S39, and for those subjected to the process of S42, the newly added label number is determined to have a value of 1 or 2 or more in S39. be done. For those processed in S41, the value of A1 is stored at the current position (x+n1) of the label storage line memory 23-1.

以上説明したように、本実施例では、次のような利点を
有している。
As explained above, this embodiment has the following advantages.

マスク設定手段21は、2値化して得られた2値画像を
走査してマスクの設定を行う。その後、外接矩形検出手
段22は、設定されたマスクの大きさや形に従って、そ
のマスク内に現れた黒画素は全て同外接矩形領域と判別
し、2値画像を走査しながらその都度連結性を判断し、
ラベル保存ラインメモリ23、ラベル保存レジスタ24
及び外接矩形位置メモリ25を用いて外接矩形を順次形
成、保存し、外接矩形の抽出を行う。そのため、画素単
位(ライン単位)で処理することが可能となり、処理に
用いるメモリ23.25及びレジスタ24の容量を減少
できると共に、処理時間を短縮できる。さらに、1回の
走査でマスクを任意に設定することにより、種々の条件
の外接矩形を的確に抽出することができる。
The mask setting means 21 scans the binary image obtained by binarizing and sets a mask. Thereafter, the circumscribed rectangle detection means 22 determines that all black pixels appearing within the mask are in the same circumscribed rectangular area according to the size and shape of the set mask, and judges connectivity each time while scanning the binary image. death,
Label storage line memory 23, label storage register 24
Then, circumscribed rectangles are sequentially formed and stored using the circumscribed rectangle position memory 25, and the circumscribed rectangles are extracted. Therefore, processing can be performed pixel by pixel (line by line), and the capacity of the memory 23, 25 and register 24 used for processing can be reduced, and the processing time can be shortened. Furthermore, by arbitrarily setting a mask in one scan, it is possible to accurately extract circumscribed rectangles under various conditions.

なお、本発明は図示の実施例に限定されず、マスク設定
手段21及び外接矩形検出手段22等の動作を示すフロ
ーチャートを種々の態様に変形することが可能である。
Note that the present invention is not limited to the illustrated embodiment, and the flowchart showing the operations of the mask setting means 21, the circumscribed rectangle detection means 22, etc. can be modified in various ways.

(発明の効果) 以上詳細に説明したように、第1の発明によれば、2値
化して得られた2値画像を入力し、マスク設定手段によ
ってマスクを任意に設定し、外接7 矩形検出手段により、2値画像を走査しながらその都度
連結性を判断し、外接矩形を順次形成、保存するように
したので、例えば画素単位(ライン単位)で処理するこ
とが可能となり、処理に用いるメモリ容量を減少できる
と共に、処理時間を短縮できる。
(Effects of the Invention) As described above in detail, according to the first invention, a binary image obtained by binarization is input, a mask is arbitrarily set by the mask setting means, and circumscribed 7 rectangle detection is performed. By using this method, connectivity is determined each time a binary image is scanned, and circumscribed rectangles are sequentially formed and saved, making it possible to process, for example, pixel by pixel (line by line), and the memory used for processing. Not only can the capacity be reduced, but also the processing time can be shortened.

第2.第3の発明では、例えば1回の走査でマスクの大
きさ・形を適宜設定することにより、種々の条件の外接
矩形を容易に抽出できる。
Second. In the third invention, for example, by appropriately setting the size and shape of the mask in one scan, circumscribed rectangles under various conditions can be easily extracted.

第4〜第8の発明では、ラベル保存ラインメモリ、ラベ
ル保存レジスタ、及び外接矩形位置メモリを用いること
により、外接矩形の抽出処理をより単純化及び簡単化で
きるという効果がある。
In the fourth to eighth inventions, by using the label storage line memory, the label storage register, and the circumscribed rectangle position memory, there is an effect that the extraction process of the circumscribed rectangle can be further simplified and simplified.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例の機能ブロック図、第2図(a
)〜(e)は第1図における走査方向1の場合のマスク
設定例を示す図、第3図(a)。 (b)は第1図における走査方向2の場合のマスク設定
例を示す図、第4図は第1−図における外接矩形検出の
フローチャート、第5図は第1図にお8 ける外接矩形の検出を説明する図、第6図は第4図にお
ける840のフローチャート、第7図は第4図における
S40の他のフローチャー1〜である。
FIG. 1 is a functional block diagram of an embodiment of the present invention, and FIG. 2 (a
) to (e) are diagrams showing examples of mask settings in the case of scanning direction 1 in FIG. 1, and FIG. 3(a). (b) is a diagram showing an example of mask setting in the case of scanning direction 2 in FIG. 1, FIG. 4 is a flowchart for detecting a circumscribed rectangle in FIGS. 6 is a flowchart of step 840 in FIG. 4, and FIG. 7 is a flowchart 1 to S40 in FIG. 4 for explaining detection.

Claims (1)

【特許請求の範囲】 1、2値化して得られた2値画像をマスク設定手段に入
力し、 前記マスク設定手段により、ある領域内に現れた黒画素
は全て同一外接矩形領域であると判定する為のある領域
を示すマスクを任意に設定した後、外接矩形検出手段に
より、前記マスク設定手段で設定したマスクに従って前
記2値画像を走査しながらその都度連結性を判断し、外
接矩形を順次形成、保存する ことを特徴とする文書画像の外接矩形切り出し方法。 2、請求項1記載の文書画像の外接矩形切り出し方法に
おいて、 前記マスク設定手段は、注目位置より先の未走査画素の
部分が前記マスクの範囲内に含まれていなければ、前記
マスクの大きさ・形を任意に設定する構成にした文書画
像の外接矩形切り出し方法。 3、請求項1記載の文書画像の外接矩形切り出し方法に
おいて、 前記外接矩形検出手段は、前記マスクの設定で作成され
たマスク範囲内に現れた黒画素は全て同一外接矩形領域
と判別し、前記2値画像を走査しながら前記外接矩形を
順次形成、保存していく構成にした文書画像の外接矩形
切り出し方法。 4、請求項1記載の文書画像の外接矩形切り出し方法に
おいて、 前記外接矩形検出手段の実行時に、 前記マスクの大きさに対応した外接矩形情報が保存され
ているラベルをラベル保存ラインメモリに記憶させ、前
記任意に設定したマスク内に存在する異なるラベルをラ
ベル保存レジスタに記憶させ、さらに前記外接矩形情報
を外接矩形位置メモリに保存させることにより、 前記外接矩形を順次形成、保存していく文書画像の外接
矩形切り出し方法。 5、請求項4記載の文書画像の外接矩形切り出し方法に
おいて、 前記ラベル保存ラインメモリは、設定したマスクのn1
、n2分と画像の大きさ分を1つのラベル保存ラインメ
モリとし、前記2値画像の座標値(x、y)に相当する
前記ラベル保存ラインメモリの位置は、所定のラベル保
存ラインメモリの(x+n1)とする文書画像の外接矩
形切り出し方法。 6、請求項4記載の文書画像の外接矩形切り出し方法に
おいて、 前記ラベル保存ラインメモリ及びラベル保存レジスタは
、黒画素の場合にその属する外接矩形情報の記憶されて
いるラベルを保存し、白画素の場合は初期値をそのまま
保存する文書画像の外接矩形切り出し方法。 7、請求項4記載の文書画像の外接矩形切り出し方法に
おいて、 前記外接矩形検出手段は、前記ラベル保存レジスタに記
憶された異なるラベル番号の個数が2個以上の場合、前
記ラベル保存レジスタに記憶されたa個(但し、aは任
意の数)のラベルに相当する外接矩形情報を1つに統合
し保存する第1のステップと、個数が1、2個以上の場
合、現在の注目位置の座標値(x、y)とそのラベル番
号に相当する外接矩形情報とを統合して同ラベル位置に
保存する第2のステップと、個数が0個の場合、新たに
注目位置の座標値(x、y)の情報を外接矩形情報とし
て付加する第3のステップとを、実行する文書画像の外
接矩形切り出し方法。 8、請求項7記載の文書画像の外接矩形切り出し方法に
おいて、 前記ラベル保存レジスタに記憶されたa個のラベルを小
さい順にA1、A2、……Aaと並びかえ、そのA1の
ラベル情報とその他のラベル情報とを比較して新しい情
報を求め、その結果をA1のラベルに新たに保存し、統
合されたラベルの情報を消去し、それ以降のラベルの情
報を前のラベルへと移動し、それに対応して前記ラベル
保存ラインメモリ及びラベル保存レジスタ内の内容も書
きかえ、常に最大ラベルがそのまま外接矩形の個数を示
す構成にした文書画像の外接矩形切り出し方法。
[Claims] A binary image obtained by 1 and binarization is input to a mask setting means, and the mask setting means determines that all black pixels appearing in a certain area are in the same circumscribed rectangular area. After arbitrarily setting a mask indicating a certain area to be scanned, the circumscribed rectangle detection means scans the binary image according to the mask set by the mask setting means, judges the connectivity each time, and sequentially detects the circumscribed rectangle. A method for cutting out a circumscribed rectangle of a document image, the method comprising forming and storing a circumscribed rectangle. 2. The method for cutting out a circumscribed rectangle of a document image according to claim 1, wherein the mask setting means determines the size of the mask if a portion of unscanned pixels beyond the position of interest is not included within the range of the mask. - A method for cutting out a circumscribed rectangle from a document image configured to arbitrarily set the shape. 3. The method for cutting out a circumscribed rectangle of a document image according to claim 1, wherein the circumscribed rectangle detecting means determines that all black pixels appearing within the mask range created by the mask settings are the same circumscribed rectangular area; A method for cutting out a circumscribed rectangle of a document image, in which the circumscribed rectangle is sequentially formed and saved while scanning a binary image. 4. In the method for cutting out a circumscribed rectangle of a document image according to claim 1, when the circumscribed rectangle detection means is executed, a label storing circumscribed rectangle information corresponding to the size of the mask is stored in a label storage line memory. , a document image in which the circumscribed rectangles are sequentially formed and saved by storing different labels existing within the arbitrarily set mask in a label storage register and further storing the circumscribed rectangle information in a circumscribed rectangle position memory. How to cut out the circumscribed rectangle. 5. The method for cutting out a circumscribed rectangle of a document image according to claim 4, wherein the label storage line memory stores n1 of the set mask.
, n2 and the size of the image are set as one label storage line memory, and the position of the label storage line memory corresponding to the coordinate values (x, y) of the binary image is determined by ( x+n1) A method for cutting out a circumscribed rectangle of a document image. 6. The method for cutting out a circumscribed rectangle of a document image according to claim 4, wherein the label storage line memory and the label storage register store a label storing circumscribed rectangle information to which the pixel belongs in the case of a black pixel; In this case, how to cut out the circumscribed rectangle of a document image by saving the initial value as is. 7. In the method for cutting out a circumscribed rectangle of a document image according to claim 4, when the number of different label numbers stored in the label storage register is two or more, the circumscribing rectangle detecting means detects the number of different label numbers stored in the label storage register. The first step is to integrate and save circumscribed rectangle information corresponding to a number of labels (where a is an arbitrary number), and if the number is 1 or 2 or more, the coordinates of the current position of interest are The second step is to integrate the value (x, y) and the circumscribed rectangle information corresponding to its label number and save it at the same label position, and if the number is 0, the coordinate value (x, y) of the target position is newly integrated. y) A third step of adding information as circumscribed rectangle information. 8. In the method for cutting out a circumscribed rectangle of a document image according to claim 7, the a number of labels stored in the label storage register are arranged in ascending order of A1, A2, . . . Aa, and the label information of A1 and other Find new information by comparing with the label information, save the result to the label of A1, delete the information of the integrated label, move the information of subsequent labels to the previous label, and A method for cutting out a circumscribed rectangle of a document image, in which the contents of the label storage line memory and the label storage register are rewritten correspondingly, so that the maximum label always indicates the number of circumscribed rectangles as it is.
JP1278944A 1989-10-26 1989-10-26 Method for segmenting circumscribing rectangle of document image Pending JPH03139783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1278944A JPH03139783A (en) 1989-10-26 1989-10-26 Method for segmenting circumscribing rectangle of document image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1278944A JPH03139783A (en) 1989-10-26 1989-10-26 Method for segmenting circumscribing rectangle of document image

Publications (1)

Publication Number Publication Date
JPH03139783A true JPH03139783A (en) 1991-06-13

Family

ID=17604240

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1278944A Pending JPH03139783A (en) 1989-10-26 1989-10-26 Method for segmenting circumscribing rectangle of document image

Country Status (1)

Country Link
JP (1) JPH03139783A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7599556B2 (en) 2005-08-25 2009-10-06 Joseph Stanley Czyszczewski Apparatus, system, and method for scanning segmentation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7599556B2 (en) 2005-08-25 2009-10-06 Joseph Stanley Czyszczewski Apparatus, system, and method for scanning segmentation

Similar Documents

Publication Publication Date Title
JP3748172B2 (en) Image processing device
JP3904840B2 (en) Ruled line extraction device for extracting ruled lines from multi-valued images
JP4646797B2 (en) Image processing apparatus, control method therefor, and program
US7170647B2 (en) Document processing apparatus and method
JP2001297303A (en) Method and device for recognizing document image and computer readable recording medium
JP4149464B2 (en) Image processing device
US5467410A (en) Identification of a blank page in an image processing system
US6367698B1 (en) Bar code reader for decoding a four state bar code
JP2000207489A (en) Character extracting method and device and record medium
US8229214B2 (en) Image processing apparatus and image processing method
JPH0256708B2 (en)
JP3268552B2 (en) Area extraction method, destination area extraction method, destination area extraction apparatus, and image processing apparatus
JPH03139783A (en) Method for segmenting circumscribing rectangle of document image
JP2003115031A (en) Image processor and its method
JP4182891B2 (en) Image processing device
JP3187895B2 (en) Character area extraction method
JPH08237404A (en) Selection of optical character recognition mode
JPH05128306A (en) Attribute discriminating method for sentence picture
JP3020293B2 (en) Attribute determination method
JP2789647B2 (en) Line image recognition method
JPH06348891A (en) Structure analysis method for graphic coexisting document picture
JPH0535914A (en) Picture inclination detection method
JPH0660220A (en) Area extracting method for document image
KR19990016302A (en) How to recognize documents in chart form
JPH0676108A (en) Tilt detecting method for document image