JP2001186338A - Device, system and method for picture processing, and storage medium - Google Patents

Device, system and method for picture processing, and storage medium

Info

Publication number
JP2001186338A
JP2001186338A JP37178199A JP37178199A JP2001186338A JP 2001186338 A JP2001186338 A JP 2001186338A JP 37178199 A JP37178199 A JP 37178199A JP 37178199 A JP37178199 A JP 37178199A JP 2001186338 A JP2001186338 A JP 2001186338A
Authority
JP
Japan
Prior art keywords
image
area
black
image processing
region
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
JP37178199A
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 JP37178199A priority Critical patent/JP2001186338A/en
Publication of JP2001186338A publication Critical patent/JP2001186338A/en
Pending legal-status Critical Current

Links

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a picture processor capable of dividing the area of a multilevel picture optimally. SOLUTION: A threshoding means 105 obtains a plurality of threshold processed pictures from the multilevel picture (a color picture, etc., obtained by reading a color document). An area extraction means 107 extracts the area (black area) of the group of pixels having a prescribed value from the threshold processed pictures obtained by the means 105. An area analyzing means 109 analyzes attributes concerning all the areas obtained by the means 107.

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くらいまで縮
小することが可能となる。また、文字領域部について
は、OCRを行うことによってコード化すれば、後々の
ファイルの検索も可能となり、他のテキストエディット
型アプリケーションでの再利用も可能となる。
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. Also, if the character area portion is coded by performing OCR, later file search can be performed, and reuse in another text edit type application is also possible.

【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】具体的には例えば、図13(a)に示すよ
うな文書900があるとする。文書900において、色
bの領域B上には、”あいうえお”という文字Aが色a
で書かれており、色dの領域D上には、”かきくけこ”
という文字Cが色cで書かれており、これらの文字A、
領域B、文字C、領域Dの各輝度レベルは、上記図13
(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
3(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.
The results are as shown in FIGS.

【0007】上記図13(c)は、二値化閾値を文字A
の輝度レベルと文字Cの輝度レベルの間の値(同図
(b)中””で示す)とした場合に得られる二値化画
像901を示したものである。上記図13(d)は、二
値化閾値を文字Cの輝度レベルと領域Bの輝度レベルの
間の値(同図(b)中””で示す)とした場合に得ら
れる二値化画像902を示したものである。上記図13
(e)は、二値化閾値を領域Bの輝度レベルと領域Dの
輝度レベルの間の値(同図(b)中””で示す)とし
た場合に得られる二値化画像903を示したものであ
る。したがって、上記図13(b)中””で示す値を
二値化閾値として得られた、同図(d)に示す二値化画
像902でないと、全ての文字を検出できる領域分割は
望めない。
FIG. 13 (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. 13D 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. 13B). 902. FIG. 13 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. 13D is obtained, in which the value indicated by "" in FIG. 13B is obtained as the binarization threshold, the region division in which all characters can be detected cannot be expected. .

【0008】しかしながら、文字Cの輝度レベルと領域
Bの輝度レベルが、図14に示すように、文字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】そこで、上記の問題を解決するために、領
域によって二値化閾値を変化させて二値化を行うアダプ
ティブ閾値二値化方式があるが、例えば、図15(a)
に示すような、黒っぽい色d’(低輝度)の領域D上
に、”かきくけこ”という文字Cが白っぽい色c’(高
輝度)で書かれた文書904に対しては、最適な領域分
割が行えない。すなわち、文字A、領域B、文字C、領
域Dの輝度レベルは、上記図15(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-mentioned problem, there is an adaptive threshold binarization method in which the binarization is changed by changing the binarization threshold depending on the region. 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 brightness 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】そこで、本発明は、上記の欠点を除去する
ために成されたもので、多値画像の領域分割を最適に行
える、画像処理装置、画像処理システム、画像処理方
法、及びそれを実施するための処理ステップをコンピュ
ータが読出可能に格納した記憶媒体を提供することを目
的とする。
Accordingly, the present invention has been made to eliminate the above-mentioned drawbacks, and is an image processing apparatus, an image processing system, an image processing method, and an image processing method capable of optimally dividing a multivalued image into regions. It is an object of the present invention to provide a storage medium in which processing steps for performing the processing are stored in a computer-readable manner.

【0011】[0011]

【課題を解決するための手段】斯かる目的下において、
第1の発明は、多値画像の領域分割を行う画像処理装置
であって、上記多値画像から複数の量子化画像を取得す
る量子化手段と、上記量子化手段により得られた複数の
量子化画像から所定値を有する画素群の領域を抽出する
領域抽出手段と、上記領域抽出手段により得られた各領
域についての属性を解析する領域解析手段を備えること
を特徴とする。
For such a purpose,
A first aspect of the present invention is an image processing apparatus that divides a multi-valued image into regions, wherein the quantizing unit acquires a plurality of quantized images from the multi-valued image, and the plurality of quantized images obtained by the quantizing unit. A region extraction unit for extracting a region of a pixel group having a predetermined value from the coded image; and a region analysis unit for analyzing an attribute of each region obtained by the region extraction unit.

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

【0013】第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.

【0014】第4の発明は、上記第1の発明において、
上記量子化手段は、上記多値画像のヒストグラムから得
られた複数の閾値に基づいて、上記複数の量子化画像を
取得することを特徴とする。
[0014] In a fourth aspect based on 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.

【0015】第5の発明は、上記第1の発明において、
上記領域抽出手段での上記領域の抽出結果を保持する領
域保持手段を備え、上記領域抽出手段は、上記量子化画
像から上記画素群の領域を検出する検出手段と、上記検
出手段により検出された領域の情報と、上記検出手段に
より既に検出され上記領域保持手段に保持されている領
域の情報との結合処理を行う結合手段とを含み、上記領
域保持手段は、上記結合手段での結合処理の結果を保持
することを特徴とする。
According to a fifth aspect based on the first aspect,
An area holding means for holding an extraction result of the area by the area extracting means, wherein the area extracting means detects the area of the pixel group from the quantized image, and the area extracting means detects the area of the pixel group. A coupling unit that performs a coupling process of the area information and the information of the region already detected by the detection unit and held in the region holding unit, wherein the region holding unit performs the coupling process by the coupling unit; The feature is to retain the result.

【0016】第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.

【0017】第7の発明は、複数の機器が通信可能に接
続されてなる画像処理システムであって、上記複数の機
器のうち少なくとも1つの機器は、請求項1〜6の何れ
かに記載の画像処理装置の機能を有することを特徴とす
る。
According to a seventh 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 any one of claims 1 to 6. It has a function of an image processing device.

【0018】第8の発明は、多値画像の領域分割を行う
ための画像処理方法であって、上記多値画像からから少
なくとも1つ以上の量子化画像を作成し、その二値化画
像から黒画素の固まりの領域を取得する領域抽出ステッ
プと、上記領域抽出ステップにより得られた全ての領域
に対して、その属性を解析する領域解析ステップとを含
むことを特徴とする。
An eighth 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 the quantized image is formed from the binarized image. The method is characterized by including a region extracting step of acquiring a region of a group of black pixels, and a region analyzing step of analyzing attributes of all regions obtained by the region extracting step.

【0019】第9の発明は、上記第8の発明において、
上記領域抽出ステップは、上記量子化画像として二値化
画像を作成するステップを含むことを特徴とする。
According to a ninth aspect, in the eighth aspect,
The region extracting step includes a step of creating a binarized image as the quantized image.

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

【0021】第11の発明は、上記第8の発明におい
て、上記領域抽出ステップでの上記黒画素の固まりの領
域の取得結果を保持する保持ステップを含み、上記領域
抽出ステップは、上記量子化画像から、連続する黒画素
の領域を検出する黒検出ステップと、上記黒検出ステッ
プにより検出された領域の情報と、上記黒検出ステップ
により既に検出され上記保持ステップにより保持された
領域の情報との結合処理を行う結合ステップとを含み、
上記保持ステップは、上記結合ステップでの結合処理の
結果を保持するステップを含むことを特徴とする。
According to an eleventh aspect based on the eighth aspect, the image processing apparatus further includes a holding step of holding an acquisition result of the area of the cluster of black pixels in the area extracting step. From the black detection step of detecting a continuous black pixel area, the information of the area detected by the black detection step, and the information of the area already detected by the black detection step and held by the holding step And a combining step for performing processing.
The holding step includes a step of holding a result of the combining process in the combining step.

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

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

【0024】第14の発明は、請求項8〜12の何れか
に記載の画像処理方法の処理ステップを、コンピュータ
が読出可能に格納した記憶媒体であることを特徴とす
る。
According to a fourteenth 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 eighth to twelfth aspects.

【0025】[0025]

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

【0026】本発明は、例えば、図1に示すような画像
処理装置100に適用される。この画像処理装置100
は、上記図1に示すように、入力画像情報(多値画像情
報)から輝度情報(輝度値)を取得する輝度変換部10
1と、輝度変換部101により得られた輝度情報を1画
像分保持する多値画像メモリ102と、多値画像メモリ
102内の輝度情報に基づきヒストグラムを生成するス
トグラム演算部103と、ヒストグラム演算部103に
て得られたヒストグラムに基づき複数の閾値を決定する
閾値決定部104と、ヒストグラム演算部103にて得
られたヒストグラムに基づき最適二値化閾値等を取得す
る領域解析部109と、閾値決定部104や領域解析部
109にて得られた閾値に基づき二値化画像を作成する
二値化部105と、二値化部105にて得られた二値化
画像を保持する二値画像メモリ106と、二値画像メモ
リ106内の二値化画像から黒領域の座標情報を取得す
る黒領域抽出部107と、黒領域抽出部107及び領域
解析部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 acquiring coordinate information of a black region from the binary image in the binary image memory 106, and a black region extracting unit 107 and a region analyzing unit 109. And a black area coordinate holding unit 108 for holding the obtained information, the histogram calculation unit 103
The binarizing unit 105 executes each process based on the information in the black area coordinate holding unit 108.

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

【0028】ステップ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).

【0029】ステップ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.

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

【0031】具体的には例えば、対象画像として、図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.

【0032】そこで、閾値決定部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.

【0033】そして、閾値決定部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 the condition 1> satisfies the condition 2> satisfies the 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.

【0034】したがって、上記図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.

【0035】その後、閾値決定部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.

【0036】尚、上述のような閾値決定部104におい
て、後処理での閾値の消去処理は必須の処理ではない。
また、条件1や条件4において、参照点から逆上る値に
ついても、”10”や”40”等に限られるものではな
く、任意の値(スキャナの特性に依存した値等)を用い
るようにしてもよい。また、閾値決定部104での処理
は、上記図4に示したようなヒストグラム上のノイズに
惑わされないように平均化しながら実行するようにして
もよい。また、条件1〜条件6に従って閾値を検出する
際、参照点において、条件1〜条件6がそれぞれ1回発
生したら、当該参照点の輝度値を閾値として決定するの
ではなく、例えば、2回連続して発生した場合に、当該
参照点の輝度値を閾値として決定するようにしてもよ
い。
In the above-described threshold value determining unit 104, the threshold value erasing process in the post-processing is not an essential process.
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.

【0037】ステップS204:二値化部(単純二値化
部)105は、閾値決定部104にて得られた複数の二
値化閾値、或いは領域解析部109にて得られた後述す
る閾値に基づいて、多値画像メモリ102に保持されて
いる対象画像(対象画像を構成する各画素の輝度情報)
を二値化して、二値化画像を生成する。二値メモリ10
6は、二値化部105にて得られた二値化画像を保持す
る。
Step S204: The binarization unit (simple binarization unit) 105 converts the plurality of binarization threshold values obtained by the threshold value determination unit 104 or the threshold values described later obtained by the region analysis unit 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.

【0038】したがって、例えば、対象画像として上記
図3(a)に示した文書の多値画像情報が入力され、二
値化部105において、閾値決定部104にて得られた
複数の二値化閾値401〜403に基づいた二値化画像
の生成が行われた場合、二値メモリ106には、上記図
3(b)〜(c)に示すような二値化画像が保持される
ことになる。上記図3(b)は、二値化閾値401に基
づいた二値化により得られた二値化画像を示したもので
あり、同図(c)は、二値化閾値402に基づいた二値
化により得られた二値化画像を示したものであり、同図
(d)は、二値化閾値403に基づいた二値化により得
られた二値化画像を示したものである。
Accordingly, for example, the multi-valued image information of the document shown in FIG. 3A is input as the target image, and the binarizing unit 105 outputs the plurality of binarized images obtained by the threshold value determining 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.

【0039】ステップS205:黒領域抽出部107
は、二値メモリ106に保持された二値化画像から、黒
領域の座標情報を作成する。例えば、詳細は後述する
が、黒領域抽出部107は、上記図4に示した二値化閾
値401〜403のうち、”白”(輝度値”255”)
に対応する輝度値に一番近い閾値401に基づいた二値
化により得られた二値化画像(上記図3(b)参照)を
二値画像メモリ206から読み出し、その二値化画像に
おいて、”黒”に対応する画素値を有する画素の固まり
の座標を抽出することで、黒領域の座標情報を作成す
る。また、他の閾値により得られた二値化画像について
も同様にして、黒領域の座標情報を作成する。黒領域座
標保持部108は、黒領域抽出部107にて得られた黒
領域の座標情報を保持する。
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 area coordinate holding unit 108 holds the coordinate information of the black area obtained by the black area extraction unit 107.

【0040】ステップ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.

【0041】尚、上記図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.

【0042】図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.

【0043】ステップ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”.

【0044】ステップS502:カウンタjが、予め設
定された値height(対象二値化画像の縦幅)に達
したか否かを判別する。この判別の結果、「j<hei
ght」でない場合、対象二値化画像に対する本処理が
終了したと認識して本処理を終了する。一方、「j<h
eight」である場合には、次のステップS503か
らの処理を実行する。
Step S502: It is determined whether or not the counter j has reached a predetermined 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.

【0045】ステップ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, the details will be described later, but 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].

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

【0047】ステップ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.

【0048】ステップ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 a 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.

【0049】ステップ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.

【0050】ステップS508:ステップS507での
判別の結果、座標xstart[l]及び座標xend
[l]により示される黒画素の固まりが、上記既に存在
する全ての構造体Groupの何れかとも結合されなか
った場合、座標xstart[l]及び座標xend
[l]により示される黒画素の固まりを、新規の構造体
Groupへ登録する。この登録された構造体Grou
pが、上述したステップS506での結合処理にて用い
られる。尚、ここでの”構造体Group”についての
詳細は後述する。
Step S508: As a result of the determination 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.

【0051】ステップ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.

【0052】ステップ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 performed for all the sets of 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.

【0053】図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;

【0054】ステップS601:先ず、対象ライン(縦
方向のカウンタjにより示される対象二値化画像におけ
るライン)を構成する全ての画素に対して、予め設定さ
れたサンプリングパラメータsample_yokoに
より示される画素数毎に、本処理を実行するためのカウ
ンタi(横方向(主走査方向)のカウンタ)を”0”に
リセットする。また、後述するステップ処理にて用いる
フラグstartflagを”OFF”にセットすると
共に、黒画素の固まりの組数を示す”linenum”
を”0”にリセットする。
Step S601: First, for all the pixels 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”.

【0055】ステップ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.

【0056】ステップ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.

【0057】尚、ステップ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 on which pattern matching is performed 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.

【0058】ステップ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.

【0059】ステップS605:ステップS604の判
別の結果、「startflag=OFF」である場
合、黒画素の固まりの組の始めの画素の座標を示すxs
tart[linenum]に対して、カウンタiを設
定する。すなわち、現在の”linenum”の値で示
される黒画素の固まりの組(対象組)の始めの画素の座
標を示すxstart[linenum]に対して、カ
ウンタiで示される画素(注目画素)の座標を設定す
る。また、フラグstartflagに対して、xst
art[linenum]への設定が終了し、xend
[linenum]への設定が未だ終了していないこと
を示すために、”ON”を設定する。
Step S605: If the result of determination in step S604 is that "startflag = OFF", xs indicating the coordinates of the first pixel in 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.

【0060】ステップ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 counter i (counter in the horizontal direction (main scanning direction)) pixel, 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.

【0061】ステップ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.

【0062】ステップ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 preset 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.

【0063】ステップS608:ステップS613又は
ステップS607にて、「startflag=ON」
であると判別された場合、黒画素の固まりの組の終わり
の画素の座標を示すxend[linenum]に対し
て、”カウンタi−1”を設定する。すなわち、”li
nenum”で示される黒画素の固まりの組(対象組)
の終わりの画素の座標を示すxend[linenu
m]に対して、カウンタiで示される画素(注目画素)
の前の画素の座標を設定する。
Step S608: In step S613 or 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.

【0064】ステップ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.

【0065】ステップ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.

【0066】ステップ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.

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

【0068】上記図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 shown 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.

【0069】構造体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.

【0070】上記図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 process shown in FIG. 5, a set of black pixels (structure Pa) obtained by the process 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.

【0071】また、構造体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.

【0072】図8(a)〜(f)は、黒領域抽出部10
7での上記図5及び図6に示した処理の実行により、対
象二値化画像上では、どのような処理が実際に行われる
かを具体的に示したものである。
FIGS. 8A to 8F show the black region extraction 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.

【0073】上記図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.

【0074】このとき、既に存在する構造体Group
は無い状態であるので、ステップS508において、新
規の2つの構造体Groupが作成され、これらの構造
体Groupのメンバーとして、構造体Parts80
1,802がそれぞれ登録(設定)される。
At this time, the already 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).

【0075】この場合、構造体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, for 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.

【0076】上記図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, 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.

【0077】このとき、既に存在する構造体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.

【0078】上記結合処理により、例えば、構造体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-described joining 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).

【0079】上記図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.

【0080】このとき、既に存在する構造体Group
としては、構造体Group806,807と、構造体
Parts805の構造体Group805’とが存在
するため、ステップS506にて、構造体Group8
06,807,805’に対する構造体Parts80
8の結合処理(座標比較による結合処理)が行われる。
At this time, the 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).

【0081】ここで、構造体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, 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).

【0082】この場合、構造体Group809として
は、構造体Group807の情報(上記図7参照)が
用いられ、構造体Group805’は消去される。但
し、構造体Group807の情報において、 next =構造体Group805’の”firs
t”により示される構造体Partsのアドレス last =構造体Group805’の”las
t”により示される構造体Partsのアドレス という、”next”及び”last”の情報の書き換
えが行われ、その結果が、構造体Group809の情
報とされる。
In this case, the 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.

【0083】上記図8(d),(f)参照:したがっ
て、構造体Parts801,803を含む構造体Gr
oup806と、構造体Parts802,804,8
05,808を含む構造体Group806との2つの
構造体Groupが生成される。
8 (d) and 8 (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.

【0084】以上説明したような黒領域(構造体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).

【0085】この結果、例えば、対象画像が、上記図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.

【0086】また、上記図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 based on the binarized threshold
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.

【0087】また、上記図3(d)に示すように、二値
化閾値403に基づいた二値化画像からは、黒領域31
0が抽出される。この黒領域310を示す構造体Gro
upでは、フラグ情報”ShapeRectangl
e”が、”FALSE(黒領域部分の形状が四角でな
い)”に設定されており、フラグ情報”SameAsM
other”が、”TRUE(同じオブジェクトが存在
する)”に設定されている。
As shown in FIG. 3D, the binarized image based on the binarization threshold 403 shows that the black area 31
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)".

【0088】したがって、閾値決定部104にて決定さ
れた複数の二値化閾値に対応する全ての二値化画像から
得られた、全ての黒領域301〜310の座標情報が、
黒領域座標保持部108に保持されることになる。
Therefore, the coordinate information of all the black regions 301 to 310 obtained from all the binarized images corresponding to the plurality of binarization thresholds determined by the threshold determination unit 104 is:
It is stored in the black area coordinate storage unit 108.

【0089】尚、黒領域の抽出の際、フラグ情報”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.

【0090】領域解析部109は、上記図2に示したス
テップS206において、黒領域座標保持部108に保
持された全ての黒領域に対して、対象黒領域が文字領域
であるか否か、文字領域であるならば反転領域であるか
否か、当該下地の平均画素値(平均下地色)、当該文字
の平均画素値(平均文字色)、二値化の際に用いる最適
な二値化閾値等の解析情報を取得する。
In step S206 shown in FIG. 2, the region analyzing unit 109 determines whether or not the target black region is a character region for all the black regions held in the black region 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.

【0091】例えば、黒領域座標保持部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.

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

【0093】マップ画像を利用した方法:この方法は、
ヒストグラム演算部103において、黒領域のヒストグ
ラムを生成する際、マップ画像を用いる方法である。例
えば、”0”に近い二値化閾値403で二値化した結果
(上記図3(d)に示した二値化画像)から抽出された
黒領域310のヒストグラムを作成する場合、対象画像
(上記図3(a)に示した文書の多値画像)のマップ画
像を用意し、当該マップ画像を構成する全ての画素を”
0”で初期化しておく。そして、黒領域310のヒスト
グラムを作成するときにアクセスした画素部に対応する
マップ画像の画素部を”1”に設定する。これにより、
マップ画像では、アクセスされていない画素部は”0”
であり、アクセスされた画素部は”1”となるため、画
素値が”1”でない画素の情報を用いてヒストグラムを
作成すればよい。このような方法により、ヒストグラム
演算部103でのヒストグラムの作成が行われることに
よって、領域解析部109は、上記図9に示したような
関係にある黒領域であっても、画素情報の重複のない正
確な当該黒領域のヒストグラムを取得することができる
ため、最適な解析処理を行なうことができる。
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.

【0094】尚、上述のマップ画像を利用した方法にお
いて、フラグ情報”SameAsMother”が”T
RUE(同じオブジェクトが存在する)”である黒領域
については、最終的な二値化処理時において重複二値化
をする時間を削減するために、二値化処理しないように
構成してもよい。この場合、当該黒領域については、領
域解析部109での解析処理についても行なわない、或
いは、解析処理を行ってもマップ画像での当該黒領域に
対応する画素部に対して”1”を設定しないようにす
る。
In the method using the map image described above, 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.

【0095】領域解析部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

【0096】[0096]

【数1】 (Equation 1)

【0097】なる演算により求め、この結果えられたス
キューskewの絶対値が、対象黒領域が存在する二値
化画像取得時の二値化閾値より大きい場合、対象黒領域
は文字領域であると認識し、対象黒領域を示す構造体G
roupのフラグ情報”CharaFlg”を”TRU
E”に設定する。また、この場合、さらに上記スキュー
skewの値が「正」である場合、対象黒領域が反転文
字領域(下地が黒っぽく、文字部が白っぽい領域)であ
ると認識し、対象黒領域を示す構造体Groupのフラ
グ情報”InvertFlg”を”TRUE”に設定す
る。また、この場合の対象黒領域を二値化するのにふさ
わしい閾値として、対象黒領域の下地部分が消去される
ような閾値を対象黒領域のヒストグラムから求め、その
結果を、対象黒領域を示す構造体Groupの情報”T
hreshold”へ設定する。
If the absolute value of the skew skew thus obtained 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 ".

【0098】上述のようにして、領域解析部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 ”.

【0099】まず、構造体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.

【0100】具体的には例えば、上記図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 regions 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.

【0101】黒領域301に対応する多値画像の領域を
反転したものを、図10(a)に示す。この反転画像3
50に対して、先ず、上記図2のステップS202にて
ヒストグラム演算部103により処理が実行されると、
図11に示すようなヒストグラムが得られる。次のステ
ップS203では、閾値決定部104により、上記図1
1に示す2つの二値化閾値451,452が決定され
る。次のステップS204では、二値化部105によ
り、上記図10(b)及び(c)に示すような二値化画
像が得られる。上記図10(b)に示す二値化画像は、
二値化閾値451に基づいた二値化により得られた画像
であり、同図(c)に示す二値化画像は、二値化閾値4
52に基づいた二値化により得られた画像である。
FIG. 10A shows an inverted multivalued 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. 11 is obtained. In the next step S203, the threshold determination unit 104 causes the above-described FIG.
2, 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. 10B and 10C. 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.

【0102】そして、次のステップS205では、黒領
域抽出部107により、上記図10(b)に示す二値化
画像から黒領域351〜355が抽出される。これらの
黒領域351〜355のうち、黒領域351〜354に
ついては、当該領域が四角形状であるため、領域解析部
109は、これを認識し、これらの黒領域351〜35
4を示す構造体Groupの、黒領域部分の形状が四角
であるか否かを示すフラグ情報”ShapeRecta
ngle”を”TRUE(四角形状)”に設定する。こ
れにより、黒領域抽出部107では、上記図10(c)
に示す二値化画像からの黒領域抽出処理が行われる。こ
の結果、上記図10(c)に示す二値化画像からは、黒
領域356〜358が抽出される。
Then, in the next step S205, the black regions 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 areas 356 to 358 are extracted from the binarized image shown in FIG.

【0103】黒領域356〜358は、その構造体Gr
oupが示す領域(当該黒領域)が抽出された二値化画
像(上記図10(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. 10C) from which the region indicated by “up” (the black region) is extracted is created. 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) ".

【0104】したがって、フラグ情報”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.

【0105】上述のようにして、全ての黒領域が抽出さ
れ、それぞれの黒領域に対する二値化閾値や、黒領域に
対応する多値画像を反転するか否か等が決定される。
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.

【0106】尚、黒領域部分の形状が四角であるか否か
を示すフラグ情報”ShapeRectangle”
は、例えば、対象黒領域が、図12(a)に示すような
形状の領域(黒塗部分)である場合には、”TRUE
(四角形状)”に設定され、同図(b)に示すような形
状の領域である場合には、”FALSE(四角形状でな
い)”に設定されるものとする。
The flag information "ShapeRectangle" indicating whether or not the shape of the black area is a square.
Is, for example, when the target black area is an area 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.

【0107】また、上述した実施の形態では、二値メモ
リ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 the 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.

【0108】先ず、閾値決定部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.

【0109】したがって、上述のような構成では、二値
メモリ106の容量は、1画像分の容量があればよく、
多量の二値メモリを所持できない場合に対応することが
できる。
Therefore, in the above-described configuration, 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.

【0110】また、上述した実施の形態では、対象とな
る多値画像を構成する全ての画素情報からヒストグラム
を作成し、そのヒストグラムから複数の二値化閾値を決
定し、それらの二値化閾値から複数の二値化画像を取得
するように構成したが、これに限られることはなく、例
えば、黒領域抽出部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 extracting unit 107 is created, and the binarized image is formed from the histogram. 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.

【0111】また、上述した実施の形態では、多値画像
から二値化画像を生成するように構成したが、これに限
られることはなく、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.

【0112】また、本発明の目的は、上述した実施の形
態のホスト及び端末の機能を実現するソフトウェアのプ
ログラムコードを記憶した記憶媒体を、システム或いは
装置に供給し、そのシステム或いは装置のコンピュータ
(又はCPUやMPU)が記憶媒体に格納されたプログ
ラムコードを読みだして実行することによっても、達成
されることは言うまでもない。この場合、記憶媒体から
読み出されたプログラムコード自体が本実施の形態の機
能を実現することとなり、そのプログラムコードを記憶
した記憶媒体は本発明を構成することとなる。プログラ
ムコードを供給するための記憶媒体としては、ROM、
フロッピーディスク、ハードディスク、光ディスク、光
磁気ディスク、CD−ROM、CD−R、磁気テープ、
不揮発性のメモリカード等を用いることができる。ま
た、コンピュータが読みだしたプログラムコードを実行
することにより、本実施の形態の機能が実現されるだけ
でなく、そのプログラムコードの指示に基づき、コンピ
ュータ上で稼動しているOS等が実際の処理の一部又は
全部を行い、その処理によって本実施の形態の機能が実
現される場合も含まれることは言うまでもない。さら
に、記憶媒体から読み出されたプログラムコードが、コ
ンピュータに挿入された拡張機能ボードやコンピュータ
に接続された機能拡張ユニットに備わるメモリに書き込
まれた後、そのプログラムコードの指示に基づき、その
機能拡張ボードや機能拡張ユニットに備わるCPUなど
が実際の処理の一部又は全部を行い、その処理によって
本実施の形態の機能が実現される場合も含まれることは
言うまでもない。
Further, an object of the present invention is to provide a storage medium storing program codes of software for realizing the functions of the host and the terminal according to the above-described embodiment to a system or an apparatus, and to provide a computer (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.

【0113】[0113]

【発明の効果】以上説明したように本発明では、処理対
象となる多値画像(カラー文書を読み取って得られた画
像等)を領域分割する際、対象多値画像から、少なくと
も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 A quantized image (a binarized image, etc.) is created, a region of a set of pixels of a predetermined value (a region of a black mass, etc.) is acquired from the quantized image, and attributes of all the acquired regions are obtained. For example, whether or not the target area is a character area, if the target area is a character area, whether or not the background is an inverted area where the background is black and the character portion is whitish, the average pixel value of the background (average background color), the average pixel of the character Attributes such as a value (average character color) and an optimal threshold used when quantizing the target area are analyzed. As a result, even if the multivalued image to be processed is obtained from a document in which various combinations of color parts, such as a base and a character area, are present, optimal area division can be performed.

【図面の簡単な説明】[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 diagram for explaining a state in which black regions obtained by the black region extraction processing are nested.

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

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

【図12】上記黒領域座標保持部に保持される情報の、
黒領域部分の形状が四角であるか否かを示すフラグ情
報”ShapeRectangle”について説明する
ための図である。
FIG. 12 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.

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

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

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

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

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

Claims (14)

【特許請求の範囲】[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; An image processing apparatus comprising: a region extracting unit that extracts a region of a pixel group having a predetermined value from an image; and a region analyzing unit that analyzes an attribute of each region obtained by the region extracting 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記載の画像処理装
置。
5. An image processing apparatus comprising: an area holding unit that holds an extraction result of the area by the area extracting unit; wherein the area extracting unit detects an area of the pixel group from the quantized image; Means for combining the information of the area detected by the means and the information of the area already detected by the detection means and held in the area holding means, wherein the area holding means comprises 2. The image processing apparatus according to claim 1, wherein a result of the combining process is held.
【請求項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〜6の何れかに記載の画像処理装置の機能を有するこ
とを特徴とする画像処理システム。
7. 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 6. An image processing system having a function.
【請求項8】 多値画像の領域分割を行うための画像処
理方法であって、 上記多値画像からから少なくとも1つ以上の量子化画像
を作成し、その二値化画像から黒画素の固まりの領域を
取得する領域抽出ステップと、 上記領域抽出ステップにより得られた全ての領域に対し
て、その属性を解析する領域解析ステップとを含むこと
を特徴とする画像処理方法。
8. 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 group of black pixels is formed from the binarized image. An image processing method comprising: an area extracting step of obtaining an area; and an area analyzing step of analyzing attributes of all the areas obtained by the area extracting step.
【請求項9】 上記領域抽出ステップは、上記量子化画
像として二値化画像を作成するステップを含むことを特
徴とする請求項8記載の画像処理方法。
9. The image processing method according to claim 8, wherein said region extracting step includes a step of creating a binarized image as said quantized image.
【請求項10】 上記少なくとも1つ以上の量子化画像
の一部は、上記多値画像の全面から得られた量子化画像
ではないことを特徴とする請求項8記載の画像処理方
法。
10. The image processing method according to claim 8, wherein 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.
【請求項11】 上記領域抽出ステップでの上記黒画素
の固まりの領域の取得結果を保持する保持ステップを含
み、 上記領域抽出ステップは、 上記量子化画像から、連続する黒画素の領域を検出する
黒検出ステップと、 上記黒検出ステップにより検出された領域の情報と、上
記黒検出ステップにより既に検出され上記保持ステップ
により保持された領域の情報との結合処理を行う結合ス
テップとを含み、 上記保持ステップは、上記結合ステップでの結合処理の
結果を保持するステップを含むことを特徴とする請求項
8記載の画像処理方法。
11. A holding step of holding an acquisition result of the cluster of black pixels in the area extracting step, wherein the area extracting step detects a continuous black pixel area from the quantized image. A black detecting step; and a combining step of combining information of the area detected by the black detecting step with information of the area already detected by the black detecting step and held by the holding step. 9. The image processing method according to claim 8, wherein the step includes a step of holding a result of the combining process in the combining step.
【請求項12】 上記黒検出ステップは、上記量子化画
像上においてMライン毎に上記検出処理を実行するステ
ップを含むことを特徴とする請求項11記載の画像処理
方法。
12. The image processing method according to claim 11, wherein said black detecting step includes a step of executing said detecting process for every M lines on said quantized image.
【請求項13】 請求項1〜6の何れかに記載の画像処
理装置の機能、又は請求項7記載の画像処理システムの
機能を実施するための処理プログラムを、コンピュータ
が読出可能に格納したことを特徴とする記憶媒体。
13. 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 7. A storage medium characterized by the above-mentioned.
【請求項14】 請求項8〜12の何れかに記載の画像
処理方法の処理ステップを、コンピュータが読出可能に
格納したことを特徴とする記憶媒体。
14. A storage medium, wherein the processing steps of the image processing method according to claim 8 are readable by a computer.
JP37178199A 1999-12-27 1999-12-27 Device, system and method for picture processing, and storage medium Pending JP2001186338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP37178199A JP2001186338A (en) 1999-12-27 1999-12-27 Device, system and method for picture processing, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP37178199A JP2001186338A (en) 1999-12-27 1999-12-27 Device, system and method for picture processing, and storage medium

Publications (1)

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

Family

ID=18499297

Family Applications (1)

Application Number Title Priority Date Filing Date
JP37178199A Pending JP2001186338A (en) 1999-12-27 1999-12-27 Device, system and method for picture processing, and storage medium

Country Status (1)

Country Link
JP (1) JP2001186338A (en)

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
JP4366011B2 (en) Document processing apparatus and method
JP3686439B2 (en) Digital image photo area detection system and method
US10049291B2 (en) Image-processing apparatus, image-processing method, and computer program product
JP4732250B2 (en) Information processing apparatus, control method, and computer program
JPH11338976A (en) Document image recognition device, method therefor, and recording medium
US8300939B2 (en) Image processing method, image processing apparatus, and program
JP6743092B2 (en) Image processing apparatus, image processing control method, and program
JP5870745B2 (en) Image processing apparatus, binarization threshold value calculation method, and computer program
JP6370080B2 (en) Image processing apparatus, image processing method, and program.
JP4441300B2 (en) Image processing apparatus, image processing method, image processing program, and recording medium storing the program
CN112040087B (en) Blank image recognition method, device, equipment and storage medium
JP2001186338A (en) Device, system and method for picture processing, and storage medium
JP7301529B2 (en) Image processing device, image processing method, and program
JP7134045B2 (en) Image processing device, image processing method, and program
JP2001184511A (en) Device, system and method for processing image and storage medium
JPH0896072A (en) Detection method of inclination of page
JPH09204525A (en) Image area separation device and method
JP4228905B2 (en) Image processing apparatus and program
JP3253201B2 (en) Image processing device and image type determination method
JP3882427B2 (en) Image processing apparatus and image processing method
JPS5914070A (en) Filing system of picture
JP2001069346A (en) Picture processor, picture binarizing method and computer readable medium
JPS6331825B2 (en)