JP2001184511A - Device, system and method for processing image and storage medium - Google Patents

Device, system and method for processing image and storage medium

Info

Publication number
JP2001184511A
JP2001184511A JP37160699A JP37160699A JP2001184511A JP 2001184511 A JP2001184511 A JP 2001184511A JP 37160699 A JP37160699 A JP 37160699A JP 37160699 A JP37160699 A JP 37160699A JP 2001184511 A JP2001184511 A JP 2001184511A
Authority
JP
Japan
Prior art keywords
area
black
image
region
pixel
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
JP37160699A
Other languages
Japanese (ja)
Inventor
Yukari Toda
ゆかり 戸田
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 JP37160699A priority Critical patent/JP2001184511A/en
Publication of JP2001184511A publication Critical patent/JP2001184511A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an image processor capable of performing the optimal and efficient area division of a multilevel image. SOLUTION: A binarizing means 105 acquires plural binary images from the multilevel image. An area extracting means 107 extracts an area (black area), which includes a pixel group (the set of the groups of black pixels) having a prescribed value, from the plural binary images provided by the binarizing means 105. An area dividing means 110 divides the area provided by the area extracting means 107 on the basis of the crowding state of starting and ending pixels of a pixel group existent inside the relevant area. An area analyzing means 109 analyzes an attribute concerning all the areas provided by the area extracting means 107 and the area dividing means 110.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、例えば、カラー文
書を読み取って得られた多値画像を領域分割する、画像
処理装置、画像処理システム、画像処理方法、及びそれ
を実施するための処理ステップをコンピュータが読出可
能に格納した記憶媒体に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to, for example, an image processing apparatus, an image processing system, an image processing method, and a processing step for performing a region division of a multivalued image obtained by reading a color document. In a computer-readable storage medium.

【0002】[0002]

【従来の技術】近年では、スキャナの普及により、文書
の電子化が進んでいる。そこで、例えば、文書をスキャ
ナで読み取り、その読取画像上で領域分割を行った場
合、次にようなメリットがある。
2. Description of the Related Art In recent years, with the spread of scanners, documents have been digitized. Thus, for example, when a document is read by a scanner and area division is performed on the read image, there are the following merits.

【0003】例えば、スキャナにより、文字領域部と画
像領域部を含む文書A4サイズのカラー文書を300d
piでフルカラー24bit(多値)で読み取った場
合、その読取画像(電子化された文書)の情報量は、約
24Mバイトとなるが、当該読取画像を文字領域部と画
像領域部に分割し、文字領域部については、2値化して
MMR符号化し、画像領域部については、JPEG符号
化等をすることによって、当該読取画像の画質を保ちつ
つ、その情報量を縮小することが可能となる。例えば、
画像によっては、その情報量を1/100程度に縮小す
ることが可能となる。また、文字領域部については、O
CRを行うことによってコード化すれば、後々のファイ
ルの検索も可能となり、他のテキストエディット型アプ
リケーションでの再利用も可能となる。
For example, a scanner converts a document A4 size color document including a character area portion and an image area portion into a 300d document.
When reading in full color 24 bits (multi-valued) with pi, the information amount of the read image (digitized document) is about 24 Mbytes, but the read image is divided into a character area portion and an image area portion, By performing binarization and MMR encoding for the character area portion and performing JPEG encoding and the like for the image area portion, it is possible to reduce the amount of information while maintaining the image quality of the read image. For example,
Depending on the image, the information amount can be reduced to about 1/100. As for the character area, O
If the encoding is performed by performing the CR, the file can be searched later, and the file can be reused in another text editing type application.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来の
画像領域分割方法では、スキャナ等で得られたカラー文
書の読取画像等の多値画像に対して領域分割を行う場
合、多値画像を1つの閾値で二値化して、その二値化画
像に対して領域分割を行っていた。このため、二値化結
果の精度が悪いと、それが領域分割に影響してしまい、
正確な領域分割を行うのが困難であった。また、カラー
文書では、下地や文字領域部等、様々な色部の組み合わ
せが1つの文書内に存在することが考えらるので、1つ
の二値化画像からは、良い領域分割が行えなかった。
However, in the conventional image area dividing method, when multi-valued images such as a read image of a color document obtained by a scanner or the like are divided, one multi-valued image is divided into one. Binarization was performed using a threshold, and region division was performed on the binarized image. For this reason, if the accuracy of the binarization result is poor, it will affect the region division,
It has been difficult to perform accurate region division. Further, in a color document, it is considered that various combinations of color portions, such as a background and a character region portion, may exist in one document. Therefore, good region division cannot be performed from one binarized image. .

【0005】具体的には例えば、図19(a)に示すよ
うな文書900があるとする。文書900において、色
bの領域B上には、”あいうえお”という文字Aが色a
で書かれており、色dの領域D上には、”かきくけこ”
という文字Cが色cで書かれており、これらの文字A、
領域B、文字C、領域Dの各輝度レベルは、上記図19
(b)に示すように、文字A、領域B、文字C、領域D
の順で高輝度レベルの方向に分布しているものとする。
[0005] Specifically, for example, it is assumed that there is a document 900 as shown in FIG. In the document 900, on the area B of the color b, the character A of "
In the area D of the color d, "Kakikukeko"
Is written in color c, and these letters A,
The brightness levels of the area B, the character C, and the area D are as shown in FIG.
As shown in (b), character A, region B, character C, region D
Are distributed in the direction of the high luminance level in this order.

【0006】このような文書900をスキャナで読み取
り、その読取画像を、ある閾値で二値化した場合、その
閾値(二値化閾値)によって、二値化結果が、上記図1
9(c)〜(e)に示すような結果となる。
When such a document 900 is read by a scanner and the read image is binarized by a certain threshold, the binarization result is obtained by the threshold (binarization threshold) shown in FIG.
9 (c) to 9 (e).

【0007】上記図19(c)は、二値化閾値を文字A
の輝度レベルと文字Cの輝度レベルの間の値(同図
(b)中””で示す)とした場合に得られる二値化画
像901を示したものである。上記図19(d)は、二
値化閾値を文字Cの輝度レベルと領域Bの輝度レベルの
間の値(同図(b)中””で示す)とした場合に得ら
れる二値化画像902を示したものである。上記図19
(e)は、二値化閾値を領域Bの輝度レベルと領域Dの
輝度レベルの間の値(同図(b)中””で示す)とし
た場合に得られる二値化画像903を示したものであ
る。したがって、上記図19(b)中””で示す値を
二値化閾値として得られた、同図(d)に示す二値化画
像902でないと、全ての文字を検出できる領域分割は
望めない。
FIG. 19 (c) shows that the binarization threshold is a character A
This figure shows a binarized image 901 obtained when a value between the luminance level of the character C and the luminance level of the character C is indicated (indicated by "" in FIG. 3B). FIG. 19D shows a binarized image obtained when the binarization threshold is set to a value between the luminance level of the character C and the luminance level of the area B (indicated by “” in FIG. 19B). 902. FIG. 19 above
(E) shows a binarized image 903 obtained when the binarization threshold is a value between the luminance level of the region B and the luminance level of the region D (indicated by “” in FIG. It is a thing. Therefore, unless the binarized image 902 shown in FIG. 19D is obtained, in which the value indicated by "" in FIG. 19B is obtained as the binarization threshold, the region division in which all characters can be detected cannot be expected. .

【0008】しかしながら、文字Cの輝度レベルと領域
Bの輝度レベルが、図20に示すように、文字Cの輝度
レベル<領域Bの輝度レベルであった場合、1つの二値
化閾値では、領域分割に最適な二値化画像は得られない
ことになる。
However, if the luminance level of the character C and the luminance level of the area B are such that the luminance level of the character C <the luminance level of the area B, as shown in FIG. An optimal binarized image for division cannot be obtained.

【0009】そこで、上記の問題を解決するために、領
域によって二値化閾値を変化させて二値化を行うアダプ
ティブ閾値二値化方式があるが、例えば、図21(a)
に示すような、黒っぽい色d’(低輝度)の領域D上
に、”かきくけこ”という文字Cが白っぽい色c’(高
輝度)で書かれた文書904に対しては、最適な領域分
割が行えない。すなわち、文字A、領域B、文字C、領
域Dの輝度レベルは、上記図21(b)に示すように、
文字A、領域D、領域B、文字C、の順で高輝度レベル
の方向に分布しており、この状態で、二値化閾値を文字
Aの輝度レベルと領域Dの輝度レベルの間の値(同図
(b)中””で示す)を二値化閾値とした場合、同図
(c)に示す二値化画像905が得られ、二値化閾値を
領域Dの輝度レベルと領域Bの輝度レベルの間の値(同
図(b)中””で示す)とした場合、同図(d)に示
す二値化画像906が得られ、二値化閾値を領域Bの輝
度レベルと文字Cの輝度レベルの間の値(同図(b)
中””で示す)とした場合、同図(e)に示す二値化
画像907が得られることになり、上記アダプティブ閾
値二値化方式であっても、領域分割に最適な二値化画像
は得られない。
In order to solve the above problem, there is an adaptive threshold binarization method in which the binarization is changed by changing the binarization threshold depending on the area. For example, FIG.
For a document 904 in which the character C of “Kakikokeko” is written in a whitish color c ′ (high brightness) on an area D of a dark color d ′ (low brightness) as shown in FIG. Cannot divide. That is, the luminance levels of the character A, the region B, the character C, and the region D are as shown in FIG.
Characters A, D, B, and C are distributed in the direction of the high luminance level in this order. In this state, the binarization threshold is set to a value between the luminance level of the character A and the luminance level of the region D. When (indicated by “” in FIG. 2B) is a binarization threshold, a binarized image 905 shown in FIG. 2C is obtained, and the binarization threshold is set to the luminance level of the area D and the area B. (Indicated by “” in FIG. 2B), a binarized image 906 shown in FIG. 2D is obtained, and the binarization threshold is set to the luminance level of the area B. A value between the luminance levels of the character C ((b) in FIG.
In the case of “medium”, the binarized image 907 shown in FIG. 11E is obtained, and even with the adaptive threshold binarization method, the binarized image optimal for the region division is obtained. Cannot be obtained.

【0010】また、分割された領域の処理(2値化処理
等)は、利便性のため外接矩形をとって、その形状での
処理がなされていた。このため、例えば、図22に示す
ような、黒下地に「ABCDEFG」及び「イロハニホ
ヘト」の白文字が存在する領域910と、白下地に「1
23」、「456」、「798」等の黒文字が存在する
領域911とからなる画像であり、特に、領域911
が、領域910と外接するような形状(外接矩形の形
状)で存在する画像である場合、この外接矩形を単位に
して、例えば、OCRのために2値化処理を実行する
と、図23に示すように、「123」、「456」、
「789」等の黒文字が白下地に存在する領域911
が、通常領域(白下地に黒文字が存在する領域)である
にも関わらず反転されてしまう。
In the processing of the divided areas (binary processing, etc.), a circumscribed rectangle is used for convenience, and processing is performed in the shape of the circumscribed rectangle. Therefore, for example, as shown in FIG. 22, a region 910 where white characters “ABCDEFG” and “Irohanihohet” exist on a black background and “1” on a white background
23 "," 456 "," 798 ", and other areas in which black characters are present.
Is an image existing in a shape circumscribing the region 910 (shape of a circumscribed rectangle), and performing a binarization process for OCR in units of the circumscribed rectangle, as shown in FIG. So, "123", "456",
An area 911 where a black character such as “789” exists on a white background
Is inverted in spite of being a normal area (an area where a black character exists on a white background).

【0011】このときの二値化処理を、外接矩形を単位
にした処理でなく、自由形での処理とすれば、上記の問
題は起こらないが、自由形での処理は、それをサポート
する関数等が必要となり、その分、処理が複雑になって
しまう。これに対して、外接矩形を単位にした処理は、
簡単な構成で効率よく処理することができるが、上記の
問題が起きてしまう。
If the binarization process at this time is not a process in units of circumscribed rectangles but a process in free form, the above problem does not occur, but the process in free format supports it. Functions and the like are required, which complicates the processing. On the other hand, the processing in units of the circumscribed rectangle is
Although the processing can be efficiently performed with a simple configuration, the above problem occurs.

【0012】そこで、本発明は、上記の欠点を除去する
ために成されたもので、多値画像の領域分割を最適に且
つ効率的に行える、画像処理装置、画像処理システム、
画像処理方法、及びそれを実施するための処理ステップ
をコンピュータが読出可能に格納した記憶媒体を提供す
ることを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to eliminate the above-mentioned disadvantages, and has been made in view of the above circumstances.
It is an object of the present invention to provide an image processing method and a storage medium in which processing steps for executing the image processing method are readable by a computer.

【0013】[0013]

【課題を解決するための手段】斯かる目的下において、
第1の発明は、多値画像の領域分割を行う画像処理装置
であって、上記多値画像から複数の量子化画像を取得す
る量子化手段と、上記二値化手段により得られた量子化
画像から、所定値を有する画素群を含む領域を抽出する
領域抽出手段と、上記領域抽出手段により得られた領域
を、当該領域内に存在する画素群の開始画素及び終了画
素の密集状態に基づいて分割する領域分割手段と、上記
領域抽出手段及び上記領域分割手段により得られた各領
域についての属性を解析する領域解析手段を備えること
を特徴とする。
For such a purpose,
According to a first aspect, there is provided an image processing apparatus for performing region division of a multi-valued image, comprising: a quantization unit configured to acquire a plurality of quantized images from the multi-valued image; A region extraction unit that extracts a region including a pixel group having a predetermined value from an image, and a region obtained by the region extraction unit is determined based on a density of start pixels and end pixels of the pixel group existing in the region. And a region analyzing unit that analyzes attributes of each region obtained by the region extracting unit and the region dividing unit.

【0014】第2の発明は、上記第1の発明において、
上記量子化手段は、上記量子化画像として二値化画像を
取得することを特徴とする。
According to a second aspect, in the first aspect,
The quantizing means acquires a binarized image as the quantized image.

【0015】第3の発明は、上記第1の発明において、
上記量子化手段は、上記多値画像における、上記領域抽
出手段の領域抽出結果に基づいた領域部分の量子化画像
を取得することを特徴とする。
According to a third aspect, in the first aspect,
The quantizing means acquires a quantized image of an area portion of the multi-valued image based on an area extraction result of the area extracting means.

【0016】第4の発明は、上記第1の発明において、
上記量子化手段は、上記多値画像のヒストグラムから得
られた複数の閾値に基づいて、上記複数の量子化画像を
取得することを特徴とする。
According to a fourth aspect, in the first aspect,
The quantizing means acquires the plurality of quantized images based on a plurality of thresholds obtained from a histogram of the multi-valued image.

【0017】第5の発明は、上記第1の発明において、
上記領域抽出手段は、上記量子化画像から、上記所定値
を有する画素が一次元的に連続する画素群を検出する検
出手段と、上記検出手段により検出された画素群の座標
情報を保持する第1の保持手段と、上記検出手段により
既に検出された画素群の座標情報を保持する第2の保持
手段と、上記第1の保持手段内の情報と上記第2の保持
手段内の情報の結合処理を行う結合手段とを含むことを
特徴とする。
According to a fifth aspect, in the first aspect,
The region extracting unit includes a detecting unit configured to detect a pixel group in which the pixels having the predetermined value are one-dimensionally continuous from the quantized image, and a second unit that stores coordinate information of the pixel group detected by the detecting unit. (1) holding means, second holding means for holding the coordinate information of the pixel group already detected by the detection means, and combining information in the first holding means and information in the second holding means. And coupling means for performing processing.

【0018】第6の発明は、上記第5の発明において、
上記検出手段は、上記量子化画像上において、Mライン
毎に上記領域の検出を行うことを特徴とする。
According to a sixth aspect based on the fifth aspect,
The detection means detects the area on the quantized image for every M lines.

【0019】第7の発明は、上記第1の発明において、
上記領域抽出手段にて抽出される領域は、一次元的に連
続する画素群を含む外接矩形の領域を含み、上記領域分
割手段は、上記領域抽出手段にて抽出された領域内に含
まれる画素群の開始画素及び終了画素のヒストグラムか
ら、当該開始画素及び終了画素の密集点を検出する第1
の検出手段と、上記第1の検出手段での検出結果に基づ
き得られる分割領域内に存在する画素群の開始画素及び
終了画素について、上記一次元方向とは異なる次元方向
の広がりを検出する第2の検出手段と、上記第2の検出
手段での検出結果に基づいて、領域分割を実行する分割
手段とを含むことを特徴とする。
According to a seventh aspect, in the first aspect,
The region extracted by the region extracting unit includes a circumscribed rectangular region including a one-dimensionally continuous pixel group, and the region dividing unit includes a pixel included in the region extracted by the region extracting unit. A first method for detecting a dense point of the start pixel and the end pixel from the histogram of the start pixel and the end pixel of the group.
Detecting means for detecting a spread in a dimensional direction different from the one-dimensional direction with respect to a start pixel and an end pixel of a pixel group present in a divided area obtained based on a detection result obtained by the first detection means. 2 and a dividing means for performing region division based on the detection result of the second detecting means.

【0020】第8の発明は、複数の機器が通信可能に接
続されてなる画像処理システムであって、上記複数の機
器のうち少なくとも1つの機器は、請求項1〜7の何れ
かに記載の画像処理装置の機能を有することを特徴とす
る。
According to an eighth aspect of the present invention, there is provided an image processing system in which a plurality of devices are communicably connected, wherein at least one device among the plurality of devices is according to any one of claims 1 to 7. It has a function of an image processing device.

【0021】第9の発明は、多値画像の領域分割を行う
ための画像処理方法であって、上記多値画像からから少
なくとも1つ以上の量子化画像を作成し、その量子化画
像から、黒画素の固まりの領域を取得する領域抽出ステ
ップと、上記領域抽出ステップにより得られた黒領域
を、当該黒領域内に存在する黒画素の固まりの開始画素
及び終了画素の密集状態に基づいて分割する領域分割ス
テップと、上記領域抽出ステップ及び領域分割ステップ
により得られた全ての領域に対して、その属性を解析す
る領域解析ステップとを含むことを特徴とする。
A ninth aspect of the present invention is an image processing method for dividing a multi-valued image into regions, wherein at least one or more quantized images are created from the multi-valued image, and An area extracting step of obtaining an area of a cluster of black pixels, and dividing the black area obtained by the area extracting step on the basis of the density of the start pixels and end pixels of the cluster of black pixels existing in the black area. And a region analyzing step of analyzing attributes of all regions obtained by the region extracting step and the region dividing step.

【0022】第10の発明は、上記第9の発明におい
て、上記領域抽出ステップは、上記量子化画像として二
値化画像を作成するステップを含むことを特徴とする。
In a tenth aspect based on the ninth aspect, the area extracting step includes a step of creating a binarized image as the quantized image.

【0023】第11の発明は、上記第9の発明におい
て、上記少なくとも1つ以上の量子化画像の一部は、上
記多値画像の全面から得られた量子化画像ではないこと
を特徴とする。
In an eleventh aspect based on the ninth aspect, a part of the at least one or more quantized images is not a quantized image obtained from the entire surface of the multi-valued image. .

【0024】第12の発明は、上記第9の発明におい
て、上記領域抽出ステップは、上記量子化画像から、一
次元的に連続する黒画素の固まり検出する黒検出ステッ
プと、上記黒検出ステップにより検出された黒画素の固
まりの座標情報を保持する第1の保持ステップと、上記
黒検出ステップにより既に検出された黒画素の固まりの
座標情報を保持する第2の保持ステップと、上記第1の
保持ステップによる保持情報と上記第2の保持ステップ
による保持情報の結合処理を行う結合ステップを含むこ
とを特徴とする。
In a twelfth aspect based on the ninth aspect, the region extracting step includes a black detecting step of detecting a cluster of one-dimensionally continuous black pixels from the quantized image, and a black detecting step. A first holding step of holding the detected coordinate information of the cluster of black pixels, a second holding step of holding the coordinate information of the cluster of black pixels already detected by the black detection step, and the first holding step; The method includes a combining step of combining the held information in the holding step and the held information in the second holding step.

【0025】第13の発明は、上記第12の発明におい
て、上記黒検出ステップは、上記量子化画像上において
Mライン毎に上記検出処理を実行するステップを含むこ
とを特徴とする。
In a thirteenth aspect based on the twelfth aspect, the black detecting step includes a step of executing the detecting process for each M lines on the quantized image.

【0026】第14の発明は、上記第9の発明におい
て、上記領域抽出ステップにより抽出される黒領域は、
一次元的に連続する黒画素の固まりを含む外接矩形の領
域を含み、上記領域分割ステップは、上記領域抽出ステ
ップにより抽出された黒領域内に含まれる黒画素の固ま
りの開始画素及び終了画素のヒストグラムから、当該開
始画素及び終了画素の密集点を検出する第1の検出ステ
ップと、上記第1の検出ステップでの検出結果に基づい
て上記黒領域を分割し、その分割領域内に存在する画素
群の開始画素及び終了画素について、上記一次元方向と
は異なる次元方向の広がりを検出する第2の検出ステッ
プと、上記第2の検出ステップでの検出結果に基づい
て、上記黒領域の分割を実行する分割ステップとを含む
ことを特徴とする。
In a fourteenth aspect based on the ninth aspect, the black area extracted in the area extracting step is:
A circumscribed rectangular area including a cluster of one-dimensionally continuous black pixels is included, and the area dividing step includes a start pixel and an end pixel of a cluster of black pixels included in the black area extracted by the area extracting step. A first detection step of detecting a dense point of the start pixel and the end pixel from the histogram, and dividing the black region based on a detection result in the first detection step; A second detection step of detecting a spread in a dimensional direction different from the one-dimensional direction for the start pixel and the end pixel of the group, and dividing the black area based on a detection result in the second detection step. And a dividing step to be executed.

【0027】第15の発明は、請求項1〜7の何れかに
記載の画像処理装置の機能、又は請求項8記載の画像処
理システムの機能を実施するための処理プログラムを、
コンピュータが読出可能に格納した記憶媒体であること
を特徴とする。
According to a fifteenth aspect, a processing program for implementing the function of the image processing apparatus according to any one of claims 1 to 7 or the function of the image processing system according to claim 8 is provided.
It is a storage medium that is readable by a computer.

【0028】第16の発明は、請求項9〜14の何れか
に記載の画像処理方法の処理ステップを、コンピュータ
が読出可能に格納した記憶媒体であることを特徴とす
る。
According to a sixteenth aspect of the present invention, a computer readable storage medium stores the processing steps of the image processing method according to any one of the ninth to fourteenth aspects.

【0029】[0029]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面を用いて説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0030】本発明は、例えば、図1に示すような画像
処理装置100に適用される。この画像処理装置100
は、上記図1に示すように、入力画像情報(多値画像情
報)から輝度情報(輝度値)を取得する輝度変換部10
1と、輝度変換部101により得られた輝度情報を1画
像分保持する多値画像メモリ102と、多値画像メモリ
102内の輝度情報に基づきヒストグラムを生成するス
トグラム演算部103と、ヒストグラム演算部103に
て得られたヒストグラムに基づき複数の閾値を決定する
閾値決定部104と、ヒストグラム演算部103にて得
られたヒストグラムに基づき最適二値化閾値等を取得す
る領域解析部109と、閾値決定部104や領域解析部
109にて得られた閾値に基づき二値化画像を作成する
二値化部105と、二値化部105にて得られた二値化
画像を保持する二値画像メモリ106と、二値画像メモ
リ106内の二値化画像から黒領域の座標情報を取得す
る黒領域抽出部107と、黒領域抽出部107にて得ら
れた黒領域を解析して必要に応じて当該黒領域を分割し
て複数の黒領域の情報を取得する黒領域分割部110
と、黒領域分割部110及び領域解析部109にて得ら
れた情報を保持する黒領域座標保持部108とを備えて
おり、ヒストグラム演算部103及び二値化部105
は、黒領域座標保持部108内の情報にも基づきそれぞ
れの処理を実行するようになされている。
The present invention is applied to, for example, an image processing apparatus 100 as shown in FIG. This image processing apparatus 100
As shown in FIG. 1, the luminance conversion unit 10 acquires luminance information (luminance value) from input image information (multi-valued image information).
1, a multi-valued image memory 102 for holding the luminance information obtained by the luminance converting unit 101 for one image, a stogram calculating unit 103 for generating a histogram based on the luminance information in the multi-valued image memory 102, and a histogram calculating unit A threshold determination unit 104 for determining a plurality of thresholds based on the histogram obtained in 103; an area analysis unit 109 for obtaining an optimal binarization threshold or the like based on the histogram obtained in the histogram calculation unit 103; A binarizing unit 105 for generating a binarized image based on a threshold value obtained by the unit 104 or the region analyzing unit 109; and a binary image memory for holding the binarized image obtained by the binarizing unit 105 106, a black region extracting unit 107 for obtaining coordinate information of the black region from the binary image in the binary image memory 106, and analyzing the black region obtained by the black region extracting unit 107 Obtaining information of a plurality of black regions by dividing the black area as needed Te black area dividing unit 110
And a black region coordinate storage unit 108 for storing information obtained by the black region division unit 110 and the region analysis unit 109. The histogram calculation unit 103 and the binarization unit 105
Are executed based on the information in the black area coordinate storage unit 108.

【0031】上述のような画像処理装置100は、例え
ば、図2のフローチャートに従って、次のように動作す
る。
The image processing apparatus 100 operates as follows according to, for example, the flowchart of FIG.

【0032】ステップS201:輝度変換部101に対
して入力される多値画像情報(以下、「対象画像」と言
う)は、RGBの三原色の情報からなるカラー画像情報
である。輝度変換部101は、RGBで入力された対象
画像を構成する各画素についての輝度情報(輝度値Y)
を、 Y=0.299R+0.587G+0.114B なる式に従って算出する。多値画像メモリ102は、輝
度変換部101にて得られた輝度値を、1画像(対象画
像)を構成する画素分保持する。
Step S201: The multi-valued image information (hereinafter referred to as "target image") input to the luminance conversion unit 101 is color image information composed of information of three primary colors of RGB. The luminance conversion unit 101 generates luminance information (luminance value Y) for each pixel constituting the target image input in RGB.
Is calculated according to the following equation: Y = 0.299R + 0.587G + 0.114B. The multi-valued image memory 102 holds the luminance values obtained by the luminance conversion unit 101 for the pixels constituting one image (target image).

【0033】ステップS202:ヒストグラム演算部1
03は、多値画像メモリ102から、全画像又は一部画
像を構成する画素分の輝度値Yを読み出し、輝度につい
てのヒストグラムを生成する。ここでは、多値画像メモ
リ102に保持されている対象画像を構成する全ての画
素の輝度値のヒストグラムを生成する。このとき、画像
読取時の解像度及び画像サイズによって、全画素数が変
わってため、画像読取時の解像度及び画像サイズに基づ
き正規化を行った方が好ましい。これは、後述する閾値
決定部104において、複数の閾値を決定する際に、ヒ
ストグラム演算部103にて得られるヒストグラムの遷
移の様子を利用しており、画素数の変化の傾きや画素数
そのものをパラメータとしているためである。
Step S202: Histogram calculation section 1
In step 03, the luminance values Y of the pixels constituting the entire image or a partial image are read from the multi-value image memory 102, and a histogram of the luminance is generated. Here, a histogram of the luminance values of all the pixels constituting the target image held in the multi-valued image memory 102 is generated. At this time, since the total number of pixels changes depending on the resolution and image size at the time of image reading, it is preferable to perform normalization based on the resolution and image size at the time of image reading. This is achieved by using the state of transition of the histogram obtained by the histogram calculation unit 103 when determining a plurality of threshold values in the threshold value determination unit 104 described later, and determining the inclination of the change in the number of pixels and the number of pixels themselves. This is because it is a parameter.

【0034】ステップS203:閾値決定部104は、
ヒストグラム演算部103にて得られたヒストグラムに
基づき、複数の閾値を決定する。
Step S203: The threshold value determining unit 104
A plurality of thresholds are determined based on the histogram obtained by the histogram calculator 103.

【0035】具体的には例えば、対象画像として、図3
(a)に示すような文書の多値画像情報が入力され、そ
の輝度情報が画像メモリ102に保持されている場合、
ヒストグラム演算部103にて得られるヒストグラム
は、図4に示すようなヒストグラムとなる。
Specifically, for example, as an object image, FIG.
When multivalued image information of a document as shown in FIG. 9A is input and the luminance information is held in the image memory 102,
The histogram obtained by the histogram calculator 103 is a histogram as shown in FIG.

【0036】そこで、閾値決定部104は、先ず、上記
図4のヒストグラムにおいて、輝度値”255”(白)
から輝度値”0”(黒)へと向かって対応する画素数を
参照する。このときの参照点は、サンプリングして4間
隔づつ(”255”、”251”、”247”、・・
・)等のようにしても良い。
Therefore, the threshold value determining unit 104 first determines the luminance value “255” (white) in the histogram of FIG.
From the pixel to the brightness value “0” (black). At this time, the reference points are sampled at intervals of four (“255”, “251”, “247”,...).
・), Etc.

【0037】そして、閾値決定部104は、次のような
条件1〜条件6での「条件1を満足一>条件2を満足一
>条件3を満足」に該当する輝度値を閾値として検出す
る。 条件1:参照点から”10”逆上った点までの合計画素
数が閾値1より大きい。 条件2:急激な減少が発生している(「傾き1より大」
が1回、又は「傾き2より大」の状態が連続して2回発
生している等)。 条件3:緩い減少、或いは上昇が発生している(傾き3
より小さい状態)。 条件4:参照点から”40”逆上った点までの合計画素
数が閾値2より大きい。 条件5:参照点の画素数が閾値3より小さい。 条件6:参照点から輝度値が”20”前の画素数が閾値
4より大きい。
Then, the threshold value determination unit 104 detects a luminance value corresponding to “satisfies condition 1> satisfies condition 2> satisfies condition 3” in the following conditions 1 to 6 as a threshold value. . Condition 1: The total number of pixels from the reference point to the point that goes up by "10" is larger than the threshold value 1. Condition 2: A sharp decrease has occurred (“greater than slope 1”)
Once, or the state of “greater than slope 2” occurs twice in succession). Condition 3: A gradual decrease or increase has occurred (slope 3
Smaller state). Condition 4: The total number of pixels from the reference point to a point that is “40” up is larger than the threshold value 2. Condition 5: the number of pixels at the reference point is smaller than threshold value 3. Condition 6: the number of pixels whose luminance value is “20” before the reference point is larger than threshold value 4.

【0038】したがって、上記図4に示すように、”4
01”〜”404”で示す4つの閾値が検出されること
になる。これらの閾値401〜404において、例え
ば、閾値402については、「条件4を満足、且つ条件
5を満足、且つ条件6を満足」に該当する閾値として検
出される。すなわち、条件1〜条件3は、ばらつきの少
ない輝度のかたまりを抽出することを目的とした条件で
あり、条件4〜条件6は、ゆるやかに分布する輝度のか
たまりを抽出することを目的とした条件であり、これら
の条件のうち条件4〜条件6に該当する閾値として、閾
値402が検出される。
Therefore, as shown in FIG.
Four thresholds indicated by 01 "to" 404 "are detected. Among these thresholds 401 to 404, for example, regarding the threshold 402," condition 4 is satisfied, condition 5 is satisfied, and condition 6 is satisfied. It is detected as a threshold value corresponding to “satisfied”. That is, the conditions 1 to 3 are conditions for extracting a cluster of luminance with little variation, and the conditions 4 to 6 are conditions for extracting a cluster of luminance that is slowly distributed. The threshold 402 is detected as a threshold corresponding to the conditions 4 to 6 among these conditions.

【0039】その後、閾値決定部104は、後処理とし
て、上記図4のヒストグラムにおいて、輝度値”0”か
ら輝度値”255”へと向かって対応する画素数を参照
して、存在する画素の合計値を算出し、閾値401〜4
04のうち、累積存在画素数が閾値5より小さいところ
に存在する輝度値に対応する閾値を消去する。この結
果、閾値401〜404のうち、閾値404が消去され
る。閾値決定部104は、残った閾値401〜403
を、二値化部105へ与える二値化閾値として決定す
る。
Thereafter, as a post-processing, the threshold determination unit 104 refers to the number of pixels corresponding to the luminance value “0” to the luminance value “255” in the histogram of FIG. The total value is calculated, and the threshold values 401 to 4
Among 04, the threshold value corresponding to the luminance value existing where the cumulative number of pixels is smaller than the threshold value 5 is deleted. As a result, the threshold 404 among the thresholds 401 to 404 is deleted. The threshold determination unit 104 determines the remaining thresholds 401 to 403
Is determined as a binarization threshold value to be given to the binarization unit 105.

【0040】尚、上述のような閾値決定部104におい
て、後処理での閾値の消去処理は必須の処理ではない。
また、条件1や条件4において、参照点から逆上る値に
ついても、”10”や”40”等に限られるものではな
く、任意の値(スキャナの特性に依存した値等)を用い
るようにしてもよい。また、閾値決定部104での処理
は、上記図4に示したようなヒストグラム上のノイズに
惑わされないように平均化しながら実行するようにして
もよい。また、条件1〜条件6に従って閾値を検出する
際、参照点において、条件1〜条件6がそれぞれ1回発
生したら、当該参照点の輝度値を閾値として決定するの
ではなく、例えば、2回連続して発生した場合に、当該
参照点の輝度値を閾値として決定するようにしてもよ
い。
In the above-described threshold determination section 104, the erasure processing of the threshold in the post-processing is not an essential processing.
Also, in the conditions 1 and 4, the value going up from the reference point is not limited to “10” or “40”, but may be any value (a value depending on the characteristics of the scanner). You may. Further, the processing in the threshold value determination unit 104 may be executed while averaging so as not to be confused by noise on the histogram as shown in FIG. Further, when detecting the threshold value according to the conditions 1 to 6, if the conditions 1 to 6 occur once at the reference point, the luminance value of the reference point is not determined as the threshold value, but, for example, two consecutive times. When the occurrence occurs, the luminance value of the reference point may be determined as the threshold.

【0041】ステップS204:二値化部(単純二値化
部)105は、閾値決定部104にて得られた複数の二
値化閾値、或いは領域解析部109にて得られた後述す
る閾値に基づいて、多値画像メモリ102に保持されて
いる対象画像(対象画像を構成する各画素の輝度情報)
を二値化して、二値化画像を生成する。二値メモリ10
6は、二値化部105にて得られた二値化画像を保持す
る。
Step S204: The binarization section (simple binarization section) 105 converts the plurality of binarization threshold values obtained by the threshold value determination section 104 or the threshold values described later obtained by the region analysis section 109. Based on the target image (the luminance information of each pixel forming the target image)
Is binarized to generate a binarized image. Binary memory 10
Reference numeral 6 holds the binarized image obtained by the binarization unit 105.

【0042】したがって、例えば、対象画像として上記
図3(a)に示した文書の多値画像情報が入力され、二
値化部105において、閾値決定部104にて得られた
複数の二値化閾値401〜403に基づいた二値化画像
の生成が行われた場合、二値メモリ106には、上記図
3(b)〜(c)に示すような二値化画像が保持される
ことになる。上記図3(b)は、二値化閾値401に基
づいた二値化により得られた二値化画像を示したもので
あり、同図(c)は、二値化閾値402に基づいた二値
化により得られた二値化画像を示したものであり、同図
(d)は、二値化閾値403に基づいた二値化により得
られた二値化画像を示したものである。
Therefore, for example, the multi-valued image information of the document shown in FIG. 3A is input as the target image, and the binarization unit 105 outputs a plurality of binarized images obtained by the threshold value determination unit 104. When a binarized image is generated based on the thresholds 401 to 403, the binarized image as shown in FIGS. 3B to 3C is held in the binary memory 106. Become. FIG. 3B shows a binarized image obtained by binarization based on the binarization threshold 401, and FIG. 3C shows a binarized image based on the binarization threshold 402. FIG. 3D shows a binarized image obtained by binarization, and FIG. 4D shows a binarized image obtained by binarization based on the binarization threshold 403.

【0043】ステップS205:黒領域抽出部107
は、二値メモリ106に保持された二値化画像から、黒
領域の座標情報を作成する。例えば、詳細は後述する
が、黒領域抽出部107は、上記図4に示した二値化閾
値401〜403のうち、”白”(輝度値”255”)
に対応する輝度値に一番近い閾値401に基づいた二値
化により得られた二値化画像(上記図3(b)参照)を
二値画像メモリ206から読み出し、その二値化画像に
おいて、”黒”に対応する画素値を有する画素の固まり
の座標を抽出することで、黒領域の座標情報を作成す
る。また、他の閾値により得られた二値化画像について
も同様にして、黒領域の座標情報を作成する。黒領域分
割部110は、黒領域抽出部107にて得られた黒領域
を解析し、必要に応じて、当該黒領域をさらに分割して
複数の黒領域の情報を取得する。黒領域座標保持部10
8は、黒領域分割部110にて得られた黒領域の座標情
報を保持する。
Step S205: Black area extraction unit 107
Creates coordinate information of a black area from the binarized image held in the binary memory 106. For example, although the details will be described later, the black area extraction unit 107 selects “white” (luminance value “255”) among the binarization thresholds 401 to 403 shown in FIG.
The binarized image (see FIG. 3B) obtained by the binarization based on the threshold value 401 closest to the luminance value corresponding to is read out from the binary image memory 206, and in the binary image, By extracting the coordinates of a cluster of pixels having a pixel value corresponding to “black”, coordinate information of a black area is created. Similarly, coordinate information of a black region is created for a binarized image obtained by another threshold. The black region dividing unit 110 analyzes the black region obtained by the black region extracting unit 107, and further divides the black region as necessary to obtain information on a plurality of black regions. Black area coordinate holding unit 10
Numeral 8 holds the coordinate information of the black area obtained by the black area dividing unit 110.

【0044】ステップS206:領域解析部109は、
詳細は後述するが、黒領域座標保持部108に保持され
た全ての黒領域の座標情報に対して、対象黒領域に対応
する画像情報(多値画像メモリ102に保持されている
輝度情報)のヒストグラムを、ヒストグラム演算部10
3により取得し、そのヒストグラムから、対象黒領域が
文字領域であるか否か、文字領域であるならば反転領域
(黒っぽい下地に白っぽい文字が存在する領域)である
か否か、当該下地の平均画素値(平均下地色)、当該文
字の平均画素値(平均文字色)、二値化の際に用いる最
適な二値化閾値等の解析情報(黒領域の属性の解析情
報)を取得する。黒領域座標保持部108は、領域解析
部109にて得られた各種の解析情報を保持する。
Step S206: The area analysis unit 109
As will be described in detail later, the coordinate information of all the black areas held in the black area coordinate holding unit 108 is compared with the image information (luminance information held in the multi-valued image memory 102) corresponding to the target black area. The histogram is calculated by the histogram calculation unit 10
3 to determine whether or not the target black area is a character area, and if it is a character area, whether or not the target black area is an inverted area (an area where a white character exists on a black background), Analysis information (analysis information of the attribute of the black area) such as a pixel value (average background color), an average pixel value (average character color) of the character, and an optimal binarization threshold used for binarization are acquired. The black area coordinate storage unit 108 stores various analysis information obtained by the area analysis unit 109.

【0045】尚、上記図2に示す点線矢印で示す処理に
ついては後述する。また、本実施の形態では、RGBの
カラー画像情報を入力としているが、これに限られるこ
とはなく、例えば、CMYKやLab等、如何なる色空
間の情報でもかまわない。また、RGBのカラー画像情
報を輝度情報に変換して、輝度1次元で二値化を行うよ
うにしているが、これに限られることはなく、例えば、
RGB3次元空間を利用して二値化を行っても良い。
The processing indicated by the dotted arrow shown in FIG. 2 will be described later. Further, in the present embodiment, RGB color image information is input. However, the present invention is not limited to this, and any color space information such as CMYK or Lab may be used. In addition, RGB color image information is converted into luminance information and luminance is one-dimensionally binarized. However, the present invention is not limited to this.
Binarization may be performed using an RGB three-dimensional space.

【0046】図5は、上記図2に示したステップS20
5の黒領域抽出処理を具体的に示したものである。すな
わち、黒領域抽出部107は、上記図5のフローチャー
トに従って、次のように動作する。
FIG. 5 is a flowchart showing the operation of step S20 shown in FIG.
5 specifically illustrates the black region extraction processing of FIG. That is, the black region extraction unit 107 operates as follows according to the flowchart of FIG.

【0047】ステップS501:先ず、例えば、上記図
4に示した二値化閾値401〜403のうち、”白”
(輝度値”255”)に対応する輝度値に一番近い二値
化閾値401に基づいた二値化により得られた二値化画
像(上記図3(b)参照、以下、「対象二値化画像」と
言う)を二値画像メモリ206から読み出し、その対象
二値化画像に対して、予め設定されたサンプリングパラ
メータsample_tateにより示されるライン数
毎に、本処理を実行するためのカウンタj(縦方向(副
走査方向)のカウンタ)を”0”にリセットする。
Step S501: First, for example, among the binarization thresholds 401 to 403 shown in FIG.
(Binarized image obtained by binarization based on the binarization threshold 401 closest to the luminance value corresponding to (luminance value “255”) (see FIG. 3B, hereinafter, “target binary”). ) Is read out from the binary image memory 206, and a counter j () for executing the present process for the target binary image for each number of lines indicated by a preset sampling parameter sample_state The counter in the vertical direction (sub-scanning direction) is reset to “0”.

【0048】ステップS502:カウンタjが、予め設
定された値height(対象二値化画像の縦幅)に達
したか否かを判別する。この判別の結果、「j<hei
ght」でない場合、対象二値化画像に対する本処理が
終了したと認識して本処理を終了する。一方、「j<h
eight」である場合には、次のステップS503か
らの処理を実行する。
Step S502: It is determined whether or not the counter j has reached a preset value height (the vertical width of the target binarized image). As a result of this determination, "j <hei
If it is not “ght”, it recognizes that this processing for the target binary image has been completed, and ends this processing. On the other hand, “j <h
If "right", the processing from the next step S503 is executed.

【0049】ステップS503:ステップS502の判
別の結果、「j<height」である場合、詳細は後
述するが、カウンタjにより示される対象二値化画像上
の1ラインを構成する各画素において、”黒”に対応す
る画素値を有する画素(黒画素)の固まりの組を検出す
る。本ステップS503にて検出された黒画素の固まり
の組数を”linenum”で示す。また、ある1つの
黒画素の固まりの組において、当該固まりの始めの画素
の座標をxstart[x]で示し、終わりの画素の座
標をxend[x]で示す。
Step S503: If "j <height" is determined as a result of the determination in step S502, as will be described in detail later, in each pixel constituting one line on the target binary image indicated by the counter j, " A set of pixels (black pixels) having a pixel value corresponding to “black” is detected. The number of sets of black pixel clusters detected in step S503 is indicated by “linenum”. In a set of one black pixel block, the coordinates of the start pixel of the block are indicated by xstart [x], and the coordinates of the end pixel are indicated by xend [x].

【0050】ステップS504:ステップS503にて
検出された黒画素の固まりの各組(”linenum”
で示される数分の組)のそれぞれに対して、ステップS
505〜S509の処理を実行するためのカウンタl
を”0”にリセットする。
Step S504: Each set ("linenum") of a set of black pixels detected in step S503
Step S)
Counter l for executing the processing of 505 to S509
Is reset to “0”.

【0051】ステップS505:カウンタlが、組数l
inenumに達したか否かを判別する。この判別の結
果、「l<linenum」でない場合、”linen
um”で示される数分の全ての組に対して、ステップS
505〜S509の処理を実行し終えたと認識し、後述
するステップS510へと進む。一方、「l<line
num」である場合、次のステップS506からの処理
を実行する。
Step S505: Counter l is set to l
It is determined whether or not inenum has been reached. As a result of this determination, if “l <linenum” is not satisfied, “linen
um ”for all sets of several minutes.
It recognizes that the processes of 505 to S509 have been executed, and proceeds to step S510 described later. On the other hand, "l <line
num ”, the processing from the next step S506 is executed.

【0052】ステップS506:ステップS505の判
別の結果、「l<linenum」である場合、カウン
タlで示される黒画素の固まりの組の座標xstart
[l]及び座標xend[l]と、後述する既に存在す
る全ての構造体Groupの座標とを比較して、座標x
start[l]及び座標xend[l]により示され
る黒画素の固まりと、当該構造体Groupとの結合処
理を行う。
Step S506: If "l <linenum" as a result of the determination in step S505, the coordinates xstart of the set of black pixel clusters indicated by the counter l
[L] and the coordinates xend [l] are compared with the coordinates of all the existing structures Group described later, and the coordinates x
A connection process is performed between a group of black pixels indicated by start [l] and coordinates xend [l] and the structure Group.

【0053】ステップS507:座標xstart
[l]及び座標xend[l]により示される黒画素の
固まりが、上記既に存在する全ての構造体Groupの
何れとも結合されなかったか否かを判別する。この判別
の結果、座標xstart[l]及び座標xend
[l]により示される黒画素の固まりが、上記既に存在
する全ての構造体Groupの何れかと結合された場合
には、次のステップS508は実行せずに、そのまま後
述するテップS509へと進む。
Step S507: Coordinate xstart
It is determined whether or not the cluster of black pixels indicated by [l] and the coordinate xend [l] has not been combined with any of the above-mentioned existing structures Group. As a result of this determination, the coordinates xstart [l] and the coordinates xend
If the cluster of black pixels indicated by [1] is combined with any of the existing structural groups, the next step S508 is not executed, and the process directly proceeds to step S509 described later.

【0054】ステップS508:ステップS507での
判別の結果、座標xstart[l]及び座標xend
[l]により示される黒画素の固まりが、上記既に存在
する全ての構造体Groupの何れかとも結合されなか
った場合、座標xstart[l]及び座標xend
[l]により示される黒画素の固まりを、新規の構造体
Groupへ登録する。この登録された構造体Grou
pが、上述したステップS506での結合処理にて用い
られる。尚、ここでの”構造体Group”についての
詳細は後述する。
Step S508: As a result of the judgment in step S507, the coordinates xstart [l] and the coordinates xend
If the cluster of black pixels indicated by [l] is not connected to any of the above-mentioned existing structures Group, the coordinates xstart [l] and the coordinates xend
The cluster of black pixels indicated by [l] is registered in a new structure Group. This registered structure Grou
p is used in the combining process in step S506 described above. The details of the “structure group” here will be described later.

【0055】ステップS509:座標xstart
[l]及び座標xend[l]により示される黒画素の
固まりの次の固まりの組に対して、ステップS505か
らの処理を実行するために、カウンタlをインクリメン
ト(l=l+1)して、ステップS505へと戻る。
Step S509: coordinate xstart
The counter l is incremented (l = l + 1) to execute the processing from step S505 on the next set of black pixels indicated by [l] and the coordinates xend [l]. It returns to S505.

【0056】ステップS510:上述のようにして、黒
画素の固まりの全ての組に対して、ステップS505〜
ステップS509の処理が実行し終えると、縦方向のカ
ウンタjに対して、サンプリングパラメータsampl
e_tateを加算して、ステップS502へと戻る。
これにより、サンプリングパラメータsample_t
ateが、例えば、”1”である場合には、対象二値化
画像に対して1ライン毎に本処理が実行され、”4”で
ある場合には、対象二値化画像に対して4ライン毎に本
処理が実行されることになる。
Step S510: As described above, steps S505 to S505 are executed for all the sets of the black pixel clusters.
When the processing of step S509 is completed, the sampling parameter sampl is added to the vertical counter j.
e_state is added, and the process returns to step S502.
Thereby, the sampling parameter sample_t
If ate is, for example, “1”, this processing is executed for each line of the target binary image, and if “ate” is “4”, 4 is applied to the target binary image. This processing is executed for each line.

【0057】図6は、上記図5に示したステップS50
3の黒画素の固まりの組の検出処理を具体的に示したも
のである。
FIG. 6 is a flowchart showing step S50 shown in FIG.
3 specifically illustrates a detection process of a set of a set of black pixels of No. 3;

【0058】ステップS601:先ず、対象ライン(縦
方向のカウンタjにより示される対象二値化画像におけ
るライン)を構成する全ての画素に対して、予め設定さ
れたサンプリングパラメータsample_yokoに
より示される画素数毎に、本処理を実行するためのカウ
ンタi(横方向(主走査方向)のカウンタ)を”0”に
リセットする。また、後述するステップ処理にて用いる
フラグstartflagを”OFF”にセットすると
共に、黒画素の固まりの組数を示す”linenum”
を”0”にリセットする。
Step S601: First, for every pixel constituting the target line (the line in the target binary image indicated by the vertical counter j), for each pixel number indicated by the preset sampling parameter sample_yoko Then, the counter i (the counter in the horizontal direction (main scanning direction)) for executing this processing is reset to “0”. In addition, a flag "startflag" used in the step processing described later is set to "OFF", and "linenum" indicating the number of groups of black pixels is set.
Is reset to “0”.

【0059】ステップS602:カウンタiが、予め設
定された値width(対象二値化画像の横幅)に達し
たか否かを判別する。この判別の結果、「i<widt
h」でない場合、後述するステップS613へと進み、
「i<width」である場合、次のステップS603
へと進む。
Step S602: It is determined whether or not the counter i has reached a predetermined value width (width of the target binarized image). As a result of this determination, “i <widt
h ”, the process proceeds to step S613 described below,
If “i <width”, the next step S603
Proceed to.

【0060】ステップS603:ステップS602の判
別の結果、「i<width」である場合、対象ライン
において、カウンタiで示される画素を中心として、横
m×縦n画素のウィンドウエリアを設け、そのエリアに
対して、予め設定された横m×縦n画素のパターンデー
タによるパタンマッチングを行う。そして、上記ウィン
ドウエリアとパターンデータが一致しているか否かを判
別する。この判別の結果、一致している場合には次のス
テップS604へ進み、不一致である場合には後述する
ステップS607へ進む。
Step S603: If “i <width” as a result of the discrimination in step S602, a window area of width m × n pixels is provided around the pixel indicated by the counter i in the target line, and the area is set. , Pattern matching is performed using preset pattern data of horizontal m × vertical n pixels. Then, it is determined whether or not the window area matches the pattern data. As a result of this determination, if they match, the process proceeds to the next step S604, and if they do not match, the process proceeds to step S607 described later.

【0061】尚、ステップS603において、パタンマ
ッチングを行う横m×縦n画素のウィンドウエリアとし
ては、例えば、横7×縦1画素のように横方向のみ参照
するエリアであってもよいし、横3×縦3画素のように
上下参照するエリアであってもよい。また、パタンマッ
チングの代わりに、次のような条件式1や2等の条件を
用いて、ステップS604へ進むか、ステップS607
へ進むかを決定するようにしてもよい。 条件式1:カウンタiで示される画素(注目画素)が黒
画素である。 条件式2:注目画素の隣あう2つの画素が黒画素であ
る。
In step S603, the window area of horizontal m × vertical n pixels for performing pattern matching may be, for example, an area which is referred to only in the horizontal direction, such as horizontal 7 × vertical 1 pixel, or horizontal. It may be an area that is vertically referenced, such as 3 × 3 vertical pixels. In addition, instead of pattern matching, the process proceeds to step S604 using conditions such as the following conditional expressions 1 and 2, or proceeds to step S607.
It may be determined whether to proceed to. Conditional expression 1: The pixel indicated by the counter i (pixel of interest) is a black pixel. Conditional expression 2: Two pixels adjacent to the target pixel are black pixels.

【0062】ステップS604:ステップS603の判
別の結果、上記ウィンドウエリアとパターンデータが一
致している場合、フラグstartflagが”OF
F”であるか否かを判別する。この判別の結果、「st
artflag=OFF」である場合、次のステップS
605へと進み、「startflag=OFF」でな
い場合には、次のステップS605及びS606は実行
せずに、そのまま後述するステップS612へと進む。
Step S604: If the window area and the pattern data match as a result of the determination in step S603, the flag startflag is set to "OF".
F "is determined. As a result of this determination," st "
If "artflag = OFF", the next step S
Proceeding to step 605, if not “startflag = OFF”, the next step S605 and S606 are not executed, and the process directly proceeds to step S612 described later.

【0063】ステップS605:ステップS604の判
別の結果、「startflag=OFF」である場
合、黒画素の固まりの組の始めの画素の座標を示すxs
tart[linenum]に対して、カウンタiを設
定する。すなわち、現在の”linenum”の値で示
される黒画素の固まりの組(対象組)の始めの画素の座
標を示すxstart[linenum]に対して、カ
ウンタiで示される画素(注目画素)の座標を設定す
る。また、フラグstartflagに対して、xst
art[linenum]への設定が終了し、xend
[linenum]への設定が未だ終了していないこと
を示すために、”ON”を設定する。
Step S605: If “startflag = OFF” as a result of the determination in step S604, xs indicating the coordinates of the first pixel of the set of black pixels is set.
A counter i is set for start [linenum]. That is, with respect to xstart [linenum] indicating the coordinates of the first pixel of the set of black pixels (target set) indicated by the current value of “linenum”, the coordinates of the pixel (target pixel) indicated by the counter i Set. Also, for the flag startflag, xst
art [linenum] has been set and xend
“ON” is set to indicate that the setting to [linenum] has not been completed.

【0064】ステップS612:カウンタi(横方向
(主走査方向)のカウンタ)画素に対して、サンプリン
グパラメータsample_yokoを加算して、ステ
ップS602へと戻る。これにより、サンプリングパラ
メータsample_yokoが、例えば、”1”であ
る場合には、対象ラインに対して1画素毎に本処理が実
行され、”4”である場合には、対象ラインに対して4
画素毎に本処理が実行されることになる。そして、ステ
ップS602において、「i<width」でないと判
別されると、次のステップS613へと進む。
Step S612: The sampling parameter sample_yoko is added to the pixel of the counter i (counter in the horizontal direction (main scanning direction)), and the process returns to step S602. Accordingly, when the sampling parameter sample_yoko is, for example, “1”, the present process is executed for each pixel on the target line, and when the sampling parameter sample_yoko is “4”, 4 for the target line.
This processing is executed for each pixel. If it is determined in step S602 that “i <width” is not satisfied, the process proceeds to the next step S613.

【0065】ステップS613:ステップS602の判
別の結果、「i<width」でない場合、フラグst
artflagが”ON”であるか否かを判別する。こ
の判別の結果、「startflag=ON」でない場
合、すなわち「i<width」でなく、且つ「sta
rtflag=ON」でない場合、対象ラインの黒画素
の固まりの全ての組の検出が終了したと認識し、本処理
を終了する。一方、「startflag=ON」であ
る場合には、後述するステップS608へと進む。
Step S613: If the result of determination in step S602 is that "i <width" is not satisfied, the flag st
It is determined whether or not artflag is “ON”. If the result of this determination is not “startflag = ON”, that is, not “i <width” and “staflag = ON”,
If “rtflag = ON” is not satisfied, it is recognized that the detection of all the sets of black pixels on the target line has been completed, and this processing ends. On the other hand, if “startflag = ON”, the process proceeds to step S608 described below.

【0066】ステップS607:また、上述したステッ
プS603において、対象ラインのカウンタiで示され
る画素を中心とした横m×縦n画素のウィンドウエリア
と、予め設定された横m×縦n画素のパターンデータと
が一致しないと判別された場合、フラグstartfl
agが”ON”であるか否かを判別する。この判別の結
果、「startflag=ON」でない場合、次のス
テップS608〜ステップS611の処理は実行せず
に、そのまま上述したステップS612へ進む。一方、
「startflag=ON」である場合には、次のス
テップS608へと進む。
Step S607: Also, in the above-mentioned step S603, a window area of horizontal m × vertical n pixels centering on the pixel indicated by the counter i of the target line and a predetermined pattern of horizontal m × vertical n pixels If it is determined that the data does not match, the flag startfl
It is determined whether or not ag is “ON”. If the result of this determination is not “startflag = ON”, the processing proceeds to the above-described step S612 without executing the processing of the next steps S608 to S611. on the other hand,
If “startflag = ON”, the process proceeds to the next step S608.

【0067】ステップS608:ステップS613又は
ステップS607にて、「startflag=ON」
であると判別された場合、黒画素の固まりの組の終わり
の画素の座標を示すxend[linenum]に対し
て、”カウンタi−1”を設定する。すなわち、”li
nenum”で示される黒画素の固まりの組(対象組)
の終わりの画素の座標を示すxend[linenu
m]に対して、カウンタiで示される画素(注目画素)
の前の画素の座標を設定する。
Step S608: In step S613 or step S607, "startflag = ON"
When it is determined that “xend [linenum]” indicates the coordinates of the pixel at the end of the set of black pixels, “counter i−1” is set. That is, "li
set of black pixels indicated by “nenum” (target set)
Xend [linemenu indicating the coordinates of the pixel at the end of
m], the pixel indicated by the counter i (pixel of interest)
Set the coordinates of the pixel before.

【0068】ステップS609:”xend[line
num]−xstart[linenum]+1”の結
果が、予め設定された、対象二値化画像の横幅の制限値
del_widthより大きいか否かを判別する。この
判別の結果、「”xend[linenum]−xst
art[linenum]+1”>del_widt
h」でない場合、次のステップS610の処理は実行せ
ずに、そのまま後述するステップS611へ進み、「”
xend[linenum]−xstart[line
num]+1”>del_width」である場合に、
次のステップS611へ進む。
Step S609: "xend [line
It is determined whether or not the result of [num] -xstart [linenum] +1 "is greater than a preset limit value del_width of the target binarized image. As a result of this determination,""xend [linenum]- xst
art [linenum] +1 "> del_widt
If it is not "h", the process of the next step S610 is not executed, and the process directly proceeds to step S611, which will be described later.
xend [linenum] -xstart [line
num] +1 ">del_width",
The process proceeds to the next step S611.

【0069】ステップS610:ステップS609の判
別の結果、「”xend[linenum]−xsta
rt[linenum]+1”>del_width」
である場合、”xstart[linenum]”及
び”xend[linenum]”で示される画素の固
まりの組を、現在の”linenum”の値で示される
黒画素の固まりの組として決定し、次の組の検出のため
に、”linenum”をインクリメントする。
Step S610: As a result of the determination in step S609, "" xend [linenum] -xsta
rt [linenum] +1 ">del_width"
, The set of pixels indicated by “xstart [linenum]” and “xend [linenum]” is determined as the set of black pixels indicated by the current value of “linenum”. "Linenum" is incremented for the detection of.

【0070】ステップS611:フラグstartfl
agを”OFF”に設定して、上述したステップS61
2へ進む。尚、ステップS609の判別の結果、「”x
end[linenum]−xstart[linen
um]+1”>del_width」でない場合、ステ
ップS609は実行されないため、すなわち”line
num”をインクリメントされないため、現在の”xs
tart[linenum]”及び”xend[lin
enum]”の値は、ステップS611からの処理にて
上書きされる。すなわち、”xstart[linen
um]”及び”xend[linenum]”で示され
る画素の固まりの組は、黒画素の固まりの組として認識
されず、事実上その組は削除されることになる。
Step S611: Flag startfl
ag is set to “OFF” and the above-described step S61 is performed.
Proceed to 2. Note that as a result of the determination in step S609, "" x
end [linenum] -xstart [linen
um] +1 ”> del_width”, the step S609 is not executed, ie, “line
num "is not incremented, so the current" xs
start [linenum] "and" xend [lin
enum] ”is overwritten in the processing from step S611. That is,“ xstart [linen]
um] "and" xend [linenum] "are not recognized as a set of black pixels, and are effectively deleted.

【0071】図7は、上述のようにして得られた黒画素
の固まりの組の構造体の一例を示したものである。
FIG. 7 shows an example of a structure of a set of a group of black pixels obtained as described above.

【0072】上記図6に示した処理では、黒画素の固ま
りの組が、上記図7の”701”で示す構造体Part
sとして生成される。ここでは、開くウィンドウを1次
元として、X方向の座標のみを有するものとしている
が、これに限られることはなく、上記図7の”701
a”で示すように、ウィンドウを2次元として、構造体
Partsのメンバーにy方向の情報をも含ませるよう
にしてもよい。
In the processing shown in FIG. 6, a set of black pixels is converted into a structure Part 701 indicated by "701" in FIG.
s. Here, the window to be opened is one-dimensional and has only the coordinates in the X direction. However, the present invention is not limited to this.
As shown by "a", the window may be two-dimensional, and the members of the structure Parts may include information in the y direction.

【0073】構造体Partsは、上述したxstar
t[linenum]及びxend[linenum]
に対応する黒画素の固まりの組の開始座標及び終了座標
を示す情報(メンバー)”startx”及び”end
x”と、次の情報のアドレス情報”next”とを含ん
でいる。アドレス情報”next”には、次の情報がな
い場合には”NULL”が設定される。
The structure Parts is the xstar described above.
t [linenum] and xend [linenum]
(Members) "startx" and "end" indicating the start coordinates and end coordinates of a set of black pixels corresponding to
x "and address information" next "of the next information, and" NULL "is set in the address information" next "when there is no next information.

【0074】上記図5に示した処理では、上記図6に示
した処理にて得られた黒画素の固まりの組(構造体Pa
rts)が結合される、上記図7の”702”で示す構
造体Groupが生成される。構造体Groupは、開
始座標及び終了座標を2次元的に示す情報”sx”、”
sy”、”ex”、及び”ey”と、構造体Group
を構築する構造体Partsの集まりの1番目の構造体
Partsのアドレスの情報”first”と、構造体
Groupを構築する構造体Partsの集まりの最後
の構造体Partsのアドレスの情報”lastとを含
み、これらの情報は、黒領域抽出部107で生成され
る。
In the processing shown in FIG. 5, a set of black pixels (structure Pa) obtained by the processing shown in FIG.
rts) are combined, and a structure Group indicated by “702” in FIG. 7 is generated. The structure Group includes information “sx” and “sx” that indicate the start coordinate and the end coordinate two-dimensionally.
sy ”,“ ex ”, and“ ey ”, and the structure Group
The information “first” of the address of the first structure Parts of the collection of the structures Parts that constructs the structure “Parts”, and the information “last” of the address of the last structure Parts of the collection of the structures Parts that construct the structure Group These pieces of information are generated by the black region extraction unit 107.

【0075】また、構造体Groupは、構造体Gro
upが示す領域を二値化するのにふさわしい閾値の情
報”Threshold”、構造体Groupが示す領
域が文字領域であるか文字以外の領域(画像領域等)で
あるかを示すフラグ情報”CharaFlg”と、構造
体Groupが示す領域が文字領域である場合に当該領
域が反転文字領域(下地が黒っぽく、文字部が白っぽい
領域)であるか否かを示すフラグ情報”InvertF
lg”と、構造体Groupが示す領域の黒領域部分の
形状が四角であるか否かを示すフラグ情報”Shape
Rectangle”と、構造体Groupが示す領域
が抽出された二値化画像を作成した閾値より1つ前の閾
値にて作成された二値化画像上にほぼ同じオブジェクト
が存在するか否かを示すフラグ情報”SameAsMo
ther”と、次の構造体Groupのアドレスを示す
ポインタ情報”next”とを含み、これらの情報は、
領域解析部109にて生成される。ポインタ情報”ne
xt”には、次の構造体Groupがない場合には”N
ULL”が設定される。
The structure Group is composed of the structure Gro
Threshold information “Threshold” suitable for binarizing the area indicated by “up”, and flag information “CharaFlg” indicating whether the area indicated by the structure Group is a character area or a non-character area (eg, an image area). And flag information "InvertF indicating whether or not the region indicated by the structure Group is a character region, whether or not the region is an inverted character region (a black background and a white character portion).
lg "and flag information" Shape indicating whether or not the shape of the black area portion of the area indicated by the structure Group is square.
Rectangle ”indicates whether or not substantially the same object exists on the binarized image created with the threshold value one immediately before the threshold value that created the binarized image in which the region indicated by the structure Group is extracted. Flag information "SameAsMo
ther "and pointer information" next "indicating the address of the next structure Group.
It is generated by the area analysis unit 109. Pointer information "ne
xt ”includes“ N ”when there is no next structure Group.
"ULL" is set.

【0076】図8(a)〜(f)は、黒領域抽出部10
7での上記図5及び図6に示した処理の実行により、対
象二値化画像上では、どのような処理が実際に行われる
かを具体的に示したものである。
FIGS. 8A to 8F show the black region extracting unit 10.
By executing the processing shown in FIGS. 5 and 6 in FIG. 7, what kind of processing is actually performed on the target binarized image is specifically shown.

【0077】上記図8(a)参照:先ず、上記図5に示
したステップS503において、二値化画像上のy座標
=”5”のライン(上記図5の処理でのカウンタjが”
5”であるときの対象ライン)上の、xstart
[5]及びxend[15]で示される黒画素の固まり
の組(構造体Parts)801と、xstart[5
0]及びxend[65]で示される黒画素の固まりの
組(構造体Parts)802とが検出されたとする。
Referring to FIG. 8A, first, in step S503 shown in FIG. 5, the line of the y coordinate = “5” on the binarized image (the counter j in the processing of FIG.
Xstart on the target line when it is 5 ")
A set (structure Parts) 801 of a group of black pixels indicated by [5] and xend [15], and xstart [5]
0] and xend [65], and a set (structure Parts) 802 of a group of black pixels is detected.

【0078】このとき、既に存在する構造体Group
は無い状態であるので、ステップS508において、新
規の2つの構造体Groupが作成され、これらの構造
体Groupのメンバーとして、構造体Parts80
1,802がそれぞれ登録(設定)される。
At this time, the existing structure Group
In step S508, two new structure groups are created, and as a member of these structure groups, the structure Parts80 is created.
1, 802 are respectively registered (set).

【0079】この場合、構造体Parts801につい
ての、上記図7に示した構造体Parts及び構造体G
roupの各メンバーの値には、次のような値が設定さ
れる。 startx=5(xstart[5]の値) endx =15(xend[15]の値) sx =5(xstart[5]の値) sy =5(カウンタjの値) ex =15(xend[15]の値) ey =6(sample_tate=1とし
て、”j+sample_tate”の値) first =構造体Parts801のアドレス last =構造体Parts801のアドレス また、構造体Parts802についても、構造体Pa
rts801の場合と同様にして、上記図7に示した構
造体Parts及び構造体Groupの各メンバーに該
当する値が設定される。尚、上記図8では、構造体Pa
rtsを黒塗りで示し、構造体Groupを白枠で示し
ている。
In this case, with respect to the structure Parts 801, the structure Parts and the structure G shown in FIG.
The following values are set as the values of the members of the group. startx = 5 (value of xstart [5]) endx = 15 (value of xend [15]) sx = 5 (value of xstart [5]) sy = 5 (value of counter j) ex = 15 (xend [15] Ey = 6 (value of “j + sample_date” where sample_state = 1) first = address of structure Parts 801 last = address of structure Parts 801 Also, for structure Parts 802, structure Pa
As in the case of rts801, values corresponding to the members of the structure Parts and the structure Group shown in FIG. 7 are set. In FIG. 8, the structure Pa
rts is shown in black, and the structure Group is shown in a white frame.

【0080】上記図8(b)参照:次に、ステップS5
03において、二値化画像上のy座標=”5”のライン
の次のライン(カウンタjがカウントアップされ”6”
であるときの対象ライン)上の、xstart[0]及
びxend[10]で示される黒画素の固まりの組(構
造体Parts)803と、xstart[45]及び
xend[75]で示される黒画素の固まりの組(構造
体Parts)804と、xstart[100]及び
xend[110]で示される黒画素の固まりの組(構
造体Parts)805との3つの組が検出されたとす
る。
Referring to FIG. 8B: Next, at step S5
At 03, the line next to the line of the y coordinate = “5” on the binarized image (counter j is counted up to “6”)
, A set (structure Parts) 803 of black pixels indicated by xstart [0] and xend [10], and black pixels indicated by xstart [45] and xend [75] It is assumed that three sets of a set (structure Parts) 804 and a set of black pixels (structure Parts) 805 indicated by xstart [100] and xend [110] are detected.

【0081】このとき、既に存在する構造体Group
としては、構造体Parts801,802の構造体G
roup801’,802’が存在するため、ステップ
S506にて、構造体Group801’,802’に
対する構造体Parts803〜805の結合処理(座
標比較による結合処理)が行われる。
At this time, the already existing structure Group
As the structure G of the structures Parts 801 and 802
Since the groups 801 ′ and 802 ′ exist, in step S 506, the joining processing of the structural parts 803 to 805 (joining processing by coordinate comparison) to the structural groups 801 ′ and 802 ′ is performed.

【0082】上記結合処理により、例えば、構造体Pa
rts803は、構造体Group801’と接触して
いるので、その構造体Group801’に結合され
る。この結果、構造体Group801’は、上記図8
(c)の”806”に示す構造体Groupに成長す
る。また、構造体Parts804は、構造体Grou
p802’と接触しているので、その構造体Group
802’に結合される。この結果、構造体Group8
02’は、上記図8(c)の”807”に示す構造体G
roupに成長する。構造体Parts805について
は、構造体Group801’,802’の何れにも接
触していないので(結合できない)、ステップS508
において、新規の構造体Groupが作成され、この構
造体Groupのメンバーとして、構造体Parts8
05が登録(設定)される。
By the above coupling process, for example, the structure Pa
Since the rts 803 is in contact with the structure Group 801 ′, it is coupled to the structure Group 801 ′. As a result, the structure Group 801 ′ corresponds to FIG.
The structure grows to the structure Group indicated by “806” in (c). In addition, the structure Parts 804 is a structure Grou.
Since it is in contact with p802 ', its structure Group
802 '. As a result, the structure Group8
02 ′ is the structure G shown in “807” in FIG.
grow into a loop. Since the structure Parts 805 does not come into contact with any of the structure groups 801 ′ and 802 ′ (cannot be combined), step S508 is performed.
, A new structure Group is created, and as a member of the structure Group, the structure Parts8
05 is registered (set).

【0083】上記図8(c)参照:次に、ステップS5
03において、二値化画像上のy座標=”6”のライン
の次のライン(カウンタjがカウントアップされ”7”
であるときの対象ライン)上の、xstart[65]
及びxend[105]で示される黒画素の固まりの組
(構造体Parts)808が検出されたとする。
Referring to FIG. 8C: Next, at step S5
At 03, the line next to the line at y coordinate = “6” on the binarized image (counter j is counted up to “7”
Xstart [65] on the target line when
Suppose that a set (structure Parts) 808 of a group of black pixels indicated by xend [105] and xend [105] is detected.

【0084】このとき、既に存在する構造体Group
としては、構造体Group806,807と、構造体
Parts805の構造体Group805’とが存在
するため、ステップS506にて、構造体Group8
06,807,805’に対する構造体Parts80
8の結合処理(座標比較による結合処理)が行われる。
At this time, the already existing structure Group
Since there is a structure Group 806, 807 and a structure Group 805 ′ of the structure Parts 805, in Step S506, the structure Group 8
Structure Parts80 for 06,807,805 '
8 is performed (coupling processing by coordinate comparison).

【0085】ここで、構造体Parts808は、2つ
の構造体Group807,805’に接触した状態に
ある。したがって、この場合、構造体Parts808
は、2つの構造体Group807,805’を合体さ
せた構造体Groupに対して結合される。この結果、
2つの構造体Group807,805’は、上記図8
(d)の”809”に示す1つの構造体Groupに成
長する。
Here, the structure Parts 808 is in contact with the two structures Group 807 and 805 '. Therefore, in this case, the structure Parts 808
Is bonded to the structure Group that combines the two structures Group 807 and 805 ′. As a result,
The two structures Group 807, 805 'are shown in FIG.
It grows into one structure Group shown by “809” in (d).

【0086】この場合、構造体Group809として
は、構造体Group807の情報(上記図7参照)が
用いられ、構造体Group805’は消去される。但
し、構造体Group807の情報において、 next =構造体Group805’の”firs
t”により示される構造体Partsのアドレス last =構造体Group805’の”las
t”により示される構造体Partsのアドレス という、”next”及び”last”の情報の書き換
えが行われ、その結果が、構造体Group809の情
報とされる。
In this case, information of the structure Group 807 (see FIG. 7) is used as the structure Group 809, and the structure Group 805 'is deleted. However, in the information of the structure Group 807, next = “firsts” of the structure Group 805 ′
address of the structure Parts indicated by “t” last = “las” of the structure Group 805 ′
The information of “next” and “last”, which is the address of the structure Parts indicated by “t”, is rewritten, and the result is the information of the structure Group 809.

【0087】上記図8(d),(f)参照:したがっ
て、構造体Parts801,803を含む構造体Gr
oup806と、構造体Parts802,804,8
05,808を含む構造体Group806との2つの
構造体Groupが生成される。
8 (d) and (f): Therefore, the structure Gr including the structures Parts 801 and 803
up806 and the structures Parts802, 804, 8
Two structures Group are generated, including a structure Group 806 including 05,808.

【0088】以上説明したような黒領域(構造体Gro
upにより示される領域)の抽出処理は、二値化部10
5にて得られた複数の二値化画像(複数の二値化閾値に
基づき得られた二値化画像)に対してそれぞれ実行され
る。
The black region (structure Gro) as described above
The extraction process of the region indicated by “up” is performed by the binarization unit 10.
5 is performed on each of the plurality of binarized images (binary images obtained based on the plurality of binarization thresholds).

【0089】この結果、例えば、対象画像が、上記図3
(a)に示したような文書の多値画像であった場合、同
図(b)に示すように、二値化閾値401に基づいた二
値化画像からは、黒領域301〜305が抽出される。
これらの黒領域301〜305を示す構造体Group
では、黒領域部分の形状が四角であるか否かを示すフラ
グ情報”ShapeRectangle”が、”TRU
E(黒領域部分の形状が四角である)”に設定されてお
り、構造体Groupが示す領域が抽出された二値化画
像を作成した閾値より1つ前の閾値にて作成された二値
化画像上にほぼ同じオブジェクトが存在するか否かを示
すフラグ情報”SameAsMother”が、”FA
LSE(同じオブジェクトが存在しない)”に設定され
ている。
As a result, for example, the target image is
In the case of a multi-valued image of a document as shown in (a), black regions 301 to 305 are extracted from the binarized image based on the binarization threshold 401 as shown in FIG. Is done.
Structure Group showing these black regions 301 to 305
Then, the flag information “ShapeRectangle” indicating whether or not the shape of the black area portion is a square is set to “TRU”.
E (the shape of the black area portion is a square) ", and the binary value created by the threshold value immediately before the threshold value used to create the binary image from which the area indicated by the structure Group is extracted. The flag information “SameAsMother” indicating whether or not substantially the same object exists on the structured image is “FA
LSE (the same object does not exist) "is set.

【0090】また、上記図3(c)に示すように、二値
化閾値402に基づいた二値化画像からは、黒領域30
6〜309が抽出される。これらの黒領域306〜30
9を示す構造体Groupでは、フラグ情報”Shap
eRectangle”が、”TRUE(黒領域部分の
形状が四角である)”に設定されている。フラグ情報”
SameAsMother”については、黒領域306
を示す構造体Groupのみが”TRUE(同じオブジ
ェクトが存在する)”に設定されており、他の黒領域3
07〜309では”FALSE(同じオブジェクトが存
在しない)”に設定されている。
Further, as shown in FIG. 3C, the black area 30 based on the binarized image
6 to 309 are extracted. These black areas 306 to 30
9, the flag information “Shap
eRectangle "is set to" TRUE (the shape of the black area is a square). "
For “SameAsMother”, the black area 306
Is set to “TRUE (the same object exists)” and the other black area 3
For 07 to 309, "FALSE (the same object does not exist)" is set.

【0091】また、上記図3(d)に示すように、二値
化閾値403に基づいた二値化画像からは、黒領域31
0が抽出される。この黒領域310を示す構造体Gro
upでは、フラグ情報”ShapeRectangl
e”が、”FALSE(黒領域部分の形状が四角でな
い)”に設定されており、フラグ情報”SameAsM
other”が、”TRUE(同じオブジェクトが存在
する)”に設定されている。
Further, as shown in FIG. 3D, the black area 31 based on the binary threshold
0 is extracted. The structure Gro indicating the black region 310
In the up, the flag information "ShapeRectangl
e "is set to" FALSE (the shape of the black area is not square) "and the flag information" SameAsM
"other" is set to "TRUE (the same object exists)".

【0092】尚、黒領域の抽出の際、フラグ情報”Sh
apeRectangle”が、”TRUE”、又は所
定の大きさ以上の領域を、黒領域として抽出するように
してもよい。
When the black area is extracted, the flag information “Sh
A region in which “aperRectangle” is “TRUE” or a region having a predetermined size or more may be extracted as a black region.

【0093】黒領域抽出部107は、上述の処理(上記
図5及び図6に示した処理)を実施するための構成とし
て、例えば、図9に示すような構成を備えている。すな
わち、黒領域抽出部107は、上記図9に示すように、
二値メモリ106(上記図2参照)に保持された処理対
象となる二値化画像に対してウィンドウを設け、そのウ
ィンドウ内の黒画素の固まり(構造体Partsにより
示される黒画素の固まりの組)を検出する検出部100
1と、検出部1001にて検出された黒画素の固まりの
1次元的な座標情報(構造体Partsにより示される
黒画素の固まりの組の座標情報)を保持する座標保持部
1002と、既に検出済みの黒画素の固まりの2次元的
な座標情報(構造体Groupにより示される黒領域の
座標情報)を保持する2次元座標保持部1004と、座
標保持部1002内の座標情報と2次元座標保持部10
04内の座標情報を比較し、必要に応じて結合処理(構
造体Partsの構造体Groupへの合体処理)を実
行した結果得られる2次元的な座標情報(構造体Gro
upにより示される黒領域の座標情報)を2次元座標保
持部1004へ保持する比較部1003とを備えてお
り、2次元座標保持部1004へ保持された情報が、黒
領域分割部110(上記図2参照)へ与えられるように
なされている。
The black area extraction unit 107 has, for example, a configuration as shown in FIG. 9 as a configuration for performing the above-described processing (the processing shown in FIGS. 5 and 6). That is, as shown in FIG.
A window is provided for the binarized image to be processed held in the binary memory 106 (see FIG. 2), and a set of black pixels in the window (a set of black pixels indicated by the structure Parts) ) Detecting section 100
1, a coordinate holding unit 1002 that holds one-dimensional coordinate information of a set of black pixels detected by the detection unit 1001 (coordinate information of a set of black pixels indicated by the structure Parts), A two-dimensional coordinate storage unit 1004 for storing two-dimensional coordinate information (coordinate information of a black area indicated by the structure Group) of a group of completed black pixels, and the coordinate information and two-dimensional coordinate storage in the coordinate storage unit 1002 Part 10
The two-dimensional coordinate information (structure Gro) obtained as a result of comparing the coordinate information in the data structure 04 and executing the combining process (the merging process of the structure Parts into the structure Group) as necessary
and a comparison unit 1003 for holding the coordinate information of the black area indicated by “up” in the two-dimensional coordinate holding unit 1004. The information held in the two-dimensional coordinate holding unit 1004 is stored in the black area dividing unit 110 (see FIG. 2).

【0094】黒領域分割部110は、黒領域抽出部10
7から黒領域の情報が与えられると、例えば、図10に
示すフローチャートに従って、次のように動作する。
The black area dividing section 110 includes the black area extracting section 10
When the information on the black area is given from 7, for example, the following operation is performed according to the flowchart shown in FIG.

【0095】ステップS1101:先ず、黒領域抽出部
107からの、1つの二値化画像から得られた全ての黒
領域(構造体Groupにより示される黒領域、以下、
単に「構造体Group」とも言う)に対して、次のス
テップS1102からの処理を実行し終えたか否かを判
別する。この判別の結果、終了していた場合、本処理終
了とし、まだ未処理の構造体Groupがある場合に
は、次のステップS1102へ進む。
Step S1101: First, all black areas (black areas indicated by the structure Group, hereinafter referred to as “structures Group”) obtained from one binarized image from the black area extraction unit 107.
It is determined whether the processing from the next step S1102 has been completed on the “structure group”). If the result of this determination is that the processing has been completed, this processing is terminated. If there is an unprocessed structure Group, the flow proceeds to the next step S1102.

【0096】ステップS1102:未処理の対象構造体
Groupの情報(上記図7参照)を参照し、対象構造
体Groupの大きさが予め設定された閾値より大きい
か、また、黒領域部分の形状が四角であるか否かを示す
フラグ情報”ShapeRectangle”が”FA
LSE(黒領域部分の形状が四角でない)”か否かを判
別し、その判別の結果、対象黒領域の大きさが予め設定
された閾値より大きく、且つ、フラグ情報”Shape
Rectangle”が”FALSE”である場合、次
のステップS1103へ進み、そうでない場合には、そ
のまま後述するステップS1110へ進む。
Step S1102: Referring to the information of the unprocessed target structure Group (see FIG. 7), whether the size of the target structure Group is larger than a preset threshold value or the shape of the black area portion The flag information “ShapeRectangle” indicating whether or not it is a square is “FA”
LSE (the shape of the black area is not square) ”is determined, and as a result of the determination, the size of the target black area is larger than a preset threshold value, and the flag information“ Shape ”
If "Rectangle" is "FALSE", the flow advances to the next step S1103; otherwise, the flow directly advances to step S1110 to be described later.

【0097】ステップS1103:ステップS1102
での判別の結果、対象構造体Groupが上記の条件に
該当した場合、対象構造体Groupが有する構造体P
artsの情報(上記図7参照)を参照し、構造体Pa
rtsにより示される黒画素の固まりの組の始めの画素
の座標を示す”startx”のヒストグラム(以下、
「ヒストグラムstarthist」と言う)、及び当
該黒画素の固まりの終わりの画素の座標を示す”end
x”のヒストグラム(以下、「ヒストグラムendhi
st」と言う)を作成する。
Step S1103: Step S1102
When the target structure Group satisfies the above condition as a result of the determination in the above, the structure P included in the target structure Group
With reference to the information of the arts (see FIG. 7 above), the structure Pa
A histogram of “startx” (hereinafter, “startx”) indicating the coordinates of the first pixel of the set of black pixels indicated by rts
"End" indicating the coordinates of the pixel at the end of the cluster of black pixels.
x "histogram (hereinafter" histogram endhi
st ").

【0098】ステップS1104:ステップS1103
で作成したヒストグラムstarthist及びヒスト
グラムendhistの密集ポイントをそれぞれm点検
出する。
Step S1104: Step S1103
M dense points of the histogram starthist and the histogram endhist created in step (1) are detected.

【0099】ステップS1105:ステップS1104
で得た密集ポイントの情報を参照して、対象構造体Gr
oupを分割すべきか否か、すなわち対象構造体Gro
upにより示される黒領域を分割すべきか否かを判別す
る。例えば、密集ポイントの位置及び数に対して任意の
条件を設け、その条件を満たしている場合には、領域分
割すると認識し、次のステップS1106へ進む。一
方、上記条件を満たしていない場合には、領域分割しな
いと認識し、そのまま後述するステップS1110へ進
む。
Step S1105: Step S1104
With reference to the information of the crowded points obtained in the above, the target structure Gr
whether or not to split “up”, that is, the target structure Gro
It is determined whether or not the black area indicated by up should be divided. For example, an arbitrary condition is provided for the position and the number of the crowded points, and when the condition is satisfied, it is recognized that the area is divided, and the process proceeds to the next step S1106. On the other hand, when the above condition is not satisfied, it is recognized that the area is not divided, and the process proceeds to step S1110 to be described later.

【0100】ステップS1106:ステップS1105
の判別の結果、領域分割する場合、ヒストグラムsta
rthistから検出されたm点の密集ポイント、及び
ヒストグラムendhistから検出されたm点の密集
ポイントから、それぞれ1点を選択し、これらの2つの
点を、”startpoint”及び”endpoin
t”として設定する。ここでは、一度に分割できる領域
は、 0〜startpoint startpoint〜endpoint endpoint〜最後まで により示される3つの領域とする。
Step S1106: Step S1105
When the region is divided as a result of the
One point is selected from each of the m dense points detected from the rthist and the m dense points detected from the histogram endhist, and these two points are defined as “startpoint” and “endpoint”.
In this case, the area that can be divided at a time is three areas indicated by 0 to start point start point to end point end point to the end.

【0101】ステップS1107:ステップS1106
の分割点の設定により得られた〜の3つの領域のそ
れぞれに対して、構造体Partsにより示される黒画
素の固まり組の方向(x方向)とは異なる、例えば、y
方向の広がりを検出する。
Step S1107: Step S1106
Is different from the direction (x direction) of the set of black pixels indicated by the structure Parts for each of the three regions obtained by setting the division point of, for example, y
Detects directional spread.

【0102】ステップS1108:ステップS1107
の検出結果により、再度、領域分割すべきか否かを判別
する。例えば、、、のそれぞれの領域に対して、
y方向の分布が全体的に広がっているか否かを判別し、
その判別の結果、、、のそれぞれの領域が、y方
向の分布が全体的に広がっている場合、領域分割すべき
でないと認識し、そのまま後述するステップS1110
へ進む。一方、、、のそれぞれの領域のy方向の
分布に偏りがある場合には、領域分割すべきと認識し、
次のステップS1109へ進む。
Step S1108: Step S1107
, It is determined again whether or not to divide the area. For example, for each region of
determine whether the distribution in the y-direction is widening as a whole,
As a result of the discrimination, if the respective regions have a wide distribution in the y direction, it is recognized that the region should not be divided, and step S1110 to be described later is performed as it is.
Proceed to. On the other hand, if there is a bias in the y-direction distribution of each of the regions, it is recognized that the region should be divided,
Proceed to the next step S1109.

【0103】ステップS1109:ステップS1108
の判別の結果、領域分割する場合、ステップS1106
の分割点の設定により得られた〜の3つの領域に、
対象構造体Groupにより示される黒領域を分割す
る。また、〜の3つの領域に対応する新規の構造体
Groupを作成し、その新規の構造体Groupに対
して、該当する新たな二次元の座標情報を設定する。そ
して、分割の元になった対象構造体Groupを削除す
る。尚、分割の元になった対象構造体Groupを削除
するのではなく、そのまま流用して、座標情報を更新す
るようにしてもよい。
Step S1109: Step S1108
If the result of the determination is that the area is to be divided, step S1106
In the three areas of ~ obtained by setting the division point of
The black area indicated by the target structure Group is divided. Further, a new structure Group corresponding to the three regions is created, and the corresponding new two-dimensional coordinate information is set for the new structure Group. Then, the target structure Group that is the source of the division is deleted. The coordinate information may be updated by diverting the target structure Group from which the division is based, instead of deleting the target structure Group.

【0104】ステップS1110:ステップS1109
の処理後、分割の結果得られた新規の構造体Group
を、黒領域座標保持部108(上記図2参照)へ保持
し、対象構造体Groupを次の構造体Groupとし
て(次の構造体Groupへポインタを進める)、ステ
ップS1101へ戻り、以降の処理ステップを繰り返し
実行する。一方、ステップS1102,S1105,S
1108の各判別処理で”No”で分岐した場合に、本
ステップS1110を実行する場合、分割が行われなか
った対象構造体Groupをそのまま黒領域座標保持部
108(上記図2参照)へ保持し、対象構造体Grou
pを次の構造体Groupとして(次の構造体Grou
pへポインタを進める)、ステップS1101へ戻り、
以降の処理ステップを繰り返し実行する。したがって、
黒領域座標保持部108には、黒領域抽出部107で得
られた黒領域の情報と、必要に応じて当該黒領域を黒領
域分割部110で分割して得られた黒領域の情報とが保
持されることになる。
Step S1110: Step S1109
, A new structure Group obtained as a result of the division
Is stored in the black area coordinate storage unit 108 (see FIG. 2), the target structure Group is set as the next structure Group (the pointer is advanced to the next structure Group), and the process returns to step S1101 to perform the subsequent processing steps. Is repeatedly executed. On the other hand, steps S1102, S1105, S
When the step S1110 is executed in the case of branching at “No” in each determination process of 1108, the target structure Group that has not been divided is stored in the black region coordinate storage unit 108 (see FIG. 2 above) as it is. , Target structure Grou
Let p be the next structure Group (next structure Group
p), the process returns to step S1101,
The subsequent processing steps are repeatedly executed. Therefore,
The black region coordinate holding unit 108 stores the information of the black region obtained by the black region extraction unit 107 and the information of the black region obtained by dividing the black region by the black region division unit 110 as necessary. Will be retained.

【0105】図11(a)〜(c)、図12、図13、
図14は、黒領域分割部110での上記図10に示した
処理の実行により、対象二値化画像上では、どのような
処理が実際に行われるかを具体的に示したものである。
FIGS. 11 (a) to 11 (c), FIGS.
FIG. 14 specifically shows what processing is actually performed on the target binarized image by the execution of the processing shown in FIG. 10 in the black area dividing unit 110.

【0106】まず、図11(a)に示す画像は、上記図
22に示した画像と同様に、白下地に「123」、「4
56」、「798」等の黒文字が存在する通常領域が、
黒下地に「ABCDEFG」及び「イロハニホヘト」の
白文字が存在する反転領域と外接している状態で存在す
る画像である。このような画像が黒領域抽出部107で
処理されると、上記図11(a)中の太線で示す領域を
構造体Partsとする黒領域(構造体Groupで示
される領域)が抽出される。
First, the image shown in FIG. 11A has “123” and “4” on a white background, similarly to the image shown in FIG.
Normal areas where black characters such as "56" and "798" exist
This is an image that exists in a state circumscribing a reverse area where white characters “ABCDEFG” and “Irohanihohet” are present on a black background. When such an image is processed by the black region extraction unit 107, a black region (region indicated by the structure Group) in which the region indicated by the thick line in FIG.

【0107】尚、上記図11(a)は、構造体Part
sが存在する様子を表すためのイメージ図であり、実際
には、同図中の太線で示す数よりも多くの構造体Par
tsが存在することになる。
Note that FIG. 11A shows the structure Part
FIG. 14 is an image diagram for showing a state in which s exists, and in fact, there are more structures Par than the number indicated by a thick line in FIG.
ts will be present.

【0108】そこで、黒領域分割部110において、上
記図10のステップS1103の処理が実行されると、
ヒストグラムstarthist及びヒストグラムen
dhistとして、上記図11(b)及び(c)に示す
ようなヒストグラムが得られる。
Therefore, when the processing of step S1103 in FIG. 10 is executed in the black area dividing section 110,
Histogram histogram and histogram en
A histogram as shown in FIGS. 11B and 11C is obtained as dhist.

【0109】次のステップS1104の処理が実行され
ると、上記図11(b)に示されるヒストグラムsta
rthistから密集ポイント1501が検出されると
共に、同図(c)に示されるヒストグラムendhis
tから密集ポイント1502,1503が検出される。
When the processing of the next step S1104 is executed, the histogram “sta” shown in FIG.
rhist, a dense point 1501 is detected, and a histogram endhis shown in FIG.
Congestion points 1502 and 1503 are detected from t.

【0110】次のステップS1105の処理では、ステ
ップS1104での密集ポイントを利用して、分割すべ
きか否かの判定(第1の判定)が行われるが、ここで
は、ヒストグラムendhistの密集ポイント150
2,1503が離れた関係にあるので、分割する必要が
あると判定する。すなわち、密集ポイント1502,1
503が離れた関係にあるということは、構造体Par
tsにより示される黒画素の固まりの組の終わりの画素
の座標を示す”endx”の密集が離れている状態であ
ることを意味するので、構造体Groupで示される黒
領域を分割する必要があると判定する。
In the next step S1105, a decision (first decision) is made as to whether or not to divide using the dense points in step S1104. Here, the dense points 150 of the histogram endhist are determined.
Since 2,1503 are in a distant relationship, it is determined that division is necessary. That is, the dense points 1502, 1
The fact that 503 is in a distant relationship means that the structure Par
This means that the density of “endx” indicating the coordinates of the pixel at the end of the set of black pixels indicated by ts is far away, so it is necessary to divide the black area indicated by the structure Group Is determined.

【0111】ステップS1105の判定結果により、次
のステップS1106の処理が実行されると、”sta
rtpoint”に”0”が設定され、”endpoi
nt”に密集ポイント1502が設定される。
When the processing in the next step S1106 is executed based on the determination result in step S1105, "sta
“0” is set in “rtpoint”, and “endpoi” is set.
A dense point 1502 is set at “nt”.

【0112】次のステップS1107の処理では、y方
向の広がりが検出される。ここでは、 0〜startpoint startpoint〜endpoint endpoint〜最後まで により示される3つの領域において、の領域との領
域は同じ領域を示すことになるため、の領域(0〜e
ndpoint)との領域(endpoint〜最後
まで)についてのy方向の広がりを、構造体Parts
のy方向の情報(上記図7の”701a”で示す情報)
を参照する等して検出する。
In the next step S1107, the spread in the y direction is detected. Here, in the three areas indicated by 0 to start point start point to end point end point to the end, the area and the area indicate the same area.
ndpoint) and the area (endpoint to the end) in the y-direction are represented by the structure Parts
(Information indicated by “701a” in FIG. 7)
, Etc. to detect.

【0113】次のステップS1108の処理では、ステ
ップS1107でのy方向の広がりの検出の結果から、
再度、分割すべきか否かの判定(第2の判定)が行われ
る。ここでは、上記検出の結果により、の領域(0〜
endpoint)は、上記図11(a)に示す”15
04”〜”1506”に分布しており、の領域(en
dpoint〜最後まで)は、同図に示す”1504”
〜”1505”にしか分布していないことが認識できる
ため、分割すべきであると判定する。
In the next step S1108, based on the result of detection of the spread in the y direction in step S1107,
Again, a determination as to whether or not to divide (a second determination) is made. Here, the region (0 to 0)
The “endpoint” is “15” shown in FIG.
04 "to" 1506 ", and the region (en
dpoint to the end) is “1504” shown in FIG.
Since it can be recognized that the data is distributed only to “1505”, it is determined that the data should be divided.

【0114】ステップS1108の判定結果により、次
のステップS1109の処理が実行されると、構造体G
roupで示される黒領域が、の領域との領域の2
つの領域に分割される。すなわち、図12に示すよう
に、黒下地に「ABCDEFG」及び「イロハニホヘ
ト」の白文字が存在する反転領域(黒領域)が、「AB
CDEFG」の領域(の領域)と、「イロハニホヘ
ト」の領域(の領域)との2つの領域に分割される。
When the processing in the next step S1109 is executed based on the determination result in step S1108, the structure G
The black area indicated by the loop is the area 2
Divided into two areas. That is, as shown in FIG. 12, an inverted area (black area) in which white characters of “ABCDEFG” and “Irohanihoheto” are present on a black background is “AB
The area is divided into two areas, an area of (CDDEFG) and an area of (Irohanihohet).

【0115】尚、ステップS1109での領域分割にお
いて、上記図12に示した分割に対して、状況によって
は、図13に示すような分割を行う必要がある場合があ
る。この場合、例えば、元の多値画像の色情報を参照し
て、上記図12に示すような分割を行うか、上記図13
に示すような分割を行うかを選択するようにしてもよ
い。
In the area division in step S1109, the division shown in FIG. 12 may need to be performed as shown in FIG. 13 depending on the situation. In this case, for example, with reference to the color information of the original multi-valued image, the division as shown in FIG.
It is also possible to select whether to perform the division as shown in FIG.

【0116】したがって、上記図11に示した画像の黒
領域が、上記図12(又は図13)に示したように分割
されることによって、例えば、OCRのために2値化処
理を実行したとしても、従来のように、「123」、
「456」、「789」等の黒文字が白下地に存在する
領域が、通常領域(白下地に黒文字が存在する領域)で
あるにも関わらず反転されてしまう(上記図23参照)
ことはなく、図14に示すように、「ABCDEFG」
及び「イロハニホヘト」の白文字が存在する黒領域のみ
が反転され、「ABCDEFG」、「イロハニホヘ
ト」、「123」、「456」、「789」等の全ての
文字を良好にOCRできる二値化が可能となる。
Therefore, by dividing the black area of the image shown in FIG. 11 as shown in FIG. 12 (or FIG. 13), for example, if the binarization processing is executed for OCR, Also, as before, "123",
An area where black characters such as "456" and "789" are present on a white background is inverted despite being a normal area (an area where black characters are present on a white background) (see FIG. 23 above).
As shown in FIG. 14, "ABCDEFG"
Only the black area where the white characters of “Irohanihohet” are present is inverted, and binarization that can satisfactorily OCR all the characters such as “ABCDEFG”, “Irohanihohet”, “123”, “456”, and “789” is performed. It becomes possible.

【0117】そして、ステップS1110の処理が実行
されると、上述のようにして、構造体Groupで示さ
れる黒領域を分割して得られた新たな黒領域を示す新規
の構造体Groupが、黒領域座標保持部108へ保持
される。また、分割が行われなかった構造体Group
については、そのまま黒領域座標保持部108へ保持さ
れる。
When the process of step S1110 is executed, a new structure Group indicating a new black region obtained by dividing the black region indicated by the structure Group as described above is added to the black structure. It is held in the area coordinate holding unit 108. In addition, the structure Group that has not been divided
Is held in the black area coordinate holding unit 108 as it is.

【0118】領域解析部109は、上記図2に示したス
テップS206において、黒領域座標保持部108に保
持された全ての黒領域に対して、対象黒領域が文字領域
であるか否か、文字領域であるならば反転領域であるか
否か、当該下地の平均画素値(平均下地色)、当該文字
の平均画素値(平均文字色)、二値化の際に用いる最適
な二値化閾値等の解析情報を取得する。
In step S206 shown in FIG. 2, the area analyzing unit 109 determines whether or not the target black area is a character area for all the black areas held in the black area coordinate holding unit 108. If it is a region, whether or not it is an inverted region, the average pixel value of the background (average background color), the average pixel value of the character (average character color), the optimal binarization threshold used for binarization And other analysis information.

【0119】例えば、黒領域座標保持部108に保持さ
れた黒領域の座標情報が、上記図3に示した黒領域30
1〜310の座標情報である場合、領域解析部109
は、先ず、これらの黒領域301〜310のそれぞれに
対応するヒストグラムを、ヒストグラム演算部103に
より取得する。そして、領域解析部109は、黒領域3
01〜310の対応する各ヒストグラムから黒領域30
1〜310のそれぞれに対して、対象黒領域が文字領域
であるか否か、文字領域であるならば反転領域であるか
否か、反転領域であるならば反転すべきか否かを判断
し、さらに、対象黒領域を二値化する際の最適閾値を算
出し、これらの結果(解析結果)を、黒領域座標保持部
108に保持されている各種情報(上記図7参照)にお
ける、構造体Groupが示す領域を二値化するのにふ
さわしい閾値の情報”Threshold”、構造体G
roupが示す領域が文字領域であるか文字以外の領域
(画像領域等)であるかを示すフラグ情報”Chara
Flg”、構造体Groupが示す領域が文字領域であ
る場合に当該領域が反転文字領域(下地が黒っぽく、文
字部が白っぽい領域)であるか否かを示すフラグ情報”
InvertFlg”、構造体Groupが示す領域が
抽出された二値化画像を作成した閾値より1つ前の閾値
にて作成された二値化画像上にほぼ同じオブジェクトが
存在するか否かを示すフラグ情報”SameAsMot
her”、及び次の構造体Groupのアドレスを示す
ポインタ情報”next”に対してそれぞれ設定する。
For example, the coordinate information of the black area held in the black area coordinate holding unit 108 is the same as the black area 30 shown in FIG.
If the coordinate information is 1 to 310, the area analysis unit 109
First, the histogram calculation unit 103 acquires histograms corresponding to the black regions 301 to 310, respectively. Then, the region analyzing unit 109 determines that the black region 3
From the corresponding histograms of 01 to 310, the black area 30
For each of 1 to 310, it is determined whether the target black area is a character area, if it is a character area, whether it is an inverted area, and if it is an inverted area, whether it should be inverted, Further, an optimum threshold value for binarizing the target black area is calculated, and these results (analysis results) are stored in the structure in various information (see FIG. 7 described above) held in the black area coordinate holding unit 108. Threshold information “Threshold” suitable for binarizing the area indicated by the Group, the structure G
The flag information "Chara" indicating whether the area indicated by the group is a character area or a non-character area (eg, an image area).
Flg ", flag information indicating whether or not the region indicated by the structure Group is a character region when the region is an inverted character region (a black background and a white character portion).
"InvertFlg", a flag indicating whether or not substantially the same object exists on the binarized image created with the threshold value one immediately before the threshold value that created the binarized image in which the region indicated by the structure Group is extracted. Information "SameAsMot
her "and pointer information" next "indicating the address of the next structure Group.

【0120】ここで、ヒストグラム演算部103により
得られる黒領域301〜310に対応したヒストグラム
から、上述のような各種解析を行なう際、子どもの黒領
域の情報を省いたほうが望ましい。例えば、黒領域30
3と黒領域307の関係は、図15に示すように、黒領
域303の中に黒領域307(黒領域303を親とする
子の黒領域)が含まれる状態となっているが、黒領域3
07についての情報(重複画素の情報)は用いないよう
にするほうが、よりよい解析結果を得ることができる。
このための処理方法としては、マップ画像を用いる方法
や、座標を用いる方法等がある。ここでは、その一例と
して、マップ画像を用いる方法について説明する。
Here, it is desirable to omit the information on the child's black area from the histograms corresponding to the black areas 301 to 310 obtained by the histogram calculation unit 103 when performing the above-described various analyses. For example, the black area 30
As shown in FIG. 15, the black region 303 includes a black region 307 (a black region of a child having the black region 303 as a parent). 3
A better analysis result can be obtained by not using information on 07 (information on overlapping pixels).
As a processing method for this, there is a method using a map image, a method using coordinates, and the like. Here, a method using a map image will be described as an example.

【0121】マップ画像を利用した方法:この方法は、
ヒストグラム演算部103において、黒領域のヒストグ
ラムを生成する際、マップ画像を用いる方法である。例
えば、”0”に近い二値化閾値403で二値化した結果
(上記図3(d)に示した二値化画像)から抽出された
黒領域310のヒストグラムを作成する場合、対象画像
(上記図3(a)に示した文書の多値画像)のマップ画
像を用意し、当該マップ画像を構成する全ての画素を”
0”で初期化しておく。そして、黒領域310のヒスト
グラムを作成するときにアクセスした画素部に対応する
マップ画像の画素部を”1”に設定する。これにより、
マップ画像では、アクセスされていない画素部は”0”
であり、アクセスされた画素部は”1”となるため、画
素値が”1”でない画素の情報を用いてヒストグラムを
作成すればよい。このような方法により、ヒストグラム
演算部103でのヒストグラムの作成が行われることに
よって、領域解析部109は、上記図15に示したよう
な関係にある黒領域であっても、画素情報の重複のない
正確な当該黒領域のヒストグラムを取得することができ
るため、最適な解析処理を行なうことができる。
A method using a map image:
The histogram calculation unit 103 uses a map image when generating a histogram of a black area. For example, when creating a histogram of the black region 310 extracted from the binarization result (the binarized image shown in FIG. 3D) with the binarization threshold 403 close to “0”, the target image ( A map image of the multi-value image of the document shown in FIG. 3A is prepared, and all the pixels constituting the map image are set to “
Then, the pixel portion of the map image corresponding to the pixel portion accessed when creating the histogram of the black region 310 is set to “1”.
In the map image, the pixel part not accessed is “0”
Since the accessed pixel portion is “1”, a histogram may be created using information on pixels whose pixel values are not “1”. By creating a histogram in the histogram calculation unit 103 according to such a method, the area analysis unit 109 can determine whether the pixel information overlaps even in the black area having the relationship shown in FIG. Since an accurate histogram of the black area can be obtained, an optimal analysis process can be performed.

【0122】尚、上述のマップ画像を利用した方法にお
いて、フラグ情報”SameAsMother”が”T
RUE(同じオブジェクトが存在する)”である黒領域
については、最終的な二値化処理時において重複二値化
をする時間を削減するために、二値化処理しないように
構成してもよい。この場合、当該黒領域については、領
域解析部109での解析処理についても行なわない、或
いは、解析処理を行ってもマップ画像での当該黒領域に
対応する画素部に対して”1”を設定しないようにす
る。
In the above-described method using the map image, the flag information "SameAsMother" is set to "T
The black region that is “RUE (the same object exists)” may be configured not to be subjected to the binarization process in order to reduce the time for performing duplicate binarization in the final binarization process. In this case, for the black area, the analysis processing in the area analysis unit 109 is not performed, or even if the analysis processing is performed, “1” is set to the pixel portion corresponding to the black area in the map image. Do not set.

【0123】領域解析部109での解析処理の具体例を
示すと、次のような処理がある。例えば、ヒストグラム
演算部103により得られた対象黒領域のヒストグラム
の平均値averageと、そのスキューskewを、
A specific example of the analysis processing in the area analysis unit 109 is as follows. For example, the average value average of the histogram of the target black area obtained by the histogram calculation unit 103 and its skew skew are

【0124】[0124]

【数1】 (Equation 1)

【0125】なる演算により求め、この結果えられたス
キューskewの絶対値が、対象黒領域が存在する二値
化画像取得時の二値化閾値より大きい場合、対象黒領域
は文字領域であると認識し、対象黒領域を示す構造体G
roupのフラグ情報”CharaFlg”を”TRU
E”に設定する。また、この場合、さらに上記スキュー
skewの値が「正」である場合、対象黒領域が反転文
字領域(下地が黒っぽく、文字部が白っぽい領域)であ
ると認識し、対象黒領域を示す構造体Groupのフラ
グ情報”InvertFlg”を”TRUE”に設定す
る。また、この場合の対象黒領域を二値化するのにふさ
わしい閾値として、対象黒領域の下地部分が消去される
ような閾値を対象黒領域のヒストグラムから求め、その
結果を、対象黒領域を示す構造体Groupの情報”T
hreshold”へ設定する。
If the absolute value of the resulting skew skew is larger than the binarization threshold at the time of obtaining the binarized image in which the target black area exists, it is determined that the target black area is a character area. Structure G that recognizes and indicates the target black area
group information "CharaFlg" to "TRU"
E ”. In this case, if the value of the skew skew is“ positive ”, the target black area is recognized as an inverted character area (a black background and a white character area). The flag information “InvertFlg” of the structure Group indicating the black area is set to “TRUE”. In addition, as a threshold suitable for binarizing the target black region in this case, a threshold value at which the background portion of the target black region is erased is obtained from the histogram of the target black region, and the result indicates the target black region. Structure Group information "T
threshold ".

【0126】上述のようにして、領域解析部109は、
上記図2に示したステップS206において、黒領域座
標保持部108に保持された全ての黒領域についての解
析を行い、その解析結果を黒領域座標保持部108へ書
き込むが、構造体Groupのフラグ情報”Inver
tFlg”が”TRUE”である黒領域については、さ
らに次のような処理を実行する。
As described above, the area analysis unit 109
In step S206 shown in FIG. 2, analysis is performed on all the black areas held in the black area coordinate holding unit 108, and the analysis result is written in the black area coordinate holding unit 108. The flag information of the structure Group "Inver
The following processing is further performed on the black area in which tFlg ”is“ TRUE ”.

【0127】まず、構造体Groupのフラグ情報”I
nvertFlg”が”TRUE”である黒領域(以
下、「対象黒領域」と言う)は、文字領域であり、且つ
反転文字領域(下地が黒っぽく、文字部が白っぽい領
域)である。そこで、本処理では、対象黒領域に対応す
る部分の多値画像(多値メモリ192に保持されている
画像情報)を反転して、その反転後の画像に対して、上
記図2に示したステップS202〜S206の処理を繰
り返し実行する(上記図2の点線矢印参照)。尚、この
ときの反転処理は、例えば、多値画像そのものを反転す
るようにしてもよいし、多値画像から得られたヒストグ
ラム(ヒストグラム演算103で得られたヒストグラ
ム)を反転するようにしてもよいし、その方法は限定さ
れることはない。
First, the flag information “I” of the structure Group
A black area in which “nvertFlg” is “TRUE” (hereinafter, referred to as a “target black area”) is a character area and an inverted character area (a black background and a whitish character part). Therefore, in this processing, the multi-valued image (the image information held in the multi-valued memory 192) of the portion corresponding to the target black area is inverted, and the image after the inversion is shown in FIG. The processing of steps S202 to S206 is repeatedly executed (see the dotted arrow in FIG. 2). The inversion processing at this time may be, for example, to invert the multi-valued image itself or to invert the histogram obtained from the multi-valued image (the histogram obtained by the histogram calculation 103). Good, and the method is not limited.

【0128】具体的には例えば、上記図3(a)に示し
た多値画像から得られた黒領域301〜310(同図
(b)〜(c)参照)において、黒領域301,30
6,310は、当該多値画像の反転文字領域に対応する
部分であるが、これらの黒領域301,306,310
のうち、黒領域306,310については、構造体Gr
oupが示す領域(当該黒領域)が抽出された二値化画
像(同図(c)及び(d)に示す二値化画像)を作成し
た閾値より1つ前の閾値にて作成された二値化画像(同
図(b)に示す二値化画像)上にほぼ同じオブジェクト
が存在するか否かを示すフラグ情報”SameAsMo
ther”が”TRUE(存在する)”に設定されるた
め、黒領域301に対して、本処理が実行される。
More specifically, for example, in the black areas 301 to 310 (see FIGS. 3B to 3C) obtained from the multi-valued image shown in FIG.
6, 310 are portions corresponding to the inverted character area of the multi-valued image, and these black areas 301, 306, 310
Of the black regions 306 and 310, the structure Gr
The bin created with the threshold value one immediately before the threshold at which the binarized image (the binarized image shown in FIGS. 3C and 3D) from which the region (the black region) indicated by “up” is extracted is created. Flag information "SameAsMo" indicating whether or not substantially the same object exists on the binarized image (binary image shown in FIG. 3B).
Since “other” is set to “TRUE (exists)”, the present process is executed on the black region 301.

【0129】黒領域301に対応する多値画像の領域を
反転したものを、図16(a)に示す。この反転画像3
50に対して、先ず、上記図2のステップS202にて
ヒストグラム演算部103により処理が実行されると、
図17に示すようなヒストグラムが得られる。次のステ
ップS203では、閾値決定部104により、上記図1
7に示す2つの二値化閾値451,452が決定され
る。次のステップS204では、二値化部105によ
り、上記図16(b)及び(c)に示すような二値化画
像が得られる。上記図16(b)に示す二値化画像は、
二値化閾値451に基づいた二値化により得られた画像
であり、同図(c)に示す二値化画像は、二値化閾値4
52に基づいた二値化により得られた画像である。
FIG. 16A shows an inverted multi-valued image area corresponding to the black area 301. This inverted image 3
For 50, first, when processing is executed by the histogram calculation unit 103 in step S202 of FIG.
A histogram as shown in FIG. 17 is obtained. In the next step S203, the threshold determination unit 104 causes the above-described FIG.
7, two binarization thresholds 451 and 452 are determined. In the next step S204, the binarization unit 105 obtains a binarized image as shown in FIGS. 16B and 16C. The binarized image shown in FIG.
An image obtained by binarization based on the binarization threshold 451, and the binarized image shown in FIG.
52 is an image obtained by binarization based on No. 52.

【0130】そして、次のステップS205では、黒領
域抽出部107により、上記図16(b)に示す二値化
画像から黒領域351〜355が抽出される。これらの
黒領域351〜355のうち、黒領域351〜354に
ついては、当該領域が四角形状であるため、領域解析部
109は、これを認識し、これらの黒領域351〜35
4を示す構造体Groupの、黒領域部分の形状が四角
であるか否かを示すフラグ情報”ShapeRecta
ngle”を”TRUE(四角形状)”に設定する。こ
れにより、黒領域抽出部107では、上記図16(c)
に示す二値化画像からの黒領域抽出処理が行われる。こ
の結果、上記図16(c)に示す二値化画像からは、黒
領域356〜358が抽出される。
In the next step S205, the black areas 351 to 355 are extracted from the binarized image shown in FIG. Of these black regions 351 to 355, the black regions 351 to 354 have a quadrangular shape. Therefore, the region analysis unit 109 recognizes this, and the black regions 351 to 355 are recognized.
The flag information “ShapeRecta” indicating whether or not the shape of the black area portion of the structure Group indicating the “4” is square.
ngle "is set to" TRUE (square shape) ".
A black region extraction process from the binarized image shown in FIG. As a result, black regions 356 to 358 are extracted from the binarized image shown in FIG.

【0131】黒領域356〜358は、その構造体Gr
oupが示す領域(当該黒領域)が抽出された二値化画
像(上記図16(c)に示す二値化画像)を作成した閾
値より1つ前の閾値にて作成された二値化画像(同図
(b)に示す二値化画像)上にほぼ同じオブジェクトが
存在するので、領域解析部109は、これを認識し、こ
れらの黒領域356〜358を示す構造体Groupの
フラグ情報”SameAsMother”を”TRUE
(存在する)”に設定する。
The black regions 356 to 358 correspond to the structure Gr.
The binarized image created with the threshold value one before the threshold value at which the binarized image (the binarized image shown in FIG. 16C) from which the region indicated by “up” (the black region) is extracted is generated. Since almost the same object exists on the (binarized image shown in FIG. 9B), the area analysis unit 109 recognizes this and sets the flag information of the structure Group indicating these black areas 356 to 358. SameAsMother "to" TRUE
(Exists) ".

【0132】したがって、フラグ情報”SameAsM
other”が”TRUE(存在する)”でない黒領域
351〜355に対して、再び本処理が実行され、領域
解析部109にて、構造体Groupが示す領域が文字
領域であるか文字以外の領域(画像領域等)であるかを
示すフラグ情報”CharaFlg”、構造体Grou
pが示す領域が文字領域である場合に当該領域が反転文
字領域(下地が黒っぽく、文字部が白っぽい領域)であ
るか否かを示すフラグ情報”InvertFlg”、及
び構造体Groupが示す領域を二値化するのにふさわ
しい閾値の情報”Threshold”等への設定が行
われる。
Therefore, the flag information "SameAsM"
This processing is executed again on the black areas 351 to 355 in which “other” is not “TRUE (existing)”, and the area analysis unit 109 determines whether the area indicated by the structure Group is a character area or a non-character area. (CharaFlg) indicating whether the image is an image region or the like, and a structure Grou
When the area indicated by p is a character area, the flag information “InvertFlg” indicating whether or not the area is an inverted character area (an area with a black base and a white character part) and an area indicated by the structure Group The threshold is set to information “Threshold” or the like suitable for conversion into a value.

【0133】上述のようにして、全ての黒領域が抽出さ
れ、それぞれの黒領域に対する二値化閾値や、黒領域に
対応する多値画像を反転するか否か等が決定される。
As described above, all the black regions are extracted, and the binarization threshold value for each black region, whether to invert the multi-valued image corresponding to the black region, and the like are determined.

【0134】尚、黒領域部分の形状が四角であるか否か
を示すフラグ情報”ShapeRectangle”
は、例えば、対象黒領域が、図18(a)に示すような
形状の領域(黒塗部分)である場合には、”TRUE
(四角形状)”に設定され、同図(b)に示すような形
状の領域である場合には、”FALSE(四角形状でな
い)”に設定されるものとする。
It should be noted that flag information "ShapeRectangle" indicating whether or not the shape of the black area is a square is shown.
For example, when the target black area is an area (black portion) having a shape as shown in FIG.
(Square shape) ", and in the case of an area having a shape as shown in FIG. 4B," FALSE (not square shape) "is set.

【0135】尚、上述した実施の形態では、二値メモリ
106を、二値化部105で得られる二値化画像分の容
量(閾値決定部104で得られる二値化閾値の数分の枚
数の画像を保持できる容量)を有するものとしている
が、このような構成の場合、多値画像を複数の二値化閾
値で二値化して、一度に複数の二値化画像を作成するこ
とができるため、処理高速の点では有効であるが、二値
化閾値の数分の枚数の画像を保持できる容量が必要とな
ってくる。しかしながら、次のような構成とすること
で、二値メモリ106を、1画像分の容量を有するもと
し、メモリの節約を行える。
In the above-described embodiment, the binary memory 106 is used to store the capacity of the binary image obtained by the binarizing unit 105 (the number of binary images corresponding to the number of binary thresholds obtained by the threshold determining unit 104). In such a configuration, it is possible to binarize a multi-valued image with a plurality of binarization thresholds and create a plurality of binarized images at once. This is effective in terms of processing speed, but requires a capacity that can hold the number of images equal to the number of binarization thresholds. However, with the following configuration, the binary memory 106 can have the capacity for one image and can save the memory.

【0136】先ず、閾値決定部104は、最初の二値化
閾値を決定し、二値化部105は、当該二値化閾値での
二値化を実行し、その結果(二値化画像)を、1画像分
の容量を有する二値メモリ106へ保持する。次に、黒
領域抽出部107は、二値メモリ106内の二値化画像
に対する黒領域抽出処理をで実行する。その後、二値メ
モリ106内の二値化画像を破棄する。次に、閾値決定
部104は、最初の二値化閾値を決定する。二値化部1
05は、当該二値化閾値での二値化を、黒領域抽出部1
07での黒領域抽出結果に対応した領域のみに対して実
行する。そして、黒領域抽出部107は、上記黒領域抽
出結果に対応した領域の二値化画像に対して、黒領域抽
出処理を実行する。
First, the threshold value decision unit 104 decides the first binarization threshold value, and the binarization unit 105 executes binarization using the binarization threshold value, and the result (binary image) Is stored in the binary memory 106 having a capacity for one image. Next, the black region extraction unit 107 executes a black region extraction process on the binarized image in the binary memory 106. After that, the binarized image in the binary memory 106 is discarded. Next, the threshold determination unit 104 determines an initial binarization threshold. Binarization unit 1
05 denotes binarization at the binarization threshold value by the black region extraction unit 1
The process is executed only for the region corresponding to the black region extraction result in 07. Then, the black region extraction unit 107 executes a black region extraction process on the binarized image of the region corresponding to the black region extraction result.

【0137】したがって、上述のような構成では、二値
メモリ106の容量は、1画像分の容量があればよく、
多量の二値メモリを所持できない場合に対応することが
できる。
Therefore, in the configuration described above, the capacity of the binary memory 106 only needs to have a capacity for one image.
It is possible to cope with a case where a large amount of binary memory cannot be possessed.

【0138】また、上述した実施の形態では、対象とな
る多値画像を構成する全ての画素情報からヒストグラム
を作成し、そのヒストグラムから複数の二値化閾値を決
定し、それらの二値化閾値から複数の二値化画像を取得
するように構成したが、これに限られることはなく、例
えば、黒領域抽出部107により得られた黒領域につい
てのヒストグラムを作成し、そのヒストグラムから二値
化閾値を決定して二値化画像を取得するようにしてもよ
い。このような構成とすれば、さらに小領域への分割が
良好に行える利点がある。
In the above-described embodiment, a histogram is created from all pieces of pixel information constituting a target multi-valued image, a plurality of binarization thresholds are determined from the histogram, and the binarization thresholds are determined. Is configured to acquire a plurality of binarized images from the image data. However, the present invention is not limited to this. For example, a histogram for a black region obtained by the black region A threshold may be determined to obtain a binarized image. With such a configuration, there is an advantage that division into smaller areas can be performed more favorably.

【0139】また、上述した実施の形態では、多値画像
から二値化画像を生成するように構成したが、これに限
られることはなく、3値化或いは4値化等の量子化画像
を生成して、その画像から最終的に領域分割する構成も
本発明に含まれる。
In the above-described embodiment, the binarized image is generated from the multi-valued image. However, the present invention is not limited to this. The present invention includes a configuration in which the image is generated and the area is finally divided from the image.

【0140】また、本発明の目的は、上述した実施の形
態のホスト及び端末の機能を実現するソフトウェアのプ
ログラムコードを記憶した記憶媒体を、システム或いは
装置に供給し、そのシステム或いは装置のコンピュータ
(又はCPUやMPU)が記憶媒体に格納されたプログ
ラムコードを読みだして実行することによっても、達成
されることは言うまでもない。この場合、記憶媒体から
読み出されたプログラムコード自体が本実施の形態の機
能を実現することとなり、そのプログラムコードを記憶
した記憶媒体は本発明を構成することとなる。プログラ
ムコードを供給するための記憶媒体としては、ROM、
フロッピーディスク、ハードディスク、光ディスク、光
磁気ディスク、CD−ROM、CD−R、磁気テープ、
不揮発性のメモリカード等を用いることができる。ま
た、コンピュータが読みだしたプログラムコードを実行
することにより、本実施の形態の機能が実現されるだけ
でなく、そのプログラムコードの指示に基づき、コンピ
ュータ上で稼動しているOS等が実際の処理の一部又は
全部を行い、その処理によって本実施の形態の機能が実
現される場合も含まれることは言うまでもない。さら
に、記憶媒体から読み出されたプログラムコードが、コ
ンピュータに挿入された拡張機能ボードやコンピュータ
に接続された機能拡張ユニットに備わるメモリに書き込
まれた後、そのプログラムコードの指示に基づき、その
機能拡張ボードや機能拡張ユニットに備わるCPUなど
が実際の処理の一部又は全部を行い、その処理によって
本実施の形態の機能が実現される場合も含まれることは
言うまでもない。
Further, an object of the present invention is to supply a storage medium storing program codes of software for realizing the functions of the host and the terminal of the above-described embodiment to a system or an apparatus, and to provide a computer (a computer) of the system or the apparatus. It is needless to say that the present invention can also be achieved by a CPU or an MPU) reading and executing a program code stored in a storage medium. In this case, the program code itself read from the storage medium implements the functions of the present embodiment, and the storage medium storing the program code constitutes the present invention. ROM, as a storage medium for supplying the program code,
Floppy disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape,
A non-volatile memory card or the like can be used. By executing the program code read out by the computer, not only the functions of the present embodiment are realized, but also the OS and the like running on the computer perform actual processing based on the instructions of the program code. It goes without saying that a part or all of the above is performed, and the processing realizes the function of the present embodiment. Further, after the program code read from the storage medium is written to a memory provided in an extension function board inserted into the computer or a function extension unit connected to the computer, the function extension is performed based on the instruction of the program code. It goes without saying that a CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the present embodiment.

【0141】[0141]

【発明の効果】以上説明したように本発明では、処理対
象となる多値画像(カラー文書を読み取って得られた画
像等)を領域分割する際、対象多値画像から、少なくと
も1つ以上の量子化画像(二値化画像等)を作成し、そ
れらの量子化画像から、所定値の画素群を含む領域(一
次元的に連続する黒画素の固まりを含む外接矩形の領域
等)を取得する。また、その領域内に存在する画素群の
始まりの画素(開始画素)及び終わりの画素(終了画
素)についてのヒストグラムをとり、これらの開始画素
及び終了画素の密集点を検出し、さらに、その密集点に
基づき分割して得られる領域内に存在する開始画素及び
終了画素の他次元方向の広がりを検出し、その検出結果
により、実際に分割を行うべきか否か判定して、領域分
割を実行するように構成した。そして、このようにして
取得した全ての領域についての属性、例えば、対象領域
が文字領域であるか否か、文字領域であるならば下地が
黒っぽく文字部が白っぽい反転領域であるか否か、下地
の平均画素値(平均下地色)、文字の平均画素値(平均
文字色)、対象領域を二値化する際に用いる最適な閾値
等の属性を解析するように構成した。これにより、処理
対象となる多値画像が、下地や文字領域部等、様々な色
部の組み合わせが存在する文書から得られたものであっ
ても、最適な領域分割を行うことができると共に、特
に、外接矩形を取ると他の余計な領域を含んでしまうよ
うな領域を有する画像であっても、良好に且つ効率的に
領域分割することが可能となり、その後の処理を矩形単
位で行うこともできる。
As described above, in the present invention, when a multivalued image to be processed (such as an image obtained by reading a color document) is divided into regions, at least one Create a quantized image (such as a binarized image) and obtain an area including a pixel group of a predetermined value (a circumscribed rectangular area including a cluster of one-dimensionally continuous black pixels) from the quantized image. I do. Further, a histogram is obtained for the start pixel (start pixel) and the end pixel (end pixel) of the pixel group existing in the area, and the dense points of these start pixels and end pixels are detected. The start pixel and the end pixel existing in the region obtained by dividing based on the points are detected in other dimension directions, and based on the detection result, it is determined whether or not to actually perform the division, and the region is divided. It was configured to be. The attributes of all the regions obtained in this manner, for example, whether the target region is a character region, if the target region is a character region, whether the background is black and the character portion is a whitish inverted region, , The average pixel value (average background color), the average pixel value (average character color) of characters, and the optimal threshold value used when binarizing the target area are analyzed. Thereby, even if the multivalued image to be processed is obtained from a document in which various combinations of color parts such as a background and a character area part are present, optimal area division can be performed, and In particular, even if the image has an area that would include another unnecessary area if a circumscribed rectangle is taken, it is possible to divide the area satisfactorily and efficiently, and perform subsequent processing in units of rectangles. Can also.

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

【図1】本発明を適用した画像処理装置の構成を説明す
るための図である。
FIG. 1 is a diagram illustrating a configuration of an image processing apparatus to which the present invention has been applied.

【図2】上記画像処理装置の動作を説明するためのフロ
ーチャートである。
FIG. 2 is a flowchart for explaining the operation of the image processing apparatus.

【図3】上記画像処理装置の処理対象となる多値画像の
一例と、当該多値画像に対する二値化処理で発生する複
数の二値化閾値による二値画像を説明するための図であ
る。
FIG. 3 is a diagram for explaining an example of a multi-value image to be processed by the image processing apparatus and a binary image based on a plurality of binarization thresholds generated in a binarization process on the multi-value image. .

【図4】上記多値画像から得られるヒストグラムを説明
するための図である。
FIG. 4 is a diagram for explaining a histogram obtained from the multi-value image.

【図5】上記画像処理装置での黒領域抽出処理を説明す
るためのフローチャートである。
FIG. 5 is a flowchart illustrating a black region extraction process in the image processing apparatus.

【図6】上記黒領域抽出処理での黒画素の固まりの組を
検出する処理を説明するためのフローチャートである。
FIG. 6 is a flowchart for explaining a process of detecting a set of black pixels in the black region extraction process.

【図7】上記画像処理装置の黒領域座標保持部に保持さ
れる情報の一例を説明するための図である。
FIG. 7 is a diagram illustrating an example of information stored in a black area coordinate storage unit of the image processing apparatus.

【図8】上記黒領域抽出処理を具体的に説明するための
図である。
FIG. 8 is a diagram for specifically explaining the black region extraction processing.

【図9】上記黒領域抽出処理を実行する黒領域抽出部の
構成を示すブロック図である。
FIG. 9 is a block diagram illustrating a configuration of a black area extraction unit that performs the black area extraction processing.

【図10】上記画像処理装置での黒領域分割処理を説明
するためのフローチャートである。
FIG. 10 is a flowchart illustrating a black area dividing process in the image processing apparatus.

【図11】上記黒領域分割処理で対象となる二値化画像
の一例と、当該画像から得られる黒画素の固まりの組の
始めの画素及び終わりの画素のヒストグラムを説明する
ための図である。
FIG. 11 is a diagram for explaining an example of a binarized image to be subjected to the black region division processing, and a histogram of the first pixel and the last pixel of a set of black pixels obtained from the image; .

【図12】上記黒領域分割処理での領域分割の結果の一
例を説明するための図である。
FIG. 12 is a diagram illustrating an example of a result of area division in the black area division processing.

【図13】上記黒領域分割処理での領域分割の結果の他
の例を説明するための図である。
FIG. 13 is a diagram for explaining another example of a result of area division in the black area division processing.

【図14】上記黒領域分割処理での領域分割の結果に基
づいて、矩形単位でOCR用に二値化した結果を説明す
るための図である。
FIG. 14 is a diagram for describing a result of binarization for OCR in a rectangular unit based on a result of area division in the black area division processing.

【図15】上記黒領域抽出処理及び上記黒領域分割処理
にて得られた黒領域が入れ子になった状態を説明するた
めの図である。
FIG. 15 is a diagram for explaining a state in which black areas obtained by the black area extraction processing and the black area division processing are nested.

【図16】上記黒領域抽出処理での階層的な黒領域抽出
処理(反転処理による黒領域の抽出処理)を説明するた
めの図である。
FIG. 16 is a diagram for explaining hierarchical black area extraction processing (black area extraction processing by inversion processing) in the black area extraction processing.

【図17】上記黒領域抽出処理(反転処理による黒領域
の抽出処理)でのヒストグラムの一例を説明するための
図である。
FIG. 17 is a diagram illustrating an example of a histogram in the above-described black area extraction processing (black area extraction processing by inversion processing).

【図18】上記黒領域座標保持部に保持される情報の、
黒領域部分の形状が四角であるか否かを示すフラグ情
報”ShapeRectangle”について説明する
ための図である。
FIG. 18 shows information stored in the black area coordinate storage unit.
It is a figure for explaining flag information "ShapeRectangle" which shows whether the shape of a black area part is a square.

【図19】従来の画像領域分割方法を説明するための図
である。
FIG. 19 is a diagram for explaining a conventional image area dividing method.

【図20】上記画像領域分割方法での対象画像(二値化
が困難な多値画像)の輝度分布状態を説明するための図
である。
FIG. 20 is a diagram for describing a luminance distribution state of a target image (a multi-valued image that is difficult to binarize) in the image area dividing method.

【図21】アダプティブ閾値二値化方式での従来の画像
領域分割方法を説明するための図である。
FIG. 21 is a diagram for explaining a conventional image area dividing method using an adaptive threshold binarization method.

【図22】上記画像領域分割方法で対象となる画像の一
例を説明するための図である。
FIG. 22 is a diagram for explaining an example of an image to be processed by the image area dividing method.

【図23】上記画像に対して上記画像領域分割方法によ
る処理を行った結果に基づいて、矩形単位でのOCR用
に二値化した結果を説明するための図である。
FIG. 23 is a diagram for describing a result of binarization for OCR in a rectangular unit based on a result of performing the image region dividing method on the image.

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

100 画像処理装置 101 輝度変換部 102 多値メモリ 103 ヒストグラム 104 閾値決定部 105 二値化部 106 二値メモリ 107 黒領域抽出部 108 黒領域座標保持部 109 領域解析部 110 黒領域分割部 REFERENCE SIGNS LIST 100 Image processing device 101 Luminance conversion unit 102 Multi-valued memory 103 Histogram 104 Threshold value determination unit 105 Binarization unit 106 Binary memory 107 Black region extraction unit 108 Black region coordinate holding unit 109 Area analysis unit 110 Black region division unit

Claims (16)

【特許請求の範囲】[Claims] 【請求項1】 多値画像の領域分割を行う画像処理装置
であって、 上記多値画像から複数の量子化画像を取得する量子化手
段と、 上記二値化手段により得られた量子化画像から、所定値
を有する画素群を含む領域を抽出する領域抽出手段と、 上記領域抽出手段により得られた領域を、当該領域内に
存在する画素群の開始画素及び終了画素の密集状態に基
づいて分割する領域分割手段と、 上記領域抽出手段及び上記領域分割手段により得られた
各領域についての属性を解析する領域解析手段を備える
ことを特徴とする画像処理装置。
1. An image processing apparatus for dividing an area of a multi-valued image, comprising: a quantizing means for acquiring a plurality of quantized images from the multi-valued image; and a quantized image obtained by the binarizing means. A region extracting means for extracting a region including a pixel group having a predetermined value, and a region obtained by the region extracting unit, based on a density of start pixels and end pixels of a pixel group present in the region. An image processing apparatus comprising: an area dividing unit that divides an image; and an area analyzing unit that analyzes an attribute of each area obtained by the area extracting unit and the area dividing unit.
【請求項2】 上記量子化手段は、上記量子化画像とし
て二値化画像を取得することを特徴とする請求項1記載
の画像処理装置。
2. The image processing apparatus according to claim 1, wherein said quantization means acquires a binarized image as said quantized image.
【請求項3】 上記量子化手段は、上記多値画像におけ
る、上記領域抽出手段の領域抽出結果に基づいた領域部
分の量子化画像を取得することを特徴とする請求項1記
載の画像処理装置。
3. The image processing apparatus according to claim 1, wherein said quantization means acquires a quantized image of an area portion of said multi-valued image based on an area extraction result of said area extraction means. .
【請求項4】 上記量子化手段は、上記多値画像のヒス
トグラムから得られた複数の閾値に基づいて、上記複数
の量子化画像を取得することを特徴とする請求項1記載
の画像処理装置。
4. The image processing apparatus according to claim 1, wherein said quantization means acquires said plurality of quantized images based on a plurality of thresholds obtained from a histogram of said multi-valued image. .
【請求項5】 上記領域抽出手段は、 上記量子化画像から、上記所定値を有する画素が一次元
的に連続する画素群を検出する検出手段と、 上記検出手段により検出された画素群の座標情報を保持
する第1の保持手段と、 上記検出手段により既に検出された画素群の座標情報を
保持する第2の保持手段と、 上記第1の保持手段内の情報と上記第2の保持手段内の
情報の結合処理を行う結合手段とを含むことを特徴とす
る請求項1記載の画像処理装置。
5. An area extracting means, comprising: a detecting means for detecting, from the quantized image, a pixel group in which pixels having the predetermined value are one-dimensionally continuous; and coordinates of the pixel group detected by the detecting means. First holding means for holding information; second holding means for holding coordinate information of a pixel group already detected by the detection means; information in the first holding means; and the second holding means 2. The image processing apparatus according to claim 1, further comprising a combining unit configured to perform a combining process of the information in the image data.
【請求項6】 上記検出手段は、上記量子化画像上にお
いて、Mライン毎に上記領域の検出を行うことを特徴と
する請求項5記載の画像処理装置。
6. The image processing apparatus according to claim 5, wherein said detecting means detects said area for every M lines on said quantized image.
【請求項7】 上記領域抽出手段にて抽出される領域
は、一次元的に連続する画素群を含む外接矩形の領域を
含み、 上記領域分割手段は、 上記領域抽出手段にて抽出された領域内に含まれる画素
群の開始画素及び終了画素のヒストグラムから、当該開
始画素及び終了画素の密集点を検出する第1の検出手段
と、 上記第1の検出手段での検出結果に基づき得られる分割
領域内に存在する画素群の開始画素及び終了画素につい
て、上記一次元方向とは異なる次元方向の広がりを検出
する第2の検出手段と、 上記第2の検出手段での検出結果に基づいて、領域分割
を実行する分割手段とを含むことを特徴とする請求項1
記載の画像処理装置。
7. The area extracted by the area extracting means includes a circumscribed rectangular area including a one-dimensionally continuous pixel group, and the area dividing means includes an area extracted by the area extracting means. A first detection unit that detects a dense point of the start pixel and the end pixel from a histogram of the start pixel and the end pixel of the pixel group included in the pixel group; and a division obtained based on a detection result of the first detection unit. For a start pixel and an end pixel of a pixel group present in the region, a second detection unit that detects a spread in a dimensional direction different from the one-dimensional direction, based on a detection result by the second detection unit, 2. A dividing means for executing region division.
An image processing apparatus as described in the above.
【請求項8】 複数の機器が通信可能に接続されてなる
画像処理システムであって、 上記複数の機器のうち少なくとも1つの機器は、請求項
1〜7の何れかに記載の画像処理装置の機能を有するこ
とを特徴とする画像処理システム。
8. An image processing system in which a plurality of devices are communicably connected, wherein at least one of the plurality of devices is the image processing apparatus according to any one of claims 1 to 7. An image processing system having a function.
【請求項9】 多値画像の領域分割を行うための画像処
理方法であって、 上記多値画像からから少なくとも1つ以上の量子化画像
を作成し、その量子化画像から、黒画素の固まりの領域
を取得する領域抽出ステップと、 上記領域抽出ステップにより得られた黒領域を、当該黒
領域内に存在する黒画素の固まりの開始画素及び終了画
素の密集状態に基づいて分割する領域分割ステップと、 上記領域抽出ステップ及び領域分割ステップにより得ら
れた全ての領域に対して、その属性を解析する領域解析
ステップとを含むことを特徴とする画像処理方法。
9. An image processing method for dividing a multi-valued image into regions, wherein at least one or more quantized images are created from the multi-valued image, and a cluster of black pixels is formed from the quantized image. And an area dividing step of dividing the black area obtained by the area extracting step on the basis of the density of the start pixels and end pixels of the cluster of black pixels existing in the black area. And an area analysis step of analyzing attributes of all areas obtained by the area extraction step and the area division step.
【請求項10】 上記領域抽出ステップは、上記量子化
画像として二値化画像を作成するステップを含むことを
特徴とする請求項9記載の画像処理方法。
10. The image processing method according to claim 9, wherein said region extracting step includes a step of creating a binarized image as said quantized image.
【請求項11】 上記少なくとも1つ以上の量子化画像
の一部は、上記多値画像の全面から得られた量子化画像
ではないことを特徴とする請求項9記載の画像処理方
法。
11. The image processing method according to claim 9, wherein a part of the at least one quantized image is not a quantized image obtained from the entire surface of the multi-valued image.
【請求項12】 上記領域抽出ステップは、 上記量子化画像から、一次元的に連続する黒画素の固ま
り検出する黒検出ステップと、 上記黒検出ステップにより検出された黒画素の固まりの
座標情報を保持する第1の保持ステップと、 上記黒検出ステップにより既に検出された黒画素の固ま
りの座標情報を保持する第2の保持ステップと、 上記第1の保持ステップによる保持情報と上記第2の保
持ステップによる保持情報の結合処理を行う結合ステッ
プを含むことを特徴とする請求項9記載の画像処理方
法。
12. The region extracting step includes: a black detecting step of detecting a one-dimensionally continuous black pixel cluster from the quantized image; and a coordinate information of the black pixel cluster detected by the black detecting step. A first holding step of holding; a second holding step of holding coordinate information of a cluster of black pixels already detected by the black detection step; a holding information by the first holding step; and the second holding The image processing method according to claim 9, further comprising a combining step of performing a combining process of the held information by the steps.
【請求項13】 上記黒検出ステップは、上記量子化画
像上においてMライン毎に上記検出処理を実行するステ
ップを含むことを特徴とする請求項12記載の画像処理
方法。
13. The image processing method according to claim 12, wherein the black detection step includes a step of executing the detection processing for each M lines on the quantized image.
【請求項14】 上記領域抽出ステップにより抽出され
る黒領域は、一次元的に連続する黒画素の固まりを含む
外接矩形の領域を含み、 上記領域分割ステップは、 上記領域抽出ステップにより抽出された黒領域内に含ま
れる黒画素の固まりの開始画素及び終了画素のヒストグ
ラムから、当該開始画素及び終了画素の密集点を検出す
る第1の検出ステップと、 上記第1の検出ステップでの検出結果に基づいて上記黒
領域を分割し、その分割領域内に存在する画素群の開始
画素及び終了画素について、上記一次元方向とは異なる
次元方向の広がりを検出する第2の検出ステップと、 上記第2の検出ステップでの検出結果に基づいて、上記
黒領域の分割を実行する分割ステップとを含むことを特
徴とする請求項9記載の画像処理方法。
14. The black area extracted in the area extraction step includes a circumscribed rectangular area including a cluster of one-dimensionally continuous black pixels, and the area division step is extracted in the area extraction step. A first detection step of detecting a dense point of the start pixel and the end pixel from a histogram of a start pixel and an end pixel of a cluster of black pixels included in the black region; and a detection result of the first detection step. A second detection step of dividing the black region based on the first region and detecting a spread of a start pixel and an end pixel of a pixel group existing in the divided region in a dimensional direction different from the one-dimensional direction; 10. The image processing method according to claim 9, further comprising a dividing step of dividing the black region based on a detection result in the detecting step.
【請求項15】 請求項1〜7の何れかに記載の画像処
理装置の機能、又は請求項8記載の画像処理システムの
機能を実施するための処理プログラムを、コンピュータ
が読出可能に格納したことを特徴とする記憶媒体。
15. A computer readable storage of a processing program for implementing the function of the image processing apparatus according to claim 1 or the function of the image processing system according to claim 8. A storage medium characterized by the above-mentioned.
【請求項16】 請求項9〜14の何れかに記載の画像
処理方法の処理ステップを、コンピュータが読出可能に
格納したことを特徴とする記憶媒体。
16. A storage medium, wherein the processing steps of the image processing method according to claim 9 are readable by a computer.
JP37160699A 1999-12-27 1999-12-27 Device, system and method for processing image and storage medium Pending JP2001184511A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP37160699A JP2001184511A (en) 1999-12-27 1999-12-27 Device, system and method for processing image and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP37160699A JP2001184511A (en) 1999-12-27 1999-12-27 Device, system and method for processing image and storage medium

Publications (1)

Publication Number Publication Date
JP2001184511A true JP2001184511A (en) 2001-07-06

Family

ID=18498996

Family Applications (1)

Application Number Title Priority Date Filing Date
JP37160699A Pending JP2001184511A (en) 1999-12-27 1999-12-27 Device, system and method for processing image and storage medium

Country Status (1)

Country Link
JP (1) JP2001184511A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7317835B2 (en) 2002-07-31 2008-01-08 Canon Kabushiki Kaisha Image processing method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7317835B2 (en) 2002-07-31 2008-01-08 Canon Kabushiki Kaisha Image processing method and apparatus

Similar Documents

Publication Publication Date Title
JP4646797B2 (en) Image processing apparatus, control method therefor, and program
US8155445B2 (en) Image processing apparatus, method, and processing program for image inversion with tree structure
JP3308032B2 (en) Skew correction method, skew angle detection method, skew correction device, and skew angle detection device
JP4732250B2 (en) Information processing apparatus, control method, and computer program
JP4522468B2 (en) Image discrimination device, image search device, image search program, and recording medium
US7277584B2 (en) Form recognition system, form recognition method, program and storage medium
US8300939B2 (en) Image processing method, image processing apparatus, and program
JP6743092B2 (en) Image processing apparatus, image processing control method, and program
US6360006B1 (en) Color block selection
US20020006224A1 (en) Computer automated process for vectorization of raster images
US8150185B2 (en) Image processing for generating a thin line binary image and extracting vectors
JP2001184511A (en) Device, system and method for processing image and storage medium
JP2003115031A (en) Image processor and its method
JP7301529B2 (en) Image processing device, image processing method, and program
JP2001186338A (en) Device, system and method for picture processing, and storage medium
JP7043667B1 (en) Information processing equipment, programs, and information processing methods
JP2020053818A (en) Image processing apparatus, image processing method, and program
US8184910B2 (en) Image recognition device, image recognition method, and image scanning apparatus having image recognition device
JPH08237404A (en) Selection of optical character recognition mode
JPH11288453A (en) Method and system for detecting skew angle and black boundary line of original image in scan environment for reproduction
JP3253201B2 (en) Image processing device and image type determination method
KR100334624B1 (en) Clustering based document image segmentation method
JPH0535914A (en) Picture inclination detection method
JPS6331825B2 (en)
JP2001143076A (en) Image processor