JP3996564B2 - Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus - Google Patents

Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus Download PDF

Info

Publication number
JP3996564B2
JP3996564B2 JP2003330432A JP2003330432A JP3996564B2 JP 3996564 B2 JP3996564 B2 JP 3996564B2 JP 2003330432 A JP2003330432 A JP 2003330432A JP 2003330432 A JP2003330432 A JP 2003330432A JP 3996564 B2 JP3996564 B2 JP 3996564B2
Authority
JP
Japan
Prior art keywords
image
background
value
frequency
histogram
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.)
Expired - Fee Related
Application number
JP2003330432A
Other languages
Japanese (ja)
Other versions
JP2005101763A (en
Inventor
輝彦 松岡
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2003330432A priority Critical patent/JP3996564B2/en
Publication of JP2005101763A publication Critical patent/JP2005101763A/en
Application granted granted Critical
Publication of JP3996564B2 publication Critical patent/JP3996564B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)

Description

この発明は、下地検出すべき画像の画像情報に基づいてヒストグラムを作成し、作成したヒストグラムを用いて下地領域を検出する下地検出方法、画像処理方法、プログラム、プログラムが格納された記録媒体、画像処理装置、および画像形成装置に関する。   The present invention relates to a background detection method, an image processing method, a program, a recording medium storing a program, and an image in which a histogram is created based on image information of an image to be background detected and the created histogram is used. The present invention relates to a processing apparatus and an image forming apparatus.

従来から、画像の下地領域を検出するためにヒストグラムを作成する手段が知られている。   Conventionally, means for creating a histogram for detecting a background area of an image is known.

例えば、入力された画像データに基づいて、濃度とその度数とをあらわすヒストグラムを作成し、ヒストグラムから濃度最大値と濃度最小値とを求め、度数最大値の濃度と濃度最大値とから仮下地濃度を検知し、仮下地濃度と濃度最小値とから下地濃度を検知する方法が提案されている(特許文献1参照。)。   For example, based on the input image data, create a histogram showing the density and its frequency, find the maximum density value and minimum density value from the histogram, and calculate the temporary background density from the maximum frequency density and the maximum density value. And a method of detecting the background density from the temporary background density and the minimum density value has been proposed (see Patent Document 1).

また、入力された画像データに基づいて、濃度とその度数とをあらわすヒストグラムを作成し、度数の最大値と度数が最大値である濃度とを検出し、それらの値から除去すべき下地の濃度範囲を決定し、その濃度範囲の最大値および最小値と画像データとを比較して濃度範囲内か否かを判定し、その判定結果に基づいて画像データまたは下地除去したデータを出力する手段が提案されている(特許文献2参照。)。   Also, based on the input image data, create a histogram showing the density and its frequency, detect the maximum frequency and the density with the maximum frequency, and remove the background density to be removed from those values Means for determining a range, comparing the maximum and minimum values of the density range with the image data to determine whether the density range is within the range, and outputting the image data or the background-removed data based on the determination result It has been proposed (see Patent Document 2).

さらに、入力されたカラー画像情報に基づきカラー画像が文字画像か写真画像かを判断し、文字画像が含まれていると判断した場合には下地除去を行い、写真画像であると判断した場合には下地除去を行わないという手段が提案されている(特許文献3参照。)。
特開平1−196971号公報 特開平3−44268号公報 特許第2984280号公報
Further, based on the input color image information, it is determined whether the color image is a character image or a photographic image. If it is determined that the character image is included, the background is removed, and if it is determined that the color image is a photographic image Has proposed a means of not removing the background (see Patent Document 3).
JP-A-1-196971 Japanese Patent Laid-Open No. 3-44268 Japanese Patent No. 2984280

しかし、単にヒストグラムを作成し、度数が最大値となる濃度を下地濃度と判定するのでは、実際には下地ではない場所まで下地と判定されてしまう場合がある。例えば、グラデーションのような画像では、画像中のある場所までが画像領域と判定され、それ以降の実際には画像領域である場所が下地と判定されてしまう場合がある。   However, if a histogram is simply created and the density at which the frequency is the maximum value is determined as the background density, it may be determined that the background is not actually the background. For example, in an image such as a gradation, up to a certain place in the image may be determined as an image area, and a subsequent area that is actually an image area may be determined as a background.

また、上述の特許文献1の手段では、検知した下地濃度に基づく閾値で画像データ全体に対して一意に処理を施してしまうので、実際には下地ではない場所まで下地として除去されてしまう可能性がある。   Further, with the above-described means of Patent Document 1, since the entire image data is uniquely processed with a threshold value based on the detected background density, there is a possibility that a place that is not a background is actually removed as a background. There is.

同様に、特許文献2の手段では、判定された下地濃度に基づく閾値で画像データ全体に対して一意に処理を施してしまうので、例えば判定された下地濃度と同じ濃度の画素が写真画像の一部に存在する場合には、写真画像の一部が下地として除去されてしまう可能性がある。   Similarly, the means of Patent Document 2 uniquely processes the entire image data with a threshold value based on the determined background density. For example, pixels having the same density as the determined background density are included in one of the photographic images. In the case where it exists in the part, a part of the photographic image may be removed as a background.

同様に、特許文献3の手段では、写真画像と判断された場合には下地除去しないとされているものの、文字画像内に下地と同じ濃度の画素が存在する場合には、下地として除去されてしまう課題は解決されていない。   Similarly, in the means of Patent Document 3, the background is not removed when it is determined to be a photographic image, but when a pixel having the same density as the background exists in the character image, the background is removed. This problem has not been solved.

本発明が解決しようとする課題は、下地領域のみを適正的確に検出できる下地検出方法、画像処理方法、プログラム、プログラムが格納された記録媒体、画像処理装置、および画像形成装置を提供することである。   The problem to be solved by the present invention is to provide a background detection method, an image processing method, a program, a recording medium storing the program, an image processing apparatus, and an image forming apparatus that can detect only the background area appropriately and accurately. is there.

この発明の下地検出方法、画像処理方法、プログラム、プログラムが格納された記録媒体、画像処理装置、および画像形成装置は、上述の課題を解決するための手段として、以下の構成を備えたものである。   A background detection method, an image processing method, a program, a recording medium storing the program, an image processing apparatus, and an image forming apparatus according to the present invention have the following configurations as means for solving the above-described problems. is there.

(1)複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、を備えることを特徴とする。   (1) The whole representing the relationship between the class value of the image information and the frequency of each class value with respect to the entire area of the image, based on the image information of the image to be detected from the background composed of pixels of a plurality of rows and columns. An image histogram is created, and for each of a plurality of partial images of the image, partial image histograms representing the relationship between the class value of the image information corresponding to each partial image and the frequency of each class value are created. A first step, a second step of obtaining a maximum value of the frequency of each of the whole image histogram and the partial image histogram, and a class value of which the frequency of each of the plurality of partial image histograms is a maximum value. A third step of calculating a difference value between each other and determining whether or not there is a ground region to be detected based on the difference value; If it is determined that there is underlying region in the third step, the frequency of the entire image histogram, characterized in that it comprises a fourth step of detecting a background area based on the class value having a maximum value.

この構成においては、複数の部分画像ヒストグラムが作成され、それぞれの度数が最大値となる階級値同士の差分値に基づいて、画像全体に一様な下地領域が存在するか否かが判定される。また、検出すべき下地領域が存在するか否かがまず判定された後で下地領域が検出されるので、誤った下地検出が低減され、下地領域のみが的確に検出される。   In this configuration, a plurality of partial image histograms are created, and it is determined whether or not a uniform background area exists in the entire image based on the difference value between the class values having the maximum frequency. . Further, since it is first determined whether or not there is a background area to be detected, the background area is detected, so erroneous background detection is reduced and only the background area is accurately detected.

(2)前記第1ステップの前に、前記画像情報を元の量子化ビット数よりも少ないビット数に再量子化するステップをさらに含むことを特徴とする。   (2) The method further includes the step of re-quantizing the image information to a bit number smaller than the original quantization bit number before the first step.

この構成においては、再量子化された画像情報に基づいて全体画像ヒストグラムおよび部分画像ヒストグラムが作成されるので、ヒストグラムの作成が簡素化され、制御に要する負担が軽減される。また、ヒストグラムのために用いられるメモリ容量が少なくて済む。さらに、作成されたヒストグラムに基づいて行われる下地検出の判定も簡素化される。   In this configuration, since the whole image histogram and the partial image histogram are created based on the re-quantized image information, the creation of the histogram is simplified and the burden required for control is reduced. Also, less memory capacity is used for the histogram. Further, the background detection determination performed based on the created histogram is simplified.

(3)前記第1ステップでは、前記複数の部分画像ヒストグラムは、前記下地検出すべき画像のうち、上部複数行、中部複数行、および下部複数行の3箇所の領域、または、左側複数列、中側複数列、および右側複数列の3箇所の領域、または、上部複数行、中部複数行、下部複数行、左側複数列、中側複数列、および右側複数列の6箇所の領域、のいずれかについて作成されることを特徴とする。   (3) In the first step, the plurality of partial image histograms include three regions of an upper plurality of rows, a middle plurality of rows, and a lower plurality of rows in the image to be detected in the background, or a plurality of left side columns, Any of the three regions of the middle multiple columns and the right multiple columns, or the six regions of the upper multiple rows, the middle multiple rows, the lower multiple rows, the left multiple columns, the middle multiple columns, and the right multiple columns It is characterized by being created about.

この構成においては、上部複数行、中部複数行、および下部複数行の3箇所の領域、または、左側複数列、中側複数列、および右側複数列の3箇所の領域について、ヒストグラムを作成することによって、小さいデータ容量で画像全体に均一に下地が存在するか否かが判定される。また、上部複数行、中部複数行、下部複数行、左側複数列、中側複数列、および右側複数列の6箇所の領域についてヒストグラムを作成することによって、画像全体に均一に下地が存在するか否かがいっそう高精度に判定される。   In this configuration, histograms are created for three regions of upper multiple rows, middle multiple rows, and lower multiple rows, or three regions of left multiple columns, middle multiple columns, and right multiple columns. Thus, it is determined whether or not the background exists uniformly over the entire image with a small data capacity. In addition, by creating histograms for the six regions of the upper multi-row, middle multi-row, lower multi-row, left multi-column, middle multi-column, and right multi-column, is there a uniform background in the entire image? Whether or not is determined with higher accuracy.

(4)前記第1ステップでは、前記複数の部分画像ヒストグラムは、前記下地検出すべき画像のうち、上部複数行と、左側複数列または右側複数列の少なくともいずれか一方とについて作成されることを特徴とする。   (4) In the first step, the plurality of partial image histograms are generated for an upper plurality of rows and at least one of a left plurality of columns or a right plurality of columns among the images to be detected for background. Features.

この構成においては、部分画像ヒストグラムが、上部複数行と、左側複数列または右側複数列の少なくともいずれか一方とについて作成される。したがって、もし入力された画像情報の画像サイズと、実際の画像の画像サイズとが異なっていた場合でも、通常原稿画像は左上または右上に揃えてセットされるので、確実に原稿画像についての部分画像ヒストグラムが作成される。また、部分画像ヒストグラムのメモリ容量をさらに抑えつつ、下地が均一に存在するか否かが判定される。   In this configuration, the partial image histogram is created for the upper plurality of rows and at least one of the left plurality of columns or the right plurality of columns. Therefore, even if the image size of the input image information and the image size of the actual image are different, the normal document image is set so as to be aligned at the upper left or upper right, so it is ensured that the partial image of the document image A histogram is created. Further, it is determined whether the background exists uniformly while further suppressing the memory capacity of the partial image histogram.

(5)前記画像情報は、輝度情報と色度情報とを含み、前記第1ステップでは、輝度情報および色度情報のそれぞれについて全体画像ヒストグラムを作成し、前記第4ステップでは、まず輝度情報についての全体画像ヒストグラムに基づいて仮下地領域を検出し、次に前記仮下地領域の中から色度情報についての全体画像ヒストグラムに基づいて下地領域を検出することを特徴とする。   (5) The image information includes luminance information and chromaticity information. In the first step, an overall image histogram is created for each of the luminance information and chromaticity information. In the fourth step, first, luminance information is obtained. A temporary ground area is detected on the basis of the whole image histogram, and then a ground area is detected from the temporary ground area on the basis of the whole image histogram for chromaticity information.

この構成においては、まず輝度情報に基づいて仮下地領域が検出され、仮下地領域をさらに色度情報によって絞り込むことで下地領域が検出される。したがって、少ない演算量で正確かつ確実に下地流域が検出される。   In this configuration, a temporary ground area is first detected based on the luminance information, and the ground area is detected by further narrowing down the temporary ground area with chromaticity information. Therefore, the groundwater basin can be detected accurately and reliably with a small amount of calculation.

(6)前記第4ステップでは、前記全体画像ヒストグラムの度数が最大値となる階級値に加え、度数が最大値となる階級値の両隣の階級値と、度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合にその階級値と、に基づいて下地領域を検出することを特徴とする。   (6) In the fourth step, in addition to the class value at which the frequency of the whole image histogram is the maximum value, the class value adjacent to the class value at which the frequency is the maximum value and the class value at which the frequency is the maximum value In the case where it is the next class value and the frequency is the third largest, the base area is detected based on the class value.

この構成においては、全体画像ヒストグラムの度数が最大値となる階級値に加え、度数が最大値となる階級値の両隣の階級値にも基づいて下地領域が検出される。さらに、度数が最大値となる階級値の又隣の階級値の度数が3番目に大きい場合にはその階級値にも基づいて下地領域が検出される。したがって、いっそう確実に漏れなく下地領域が検出される。   In this configuration, in addition to the class value at which the frequency of the entire image histogram has the maximum value, the background region is detected based on the class value on both sides of the class value at which the frequency has the maximum value. Further, when the frequency of the class value having the maximum frequency and the adjacent class value is the third largest, the background area is detected based on the class value. Accordingly, the base region is detected more reliably and without leakage.

(7)検出された下地領域に対して孤立領域除去処理を施して得られた領域を下地領域とするステップをさらに含むことを特徴とする。   (7) The method further includes a step of setting a region obtained by subjecting the detected background region to an isolated region removal process as a base region.

下地領域として検出されるべき画素がノイズによって下地領域として検出されない場合や、逆に、写真画像等の中に下地領域と同じ画像情報の画素が一部存在するとその画素が下地として検出されてしまう場合がある。この構成においては、このような孤立した一部の領域の画素は、その回りの画素の画像情報に基づいて除去される。また、一旦検出された下地領域に対して、さらに孤立領域除去処理が施される。したがって、下地領域として検出されるべき画素は下地領域として適正に検出され、下地領域でない画素は下地領域から的確に除去される。   If a pixel that should be detected as a background area is not detected as a background area due to noise, or conversely, if some pixels of the same image information as the background area exist in a photographic image, the pixel is detected as the background There is a case. In this configuration, pixels in such an isolated partial region are removed based on image information of surrounding pixels. Further, the isolated region removal process is further performed on the ground region once detected. Therefore, the pixel to be detected as the background area is appropriately detected as the background area, and the pixel that is not the background area is accurately removed from the background area.

(8)検出された下地領域ごとの画素数を算出し、前記画素数が予め設定される所定値未満である場合にはその領域を下地領域から除去する処理を施すステップをさらに含むことを特徴とする。   (8) The method further includes a step of calculating the number of pixels for each detected background area and, when the number of pixels is less than a predetermined value set in advance, performing a process of removing the area from the background area. And

この構成においては、閉領域の画素数が所定値未満の領域は下地領域から除去されるので、予め所望の閾値を設定することによって、下地領域とは認められない小さい領域が下地領域から除去され、下地領域のみが適正に検出される。また、孤立領域除去処理が施された後にさらにこの処理が施されることで、いっそう適正に下地領域のみが検出される。   In this configuration, an area where the number of pixels of the closed area is less than a predetermined value is removed from the background area. Therefore, by setting a desired threshold value in advance, a small area that is not recognized as a background area is removed from the background area. Only the ground area is detected properly. Further, this process is further performed after the isolated area removing process is performed, so that only the base area is detected more appropriately.

また、この発明の画像処理方法は、上述の課題を解決するための手段として、以下の構成を備えたものである。   The image processing method of the present invention has the following configuration as means for solving the above-described problems.

(9)(1)から(8)のいずれかに記載の下地検出方法によって検出された下地領域のみに対して下地除去処理を施すことを特徴とする。   (9) A background removal process is performed only on the background area detected by the background detection method according to any one of (1) to (8).

この構成においては、(1)から(8)のいずれかに記載の下地検出方法によって適正的確に検出された下地領域のみに対して下地除去処理が施されるので、文字画像や写真画像等の中に下地領域と同じ画像情報の画素が存在する場合でも、文字画像や写真画像等の中の画素は除去されることなく、下地領域の画素のみが的確に除去される。   In this configuration, since the background removal processing is performed only on the background area that has been properly and accurately detected by the background detection method according to any one of (1) to (8), character images, photographic images, etc. Even when pixels having the same image information as the background area exist, only the pixels in the background area are accurately removed without removing the pixels in the character image or the photographic image.

また、この発明のプログラムは、上述の課題を解決するための手段として、以下の構成を備えたものである。   Moreover, the program of this invention is provided with the following structures as a means for solving the above-mentioned subject.

(10)複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、をコンピュータに実行させることを特徴とする。   (10) Based on the image information of the image to be detected from the background composed of pixels of a plurality of rows and a plurality of columns, the whole representing the relationship between the class value of the image information and the frequency of each class value for the entire area of the image An image histogram is created, and for each of a plurality of partial images of the image, partial image histograms representing the relationship between the class value of the image information corresponding to each partial image and the frequency of each class value are created. A first step, a second step of obtaining a maximum value of the frequency of each of the whole image histogram and the partial image histogram, and a class value of which the frequency of each of the plurality of partial image histograms is a maximum value. A third step of calculating a difference value between each other and determining whether or not there is a ground region to be detected based on the difference value And, when it is determined in the third step that there is a background area, causing the computer to execute a fourth step of detecting the background area based on a class value at which the frequency of the whole image histogram is maximum. Features.

この構成においては、再量子化された画像情報に基づいて処理することによってメモリ容量が少なくて済み下地検出の判定を簡素化でき、また、誤った下地検出を低減でき、下地領域のみを適正的確に検出できる下地検出方法、および下地領域の画素のみを的確に除去できる下地除去方法が、コンピュータによって実行されるので、上述のような下地検出方法および下地除去方法の汎用性が向上される。   In this configuration, processing based on the re-quantized image information requires less memory capacity, simplifies the detection of background detection, reduces erroneous background detection, and appropriately corrects only the background region. The background detection method that can be detected in a short time and the background removal method that can accurately remove only the pixels in the background region are executed by the computer, so that the versatility of the background detection method and the background removal method as described above is improved.

また、この発明の記録媒体は、上述の課題を解決するための手段として、以下の構成を備えたものである。   The recording medium of the present invention has the following configuration as means for solving the above-described problems.

(11)複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、をコンピュータに実行させるプログラムをコンピュータに読み取り可能に格納したことを特徴とする。   (11) The whole representing the relationship between the class value of the image information and the frequency of each class value for the entire area of the image, based on the image information of the image to be detected from the background composed of pixels of a plurality of rows and columns. An image histogram is created, and for each of a plurality of partial images of the image, partial image histograms representing the relationship between the class value of the image information corresponding to each partial image and the frequency of each class value are created. A first step, a second step of obtaining a maximum value of the frequency of each of the whole image histogram and the partial image histogram, and a class value of which the frequency of each of the plurality of partial image histograms is a maximum value. A third step of calculating a difference value between each other and determining whether or not there is a ground region to be detected based on the difference value A program for causing a computer to execute a fourth step of detecting a background area based on a class value at which the frequency of the whole image histogram is maximum when it is determined that there is a background area in the third step. It is stored in a computer in a readable manner.

この構成においては、再量子化された画像情報に基づいて処理することによってメモリ容量が少なくて済み下地検出の判定を簡素化でき、また、誤った下地検出を低減でき、下地領域のみを適正的確に検出できる下地検出方法、および下地領域の画素のみを的確に除去できる下地除去方法、を実行するプログラムが、コンピュータに容易に供給される。   In this configuration, processing based on the re-quantized image information requires less memory capacity, simplifies the detection of background detection, reduces erroneous background detection, and appropriately corrects only the background region. A computer program that executes a background detection method that can be detected easily and a background removal method that can accurately remove only pixels in the background region is easily supplied to a computer.

また、この発明の画像処理装置は、上述の課題を解決するための手段として、以下の構成を備えたものである。   The image processing apparatus of the present invention has the following configuration as means for solving the above-described problems.

(12)複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数とをあらわす全体画像ヒストグラムを作成するとともに、前記下地検出すべき画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数とをあらわす部分画像ヒストグラムをそれぞれ作成するヒストグラム作成手段と、前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める解析手段と、前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する判定手段と、前記判定手段において下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて仮下地領域を検出する検出手段と、前記検出された仮下地領域に対して、さらに孤立領域除去処理を施して得られた領域を下地領域とする孤立領域除去手段と、前記孤立領域除去手段によって得られた下地領域のみに対して下地除去処理を施す下地除去手段と、を備えることを特徴とする。   (12) A whole image histogram representing the class value of the image information and the frequency of each class value for the entire area of the image, based on the image information of the image to be detected from the background composed of pixels of a plurality of rows and columns. And a partial image histogram representing the class value of the image information corresponding to each partial image and the frequency of each class value for each of the plurality of partial images of the image to be subjected to background detection. Histogram creation means, analysis means for obtaining a class value having a maximum frequency for each of the whole image histogram and the partial image histogram, and class values having a maximum frequency for each of the plurality of partial image histograms. And determining whether there is a ground region to be detected based on the difference value. And a detecting means for detecting a temporary ground area based on a class value at which the frequency of the whole image histogram is maximum when the determining means determines that there is a ground area, and the detected temporary ground area In addition, an isolated region removing unit that uses a region obtained by further performing an isolated region removing process as a ground region, and a ground removing unit that performs a ground removing process only on the ground region obtained by the isolated region removing unit And.

この構成においては、複数の部分画像ヒストグラムが作成され、それぞれの度数が最大値となる階級値同士の差分値に基づいて、画像全体に一様な下地領域が存在するか否かが判定される。また、検出すべき下地領域が存在するか否かがまず判定された後で下地領域が検出されるので、誤った下地検出が低減され、下地領域のみが的確に検出される。さらに、仮下地領域に対してさらに孤立領域除去処理が施されるので、下地領域として検出されるべき画素は下地領域として適正に検出され、下地領域でない画素は下地領域から的確に除去される。また、適正的確に検出された下地領域のみに対して下地除去処理が施されるので、下地領域のみが的確に除去される。   In this configuration, a plurality of partial image histograms are created, and it is determined whether or not a uniform background area exists in the entire image based on the difference value between the class values having the maximum frequency. . Further, since it is first determined whether or not there is a background area to be detected, the background area is detected, so erroneous background detection is reduced and only the background area is accurately detected. Further, since the isolated region removal process is further performed on the temporary ground region, pixels that should be detected as the ground region are properly detected as ground regions, and pixels that are not ground regions are accurately removed from the ground region. In addition, since the background removal process is performed only on the ground area that is detected appropriately and accurately, only the ground area is accurately removed.

(13)前記ヒストグラム作成手段で用いられる前記画像情報を元の量子化ビット数よりも少ないビット数に再量子化する再量子化手段をさらに備え、再量子化された画像情報に基づいて前記全体画像ヒストグラムおよび前記部分画像ヒストグラムを作成することを特徴とする。   (13) Re-quantization means for re-quantizing the image information used by the histogram creation means to a bit number smaller than the original quantization bit number, and based on the re-quantized image information, An image histogram and the partial image histogram are created.

この構成においては、再量子化された画像情報に基づいて全体画像ヒストグラムおよび部分画像ヒストグラムが作成されるので、ヒストグラムの作成が簡素化され、制御に要する負担が軽減される。また、ヒストグラムのために用いられるメモリ容量が少なくて済む。さらに、作成されたヒストグラムに基づいて行われる下地検出の判定も簡素化される。   In this configuration, since the whole image histogram and the partial image histogram are created based on the re-quantized image information, the creation of the histogram is simplified and the burden required for control is reduced. Also, less memory capacity is used for the histogram. Further, the background detection determination performed based on the created histogram is simplified.

また、この発明の画像形成装置は、上述の課題を解決するための手段として、以下の構成を備えたものである。   The image forming apparatus of the present invention has the following configuration as means for solving the above-described problems.

(14)前記下地検出すべき画像の画像情報を入力する入力手段と、(12)または
(13)に記載の画像処理装置と、前記画像処理装置によって画像処理された画像を出力する出力手段と、を備えることを特徴とする。
(14) An input means for inputting image information of the image to be detected on the background, an image processing apparatus according to (12) or (13), and an output means for outputting an image processed by the image processing apparatus It is characterized by providing.

この構成においては、複数の部分画像ヒストグラムが作成され、それぞれの度数が最大値となる階級値同士の差分値に基づいて、画像全体に一様な下地領域が存在するか否かが判定される。また、検出すべき下地領域が存在するか否かがまず判定された後で下地領域が検出されるので、誤った下地検出が低減され、下地領域のみが的確に検出される。さらに、仮下地領域に対してさらに孤立領域除去処理が施されるので、下地領域として検出されるべき画素は下地領域として適正に検出され、下地領域でない画素は下地領域から的確に除去される。また、適正的確に検出された下地領域のみに対して下地除去処理が施されるので、下地領域のみが的確に除去される。さらに、再量子化された画像情報に基づいて処理することによって、メモリ容量が少なくて済み、下地検出の判定が簡素化される。   In this configuration, a plurality of partial image histograms are created, and it is determined whether or not a uniform background area exists in the entire image based on the difference value between the class values having the maximum frequency. . Further, since it is first determined whether or not there is a background area to be detected, the background area is detected, so erroneous background detection is reduced and only the background area is accurately detected. Further, since the isolated region removal process is further performed on the temporary ground region, pixels that should be detected as the ground region are properly detected as ground regions, and pixels that are not ground regions are accurately removed from the ground region. In addition, since the background removal process is performed only on the ground area that is detected appropriately and accurately, only the ground area is accurately removed. Furthermore, the processing based on the requantized image information requires less memory capacity, and the background detection determination is simplified.

この発明によれば、以下の効果を奏することができる。   According to the present invention, the following effects can be obtained.

(1)画像全体に一様な下地領域が存在するか否かを判定できる。また、誤った下地検出を低減でき、下地領域のみを的確に検出できる。   (1) It can be determined whether or not a uniform background area exists in the entire image. Further, erroneous background detection can be reduced, and only the background region can be detected accurately.

(2)ヒストグラムの作成を簡素化でき、制御に要する負担を軽減することができる。また、ヒストグラムのために用いられるメモリ容量が少なくて済む。さらに、作成されたヒストグラムに基づいて行われる下地検出の判定も簡素化することができる。   (2) The creation of a histogram can be simplified and the burden required for control can be reduced. Also, less memory capacity is used for the histogram. Furthermore, the determination of the background detection performed based on the created histogram can be simplified.

(3)3箇所の領域についてヒストグラムを作成することによって、小さいデータ容量で画像全体に均一に下地が存在するか否かを判定できる。また、6箇所の領域についてヒストグラムを作成することによって、画像全体に均一に下地領域が存在するか否かをいっそう高精度に判定することができる。   (3) By creating histograms for three regions, it is possible to determine whether or not a background exists uniformly in the entire image with a small data capacity. In addition, by creating histograms for the six regions, it can be determined with higher accuracy whether or not the background region exists uniformly in the entire image.

(4)もし入力された画像情報の画像サイズと、実際の画像の画像サイズとが異なっていた場合でも、確実に原稿画像についての部分画像ヒストグラムを作成することができる。また、部分画像ヒストグラムのメモリ容量をさらに抑えつつ、下地が均一に存在するか否かを判定することができる。   (4) Even if the image size of the input image information and the image size of the actual image are different, the partial image histogram for the document image can be generated reliably. Further, it is possible to determine whether or not the background exists uniformly while further suppressing the memory capacity of the partial image histogram.

(5)少ない演算量で正確かつ確実に下地流域を検出することができる。   (5) The groundwater basin can be detected accurately and reliably with a small amount of calculation.

(6)いっそう確実に漏れなく下地領域を検出することができる。   (6) The base region can be detected more reliably without leakage.

(7)下地領域として検出されるべき画素を下地領域として適正に検出することができ、下地領域でない画素を下地領域から的確に除去することができる。   (7) A pixel to be detected as a background area can be properly detected as a background area, and pixels that are not the background area can be accurately removed from the background area.

(8)下地領域とは認められない小さい領域を下地領域から除去し、下地領域のみを適正に検出することができる。また、孤立領域除去処理が施された後にさらにこの処理が施されることで、いっそう適正に下地領域のみを検出することができる。   (8) A small region that is not recognized as a base region can be removed from the base region, and only the base region can be detected properly. Further, when this process is further performed after the isolated area removing process is performed, only the base area can be detected more appropriately.

(9)文字画像や写真画像等の中に下地領域と同じ画像情報の画素が存在する場合でも、文字画像や写真画像等の中の画素は除去することなく、下地領域の画素のみを的確に除去することができる。   (9) Even when pixels having the same image information as the background area exist in the character image or the photographic image, only the pixels in the background area are accurately removed without removing the pixels in the character image or the photographic image. Can be removed.

(10)メモリ容量が少なくて済み下地検出の判定を簡素化でき、また、誤った下地検出を低減でき、下地領域のみを適正的確に検出できる下地検出方法、および下地領域の画素のみを的確に除去できる下地除去方法の、汎用性を向上することができる。   (10) It is possible to simplify the determination of the background detection because the memory capacity is small, and it is possible to reduce erroneous background detection, and to detect only the background area properly, and to accurately detect only the pixels in the background area. The versatility of the base removal method that can be removed can be improved.

(11)メモリ容量が少なくて済み下地検出の判定を簡素化でき、また、誤った下地検出を低減でき、下地領域のみを適正的確に検出できる下地検出方法、および下地領域の画素のみを的確に除去できる下地除去方法、を実行するプログラムを、コンピュータに容易に供給することができる。   (11) Since the memory capacity is small, determination of background detection can be simplified, erroneous background detection can be reduced, and only the background area pixels can be detected accurately, and only the background area pixels can be accurately detected. A program for executing the background removal method that can be removed can be easily supplied to a computer.

(12)画像全体に一様な下地領域が存在するか否かを判定することができる。また、誤った下地検出を低減でき、下地領域のみを的確に検出することができる。また、下地領域として検出されるべき画素を下地領域として適正に検出でき、下地領域でない画素を下地領域から的確に除去することができる。さらに、下地領域のみを的確に除去することができる。   (12) It can be determined whether or not a uniform background area exists in the entire image. Further, erroneous background detection can be reduced, and only the background region can be detected accurately. In addition, the pixel to be detected as the background area can be appropriately detected as the background area, and the pixels that are not the background area can be accurately removed from the background area. Furthermore, it is possible to accurately remove only the base region.

(13)ヒストグラムの作成を簡素化でき、制御に要する負担を軽減することができる。また、ヒストグラムのために用いられるメモリ容量が少なくて済む。さらに、作成されたヒストグラムに基づいて行われる下地検出の判定も簡素化することができる。   (13) The creation of a histogram can be simplified and the burden required for control can be reduced. Also, less memory capacity is used for the histogram. Furthermore, the determination of the background detection performed based on the created histogram can be simplified.

(14)画像全体に一様な下地領域が存在するか否かを判定することができる。また、誤った下地検出を低減でき、下地領域のみを的確に検出することができる。さらに、下地領域として検出されるべき画素を下地領域として適正に検出でき、下地領域でない画素を下地領域から的確に除去することができる。また、下地領域のみを的確に除去することができる。さらに、メモリ容量が少なくて済み、下地検出の判定を簡素化することができる。   (14) It is possible to determine whether or not a uniform background area exists in the entire image. Further, erroneous background detection can be reduced, and only the background region can be detected accurately. Furthermore, the pixel to be detected as the background area can be appropriately detected as the background area, and pixels that are not the background area can be accurately removed from the background area. In addition, only the base region can be removed accurately. Furthermore, the memory capacity can be reduced, and the background detection determination can be simplified.

以下に、この発明の実施形態を図面に基づいて詳述する。図1は、この発明の実施形態に係るカラー画像形成装置の概略の構成を示すブロック図である。カラー画像形成装置10は、カラー画像入力装置11、カラー画像処理装置20、およびカラー画像出力装置12を含む。カラー画像入力装置11によって入力されたRGB(R:赤、G:緑、B:青)のアナログ信号の画像データは、カラー画像処理装置20内において後述する処理が施され、CMYK(C:シアン、M:マゼンタ、Y:イエロー、K:黒)のデジタルカラー信号として、カラー画像出力装置12へ出力される。   Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a block diagram showing a schematic configuration of a color image forming apparatus according to an embodiment of the present invention. The color image forming apparatus 10 includes a color image input device 11, a color image processing device 20, and a color image output device 12. The image data of RGB (R: red, G: green, B: blue) analog signals input by the color image input device 11 is subjected to processing described later in the color image processing device 20 to obtain CMYK (C: cyan). , M: magenta, Y: yellow, K: black) are output to the color image output device 12 as digital color signals.

カラー画像入力装置11は、この実施形態ではCCD(Charge Coupled Device )を備えたスキャナであり、原稿画像からの反射光像を、RGBのアナログ信号として読み取り、カラー画像処理装置20に出力する。カラー画像処理装置20については後述する。カラー画像出力装置12は、原稿画像の画像データを記録用紙上に出力する電子写真方式またはインクジェット方式のプリンタである。また、カラー画像出力装置12は、ディスプレイ等の表示装置であってもよい。   In this embodiment, the color image input device 11 is a scanner provided with a CCD (Charge Coupled Device), reads a reflected light image from a document image as an RGB analog signal, and outputs it to the color image processing device 20. The color image processing apparatus 20 will be described later. The color image output device 12 is an electrophotographic or ink jet printer that outputs image data of a document image onto a recording sheet. The color image output device 12 may be a display device such as a display.

カラー画像処理装置20は、A/D(アナログ/デジタル)変換部21を含む。A/D変換部21では、カラー画像入力装置11から入力されたRGBのアナログ信号が例えば8ビットのデジタル信号に量子化される。A/D変換部21から出力されたRGBのデジタル信号はシェーディング補正部22に入力される。シェーディング補正部22では、入力されたRGBのデジタル信号に対して、カラー画像入力装置11の照明系、結像系、撮像系で生じた各種の歪みを取り除く処理が施される。シェーディング補正部22から出力されたRGB信号は入力階調補正部23に入力される。   The color image processing apparatus 20 includes an A / D (analog / digital) conversion unit 21. In the A / D conversion unit 21, the RGB analog signal input from the color image input device 11 is quantized into, for example, an 8-bit digital signal. The RGB digital signals output from the A / D conversion unit 21 are input to the shading correction unit 22. The shading correction unit 22 performs processing for removing various distortions generated in the illumination system, the imaging system, and the imaging system of the color image input device 11 on the input RGB digital signal. The RGB signal output from the shading correction unit 22 is input to the input tone correction unit 23.

入力階調補正部23では、シェーディング補正部22において各種の歪みが取り除かれたRGB信号(RGBの反射率信号)に対して、カラーバランスを整えるとともに、濃度信号などカラー画像処理装置20に採用されている扱い易い信号に変換する処理が施される。入力階調補正部23から出力されたRGB信号は色空間変換部24に出力される。   The input tone correction unit 23 adjusts the color balance of the RGB signal (RGB reflectance signal) from which various distortions have been removed by the shading correction unit 22 and is used in the color image processing apparatus 20 such as a density signal. The signal is converted into an easy-to-handle signal. The RGB signal output from the input tone correction unit 23 is output to the color space conversion unit 24.

色空間変換部24では、RGB信号がLC1C2(L:輝度、C1・C2:色度)の色空間に変換され、変換後のLC1C2信号は、下地検出処理部26に出力される。下地検出処理部26では、入力されたLC1C2信号が例えば8ビットから5ビットに再量子化される。そして、再量子化されたLC1C2信号はメモリ25に出力されてメモリ25に一時的に格納される。また、再量子化されたLC1C2信号に基づいて画像の下地領域が検出され、検出結果がメモリ25に出力されメモリ25に一時的に格納される。詳細については後述する。   In the color space conversion unit 24, the RGB signal is converted into a color space of LC1C2 (L: luminance, C1 · C2: chromaticity), and the converted LC1C2 signal is output to the background detection processing unit 26. In the background detection processing unit 26, the input LC1C2 signal is requantized from 8 bits to 5 bits, for example. The requantized LC1C2 signal is output to the memory 25 and temporarily stored in the memory 25. Further, the background area of the image is detected based on the requantized LC1C2 signal, and the detection result is output to the memory 25 and temporarily stored in the memory 25. Details will be described later.

下地検出処理部26での検出結果がメモリ25に格納されると、下地除去処理部27では、色空間変換部24から直接メモリ25に格納された画像データ(LC1C2信号)と、下地検出処理部26の検出結果とがメモリ25から読み出され、画像データ(LC1C2信号)に対して下地検出結果に基づいて下地除去処理が施される。詳細については後述する。下地除去処理部27から出力されたLC1C2信号は領域分離処理部28に入力される。   When the detection result of the background detection processing unit 26 is stored in the memory 25, the background removal processing unit 27 stores the image data (LC1C2 signal) directly stored in the memory 25 from the color space conversion unit 24 and the background detection processing unit. 26 detection results are read from the memory 25, and background removal processing is performed on the image data (LC1C2 signal) based on the background detection results. Details will be described later. The LC1C2 signal output from the background removal processing unit 27 is input to the region separation processing unit 28.

領域分離処理部28では、LC1C2信号に基づき、入力された画像中の各画素が文字領域、網点領域、写真領域の何れかに分離される。領域分離処理部28では、分離結果に基づいて、各画素がどの領域に属しているかを示す領域識別信号が、空間フィルタ処理部29、黒生成下色除去部32、および階調再現処理部34へと出力されるとともに、下地除去処理部27から入力されたLC1C2信号がそのまま空間フィルタ処理部29へ出力される。   The region separation processing unit 28 separates each pixel in the input image into one of a character region, a halftone dot region, and a photographic region based on the LC1C2 signal. In the region separation processing unit 28, based on the separation result, a region identification signal indicating to which region each pixel belongs is sent to the spatial filter processing unit 29, the black generation and under color removal unit 32, and the gradation reproduction processing unit 34. The LC1C2 signal input from the background removal processing unit 27 is output to the spatial filter processing unit 29 as it is.

空間フィルタ処理部29では、領域分離処理部28から入力されたLC1C2信号の画像データに対して、領域識別信号に基づきデジタルフィルタによる空間フィルタ処理が施される。これによって、空間周波数特性が補正され、カラー画像出力装置12における出力画像のぼやけや粒状性劣化が防止される。例えば、領域分離処理部28において文字領域に分離された領域は、特に黒文字または色文字の再現性を高めるために、空間フィルタ処理部29において、空間フィルタ処理の一つである鮮鋭強調処理が施され高周波成分が強調される。また、領域分離処理部28において網点領域に分離された領域は、空間フィルタ処理部29において、入力網点成分を除去するためのローパス・フィルタ処理が施される。空間フィルタ処理部29で処理が施された画像データは変倍処理部30へ出力される。   In the spatial filter processing unit 29, the image data of the LC1C2 signal input from the region separation processing unit 28 is subjected to spatial filter processing using a digital filter based on the region identification signal. As a result, the spatial frequency characteristic is corrected, and blurring and graininess deterioration of the output image in the color image output device 12 are prevented. For example, a region separated into character regions by the region separation processing unit 28 is subjected to sharp enhancement processing, which is one of spatial filter processing, by the spatial filter processing unit 29 in order to improve the reproducibility of black characters or color characters. The high frequency component is emphasized. Further, the region separated into halftone dot regions by the region separation processing unit 28 is subjected to low-pass filter processing for removing the input halftone dot component by the spatial filter processing unit 29. The image data processed by the spatial filter processing unit 29 is output to the scaling processing unit 30.

変倍処理部30では、空間フィルタ処理が施された画像データに対し、所定倍率になるように拡大演算処理または縮小演算処理が施される。処理後のLC1C2信号は色補正部31へ出力される。   In the scaling processing unit 30, the enlargement calculation process or the reduction calculation process is performed on the image data on which the spatial filter process has been performed so as to obtain a predetermined magnification. The processed LC1C2 signal is output to the color correction unit 31.

色補正部31では、入力されたLC1C2信号の画像データがCMYの色空間に変換されるとともに、カラー画像出力装置12に合わせて色補正が施される。補正後のCMY信号の画像データは黒生成下色除去部32へ出力される。   In the color correction unit 31, the input image data of the LC1C2 signal is converted into a CMY color space, and color correction is performed in accordance with the color image output device 12. The corrected CMY signal image data is output to the black generation and under color removal unit 32.

黒生成下色除去部32では、色補正後のCMYの3色信号から黒(K)信号を生成する黒生成処理、および元のCMY信号から黒生成処理で取得されたK信号を差し引いて新たなCMY信号を生成する処理が施され、CMYの3色信号はCMYKの4色信号に変換される。黒生成処理の一例を以下に示す。例えばスケルトンブラックによる黒生成を行う処理(一般的処理)では、スケルトンカーブの入出力特性をy=f(x)とし、入力されるデータをC、M、Yとし、出力されるデータをC’、M’、Y’、K’とし、UCR(Under Color Removal )率をα(0<α<1)とすると、黒生成下色除去処理は以下の数式1で表わされる。   The black generation and under color removal unit 32 performs a black generation process for generating a black (K) signal from the CMY three-color signals after color correction, and newly subtracts the K signal acquired by the black generation process from the original CMY signal. The CMY three-color signal is converted into a CMYK four-color signal. An example of black generation processing is shown below. For example, in the process of generating black by skeleton black (general process), the input / output characteristic of the skeleton curve is y = f (x), the input data is C, M, Y, and the output data is C ′. , M ′, Y ′, and K ′, and the UCR (Under Color Removal) rate is α (0 <α <1), the black generation and under color removal processing is expressed by the following Equation 1.

Figure 0003996564
Figure 0003996564

黒生成下色除去部32から出力されたCMYK信号は、出力階調補正部33を介して階調再現処理部34に入力される。   The CMYK signal output from the black generation and under color removal unit 32 is input to the gradation reproduction processing unit 34 via the output gradation correction unit 33.

階調再現処理部34では、空間フィルタ処理部29と同様に、CMYK信号の画像データに対して、領域分離処理部28から入力される領域識別信号に基づき所定の処理が施される。例えば、領域分離処理部28において文字領域に分離された領域は、特に黒文字または色文字の再現性を高めるために、階調再現処理部34において、高域周波数成分の再現に適した高解像度のディスプレイに適するように二値化処理または多値化処理が選択されて施される。また、領域分離処理部28において網点領域に分離された領域は、出力階調補正部33において、濃度信号などの信号をカラー画像出力装置12の特性値である網点面積率に変換する出力階調補正処理が施された後、階調再現処理部34において、最終的に画像を画素に分離してそれぞれの階調を再現できるように処理する階調再現処理(中間調生成)が施される。さらに、領域分離処理部において写真領域に分離された領域は、階調再現性を重視したディスプレイに適するように二値化処理または多値化処理が施される。   Similar to the spatial filter processing unit 29, the gradation reproduction processing unit 34 performs predetermined processing on the image data of the CMYK signal based on the region identification signal input from the region separation processing unit 28. For example, a region separated into character regions by the region separation processing unit 28 has a high resolution suitable for reproducing high-frequency components in the gradation reproduction processing unit 34 in order to improve the reproducibility of black characters or color characters. A binarization process or a multi-value process is selected and applied so as to be suitable for a display. The region separated into halftone dot regions by the region separation processing unit 28 is an output for converting a signal such as a density signal into a halftone dot area ratio which is a characteristic value of the color image output device 12 in the output tone correction unit 33. After the gradation correction processing is performed, the gradation reproduction processing unit 34 performs gradation reproduction processing (halftone generation) in which the image is finally separated into pixels and each gradation is reproduced. Is done. Further, the region separated into the photographic regions in the region separation processing unit is subjected to binarization processing or multi-value processing so as to be suitable for a display that emphasizes gradation reproducibility.

上述したカラー画像処理装置20における各処理が施された画像データは、図示しない記憶手段に一旦記憶され、所定のタイミングで読み出されてカラー画像出力装置12に入力される。また、以上の処理は図示しないCPU(Central Processing Unit )によって制御される。   The image data subjected to each process in the color image processing apparatus 20 described above is temporarily stored in a storage unit (not shown), read out at a predetermined timing, and input to the color image output apparatus 12. The above processing is controlled by a CPU (Central Processing Unit) (not shown).

なお、カラー画像処理装置20において、下地除去処理部27は下地検出処理部26の直後に配置されているが、これに限定されるものではなく、領域分離処理部28や空間フィルタ処理部29の後などでもよく、下地検出処理部26以降、色補正部31以前であればどこに配置されても構わない。   In the color image processing apparatus 20, the background removal processing unit 27 is disposed immediately after the background detection processing unit 26. However, the present invention is not limited to this, and the region separation processing unit 28 and the spatial filter processing unit 29 are not limited thereto. It may be arranged later, and may be arranged anywhere after the background detection processing unit 26 and before the color correction unit 31.

次に、この発明の特徴部分である下地検出処理部26および下地除去処理部27の構成について説明する。図2は下地検出処理部26および下地除去処理部27の構成を示すブロック図である。下地検出処理部26は、再量子化手段26a、ヒストグラム作成手段26b、ヒストグラム解析手段26c、下地判定手段26d、下地領域検出手段26e、および孤立領域除去手段26fを含む。色空間変換部24から出力された輝度情報Lと色度情報C1、C2とからなる画像データは、再量子化手段26aに入力されるとともに、メモリ25に格納される。再量子化手段26aでは、輝度情報と色度情報とからなる画像データが、例えば8ビットから5ビットに再量子化される。再量子化された画像データは、メモリ25に格納されるとともに、ヒストグラム作成手段26bに出力される。   Next, the configurations of the background detection processing unit 26 and the background removal processing unit 27, which are features of the present invention, will be described. FIG. 2 is a block diagram showing the configuration of the background detection processing unit 26 and the background removal processing unit 27. The background detection processing unit 26 includes re-quantization means 26a, histogram creation means 26b, histogram analysis means 26c, background determination means 26d, background area detection means 26e, and isolated area removal means 26f. The image data composed of the luminance information L and the chromaticity information C1 and C2 output from the color space conversion unit 24 is input to the requantization unit 26a and stored in the memory 25. In the requantization means 26a, the image data composed of luminance information and chromaticity information is requantized from 8 bits to 5 bits, for example. The requantized image data is stored in the memory 25 and is output to the histogram creating means 26b.

ヒストグラム作成手段26bでは、再量子化された画像データに基づいて、画像全体についての全体画像ヒストグラムが輝度情報Lおよび色度情報C1、C2のそれぞれについて作成されるとともに、複数の部分画像についてそれぞれ部分画像ヒストグラムが輝度情報Lおよび色度情報C1、C2のそれぞれについて作成される。図3に、ヒストグラムの一例を示す。輝度情報Lについてのヒストグラムでは、横軸が輝度情報Lの階級値を示し、縦軸がそれぞれの階級値の度数を示す。また、色度情報C1についての画像ヒストグラムでは、横軸が色度情報C1の階級値を示し、縦軸がそれぞれの階級値の度数を示す。同様に、色度情報C2についての画像ヒストグラムでは、横軸が色度情報C2の階級値を示し、縦軸がそれぞれの階級値の度数を示す。ヒストグラム解析手段26cでは、それぞれのヒストグラムにおいて度数が最大値となる階級値が算出される。   In the histogram creation means 26b, an entire image histogram for the entire image is created for each of the luminance information L and the chromaticity information C1 and C2 based on the requantized image data, and each of the partial images for each of the partial images. An image histogram is created for each of the luminance information L and the chromaticity information C1 and C2. FIG. 3 shows an example of a histogram. In the histogram for the luminance information L, the horizontal axis indicates the class value of the luminance information L, and the vertical axis indicates the frequency of each class value. In the image histogram for the chromaticity information C1, the horizontal axis indicates the class value of the chromaticity information C1, and the vertical axis indicates the frequency of each class value. Similarly, in the image histogram for the chromaticity information C2, the horizontal axis indicates the class value of the chromaticity information C2, and the vertical axis indicates the frequency of each class value. In the histogram analysis means 26c, a class value having the maximum frequency in each histogram is calculated.

下地判定手段26dでは、複数の部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値同士の差分値が算出され、この差分値に基づいて、検出すべき下地領域があるか否かが判定される。下地判定手段26dにおいて検出すべき下地領域があると判定された場合、下地領域検出手段26eでは、メモリ25に格納されている再量子化手段で再量子化された画像データが読み出され、再量子化手段で再量子化された画像データのそれぞれの画素の階級値と、全体画像ヒストグラムの度数が最大値となる階級値とに基づいて、画像の下地領域が検出される。孤立領域除去手段26fでは、検出された下地領域の画素に対して、孤立領域除去処理が施され、その処理後のデータが最終的な下地領域マップデータとしてメモリ25に出力され、メモリ25に格納される。   The background determination unit 26d calculates a difference value between the class values having the maximum frequency in each of the plurality of partial image histograms, and determines whether there is a background region to be detected based on the difference value. Is done. When the background determination unit 26d determines that there is a background region to be detected, the background region detection unit 26e reads the image data requantized by the requantization unit stored in the memory 25, The background area of the image is detected based on the class value of each pixel of the image data requantized by the quantization means and the class value at which the frequency of the entire image histogram is the maximum. In the isolated area removing unit 26f, the isolated area removal processing is performed on the detected pixels in the background area, and the processed data is output to the memory 25 as final background area map data and stored in the memory 25. Is done.

下地除去処理部27は、1DLUT(1次元ルックアップテーブル)作成手段27aおよび下地除去手段27bを含む。1DLUT作成手段27aでは、全体画像ヒストグラムの度数が最大値となる階級値に基づいて、下地除去処理用の1DLUTが作成され、メモリ25に格納される。下地除去手段27bでは、輝度情報Lと色度情報C1、C2とからなる画像データと、孤立領域除去手段26fからメモリ25に入力された下地領域マップデータとに基づいて、下地領域の輝度情報が1DLUTを用いて補正処理される。これによって画像の下地領域が除去される。下地除去された画像データは領域分離処理部28に出力される。   The background removal processing unit 27 includes a 1DLUT (one-dimensional lookup table) creation unit 27a and a background removal unit 27b. In the 1DLUT creation means 27 a, a 1DLUT for background removal processing is created based on the class value that maximizes the frequency of the entire image histogram, and is stored in the memory 25. In the background removal means 27b, the brightness information of the background area is obtained based on the image data composed of the luminance information L and the chromaticity information C1 and C2 and the background area map data input to the memory 25 from the isolated area removal means 26f. Correction processing is performed using 1DLUT. As a result, the background area of the image is removed. The image data from which the background has been removed is output to the region separation processing unit 28.

次に、下地検出処理部における処理手順について説明する。図4は、下地検出処理部での処理手順の一部を示すフローチャートである。   Next, a processing procedure in the background detection processing unit will be described. FIG. 4 is a flowchart showing a part of the processing procedure in the background detection processing unit.

まず、色空間変換部24で輝度情報Lと2つの色度情報C1、C2とに分離された画像データが、下地検出処理部26に1画素分ずつ入力される(S1)。ここで、入力された各画像データL、C1、C2は8ビットデータであり、0から255の値をとるものとする。また、色度情報C1、C2は本来それぞれ、−128〜+127の値をとるが、ここでは符号無しで扱えるようにC1、C2にそれぞれ128を加算して0から255の値を用いる。   First, the image data separated into the luminance information L and the two chromaticity information C1 and C2 by the color space conversion unit 24 is input to the background detection processing unit 26 pixel by pixel (S1). Here, each of the input image data L, C1, and C2 is 8-bit data and takes a value from 0 to 255. In addition, the chromaticity information C1 and C2 originally have values of −128 to +127, but here, 128 is added to C1 and C2 so that they can be handled without codes, and values of 0 to 255 are used.

次に、入力された1画素の画像データの輝度情報Lと2つの色度情報C1、C2とが順次5ビットに再量子化される(S2)。再量子化された画像データはメモリ25に格納されるとともに、輝度情報Lおよび2つの色度情報C1、C2のそれぞれの階級値ごとの度数がカウントアップされる(S3)。そして、下地検出すべき画像の全ての画素についてS1からS3までの処理が終了したか否かが判定される(S4)。全ての画素について終了していない場合にはS1の処理に戻り、下地検出すべき画像の全ての全画素について上述の処理が繰り返される。   Next, the luminance information L of the input image data of one pixel and the two chromaticity information C1 and C2 are sequentially requantized to 5 bits (S2). The requantized image data is stored in the memory 25, and the frequency for each class value of the luminance information L and the two chromaticity information C1 and C2 is counted up (S3). Then, it is determined whether or not the processing from S1 to S3 has been completed for all the pixels of the image to be subjected to background detection (S4). If the process has not been completed for all the pixels, the process returns to S1, and the above-described process is repeated for all the pixels of the image to be detected.

また、ここでは画像全体について輝度情報Lおよび色度情報C1、C2の全体画像ヒストグラムが作成される他に、画像の上部16行、中部16行、下部16行、左側16列、中側16列、右側16列についてそれぞれ輝度情報Lおよび色度情報C1、C2の部分画像ヒストグラムが作成される。したがって、この実施形態では合計21個のヒストグラムが作成される。   Here, the entire image histogram of the luminance information L and chromaticity information C1 and C2 is created for the entire image, and the upper 16 rows, the middle 16 rows, the lower 16 rows, the left 16 columns, and the middle 16 columns of the image. , Partial image histograms of luminance information L and chromaticity information C1 and C2 are created for the right 16 columns, respectively. Therefore, a total of 21 histograms are created in this embodiment.

S4の処理において、全ての画素についてS1からS3までの処理が終了したと判定されると、作成された各ヒストグラムの度数が最大値となる画像データL、C1、C2の階級値がそれぞれ算出される(S5)。そして、複数の部分画像ヒストグラムの、度数が最大値となる輝度情報Lの階級値同士が比較され、度数が最大値となる色度情報C1の階級値同士が比較され、度数が最大値となる色度情報C2の階級値同士が比較される(S6)。これらの比較結果として、それぞれ差分値が取得される。   In the process of S4, when it is determined that the processes from S1 to S3 have been completed for all the pixels, the class values of the image data L, C1, and C2 at which the frequency of each created histogram has the maximum value are calculated. (S5). Then, the class values of the luminance information L having the maximum frequency in the plurality of partial image histograms are compared, the class values of the chromaticity information C1 having the maximum frequency are compared, and the frequency has the maximum value. The class values of the chromaticity information C2 are compared (S6). As these comparison results, difference values are acquired.

ここで、もし検出すべき下地領域が存在する場合には、下地領域は原稿画像の全体に略均一に存在し、したがってそれぞれの部分画像にも略同じ画素数の下地領域が存在し、文字画像領域や網点画像領域、写真画像領域よりも画素数が多いと考えられる。したがって、上述のように各部分画像ヒストグラムを作成して度数が最大値となる階級値同士の差分値を算出し、差分値が所定の閾値以下であれば、各部分画像に略同じ階級値の画素が最も多く存在することになり、それらの画素が下地領域の画素であり、下地領域が存在すると判定できる。   Here, if there is a background area to be detected, the background area exists substantially uniformly in the entire original image, and therefore, each partial image has a background area having substantially the same number of pixels, and the character image. It is considered that the number of pixels is larger than that of the area, the halftone image area, and the photographic image area. Therefore, as described above, each partial image histogram is created and the difference value between the class values having the maximum frequency is calculated. If the difference value is equal to or less than a predetermined threshold value, each partial image has substantially the same class value. It can be determined that there are the largest number of pixels, these pixels are pixels in the background region, and the background region exists.

そこで、それぞれの差分値全てが予め設定される所定の閾値以下であるか否かが判定され(S7)、全ての差分値が閾値以下であれば下地領域が存在すると判定される。差分値のうち1つでも閾値を超えるものがあれば下地領域は存在しないと判定され、下地検出処理は終了する。   Therefore, it is determined whether or not all the difference values are equal to or less than a predetermined threshold value set in advance (S7). If all the difference values are equal to or less than the threshold value, it is determined that the background area exists. If even one of the difference values exceeds the threshold value, it is determined that there is no background area, and the background detection process ends.

下地領域が存在すると判定された場合には、メモリ25に格納されている5ビットに再量子化された画像データL、C1、C2が1画素分ずつ読み出される(S8)。そして、読み出された画素の輝度情報Lと、輝度情報Lについての全体画像ヒストグラムの度数が最大値となる階級値、度数が最大値となる階級値の両隣の階級値、および度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合にその階級値とがそれぞれ比較される(S9)。比較結果としての差分値がそれぞれの所定の閾値以下であれば、読み出された画素は下地領域の画素であると仮判定される。差分値が閾値を超える場合には下地領域の画素ではないと判定されて下地領域マップデータとして“0”がメモリ25に出力される。   If it is determined that the background area exists, the image data L, C1, and C2 requantized to 5 bits stored in the memory 25 are read out for each pixel (S8). Then, the luminance information L of the read pixel, the class value at which the frequency of the entire image histogram for the luminance information L is the maximum value, the class value adjacent to the class value at which the frequency is the maximum value, and the frequency are the maximum value When the frequency value is the third highest value and the frequency value that is next to the next value, the value is compared with each other (S9). If the difference value as the comparison result is equal to or less than each predetermined threshold value, the read pixel is provisionally determined to be a pixel in the background area. If the difference value exceeds the threshold value, it is determined that the pixel is not a pixel in the background area, and “0” is output to the memory 25 as the background area map data.

下地領域の画素であると仮判定された場合には、読み出された画素の2つの色度情報C1、C2と、色度情報C1、C2についての全体画像ヒストグラムの度数が最大値となる階級値とがそれぞれ比較される(S10)。比較結果としての差分値がそれぞれ所定の閾値以下であれば、読み出された画素は下地領域の画素であると判定されて下地領域マップデータとして“1”がメモリ25に出力される。差分値が閾値を超える場合には下地領域の画素ではないと判定されて下地領域マップデータとして“0”がメモリ25に出力される。   If it is temporarily determined that the pixel is a pixel in the background area, the two chromaticity information C1 and C2 of the read pixel and the class in which the frequency of the entire image histogram for the chromaticity information C1 and C2 is the maximum value. Each value is compared (S10). If the difference values as the comparison results are each equal to or less than a predetermined threshold value, it is determined that the read pixel is a pixel in the background area, and “1” is output to the memory 25 as background area map data. If the difference value exceeds the threshold value, it is determined that the pixel is not a pixel in the background area, and “0” is output to the memory 25 as the background area map data.

そして、S8からS10までの処理が全ての画素に対して終了したか否かが判定される(S11)。全ての画素に対して終了したと判定された場合は、S12の処理に進む。まだ全ての画素に対して終了していないと判定された場合にはS8の処理に戻って次の画素の画像データL、C1、C2が読み出され、1行分の処理が終了すると、さらに次の行の画素に移って処理を続け、最終的に全画素に対してS8からS10までの処理が行われる。   Then, it is determined whether or not the processing from S8 to S10 has been completed for all pixels (S11). If it is determined that the process has been completed for all the pixels, the process proceeds to S12. If it is determined that the processing has not been completed for all the pixels, the process returns to S8, and the image data L, C1, and C2 of the next pixel are read out. The process continues to the next row of pixels, and finally, the processes from S8 to S10 are performed on all the pixels.

全ての画素に対してS8からS10までの処理が終了した場合は、検出された下地領域マップデータに対して孤立領域除去処理が施される(S12)。この処理では例えば、予め設定されるマスク領域内のデータをメディアンフィルタなどによって中心値で置き換える方法や、注目画素に対して所定のマスク領域が設定され、マスク領域内の“1”と“0”の数が比較され多数決によって多い方の値が注目画素の値に設定される方法などが用いられる。どの方法を採用するかは、最終的な下地領域検出結果をどのように扱うかによって任意に選択するとよい。すなわち例えば、1画素毎の孤立点のみを消しておけばよい場合にはメディアンフィルタを用い、ある程度の大きさの孤立領域をも除去するならば、マスク領域内の多数決による方法を用いるとよい。孤立領域除去処理が施された下地領域マップデータはメモリ25に格納される。   When the processing from S8 to S10 is completed for all the pixels, the isolated region removal processing is performed on the detected background region map data (S12). In this processing, for example, data in a preset mask area is replaced with a center value by a median filter or a predetermined mask area is set for the target pixel, and “1” and “0” in the mask area are set. For example, a method is used in which the number of pixels is compared and the larger value is set as the value of the target pixel by majority vote. Which method is adopted may be arbitrarily selected depending on how the final ground region detection result is handled. That is, for example, when it is necessary to erase only isolated points for each pixel, a median filter is used, and if an isolated area of a certain size is also removed, a method based on majority in the mask area may be used. The background area map data subjected to the isolated area removal process is stored in the memory 25.

次に、孤立領域除去処理で除去しきれなかった誤検出の下地領域を除去し下地領域検出精度を上げるために、以下の処理が施される。下地領域であると判定された各閉領域内の画素数がカウントされ、画素数が予め設定される所定の閾値以下であれば、その領域は誤検出された下地領域であると判定され、その領域内の“1”の値が全て“0”に変更される(S13)。すなわち画素数が所定値以下の小さい領域は下地領域から除去される。以上で下地検出処理は終了し、次に下地除去処理に移る。   Next, the following processing is performed in order to remove the erroneously detected background region that could not be removed by the isolated region removal processing and increase the background region detection accuracy. The number of pixels in each closed area determined to be a background area is counted, and if the number of pixels is equal to or less than a predetermined threshold value, the area is determined to be a falsely detected background area, and All the values of “1” in the area are changed to “0” (S13). That is, a small area with the number of pixels equal to or less than a predetermined value is removed from the base area. Thus, the background detection processing is completed, and then the background removal processing is started.

図5を参照しながら、下地除去処理について説明する。図5は、下地除去処理部27での処理手順の一部を示すフローチャートである。まず、輝度情報Lについての全体画像ヒストグラムの度数が最大値となる階級値に基づいて、1DLUTが作成される(S21)。次に、下地検出処理で出力された下地領域マップデータがメモリ25から入力される
(S22)。そして、色空間変換部24で輝度情報Lと2つの色度情報C1、C2とに分離されメモリ25に格納されていた画像データL、C1、C2が、下地除去処理部27に1画素分ずつ入力される(S23)。
The background removal process will be described with reference to FIG. FIG. 5 is a flowchart showing a part of the processing procedure in the background removal processing unit 27. First, a 1DLUT is created based on the class value that maximizes the frequency of the entire image histogram for the luminance information L (S21). Next, the background area map data output in the background detection process is input from the memory 25 (S22). Then, the image data L, C1, and C2 separated into the luminance information L and the two chromaticity information C1 and C2 by the color space conversion unit 24 and stored in the memory 25 are supplied to the background removal processing unit 27 for each pixel. Input (S23).

入力された1画素分の画像データは下地領域マップデータに基づいて下地領域であるか否かが判定される(S24)。下地領域であると判定された場合は、輝度情報Lに関してはその画素の輝度情報Lとして1DLUTで補正された値が出力され、色度情報C1、C2に関しては無彩色の値に置き換えて出力され、これによって下地が除去される(S25)。S24において下地領域でないと判定された場合は、S25での処理が施されることなくそのままの画像データL、C1、C2が出力され、S26の処理に進む。   It is determined whether the input image data for one pixel is a background area based on the background area map data (S24). If it is determined that the area is the background area, the luminance information L is output as a value corrected by 1DLUT as the luminance information L of the pixel, and the chromaticity information C1 and C2 are output by being replaced with achromatic values. Thereby, the ground is removed (S25). If it is determined in S24 that the area is not the background area, the image data L, C1, and C2 are output as they are without being processed in S25, and the process proceeds to S26.

そして、全ての画素について上述の処理が終了したか否かが判定され(S26)、全ての画素について終了していない場合はS23の処理に戻り、全ての全画素に対して上述の処理が繰り返される。全ての画素について終了したと判定された場合は、下地除去処理が終了し、結果的に得られた画像データL、C1、C2が領域分離処理部28に出力される。   Then, it is determined whether or not the above processing has been completed for all the pixels (S26). If all the pixels have not been completed, the processing returns to S23, and the above processing is repeated for all the pixels. It is. If it is determined that all the pixels have been completed, the background removal processing is completed, and the resulting image data L, C1, and C2 are output to the region separation processing unit 28.

次に、図6に示すような原稿画像について下地検出処理および下地除去処理する場合を例にあげて具体的に説明する。図6は、原稿画像の一例を示す説明図である。図7は、図6に示す原稿画像の一部の画像領域における各画素の画像データを示す図であり、図7
(a)は入力された8ビットの画像データを示し、図7(b)は5ビットに再量子化された画像データを示し、図7(c)は検出された下地領域マップデータを示す。
Next, the case where the background detection process and the background removal process are performed on the document image as shown in FIG. 6 will be specifically described. FIG. 6 is an explanatory diagram illustrating an example of a document image. FIG. 7 is a diagram showing image data of each pixel in a partial image area of the document image shown in FIG.
(A) shows the input 8-bit image data, FIG. 7 (b) shows the image data requantized to 5 bits, and FIG. 7 (c) shows the detected background area map data.

1画素分ずつ入力された8ビットの画像データL、C1、C2(図7(a)参照)は、図7(b)に示すような5ビットデータに順次再量子化される。例えば図7(a)の左上の画素の輝度情報L=192が再量子化される場合は次のように処理される。“192”を8ビット2値であらわすと、“11000000”となる。これを3ビット右シフトすると、“11111000”となる。そして、この値の下位5ビットの値を得るために
“00011111”との論理積を求めると、“00011000”となり、これを10進数で表すと、図6(b)に示すように5ビットに再量子化された値“24”が得られる。
The 8-bit image data L, C1, and C2 (see FIG. 7A) input for each pixel are sequentially requantized to 5-bit data as shown in FIG. 7B. For example, when the luminance information L = 192 of the upper left pixel in FIG. 7A is requantized, the following processing is performed. When “192” is represented by an 8-bit binary value, “11000000” is obtained. When this is shifted 3 bits to the right, it becomes “11111000”. Then, when obtaining the logical product of “00011111” in order to obtain the value of the lower 5 bits of this value, it becomes “00011000”. When this is expressed in decimal, it is converted into 5 bits as shown in FIG. A requantized value “24” is obtained.

再量子化された画像データはメモリ25に格納されるとともに、輝度情報Lおよび2つの色度情報C1、C2のそれぞれの階級値ごとの度数がカウントアップされる。そして、画像の全ての画素について階級値ごとの度数がカウントアップされることによって、図8および図9に示すようなヒストグラムが作成される。ここでは5ビットに再量子化されているので、各画像データL、C1、C2の階級値は0〜31の32段階であらわされる。   The requantized image data is stored in the memory 25, and the frequency for each class value of the luminance information L and the two chromaticity information C1 and C2 is counted up. And the histogram as shown in FIG. 8 and FIG. 9 is produced by counting up the frequency for every class value about all the pixels of an image. Here, since re-quantization is performed to 5 bits, the class values of the image data L, C1, and C2 are expressed in 32 levels from 0 to 31.

図8は、図6に示す原稿画像の画像領域全体についての全体画像ヒストグラムであり、図8(a)は輝度情報Lについての全体画像ヒストグラムであり、図8(b)は色度情報C1についての全体画像ヒストグラムであり、図8(c)は色度情報C2についての全体画像ヒストグラムである。図9は、図6に示す原稿画像の部分画像についての部分画像ヒストグラムであり、図9(a)は上部16行の輝度情報Lについての部分画像ヒストグラムであり、図9(b)は中部16行の輝度情報Lについての部分画像ヒストグラムであり、図9(c)は下部16行の輝度情報Lについての部分画像ヒストグラムである。図9には説明の便宜上、上部16行、中部16行、下部16行の輝度情報Lについての部分画像ヒストグラムのみ示すが、実際には画像の上部16行、中部16行、下部16行、左側16列、中側16列、右側16列についてそれぞれ輝度情報Lおよび色度情報C1、C2の部分画像ヒストグラムが作成される。したがって、この実施形態では合計21個のヒストグラムが作成される。メモリに制限がある等の場合は、上部16行、中部16行、下部16行の3箇所のみ、または、左側16列、中側16列、右側16列の3箇所のみ、または、上部16行と左側16行の2箇所のみ若しくは上部16行と右側16列の2箇所のみなど、可能な数の複数の部分画像ヒストグラムを作成することでも、下地領域があるか否かを判定することが可能である。   8 is an overall image histogram for the entire image area of the original image shown in FIG. 6, FIG. 8A is an overall image histogram for luminance information L, and FIG. 8B is an illustration for chromaticity information C1. 8C is an overall image histogram for the chromaticity information C2. 9 is a partial image histogram for the partial image of the original image shown in FIG. 6, FIG. 9A is a partial image histogram for the luminance information L in the upper 16 rows, and FIG. FIG. 9C is a partial image histogram for the luminance information L of the lower 16 rows, and FIG. 9C is a partial image histogram for the luminance information L of the lower 16 rows. For convenience of explanation, FIG. 9 shows only the partial image histograms for the luminance information L of the upper 16 rows, the middle 16 rows, and the lower 16 rows, but actually the upper 16 rows, the middle 16 rows, the lower 16 rows, and the left side of the image. Partial image histograms of luminance information L and chromaticity information C1 and C2 are created for the 16 columns, the middle 16 columns, and the right 16 columns, respectively. Therefore, a total of 21 histograms are created in this embodiment. When there are memory restrictions, etc., only the upper 16 rows, the middle 16 rows, the lower 16 rows, or the left 16 columns, the middle 16 columns, the right 16 columns only, or the upper 16 rows It is also possible to determine whether or not there is a background area by creating as many partial image histograms as possible, such as only two places on the left 16 rows or only two places on the upper 16 rows and the right 16 columns. It is.

部分画像ヒストグラムの度数は例えば次のようにして算出される。画像データの上部部分画像、中部部分画像、下部部分画像については、予め開始行と終了行とが図示しないCPUによってレジスタに設定されており、まず開始行直前の全体画像ヒストグラムの度数がメモリ25に格納され、その後、終了行直後の全体画像ヒストグラムの度数からメモリ25に格納されている開始行直前の全体画像ヒストグラムの度数を減じた値がその部分画像ヒストグラムの度数としてメモリ25に格納されることで得られる。また、画像データの左側部分画像、中側部分画像、右側部分画像の場合には、同様に予め開始画素位置と終了画素位置とがCPUによってレジスタに設定されており、行ごとに、開始画素位置から終了画素位置までカウントされた後、その行の度数がメモリ25に格納される。そして、次の行の開始画素位置になると、メモリ25に格納された前の行の度数が読み出され、同様に開始画素位置からカウントする値が加算されていく。このようにしてカウントすべき全ての行について繰り返されることで、部分画像ヒストグラムの度数が得られる。   The frequency of the partial image histogram is calculated as follows, for example. For the upper partial image, the middle partial image, and the lower partial image of the image data, the start line and the end line are previously set in the register by the CPU (not shown), and the frequency of the entire image histogram immediately before the start line is first stored in the memory 25. A value obtained by subtracting the frequency of the entire image histogram immediately before the start row stored in the memory 25 from the frequency of the entire image histogram immediately after the end row is stored in the memory 25 as the frequency of the partial image histogram. It is obtained with. In the case of the left partial image, the middle partial image, and the right partial image of the image data, the start pixel position and the end pixel position are similarly set in the register in advance by the CPU, and the start pixel position is set for each row. After counting to the end pixel position, the frequency of the row is stored in the memory 25. When the start pixel position of the next row is reached, the frequency of the previous row stored in the memory 25 is read, and the value counted from the start pixel position is similarly added. The frequency of the partial image histogram is obtained by repeating for all the rows to be counted in this way.

図7(b)に示す9画素のみに注目すれば、輝度情報Lについては階級値“24”が9つ、色度情報C1については階級値“7”が6つ、“18”が3つ、色度情報C2については階級値“16”が6つ、“17”が3つということになる。   Focusing only on the 9 pixels shown in FIG. 7B, the luminance information L has nine class values “24”, the chromaticity information C1 has six class values “7”, and three “18”. As for the chromaticity information C2, the class value “16” is six and the “17” is three.

そして、作成された各ヒストグラムの度数が最大値となる画像データL、C1、C2の階級値がそれぞれ算出される。この場合、例えば次のようにして算出される。まず階級値“0”の度数と階級値“1”の度数とが比較され、度数の大きい方の階級値が選択される。次に、選択された階級値の度数と階級値“2”の度数とが比較され、度数の大きい方の階級値が選択される。このようにして順次比較が繰り返され、最終的に選択された階級値が、度数が最大値となる階級値としてそれぞれレジスタに格納される。また、全体画像ヒストグラムの輝度情報Lについては、度数が3番目に大きい階級値もレジスタに格納される。この場合は例えば、最初に階級値“0”から“2”までの度数が保持され、階級値
“3”の度数と比較され、度数が最も小さい階級値が切り捨てられ、残り3つの階級値が保持される。そしてさらに階級値“4”の度数と比較され、同様の処理が繰り返され、最終的に残った3つの階級値のうち度数が最小となる階級値が、度数が3番目に大きい階級値としてレジスタに格納される。
Then, the class values of the image data L, C1, and C2 at which the frequency of each created histogram has the maximum value are calculated. In this case, for example, it is calculated as follows. First, the frequency of the class value “0” and the frequency of the class value “1” are compared, and the class value having the higher frequency is selected. Next, the frequency of the selected class value is compared with the frequency of the class value “2”, and the class value having the larger frequency is selected. The comparison is sequentially repeated in this way, and the finally selected class value is stored in each register as the class value having the maximum frequency. For the luminance information L of the whole image histogram, the class value having the third highest frequency is also stored in the register. In this case, for example, the frequency from the class value “0” to “2” is held first, compared with the frequency of the class value “3”, the class value having the lowest frequency is rounded down, and the remaining three class values are Retained. Then, it is compared with the frequency of the class value “4”, the same processing is repeated, and the class value having the smallest frequency among the remaining three class values is registered as the class value having the third highest frequency. Stored in

図8の場合では、輝度情報Lの階級値“24”、色度情報C1の階級値“18”、および色度情報C2の階級値“17”が、それぞれ度数が最大値となる階級値としてレジスタに格納され、輝度情報Lの階級値“26”が、度数が3番目に大きい輝度情報Lの階級値としてレジスタに格納される。また、図9の場合では、上部部分画像の輝度情報Lの階級値“24”、中部部分画像の輝度情報Lの階級値“23”、下部部分画像の輝度情報Lの階級値“24”が、それぞれ度数が最大値となる階級値としてレジスタに格納される。   In the case of FIG. 8, the class value “24” of the luminance information L, the class value “18” of the chromaticity information C1, and the class value “17” of the chromaticity information C2 are the class values having the maximum frequency. The class value “26” of the luminance information L is stored in the register as the class value of the luminance information L having the third highest frequency. In the case of FIG. 9, the class value “24” of the luminance information L of the upper partial image, the class value “23” of the luminance information L of the middle partial image, and the class value “24” of the luminance information L of the lower partial image are obtained. These are stored in the registers as class values having the maximum frequency.

次に、レジスタに格納された複数の部分画像ヒストグラムの、度数が最大値となる輝度情報Lの階級値同士が比較され、度数が最大値となる色度情報C1の階級値同士が比較され、度数が最大値となる色度情報C2の階級値同士が比較される。具体的には例えば、まず、上部部分画像、中部部分画像、および下部部分画像のそれぞれの、度数が最大値となる輝度情報Lの階級値同士、度数が最大値となる色度情報C1の階級値同士、度数が最大値となる色度情報C2の階級値同士が比較される。次いで、左側部分画像、中側部分画像、および右側部分画像のそれぞれの、度数が最大値となる輝度情報Lの階級値同士、度数が最大値となる色度情報C1の階級値同士、度数が最大値となる色度情報C2の階級値同士が比較される。最後に、上部部分画像および左側部分画像のそれぞれの、度数が最大値となる輝度情報Lの階級値同士、度数が最大値となる色度情報C1の階級値同士、度数が最大値となる色度情報C2の階級値同士が比較される。これらの比較結果として、それぞれ差分値が取得される。   Next, among the partial image histograms stored in the register, the class values of the luminance information L having the maximum frequency are compared, and the class values of the chromaticity information C1 having the maximum frequency are compared. The class values of the chromaticity information C2 having the maximum frequency are compared with each other. Specifically, for example, first, the class values of the luminance information L having the maximum frequency and the classes of the chromaticity information C1 having the maximum frequency are obtained for each of the upper partial image, the middle partial image, and the lower partial image. The class values of the chromaticity information C2 having the maximum frequency are compared with each other. Next, each of the left partial image, the middle partial image, and the right partial image has class values of the luminance information L having the maximum frequency, class values of the chromaticity information C1 having the maximum frequency, and the frequency. The class values of the chromaticity information C2 that is the maximum value are compared. Finally, in each of the upper partial image and the left partial image, the class values of the luminance information L having the maximum frequency, the class values of the chromaticity information C1 having the maximum frequency, and the color having the maximum frequency The class values of the degree information C2 are compared. As these comparison results, difference values are acquired.

そして、それぞれの差分値全てが予め設定される所定の閾値以下であれば、下地領域が存在すると判定される。差分値のうち1つでも閾値を超えるものがあれば、下地領域は存在しないと判定され、下地検出処理は終了する。具体的には例えば、上部部分画像、中部部分画像、および下部部分画像の輝度情報L、色度情報C1、C2のそれぞれについて、度数が最大値となる階級値同士の差分値が閾値1以下であり、かつ、左側部分画像、中側部分画像、および右側部分画像の輝度情報L、色度情報C1、C2のそれぞれについて、度数が最大値となる階級値同士の差分値が閾値1以下であり、かつ、上部部分画像および左側部分画像の輝度情報L、色度情報C1、C2のそれぞれについて、度数が最大値となる階級値同士の差分値が閾値1以下であれば、下地領域が存在すると判定される。もし、差分値のうちのいずれか1つでも閾値1を超える場合には、下地領域が存在しないと判定され、下地領域に関する信号は出力されずに下地検出処理が終了する。なお、ここでは閾値を1と設定したが、これに限定されるものではなく、再量子化されるビット数や判定精度の調整に応じて適宜変更可能である。   If all the difference values are equal to or less than a predetermined threshold value set in advance, it is determined that a base area exists. If at least one of the difference values exceeds the threshold value, it is determined that there is no background area, and the background detection process ends. Specifically, for example, for each of the luminance information L and the chromaticity information C1 and C2 of the upper partial image, the middle partial image, and the lower partial image, the difference value between the class values having the maximum frequency is equal to or less than the threshold value 1. Yes, and for each of the luminance information L and the chromaticity information C1 and C2 of the left partial image, the middle partial image, and the right partial image, the difference value between the class values having the maximum frequency is not more than the threshold value 1. In addition, for each of the luminance information L and the chromaticity information C1 and C2 of the upper partial image and the left partial image, if the difference value between the class values at which the frequency is the maximum value is equal to or less than the threshold value 1, a ground region exists. Determined. If any one of the difference values exceeds the threshold value 1, it is determined that the background area does not exist, and the background detection process ends without outputting a signal regarding the background area. Although the threshold value is set to 1 here, the threshold value is not limited to this, and can be changed as appropriate according to the number of bits to be requantized and the adjustment of determination accuracy.

下地領域が存在すると判定された場合は、メモリ25に格納されている5ビットに再量子化された画像データL、C1、C2が1画素分ずつ読み出される。そして、読み出された画素の輝度情報Lと、輝度情報Lについての全体画像ヒストグラムの度数が最大値となる階級値、度数が最大値となる階級値の両隣の階級値、および度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合にその階級値とが、それぞれ比較される。比較結果としての差分値がそれぞれの所定の閾値以下であれば、読み出された画素は下地領域の画素であると仮判定される。差分値が閾値を超える場合には下地領域の画素ではないと判定されて下地領域マップデータとして“0”がメモリ25に出力される。   When it is determined that the background area exists, the image data L, C1, and C2 requantized to 5 bits stored in the memory 25 are read out for each pixel. Then, the luminance information L of the read pixel, the class value at which the frequency of the entire image histogram for the luminance information L is the maximum value, the class value adjacent to the class value at which the frequency is the maximum value, and the frequency are the maximum value When the frequency value is the third highest value next to the next value and the frequency is the third largest, the value is compared with each other. If the difference value as the comparison result is equal to or less than each predetermined threshold value, the read pixel is provisionally determined to be a pixel in the background area. If the difference value exceeds the threshold value, it is determined that the pixel is not a pixel in the background area, and “0” is output to the memory 25 as the background area map data.

ここで、上述のように下地領域は原稿画像の全体に略均一に存在し、文字画像領域や網点画像領域、写真画像領域よりも画素数が多いと考えられることから、読み出された画素の階級値を、全体画像ヒストグラムにおいて度数が最大値となる階級値と比較することで、読み出された画素が下地領域であるか否かが、輝度情報のみからでも判定できるのである。   Here, as described above, the background area exists substantially uniformly throughout the original image, and is considered to have more pixels than the character image area, the halftone image area, and the photographic image area. Is compared with the class value having the maximum frequency in the entire image histogram, it is possible to determine whether or not the read pixel is a background area only from the luminance information.

また、度数が最大値となる階級値に加え、度数が最大値となる階級値の両隣の階級値、および度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合にその階級値とも比較する理由は以下の通りである。度数が最大値となる階級値は、画像全体にわたって存在する下地領域である可能性が高いからである。また、その両隣の階級値は、カラー画像入力装置11のCCDにおける誤差や濃度ムラなどの影響を受けた下地領域である可能性が高いからである。さらに、度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合のその階級値、すなわち図8(a)における階級値“26”のような場合は、その階級値も下地領域である可能性が高いからである。   In addition to the class value with the maximum frequency, the class value adjacent to the class value with the maximum frequency, and the class value adjacent to the class value with the maximum frequency, the frequency is the third. The reason for comparing with the class value when the value is larger is as follows. This is because the class value at which the frequency is the maximum value is highly likely to be a ground region existing throughout the entire image. In addition, the class values on both sides of the color image input device 11 are highly likely to be background regions that are affected by errors and density unevenness in the CCD. Further, in the case of the class value adjacent to the class value where the frequency is the maximum and the frequency is the third largest, that is, the class value “26” in FIG. This is because the class value is also likely to be a ground area.

下地領域の画素であると仮判定された場合は、読み出された画素の2つの色度情報C1、C2と、色度情報C1、C2についての全体画像ヒストグラムの度数が最大値となる階級値とがそれぞれ比較される。比較結果としての差分値がそれぞれ所定の閾値以下であれば、読み出された画素は下地領域の画素であると判定されて下地領域マップデータとして“1”がメモリ25に出力される。差分値が閾値を超える場合には下地領域の画素ではないと判定されて下地領域マップデータとして“0”がメモリ25に出力される。   If it is provisionally determined that the pixel is a pixel in the background area, the two chromaticity information C1 and C2 of the read pixel and the class value at which the frequency of the entire image histogram for the chromaticity information C1 and C2 is the maximum value. Are compared with each other. If the difference values as the comparison results are each equal to or less than a predetermined threshold value, it is determined that the read pixel is a pixel in the background area, and “1” is output to the memory 25 as background area map data. If the difference value exceeds the threshold value, it is determined that the pixel is not a pixel in the background area, and “0” is output to the memory 25 as the background area map data.

そして、上述のような輝度情報Lによる下地判定、および色度情報C1、C2による下地判定が、全ての画素に対して終了すると、後述する孤立領域除去処理に進む。   When the background determination based on the luminance information L and the background determination based on the chromaticity information C1 and C2 are completed for all the pixels, the process proceeds to an isolated area removal process described later.

輝度情報Lによる下地判定、および色度情報C1、C2による下地判定について、図8に示す場合を例にあげて具体的に説明する。ここでは、度数が最大値となる輝度情報Lの階級値Lmax=24、度数が3番目に大きい輝度情報Lの階級値L3rd=26、度数が最大値となる色度情報C1の階級値C1max=18、度数が最大値となる色度情報C2の階級値C2max=17がレジスタに設定されている。これらの値に基づいて以下の条件式を用いて各画素が下地領域の画素であるか否かが判定される。   The background determination based on the luminance information L and the background determination based on the chromaticity information C1 and C2 will be specifically described by taking the case shown in FIG. 8 as an example. Here, the class value Lmax = 24 of the luminance information L having the maximum frequency, the class value L3rd = 26 of the luminance information L having the third highest frequency, and the class value C1max of the chromaticity information C1 having the maximum frequency = 18. The class value C2max = 17 of the chromaticity information C2 having the maximum frequency is set in the register. Based on these values, it is determined whether or not each pixel is a pixel in the background region using the following conditional expression.

Figure 0003996564
Figure 0003996564

Figure 0003996564
Figure 0003996564

Figure 0003996564
Figure 0003996564

数式2は輝度情報Lの条件式である。数式2の1行目の条件式では、対象とする画素の輝度情報Lの階級値が、度数が最大値となる階級値またはその両隣の階級値であるか否かが判定される。数式2の2行目の条件式では、対象とする画素の輝度情報Lの階級値が、度数が3番目に大きく、かつ、度数が最大値となる階級値の又隣の階級値であるか否かが判定される。数式2の1行目の条件式および2行目の条件式の少なくともいずれか一方が満たされれば、輝度情報Lによる下地判定において、下地領域の画素であると仮判定される。図8(a)の全体画像ヒストグラムにおいては、黒く塗りつぶされた部分が数式2の条件を満たす階級値である。   Expression 2 is a conditional expression of the luminance information L. In the conditional expression on the first line of Equation 2, it is determined whether or not the class value of the luminance information L of the target pixel is the class value having the maximum frequency or the class value adjacent to both. In the conditional expression on the second line of Equation 2, whether the class value of the luminance information L of the target pixel is the class value adjacent to the class value where the frequency is the third largest and the frequency is the maximum value. It is determined whether or not. If at least one of the conditional expression in the first row and the conditional expression in the second row of Expression 2 is satisfied, the background determination based on the luminance information L is provisionally determined as a pixel in the background area. In the entire image histogram of FIG. 8A, the blacked out portion is the class value that satisfies the condition of Equation 2.

数式3および数式4の条件式では、数式2の1行目の条件式と同様に、色度情報C1、C2の度数が最大値となる階級値またはその両隣の階級値であるか否かがそれぞれ判定される。そして、数式2の条件を満たした画素が、さらに数式3および数式4の条件を満たした場合に、その画素は下地領域の画素であるとして検出される。なおここでは、輝度情報Lによる判定では広めの条件で下地領域を検出し、色度情報C1、C2による判定でさらに領域を限定して下地領域を検出するようにしている。   In the conditional expressions of Expression 3 and Expression 4, as in the first line of Expression 2, it is determined whether or not the frequency value of the chromaticity information C1 and C2 is the maximum value or its adjacent value. Each is judged. When a pixel satisfying the condition of Expression 2 further satisfies the conditions of Expression 3 and Expression 4, the pixel is detected as a pixel in the background area. Here, in the determination based on the luminance information L, the background area is detected under a broader condition, and in the determination based on the chromaticity information C1 and C2, the area is further limited to detect the background area.

図7(b)に示す画素で検証すると、輝度情報Lによる数式2の条件では9画素全てが検出されるが、色度情報C1、C2による数式3および数式4の条件では、3画素のみが下地領域の画素として検出され、残りの画素は下地領域から除去される。その結果、図7(c)に示すような下地領域マップデータが検出される。ここで、“1”が下地領域の画素を示し、“0”が下地領域でない画素を示す。   When verifying with the pixels shown in FIG. 7B, all nine pixels are detected under the condition of Expression 2 based on the luminance information L, but only three pixels are detected under the conditions of Expression 3 and Expression 4 based on the chromaticity information C1 and C2. It is detected as a pixel in the ground area, and the remaining pixels are removed from the ground area. As a result, background area map data as shown in FIG. 7C is detected. Here, “1” indicates a pixel in the base region, and “0” indicates a pixel that is not in the base region.

次に、検出精度を高めるために、検出された下地領域マップデータに対してさらに孤立領域除去処理が施される。孤立領域除去処理を施す具体的方法としては例えば、予め設定されるマスク領域内のデータをメディアンフィルタによって中心値で置き換える方法や、注目画素に対して所定のマスク領域が設定され、マスク領域内の“1”と“0”の数が比較され多数決によって多い方の値が注目画素の値に設定される方法などがある。ここでは後者の、マスク領域内の多数決による方法について具体例をあげて説明する。図10(a)は一部の画像領域における下地領域マップデータの一例を示す図であり、図10(b)は孤立領域除去処理が施された後の下地領域マップデータを示す図である。   Next, in order to improve the detection accuracy, an isolated region removal process is further performed on the detected base region map data. As a specific method for performing the isolated region removal processing, for example, a method of replacing data in a preset mask region with a median filter by a median filter, or a predetermined mask region is set for a pixel of interest, There is a method in which the number of “1” and “0” are compared and the larger value is set as the value of the target pixel by majority vote. Here, the latter method based on the majority decision in the mask region will be described with a specific example. FIG. 10A is a diagram illustrating an example of background region map data in a part of image regions, and FIG. 10B is a diagram illustrating background region map data after an isolated region removal process is performed.

図10(a)の下地領域マップデータにおいて例えば、上から2行目、左から2列目の画素に注目する場合、その回りの3×3画素がマスク領域として設定される。このマスク領域内では、“1”が7つ、“0”が2つあるので、多数決により注目画素の値は“1”に設定される(図10(b)参照)。そして、注目画素を順次横方向にずらしていき、その行の端まで横にずらしたら、次の行に移り処理を続ける。この際、最も右端や左端に位置する画素のように、マスク領域として3×3画素分設定できない場合がある。このような場合は設定可能なマスク領域(例えば2×3画素)で同様に処理を行う。また、“1”と“0”とが同数の場合は、例えば注目画素の値はそのまま変更しないようにする。このようにして、図10(a)の全ての画素に対して孤立除去処理が行われると図10(b)に示す図のようになる。孤立領域除去処理された下地領域マップデータはメモリ25に格納される。   In the background area map data in FIG. 10A, for example, when attention is paid to the pixels in the second row from the top and the second column from the left, the surrounding 3 × 3 pixels are set as the mask area. Since there are seven “1” s and two “0” s in this mask region, the value of the target pixel is set to “1” by majority decision (see FIG. 10B). Then, the pixel of interest is sequentially shifted in the horizontal direction, and when it is shifted horizontally to the end of the row, the process moves to the next row and the processing is continued. At this time, there may be a case where 3 × 3 pixels cannot be set as a mask area like the pixel located at the right end or the left end. In such a case, the same processing is performed in a settable mask area (for example, 2 × 3 pixels). If “1” and “0” are the same number, for example, the value of the target pixel is not changed as it is. In this way, when the isolated removal processing is performed on all the pixels in FIG. 10A, a diagram shown in FIG. 10B is obtained. The background area map data subjected to the isolated area removal processing is stored in the memory 25.

また、さらに検出精度を高めるために、下地領域であると判定された領域内の画素数をカウントし、その画素数が予め設定される所定の閾値以下であれば、下地領域から除去する処理が施される。具体的には例えば以下のように処理される。図11は、画素数が所定値以下の領域が下地領域から除去される様子を示す説明図である。例えば、図11(a)に示すように孤立領域除去処理された下地領域マップデータの左上の画素から順番に、
“1”か“0”かの値を判定し、“1”が現れたらその画素から右、左、下の値を見て、いずれかに“1”がある画素の数をカウントしていく。さらに、“1”が存在した方向の画素に対して同様に、右、左、下の値を見ていくことで、閉じた領域内にある“1”の数を順次カウントしていく。この数が予め設定される所定の閾値以下であれば、その領域は誤って下地領域であると判定された領域であるとして、その領域内の“1”の値が全て
“0”に変更される。例えば図11において、閾値を100画素という値に設定しておくと、100画素以下の領域は、下地領域として不適正であるとして、その領域内の全ての画素の値が“0”に置き換えられる(図11(b)参照)。閾値をどの程度の値に設定するかは、実験的に様々なサンプルを参照して決定するとよい。
In order to further improve the detection accuracy, the number of pixels in the area determined to be the background area is counted, and if the number of pixels is equal to or less than a predetermined threshold value, the process of removing from the background area is performed. Applied. Specifically, for example, the following processing is performed. FIG. 11 is an explanatory diagram showing a state where an area having the number of pixels equal to or smaller than a predetermined value is removed from the base area. For example, as shown in FIG. 11A, in order from the upper left pixel of the base area map data subjected to the isolated area removal processing,
The value of “1” or “0” is determined, and when “1” appears, the right, left, and lower values are viewed from that pixel, and the number of pixels having “1” in any one is counted. . Further, similarly, the number of “1” s in the closed region is sequentially counted by looking at the right, left, and lower values for the pixels in the direction in which “1” exists. If this number is less than or equal to a predetermined threshold value set in advance, the area is erroneously determined to be the background area, and all the values of “1” in the area are changed to “0”. The For example, in FIG. 11, if the threshold is set to a value of 100 pixels, an area of 100 pixels or less is regarded as inappropriate as a base area, and the values of all the pixels in the area are replaced with “0”. (Refer FIG.11 (b)). It should be determined experimentally with reference to various samples how much the threshold value is set.

なお、この処理は、孤立領域除去処理で除去しきれなかった下地領域の除去に加え、最終的に残った全ての“1”の数をカウントし、所定の閾値と比較することで、画像全体に本当に下地領域が存在するのか否かの判定に用いることもできる。下地領域が存在するのか否かの判定では例えば、画像全体の25%以下の画素にしか“1”が存在しなかった場合には、最終的に下地領域は存在しないと判定される。   In addition to the removal of the background area that could not be removed by the isolated area removal process, this process counts the number of all the remaining “1” s, and compares it with a predetermined threshold value, thereby comparing the entire image. It can also be used to determine whether or not the background area really exists. In determining whether or not the background area exists, for example, when “1” exists only in pixels of 25% or less of the entire image, it is finally determined that the background area does not exist.

次に、下地除去処理について説明する。図12は、1DLUTのグラフである。まず、レジスタに格納される輝度情報Lについての全体画像ヒストグラムの度数が最大値となる階級値に基づいて、1DLUTが作成される。具体的には、まず、図12に示すように入出力がリニアになる直線(45度の角度の直線)を想定する。次に、全体画像ヒストグラムの度数が最大値となる階級値を3ビット左シフトすることで8ビットに戻し、その値から“a”の値を減じた値を直線の変化開始点とし、この“a”の値を減じた値からさらに“b”の値を加算した値を直線の変化終了点とする。そして、変化終了点の出力値を255に設定して、変化開始点から変化終了点まで直線で結び、変化終了点以降の出力値が255になるようなテーブルデータを作成する。“a”および“b”の値は、度数が最大値となる階級値や、カラー画像入力装置11およびカラー画像出力装置12の性能や、除去したい下地領域などに基づいて設定される。例えば、度数が最大値となる階級値を8ビットに戻した値が所定の閾値以上であれば、a=10、b=30が設定され、閾値未満であれば、a=20、b=40が設定される。この1DLUTはメモリ25に格納される。   Next, the background removal process will be described. FIG. 12 is a graph of 1DLUT. First, a 1DLUT is created based on a class value that maximizes the frequency of the entire image histogram for the luminance information L stored in the register. Specifically, first, as shown in FIG. 12, a straight line (linear with a 45 degree angle) in which input and output are linear is assumed. Next, the class value at which the frequency of the entire image histogram is the maximum value is shifted left by 3 bits to return it to 8 bits. The value obtained by adding the value of “b” to the value obtained by subtracting the value of “a” is defined as the end point of the straight line change. Then, the output value at the change end point is set to 255, and the table data is created so that the output value after the change end point is 255 by connecting with a straight line from the change start point to the change end point. The values of “a” and “b” are set based on the class value with the maximum frequency, the performance of the color image input device 11 and the color image output device 12, the background area to be removed, and the like. For example, if the value obtained by returning the class value having the maximum frequency to 8 bits is equal to or greater than a predetermined threshold, a = 10 and b = 30 are set. If the value is less than the threshold, a = 20 and b = 40. Is set. This 1DLUT is stored in the memory 25.

例示的に具体的な数値を当てはめてさらに詳述する。まず輝度情報Lについての全体画像ヒストグラムの度数が最大値となる階級値Lmaxを8ビット値に戻した値Lmax’を得る。3ビット右シフトするかまたは8を乗ずることで、数式5のように8ビット値に戻すことができる。   Further detailed description will be made by applying specific numerical values by way of example. First, a value Lmax ′ is obtained by returning the class value Lmax at which the frequency of the entire image histogram for the luminance information L is the maximum value to an 8-bit value. By shifting right by 3 bits or multiplying by 8, it can be returned to an 8-bit value as shown in Equation 5.

Figure 0003996564
Figure 0003996564

そしてここでは例えば、Lmax’が200以上の値である場合には、a=10、b=10が設定され、Lmax’が199以下の値である場合には、a=15、b=40が設定される。ここではLmax’=192で199以下であるので、a=15、b=40が設定される。この“a”および“b”を用いて1DLUTを作成する場合、以下の数式6〜数式8が用いられる。   Here, for example, when Lmax ′ is a value of 200 or more, a = 10 and b = 10 are set, and when Lmax ′ is a value of 199 or less, a = 15 and b = 40 are set. Is set. Here, since Lmax ′ = 192 and 199 or less, a = 15 and b = 40 are set. When creating a 1DLUT using “a” and “b”, the following Equations 6 to 8 are used.

Figure 0003996564
Figure 0003996564

Figure 0003996564
Figure 0003996564

Figure 0003996564
Figure 0003996564

以上の数式6〜数式8を用いて作成された1DLUTのテーブルデータを図13に示す。そして、この1DLUTのデータは、入力値xと出力値LUT(x)とが対応するように、メモリ25のメモリアドレス(LUT開始アドレス+x)に、それぞれ出力値LUT(x)の値が格納される。   FIG. 13 shows 1DLUT table data created by using the above Equations 6 to 8. The 1DLUT data stores the output value LUT (x) at the memory address (LUT start address + x) of the memory 25 so that the input value x and the output value LUT (x) correspond to each other. The

次に、下地検出処理で出力された下地領域マップデータがメモリ25から入力される。そして、色空間変換部24で輝度情報Lと2つの色度情報C1、C2とに分離されメモリ25に格納されていた画像データL、C1、C2が、下地除去処理部27に1画素分ずつ入力される。   Next, the background area map data output in the background detection process is input from the memory 25. Then, the image data L, C1, and C2 separated into the luminance information L and the two chromaticity information C1 and C2 by the color space conversion unit 24 and stored in the memory 25 are supplied to the background removal processing unit 27 for each pixel. Entered.

入力された1画素分の画像データは下地領域マップデータに基づいて下地領域であるか否かが判定される。下地領域であると判定された場合は、以下のように処理される。輝度情報Lに関しては、その画素の輝度情報Lとして1DLUTで補正処理された値が出力される。すなわち、図13に示すテーブルデータに基づいて、入力値xに対応する出力値LUT(x)が出力される。色度情報C1、C2に関しては、無彩色になるように符号無しでは“128”(符号ありでは“0”)の値に置き換えて出力される。これによって下地領域が除去される。   It is determined whether or not the input image data for one pixel is a background area based on the background area map data. If it is determined that the area is the background area, the following processing is performed. As for the luminance information L, a value corrected by 1DLUT is output as the luminance information L of the pixel. That is, the output value LUT (x) corresponding to the input value x is output based on the table data shown in FIG. The chromaticity information C1 and C2 is output by being replaced with a value of “128” without a sign (“0” with a sign) so as to be an achromatic color. As a result, the base region is removed.

下地領域マップデータに基づいて下地領域でないと判定された場合は、輝度情報Lおよび色度情報C1、C2ともに、入力画像データL、C1、C2がそのまま出力される。そして、全ての画素について上述の処理が繰り返され、下地除去処理が終了する。そして、結果的に得られた画像データL、C1、C2が領域分離処理部28に出力される。   When it is determined that it is not a background area based on the background area map data, the input image data L, C1, and C2 are output as they are together with the luminance information L and the chromaticity information C1 and C2. Then, the above process is repeated for all the pixels, and the background removal process ends. The resulting image data L, C1, and C2 are output to the region separation processing unit 28.

図14に、輝度情報Lおよび色度情報C1、C2のそれぞれについて、下地除去処理された結果を示す。図14(a)は下地領域マップデータであり、図14(b)は輝度情報Lについて下地除去処理された結果を示す図であり、図14(c)は色度情報C1について下地除去処理された結果を示す図であり、図14(d)は色度情報C2について下地除去処理された結果を示す図である。下地領域マップデータおよび1DLUTに基づいて補正処理され下地除去された状態を確認できる。   FIG. 14 shows the result of the background removal processing for each of the luminance information L and the chromaticity information C1 and C2. FIG. 14A shows the background area map data, FIG. 14B shows the result of the background removal processing for the luminance information L, and FIG. 14C shows the background removal processing for the chromaticity information C1. FIG. 14D is a diagram showing the result of the background removal processing for the chromaticity information C2. Based on the background area map data and the 1DLUT, it is possible to confirm a state in which the background processing is corrected and the background is removed.

画像処理装置20によれば、複数の部分画像ヒストグラムが作成され、それぞれの度数が最大値となる階級値同士の差分値に基づいて、画像全体に一様な下地領域が存在するか否かを判定することができる。また、検出すべき下地領域が存在するか否かをまず判定した後で下地領域を検出するので、誤った下地検出を低減することができ、下地領域のみを的確に検出することができる。さらに、下地領域であると判定された領域に対してさらに孤立領域除去処理が施されるので、下地領域として検出されるべき画素を下地領域として適正に検出することができ、下地領域でない画素を下地領域から的確に除去することができる。   According to the image processing device 20, a plurality of partial image histograms are created, and whether or not there is a uniform background area in the entire image based on the difference value between the class values at which the respective frequencies are the maximum values. Can be determined. In addition, since the background area is detected after first determining whether or not there is a background area to be detected, erroneous background detection can be reduced, and only the background area can be accurately detected. Further, since the isolated region removal process is further performed on the area determined to be the base area, the pixel to be detected as the base area can be appropriately detected as the base area, and the pixels that are not the base area can be detected. It can be accurately removed from the underlying region.

また、閉領域の画素数が所定の閾値以下の領域は下地領域から除去されるので、下地領域とは認められないような小さい領域を下地領域から除去することができ、下地領域のみを適正に検出することができる。さらに、孤立領域除去処理が施された後にさらにこの処理が施されることで、いっそう適正に下地領域のみを検出することができる。また、適正的確に検出された下地領域のみに対して下地除去処理が施されるので、下地領域のみを的確に除去することができる。さらに、再量子化された画像情報L、C1、C2に基づいて処理することによって、メモリ容量が少なくて済み、下地検出の判定を簡素化することができる。   In addition, since the area where the number of pixels of the closed area is equal to or less than the predetermined threshold is removed from the ground area, a small area that cannot be recognized as the ground area can be removed from the ground area, and only the ground area is appropriately Can be detected. Furthermore, by performing this process after the isolated area removal process is performed, it is possible to detect only the base area more appropriately. In addition, since the background removal process is performed only on the background area that has been detected appropriately and accurately, only the background area can be accurately removed. Furthermore, by performing processing based on the requantized image information L, C1, and C2, the memory capacity can be reduced, and the background detection determination can be simplified.

なお、上述の実施形態の下地検出処理および下地除去処理を、コンピュータにおいて実行可能なプログラムとして構成し、そのプログラムを図示しない記録媒体に格納し、CPUによって制御する構成とすることもできる。記録媒体としては、コンピュータ本体に固定的に備えられるROMやRAM、内蔵ハードディスクなどであってもよく、または、コンピュータ本体と分離可能に構成される記録媒体であってもよい。コンピュータ本体と分離可能に構成される記録媒体としては例えば、磁気テープやカセットテープ等のテープ系、フロッピー(登録商標)ディスクや外付けハードディスク等の磁気ディスクや、CD−ROM、MO、MD、DVD等の光ディスクなどのディスク系、ICカード(メモリカードを含む)や光カード等のカード系などであってもよい。あるいはマスクROM、EPROM(Erasable Programmable Read Only Memory)、EEPROM(Electrically Erasable Programmable Read Only Memory )、フラッシュROM等による半導体メモリを含めた固定的にプログラムを担持する媒体であっても良い。これによって、下地検出処理および下地除去処理を行うプログラムを記録した記録媒体を持ち運び自在に提供することができる。   The background detection processing and background removal processing of the above-described embodiment may be configured as a program that can be executed by a computer, stored in a recording medium (not shown), and controlled by the CPU. The recording medium may be a ROM, a RAM, a built-in hard disk, or the like fixedly provided in the computer main body, or a recording medium configured to be separable from the computer main body. Recording media configured to be separable from the computer main body include, for example, tape systems such as magnetic tapes and cassette tapes, magnetic disks such as floppy (registered trademark) disks and external hard disks, CD-ROMs, MOs, MDs, and DVDs. It may be a disk system such as an optical disk such as an IC card (including a memory card) or a card system such as an optical card. Alternatively, it may be a medium carrying a fixed program including a semiconductor memory such as a mask ROM, an EPROM (Erasable Programmable Read Only Memory), an EEPROM (Electrically Erasable Programmable Read Only Memory), or a flash ROM. Accordingly, it is possible to provide a portable recording medium on which a program for performing background detection processing and background removal processing is recorded.

また、格納されているプログラムは、マイクロプロセッサがアクセスして実行させる構成であってもよいし、あるいはプログラムを読み出し、読み出されたプログラムはコンピュータの図示しないプログラム記憶エリアにインストールされて、そのプログラムが実行される構成であってもよい。   Further, the stored program may be configured to be accessed and executed by the microprocessor, or the program is read out, and the read program is installed in a program storage area (not shown) of the computer, and the program is read. May be configured to be executed.

さらに、この実施の形態においては、図示しないインターネットを含む通信ネットワークを接続可能なシステムに構成することも可能であり、通信ネットワークからプログラムをダウンロードするように流動的にプログラムを担持する媒体であってもよい。なお、このように通信ネットワークからプログラムをダウンロードする場合には、そのダウンロード用のプログラムは予めコンピュータ本体内に格納しておくか、あるいは別の記録媒体からインストールされるものであっても良い。   Furthermore, in this embodiment, it is also possible to configure a system that can connect a communication network including the Internet (not shown), and a medium that fluidly carries the program so as to download the program from the communication network. Also good. When the program is downloaded from the communication network in this way, the download program may be stored in the computer main body in advance, or may be installed from another recording medium.

上述のプログラムは、この実施形態の下地検出処理や下地除去処理のみを実行するものではなく、図1に示す画像処理装置20における他の処理も含めて統括的に実行するように構成されたものであってもよい。   The above-described program is configured not to execute only the background detection processing and background removal processing of this embodiment, but to be executed comprehensively including other processing in the image processing apparatus 20 shown in FIG. It may be.

また、カラー画像入力装置11としては例えば、フラットベッドスキャナ、フィルムスキャナ、デジタルカメラなどが用いられる。カラー画像出力装置12としては例えば、CRTディスプレイ、液晶ディスプレイなどの画像表示装置、または処理結果を紙などに出力する電子写真方式若しくはインクジェット方式のプリンタなどが用いられる。さらに、画像形成装置10には、ネットワークを介してサーバーなどに接続するための通信手段としてのモデムなどを備えることもできる。   As the color image input device 11, for example, a flat bed scanner, a film scanner, a digital camera, or the like is used. As the color image output device 12, for example, an image display device such as a CRT display or a liquid crystal display, or an electrophotographic or inkjet printer that outputs processing results to paper or the like is used. Further, the image forming apparatus 10 may include a modem as a communication unit for connecting to a server or the like via a network.

さらに、上述の実施形態では再量子化後のビット数を5ビットとしたが、これに限定されず、検出精度やメモリ量などに応じて任意にビット数を設定すればよい。この場合、設定したビット数に応じて下地領域として検出する画像データL、C1、C2の階級値の範囲を調整するとよい。また、上述の実施形態では再量子化された画像データL、C1、C2を用いて下地検出処理および下地除去処理を行う場合について説明したが、再量子化せずに入力された画像データL、C1、C2をそのまま用いて下地検出処理および下地除去処理してもよい。   Furthermore, in the above-described embodiment, the number of bits after re-quantization is set to 5 bits. However, the number of bits is not limited to this, and the number of bits may be arbitrarily set according to the detection accuracy, the memory amount, and the like. In this case, the range of the class values of the image data L, C1, and C2 to be detected as the background area may be adjusted according to the set number of bits. In the above-described embodiment, the case where the background detection process and the background removal process are performed using the requantized image data L, C1, and C2 has been described. However, the input image data L, C1 and C2 may be used as they are for background detection processing and background removal processing.

この発明の実施形態に係るカラー画像形成装置の概略の構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a color image forming apparatus according to an embodiment of the present invention. 下地検出処理部および下地除去処理部の機能構成を示すブロック図である。It is a block diagram which shows the function structure of a background detection process part and a background removal process part. ヒストグラムの一例を示す図である。It is a figure which shows an example of a histogram. 下地検出処理部での処理手順の一部を示すフローチャートである。It is a flowchart which shows a part of process sequence in a background detection process part. 下地除去処理部27での処理手順の一部を示すフローチャートである。4 is a flowchart showing a part of a processing procedure in a background removal processing unit 27. 原稿画像の一例を示す説明図である。It is explanatory drawing which shows an example of a manuscript image. 図6に示す原稿画像の一部の画像領域における各画素の画像データを示す図であり、図6(a)は入力された8ビットの画像データを示し、図6(b)は5ビットに再量子化された画像データを示し、図6(c)は検出された下地領域マップデータを示す。FIG. 7 is a diagram illustrating image data of each pixel in a partial image area of the document image illustrated in FIG. 6, FIG. 6A illustrates input 8-bit image data, and FIG. 6B illustrates 5 bits. Requantized image data is shown, and FIG. 6C shows detected base area map data. 図6に示す原稿画像の画像領域全体についての全体画像ヒストグラムであり、図8(a)は輝度情報Lについての全体画像ヒストグラムであり、図8(b)は色度情報C1についての全体画像ヒストグラムであり、図8(c)は色度情報C2についての全体画像ヒストグラムである。6 is an overall image histogram for the entire image area of the document image shown in FIG. 6, FIG. 8A is an overall image histogram for luminance information L, and FIG. 8B is an overall image histogram for chromaticity information C1. FIG. 8C is an overall image histogram for the chromaticity information C2. 図6に示す原稿画像の部分画像についての部分画像ヒストグラムであり、図9(a)は上部16行の輝度情報Lについての部分画像ヒストグラムであり、図9(b)は中部16行の輝度情報Lについての部分画像ヒストグラムであり、図9(c)は下部16行の輝度情報Lについての部分画像ヒストグラムである。FIG. 9A is a partial image histogram for the partial image of the original image shown in FIG. 6, FIG. 9A is a partial image histogram for the luminance information L of the upper 16 rows, and FIG. 9B is the luminance information of the middle 16 rows. FIG. 9C is a partial image histogram for luminance information L in the lower 16 rows. 図10(a)は一部の画像領域における下地領域マップデータの一例を示す図であり、図10(b)は孤立領域除去処理が施された後の下地領域マップデータを示す図である。FIG. 10A is a diagram illustrating an example of background region map data in a part of image regions, and FIG. 10B is a diagram illustrating background region map data after an isolated region removal process is performed. 画素数が所定値以下の領域が下地領域から除去される様子を示す説明図である。It is explanatory drawing which shows a mode that the area | region where a pixel number is below a predetermined value is removed from a base area | region. 1DLUTのグラフである。It is a graph of 1DLUT. 1DLUTのテーブルデータである。Table data of 1DLUT. 図14(a)は下地領域マップデータであり、図14(b)は輝度情報Lについて下地除去処理された結果を示す図であり、図14(c)は色度情報C1について下地除去処理された結果を示す図であり、図14(d)は色度情報C2について下地除去処理された結果を示す図である。FIG. 14A shows the background area map data, FIG. 14B shows the result of the background removal processing for the luminance information L, and FIG. 14C shows the background removal processing for the chromaticity information C1. FIG. 14D is a diagram showing the result of the background removal processing for the chromaticity information C2.

符号の説明Explanation of symbols

10 画像形成装置
11 カラー画像入力装置
12 カラー画像出力装置
20 画像処理装置
26 下地検出処理部
26a 再量子化手段
26b ヒストグラム作成手段
26c ヒストグラム解析手段
26d 下地判定手段
26e 下地領域検出手段
26f 孤立領域除去手段
27 下地除去処理部
27b 下地除去手段
DESCRIPTION OF SYMBOLS 10 Image forming apparatus 11 Color image input apparatus 12 Color image output apparatus 20 Image processing apparatus 26 Background detection processing part 26a Requantization means 26b Histogram creation means 26c Histogram analysis means 26d Background determination means 26e Background area detection means 26f Isolated area removal means 27 Ground removal processing unit 27b Ground removal means

Claims (14)

複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、
前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、
前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、
前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、を備えることを特徴とする下地検出方法。
Based on the image information of the image to be detected for background detection composed of pixels of a plurality of rows and a plurality of columns, an overall image histogram representing the relationship between the class value of the image information and the frequency of each class value for the entire area of the image A first step of creating a partial image histogram representing a relationship between a class value of the image information corresponding to each partial image and a frequency of each class value for a plurality of partial images of the image. When,
A second step of obtaining a class value at which the frequency is a maximum value of each of the whole image histogram and the partial image histogram;
A third step of calculating a difference value between class values at which the respective frequencies of the plurality of partial image histograms are maximum values, and determining whether there is a ground region to be detected based on the difference value;
And a fourth step of detecting a background area based on a class value at which the frequency of the whole image histogram is maximum when it is determined in the third step that there is a background area. Detection method.
前記第1ステップの前に、前記画像情報を元の量子化ビット数よりも少ないビット数に再量子化するステップをさらに含むことを特徴とする請求項1に記載の下地検出方法。   The background detection method according to claim 1, further comprising a step of re-quantizing the image information to a bit number smaller than an original quantization bit number before the first step. 前記第1ステップでは、前記複数の部分画像ヒストグラムは、前記下地検出すべき画像のうち、上部複数行、中部複数行、および下部複数行の3箇所の領域、または、左側複数列、中側複数列、および右側複数列の3箇所の領域、または、上部複数行、中部複数行、下部複数行、左側複数列、中側複数列、および右側複数列の6箇所の領域、のいずれかについて作成されることを特徴とする請求項1または2に記載の下地検出方法。   In the first step, the plurality of partial image histograms include three regions of an upper plurality of rows, a middle plurality of rows, and a lower plurality of rows in the image to be detected in the background, or a plurality of left side columns and a plurality of middle sides. Created in one of the three regions of the column and the right multiple columns, or the six regions of the upper multiple rows, the middle multiple rows, the lower multiple rows, the left multiple columns, the middle multiple columns, and the right multiple columns The background detection method according to claim 1, wherein the background detection method is performed. 前記第1ステップでは、前記複数の部分画像ヒストグラムは、前記下地検出すべき画像のうち、上部複数行と、左側複数列または右側複数列の少なくともいずれか一方とについて作成されることを特徴とする請求項1または2に記載の下地検出方法。   In the first step, the plurality of partial image histograms are created for an upper plurality of rows and at least one of a plurality of left columns or a plurality of right columns among the images to be detected for background. The background detection method according to claim 1 or 2. 前記画像情報は、輝度情報と色度情報とを含み、前記第1ステップでは、輝度情報および色度情報のそれぞれについて全体画像ヒストグラムを作成し、前記第4ステップでは、まず輝度情報についての全体画像ヒストグラムに基づいて仮下地領域を検出し、次に前記仮下地領域の中から色度情報についての全体画像ヒストグラムに基づいて下地領域を検出することを特徴とする請求項1から4のいずれかに記載の下地検出方法。   The image information includes luminance information and chromaticity information. In the first step, an overall image histogram is created for each of the luminance information and chromaticity information. In the fourth step, first, an entire image for luminance information is created. 5. The temporary ground area is detected based on a histogram, and then the ground area is detected from the temporary ground area based on an overall image histogram for chromaticity information. The background detection method described. 前記第4ステップでは、前記全体画像ヒストグラムの度数が最大値となる階級値に加え、度数が最大値となる階級値の両隣の階級値と、度数が最大値となる階級値の又隣の階級値であってその度数が3番目に大きい場合にその階級値と、に基づいて下地領域を検出することを特徴とする請求項1から5のいずれかに記載の下地検出方法。   In the fourth step, in addition to the class value at which the frequency of the whole image histogram is the maximum value, the class value adjacent to the class value at which the frequency is the maximum value, and the class value next to the class value at which the frequency is the maximum value 6. The background detection method according to claim 1, wherein a background region is detected based on a class value when the frequency is the third largest. 検出された下地領域に対して孤立領域除去処理を施して得られた領域を下地領域とするステップをさらに含むことを特徴とする請求項1から6のいずれかに記載の下地検出方法。   7. The background detection method according to claim 1, further comprising a step of setting a region obtained by subjecting the detected background region to isolated region removal processing as a background region. 検出された下地領域ごとの画素数を算出し、前記画素数が予め設定される所定値未満である場合にはその領域を下地領域から除去する処理を施すステップをさらに含むことを特徴とする請求項1から7のいずれかに記載の下地検出方法。   The method further includes the step of calculating the number of pixels for each detected background area, and performing processing for removing the area from the background area when the number of pixels is less than a predetermined value set in advance. Item 8. The background detection method according to any one of Items 1 to 7. 請求項1から8のいずれかに記載の下地検出方法によって検出された下地領域のみに対して下地除去処理を施すことを特徴とする画像処理方法。   9. An image processing method, wherein a background removal process is performed only on a background area detected by the background detection method according to claim 1. 複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、
前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、
前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、
前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、をコンピュータに実行させることを特徴とするプログラム。
Based on the image information of the image to be detected for background detection composed of pixels of a plurality of rows and a plurality of columns, an overall image histogram representing the relationship between the class value of the image information and the frequency of each class value for the entire area of the image A first step of creating a partial image histogram representing a relationship between a class value of the image information corresponding to each partial image and a frequency of each class value for a plurality of partial images of the image. When,
A second step of obtaining a class value at which the frequency is a maximum value of each of the whole image histogram and the partial image histogram;
A third step of calculating a difference value between class values at which the respective frequencies of the plurality of partial image histograms are maximum values, and determining whether there is a ground region to be detected based on the difference value;
When it is determined in the third step that there is a background area, the computer executes a fourth step of detecting the background area based on a class value at which the frequency of the whole image histogram is maximum. Program.
複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす全体画像ヒストグラムを作成するとともに、前記画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数との関係をあらわす部分画像ヒストグラムをそれぞれ作成する第1ステップと、
前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める第2ステップと、
前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する第3ステップと、
前記第3ステップにおいて下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて下地領域を検出する第4ステップと、をコンピュータに実行させるプログラムをコンピュータに読み取り可能に格納したことを特徴とする記録媒体。
Based on the image information of the image to be detected for background detection composed of pixels of a plurality of rows and a plurality of columns, an overall image histogram representing the relationship between the class value of the image information and the frequency of each class value for the entire area of the image A first step of creating a partial image histogram representing a relationship between a class value of the image information corresponding to each partial image and a frequency of each class value for a plurality of partial images of the image. When,
A second step of obtaining a class value at which the frequency is a maximum value of each of the whole image histogram and the partial image histogram;
A third step of calculating a difference value between class values at which the respective frequencies of the plurality of partial image histograms are maximum values, and determining whether there is a ground region to be detected based on the difference value;
A program for causing a computer to execute a fourth step of detecting a background area based on a class value at which the frequency of the whole image histogram is maximum when it is determined in the third step that there is a background area. A recording medium characterized by being stored in a readable manner.
複数行複数列の画素から構成される下地検出すべき画像の画像情報に基づいて、前記画像の全領域について前記画像情報の階級値とそれぞれの階級値の度数とをあらわす全体画像ヒストグラムを作成するとともに、前記下地検出すべき画像のうちの複数の部分画像について、それぞれの部分画像に対応する前記画像情報の階級値とそれぞれの階級値の度数とをあらわす部分画像ヒストグラムをそれぞれ作成するヒストグラム作成手段と、
前記全体画像ヒストグラムおよび前記部分画像ヒストグラムのそれぞれの、度数が最大値となる階級値を求める解析手段と、
前記複数の部分画像ヒストグラムのそれぞれの度数が最大値となる階級値同士の差分値を算出し、前記差分値に基づいて検出すべき下地領域があるか否かを判定する判定手段と、
前記判定手段において下地領域があると判定された場合に、前記全体画像ヒストグラムの度数が最大値となる階級値に基づいて仮下地領域を検出する検出手段と、
前記検出された仮下地領域に対して、さらに孤立領域除去処理を施して得られた領域を下地領域とする孤立領域除去手段と、
前記孤立領域除去手段によって得られた下地領域のみに対して下地除去処理を施す下地除去手段と、を備えることを特徴とする画像処理装置。
Based on the image information of the image to be detected for background detection composed of pixels of a plurality of rows and a plurality of columns, a whole image histogram representing the class value of the image information and the frequency of each class value is created for the entire area of the image. In addition, for a plurality of partial images of the image to be subjected to background detection, histogram generating means for generating partial image histograms each representing a class value of the image information corresponding to each partial image and a frequency of each class value When,
Each of the whole image histogram and the partial image histogram, an analysis means for obtaining a class value having a maximum frequency,
A determination means for calculating a difference value between class values at which the respective frequencies of the plurality of partial image histograms are maximum values, and determining whether or not there is a ground region to be detected based on the difference value;
Detecting means for detecting a temporary background area based on a class value at which the frequency of the whole image histogram is maximum when the determination means determines that there is a background area;
An isolated region removing unit that uses a region obtained by further performing an isolated region removal process on the detected temporary ground region as a ground region;
An image processing apparatus comprising: a background removal unit that performs background removal processing only on the background region obtained by the isolated region removal unit.
前記ヒストグラム作成手段で用いられる前記画像情報を元の量子化ビット数よりも少ないビット数に再量子化する再量子化手段をさらに備え、再量子化された画像情報に基づいて前記全体画像ヒストグラムおよび前記部分画像ヒストグラムを作成することを特徴とする請求項12に記載の画像処理装置。   Re-quantization means for re-quantizing the image information used in the histogram creation means to a bit number smaller than the original quantization bit number, and based on the re-quantized image information, the whole image histogram and The image processing apparatus according to claim 12, wherein the partial image histogram is created. 前記下地検出すべき画像の画像情報を入力する入力手段と、
請求項12または13に記載の画像処理装置と、
前記画像処理装置によって画像処理された画像を出力する出力手段と、を備えることを特徴とする画像形成装置。
Input means for inputting image information of the image to be detected on the background;
An image processing apparatus according to claim 12 or 13,
An image forming apparatus comprising: an output unit configured to output an image processed by the image processing apparatus;
JP2003330432A 2003-09-22 2003-09-22 Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus Expired - Fee Related JP3996564B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003330432A JP3996564B2 (en) 2003-09-22 2003-09-22 Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003330432A JP3996564B2 (en) 2003-09-22 2003-09-22 Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus

Publications (2)

Publication Number Publication Date
JP2005101763A JP2005101763A (en) 2005-04-14
JP3996564B2 true JP3996564B2 (en) 2007-10-24

Family

ID=34459403

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003330432A Expired - Fee Related JP3996564B2 (en) 2003-09-22 2003-09-22 Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus

Country Status (1)

Country Link
JP (1) JP3996564B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4533327B2 (en) * 2006-02-23 2010-09-01 キヤノン株式会社 Image processing apparatus and method, computer program, and storage medium

Also Published As

Publication number Publication date
JP2005101763A (en) 2005-04-14

Similar Documents

Publication Publication Date Title
US8259357B2 (en) Image processing apparatus, image forming apparatus, image processing method, and computer readable recording medium
JP4495197B2 (en) Image processing apparatus, image forming apparatus, image processing program, and recording medium for recording image processing program
US6914628B1 (en) Image processing apparatus and method, and medium containing image processing control program
US7667711B2 (en) Image processing system, a method thereof, and a recording medium thereof
JP4197346B2 (en) Image processing apparatus, image processing method, image forming apparatus, image processing program, and recording medium
US7602967B2 (en) Method of improving image quality
JP4402090B2 (en) Image forming apparatus, image forming method, program, and recording medium
JPH1185978A (en) Image processor and its method
JP4105539B2 (en) Image processing apparatus, image forming apparatus including the same, image processing method, image processing program, and recording medium
JP4596964B2 (en) Image processing apparatus, image forming apparatus, image processing method, computer program, and recording medium
JP2007053439A (en) Isolated point discrimination apparatus, image processing apparatus, image reading apparatus, image forming apparatus, isolated point discrimination method, isolated point discrimination program, image processing program, and computer-readable recording medium
JP3996564B2 (en) Background detection method, image processing method, program, recording medium, image processing apparatus, and image forming apparatus
JP2010119006A (en) Image processing apparatus,and image processing method
JP4260774B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium
JP2006229817A (en) Background detection method, program, recording medium, image processing apparatus, and image forming apparatus
JPS6359272A (en) Picture processor
JP4176053B2 (en) Image processing method, image processing apparatus, image forming apparatus, and computer program
JP2008306400A (en) Image processing method, image processing device, image forming apparatus, computer program, and record medium
JP2005347963A (en) Method for detecting background, and image processor using the same
JP2005284423A (en) Image processor and image processing method
JP4314141B2 (en) Document image identification device, color copying machine, and document image identification method
JP2005191890A (en) Image processing device, image processing method, image processing program, recording medium stored with image processing program and image forming apparatus with image processor
JP4808282B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium for recording image processing program
JP4499685B2 (en) Image processing apparatus, image forming apparatus including the same, image processing method, image processing program, and recording medium
JP2009055121A (en) Image processing device, image processing method, image forming apparatus and program, recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050810

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070704

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070731

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070802

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 3996564

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100810

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110810

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110810

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120810

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120810

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130810

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees