JP2013058966A - Image processing apparatus and image processing program - Google Patents

Image processing apparatus and image processing program Download PDF

Info

Publication number
JP2013058966A
JP2013058966A JP2011196969A JP2011196969A JP2013058966A JP 2013058966 A JP2013058966 A JP 2013058966A JP 2011196969 A JP2011196969 A JP 2011196969A JP 2011196969 A JP2011196969 A JP 2011196969A JP 2013058966 A JP2013058966 A JP 2013058966A
Authority
JP
Japan
Prior art keywords
pixel
foreground
background
target pixel
value
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.)
Granted
Application number
JP2011196969A
Other languages
Japanese (ja)
Other versions
JP5867683B2 (en
Inventor
Koichi Fujii
晃一 藤井
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP2011196969A priority Critical patent/JP5867683B2/en
Publication of JP2013058966A publication Critical patent/JP2013058966A/en
Application granted granted Critical
Publication of JP5867683B2 publication Critical patent/JP5867683B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing apparatus and an image processing program capable of separating the foreground and background in an image more reliably when compared with a case not having this configuration.SOLUTION: When a determination is made in a pixel value determination unit 11 that the pixel value of a target pixel is out of a predetermined range from a first threshold, a foreground/background determination unit 13 determines whether the target pixel belongs to foreground or background by comparing the pixel value of the target pixel with the first threshold. When a determination is made in the pixel value determination unit 11 that the pixel value of a target pixel is in a predetermined range from the first threshold, a determination is made as to whether the target pixel belongs to foreground or background by extracting an average pixel value from the pixel values of pixels in a predetermined range including the target pixel, as a feature value, in a feature value extraction unit 12, and then comparing the pixel value of the target pixel with a second threshold set according to the average pixel value.

Description

本発明は、画像処理装置および画像処理プログラムに関するものである。   The present invention relates to an image processing apparatus and an image processing program.

従来より、画像を背景(下地)と前景(文字、絵柄、表など)に分離し、それぞれに対して種々の処理を行っている。例えば文書画像の解析、理解を行う際の最初の処理として、文書画像の領域分離を行うことが一般に知られている。一例として特許文献1では、第1段階として文書画像を絵柄と文字に分離した後、各絵柄領域に対して2値化処理を行い、文字抽出を実現している。   Conventionally, an image is separated into a background (background) and a foreground (characters, patterns, tables, etc.), and various processes are performed on each. For example, as a first process when analyzing and understanding a document image, it is generally known to perform region separation of the document image. As an example, in Patent Document 1, as a first stage, a document image is separated into a pattern and a character, and then binarization processing is performed on each of the pattern areas to realize character extraction.

文書画像の領域分離において、まず、文書画像の前景と背景を分離する必要がある。文書画像の下地の画素値がある範囲内に収まる特性を利用して、文書画像から固定閾値を算出し、算出した固定閾値を使用して文書画像を前景と背景に分離する処理が広く行われている。固定閾値を算出する技術としては、特許文献2に記載されている濃度ヒストグラムを用いる技術や特許文献3に記載されているクラスタリングにより背景の色を抽出する技術などがある。また、特許文献4では、カラー画像に対して各色成分のヒストグラムを用いて前景と背景の分離を行っている。   In the region separation of the document image, first, it is necessary to separate the foreground and the background of the document image. A process for calculating a fixed threshold value from a document image by using a characteristic that the pixel value of the background of the document image falls within a certain range, and separating the document image into the foreground and the background using the calculated fixed threshold value is widely performed. ing. As a technique for calculating the fixed threshold, there are a technique using a density histogram described in Patent Document 2 and a technique for extracting a background color by clustering described in Patent Document 3. In Patent Document 4, the foreground and the background are separated from the color image using the histogram of each color component.

図11は、固定閾値を用いた場合の前景、背景の分離処理の一例の説明図である。固定閾値を用いた処理では、文書画像の各画素の画素値(例えば明度)と固定閾値を比較し、固定閾値よりも明るい場合は背景、暗い場合は前景と判定する。図11において、一点鎖線で固定閾値を示している。この固定閾値により、図11(B)に示す淡い文字については前景として正しい判定がなされる。しかし、図11(A)に示す裏写りや紙面汚れ等の雑音成分が存在する場合には、これらの成分が固定閾値により前景と判定される場合がある。また、例えば図11(C)に示す例のように、予め想定した濃度よりも淡い色の領域が存在する場合、固定閾値よりも明るく、背景と判定される場合がある。例えば図11(A)に示す雑音成分を前景と判定しないように閾値を変更すると図11(B)に示す淡い文字が背景と判定されてしまう。逆に図11(C)に示す淡い文字を前景として判定するように閾値を変更しても、図11(A)に示す雑音成分は依然として前景として判定されたままである。このように、固定閾値を変更しても誤判定は発生する。   FIG. 11 is an explanatory diagram of an example of foreground / background separation processing when a fixed threshold is used. In the process using the fixed threshold value, the pixel value (for example, brightness) of each pixel of the document image is compared with the fixed threshold value, and if it is brighter than the fixed threshold value, the background is determined, and if it is dark, the foreground is determined. In FIG. 11, the fixed threshold value is indicated by a one-dot chain line. With this fixed threshold, the light character shown in FIG. 11B is correctly determined as the foreground. However, if there are noise components such as show-through and paper stains shown in FIG. 11A, these components may be determined as a foreground by a fixed threshold value. Further, for example, as in the example illustrated in FIG. 11C, when there is a region having a color lighter than a density assumed in advance, the background may be determined to be brighter than the fixed threshold. For example, if the threshold value is changed so that the noise component shown in FIG. 11A is not determined as the foreground, the light character shown in FIG. 11B is determined as the background. Conversely, even if the threshold value is changed so that the light character shown in FIG. 11C is determined as the foreground, the noise component shown in FIG. 11A is still determined as the foreground. In this way, erroneous determination occurs even if the fixed threshold is changed.

画像読取装置等で読み込んだ文書画像では、これらの領域において領域内で固定閾値を跨ぐ画素値を有する可能性があり、結果として、領域の一部が誤判定されて誤抽出される。このような誤抽出された領域の影響は、後続の処理にも影響してしまう。誤判定は固定閾値を算出する方法にかかわらず、固定閾値を使用した前景、背景分離技術に共通して発生し得る。   In a document image read by an image reading device or the like, there is a possibility that these regions have pixel values that cross a fixed threshold within the region, and as a result, a part of the region is erroneously determined and erroneously extracted. Such an influence of the erroneously extracted region also affects subsequent processing. A misjudgment may occur in common with foreground and background separation techniques using a fixed threshold regardless of the method of calculating the fixed threshold.

一方、画像を2値化する技術としては、単一の固定閾値を用いる方法以外にも、いくつかの技術が提案されている。例えば特許文献5では、注目画素を囲む予め決められた範囲の画素の平均値と注目画素の画素値に応じて注目画素の画素値を補正した後、閾値を設定して二値化している。また特許文献6では、注目画素がエッジ画素であるか否かに応じて、隣接画素の閾値と注目画素を取り囲む画素の濃度平均値とに基づく第1の閾値と、注目画素を取り囲む画素の濃度値に基づく第2の閾値とを切り替えて用い、二値化している。さらに特許文献7では、注目画素を含む3×3画素の濃度の平均値と注目画素の濃度との差がある範囲内であれば固定閾値により二値化し、濃度差がある範囲を超えている場合には3×3画素の濃度の平均値により二値化している。   On the other hand, as a technique for binarizing an image, several techniques have been proposed in addition to a method using a single fixed threshold value. For example, in Patent Document 5, after correcting the pixel value of the target pixel according to the average value of the pixels in a predetermined range surrounding the target pixel and the pixel value of the target pixel, the threshold value is set and binarized. Further, in Patent Document 6, depending on whether or not a target pixel is an edge pixel, a first threshold based on a threshold value of an adjacent pixel and a density average value of pixels surrounding the target pixel, and a density of a pixel surrounding the target pixel The second threshold based on the value is switched and used for binarization. Further, in Patent Document 7, if the difference between the average value of the density of 3 × 3 pixels including the target pixel and the density of the target pixel is within a certain range, it is binarized by a fixed threshold value and exceeds the range having the density difference. In this case, binarization is performed by the average value of the density of 3 × 3 pixels.

これらの2値化の技術は、いずれも注目画素からある範囲の画素の状況に応じて閾値を切り替える技術である。そのため、例えば画像中に存在する絵柄上に文字が存在する場合には、絵柄部分を背景、文字を前景として2値化する。従って、背景(下地)とそれ以外の前景(文字、絵柄、表など)に分離されない場合がある。   Each of these binarization techniques is a technique for switching the threshold according to the situation of pixels within a certain range from the target pixel. For this reason, for example, when a character is present on a pattern present in the image, binarization is performed with the pattern portion as the background and the character as the foreground. Therefore, the background (background) and other foregrounds (characters, pictures, tables, etc.) may not be separated.

特開2005−184402号公報Japanese Patent Laid-Open No. 2005-184402 特開平5−63968号公報JP-A-5-63968 特開2001−222717号公報JP 2001-222717 A 特開2010−187270号公報JP 2010-187270 A 特開2001−298615号公報JP 2001-298615 A 特開2005−311992号公報JP 2005-311992 A 特開平6−276392号公報JP-A-6-276392

本発明は、画像中の前景と背景との分離を、本構成を有しない場合に比べて確実に行うことができる画像処理装置および画像処理プログラムを提供することを目的とするものである。   An object of the present invention is to provide an image processing apparatus and an image processing program capable of reliably separating a foreground and a background in an image as compared with a case where the present configuration is not provided.

本願請求項1に記載の発明は、注目画素の画素値が予め決められた第1の閾値から予め決められた範囲内であるか否かを判定する画素値判定手段と、注目画素を含む予め決められた範囲の画素から特徴量を抽出する特徴量抽出手段と、注目画素の画素値と前記第1の閾値と前記画素値判定手段による判定結果と前記特徴量抽出手段で抽出した特徴量に基づいて注目画素が前景に属するか背景に属するかを判定する前景背景判定手段を有することを特徴とする画像処理装置である。   The invention according to claim 1 of the present application includes a pixel value determination unit that determines whether or not a pixel value of a target pixel is within a predetermined range from a predetermined first threshold value, and includes a target pixel in advance. A feature amount extracting unit that extracts a feature amount from a predetermined range of pixels, a pixel value of a target pixel, the first threshold value, a determination result by the pixel value determining unit, and a feature amount extracted by the feature amount extracting unit. An image processing apparatus comprising foreground / background determination means for determining whether a pixel of interest belongs to a foreground or a background based on the background.

本願請求項2に記載の発明は、本願請求項1に記載の発明における前記前景背景判定手段が、前記画素値判定手段で注目画素の画素値が前記第1の閾値から予め決められた範囲内であると判定された場合に、注目画素の画素値と前記特徴量抽出手段で抽出した特徴量に従って注目画素が前景に属するか背景に属するかを判定することを特徴とする画像処理装置である。   The invention according to claim 2 of the present application is such that the foreground / background determination means in the invention according to claim 1 is within a range in which the pixel value of the pixel of interest is determined in advance by the pixel value determination means from the first threshold value. And determining whether the pixel of interest belongs to the foreground or the background according to the pixel value of the pixel of interest and the feature amount extracted by the feature amount extraction unit. .

本願請求項3に記載の発明は、本願請求項2に記載の発明における前記特徴量抽出手段が、注目画素を含む予め決められた範囲の画素の画素値から平均の画素値を特徴量として抽出し、前記前景背景判定手段は、前記特徴量抽出手段で抽出した平均の画素値に従って第2の閾値を設定し、該第2の閾値と注目画素の画素値とを比較し、注目画素が前景に属するか背景に属するかを判定することを特徴とする画像処理装置である。   In the invention according to claim 3 of the present application, the feature amount extraction means in the invention of claim 2 extracts an average pixel value as a feature amount from pixel values of pixels in a predetermined range including the target pixel. The foreground / background determination unit sets a second threshold value according to the average pixel value extracted by the feature amount extraction unit, compares the second threshold value with the pixel value of the target pixel, and determines that the target pixel is the foreground. It is an image processing apparatus characterized by determining whether it belongs to the background or the background.

本願請求項4に記載の発明は、本願請求項1から請求項3のいずれか1項に記載の発明における前記前景背景判定手段は、前記画素値判定手段で注目画素の画素値が前記第1の閾値から予め決められた範囲外であると判定された場合に、注目画素の画素値と前記第1の閾値を比較して注目画素が前景に属するか背景に属するかを判定することを特徴とする画像処理装置である。   According to a fourth aspect of the present invention, the foreground / background determination unit according to any one of the first to third aspects of the present invention is configured such that the pixel value of the target pixel is the first pixel value determination unit. A pixel value of a target pixel is compared with the first threshold value to determine whether the target pixel belongs to the foreground or the background when it is determined that the target pixel is out of a predetermined range from the threshold value The image processing apparatus.

本願請求項5に記載の発明は、注目画素の輝度または明度について請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する第1の判定手段と、前記第1の判定手段で背景と判定された注目画素について該注目画素の輝度または明度成分以外の色成分について請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する第2の判定手段を有することを特徴とする画像処理装置である。   In the invention according to claim 5 of the present application, regarding the luminance or brightness of the target pixel, whether the target pixel belongs to the foreground or the background by the configuration of the image processing device according to any one of claims 1 to 4. 5. The first determination means for determining the color component other than the luminance or brightness component of the target pixel for the target pixel determined as the background by the first determination means. According to the configuration of the image processing apparatus, the image processing apparatus includes a second determination unit that determines whether the target pixel belongs to the foreground or the background.

本願請求項6に記載の発明は、注目画素の値を構成する複数の色成分についてそれぞれ請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する複数の色成分判定手段と、前記複数の色成分判定手段の判定結果に基づいて前記注目画素が前景に属するか背景に属するかを判定する総合判定手段を有することを特徴とする画像処理装置である。   In the invention according to claim 6 of the present application, the pixel of interest is brought to the foreground by the configuration of the image processing device according to any one of claims 1 to 4 for each of a plurality of color components constituting the value of the pixel of interest. A plurality of color component determination means for determining whether the target pixel belongs to the background, and a comprehensive determination means for determining whether the pixel of interest belongs to the foreground or the background based on the determination results of the plurality of color component determination means An image processing apparatus characterized by this.

本願請求項7に記載の発明は、コンピュータに、請求項1から請求項6のいずれか1項に記載の画像処理装置の機能を実行させるものであることを特徴とする画像処理プログラムである。   The invention described in claim 7 of the present application is an image processing program for causing a computer to execute the function of the image processing apparatus described in any one of claims 1 to 6.

本願請求項1に記載の発明によれば、固定閾値のみを用いる場合に比べて確実に前景と背景を判定することができるという効果がある。   According to the first aspect of the present invention, there is an effect that the foreground and the background can be reliably determined as compared with the case where only the fixed threshold is used.

本願請求項2に記載の発明によれば、第1の閾値では誤った判定を行う可能性がある場合について、本構成を有しない場合に比べて確実に前景と背景の判定を行うことができる。   According to the second aspect of the present invention, foreground and background can be more reliably determined when there is a possibility of erroneous determination at the first threshold than when the present configuration is not provided. .

本願請求項3に記載の発明によれば、裏写りや紙面汚れ等の雑音成分と淡い文字などの前景成分とを、本構成を有しない場合に比べて確実に判定することができる。   According to the third aspect of the present invention, noise components such as show-through and paper stains and foreground components such as light characters can be reliably determined as compared with the case where the present configuration is not provided.

本願請求項4に記載の発明によれば、本構成を有しない場合に比べて、明らかに前景、背景と判定される領域を、特徴量を用いた判定から除外して処理を高速化することができる。   According to the invention described in claim 4 of the present application, compared with the case where the present configuration is not provided, the areas that are clearly determined to be the foreground and the background are excluded from the determination using the feature amount, thereby speeding up the processing. Can do.

本願請求項5に記載の発明によれば、カラー画像に対しても固定閾値のみを用いる場合に比べて確実に前景と背景を判定することができる。   According to the fifth aspect of the present invention, the foreground and the background can be reliably determined as compared with the case where only the fixed threshold is used for the color image.

本願請求項6に記載の発明によれば、カラー画像に対しても固定閾値のみを用いる場合に比べて確実に前景と背景を判定することができる。   According to the sixth aspect of the present invention, it is possible to reliably determine the foreground and the background as compared with the case where only the fixed threshold is used for the color image.

本願請求項7に記載の発明によれば、本願請求項1から請求項6のいずれか1項に記載の発明の効果を得ることができる。   According to the invention of claim 7 of the present application, the effect of the invention of any one of claims 1 to 6 can be obtained.

本発明の実施の一形態を示す構成図である。It is a block diagram which shows one Embodiment of this invention. 本発明の実施の一形態における動作の一例を示す流れ図である。It is a flowchart which shows an example of the operation | movement in one Embodiment of this invention. 本発明の実施の一形態における前景、背景の分離処理の一例の説明図である。It is explanatory drawing of an example of the foreground / background separation process in the embodiment of the present invention. 本発明の実施の一形態における具体的な画像に対する前景、背景の判定処理の一例の説明図である。It is explanatory drawing of an example of the determination process of the foreground and the background with respect to the specific image in one Embodiment of this invention. 本発明の実施の一形態の変形例を示す構成図である。It is a block diagram which shows the modification of one Embodiment of this invention. 本発明の実施の一形態の変形例における動作の一例を示す流れ図である。It is a flowchart which shows an example of the operation | movement in the modification of one Embodiment of this invention. 本発明の実施の一形態の第1の応用例の構成図である。It is a block diagram of the 1st application example of one Embodiment of this invention. 本発明の実施の一形態の第1の応用例における第2判定部32の動作の一例を示す流れ図である。It is a flowchart which shows an example of operation | movement of the 2nd determination part 32 in the 1st application example of one Embodiment of this invention. 本発明の実施の一形態の第2の応用例の構成図である。It is a block diagram of the 2nd application example of one Embodiment of this invention. 本発明の実施の一形態またはその変形例、応用例で説明した機能をコンピュータプログラムで実現した場合におけるコンピュータプログラム及びそのコンピュータプログラムを格納した記憶媒体とコンピュータの一例の説明図である。FIG. 15 is an explanatory diagram of an example of a computer program, a storage medium storing the computer program, and a computer when the functions described in the embodiment of the present invention or its modifications and application examples are realized by a computer program. 固定閾値を用いた場合の前景、背景の分離処理の一例の説明図である。It is explanatory drawing of an example of a foreground and background separation process at the time of using a fixed threshold value.

図1は、本発明の実施の一形態を示す構成図である。図中、11は画素値判定部、12は特徴量抽出部、13は前景背景判定部である。ここでは、処理対象の画像が与えられ、その画像のそれぞれの画素を注目画素として、その注目画素が前景であるか背景であるのかを判定する処理を行ってゆくものとする。もちろん、複数の画素をまとめて注目画素とし、前景または背景の判定を行ってもよい。   FIG. 1 is a configuration diagram showing an embodiment of the present invention. In the figure, 11 is a pixel value determination unit, 12 is a feature amount extraction unit, and 13 is a foreground / background determination unit. Here, it is assumed that an image to be processed is given, and each pixel of the image is set as a target pixel, and processing for determining whether the target pixel is a foreground or a background is performed. Of course, the foreground or the background may be determined using a plurality of pixels as a target pixel.

また、第1の閾値は前景と背景を判別するために従来から用いられている固定閾値であり、予め与えられるものとする。例えば、想定される淡い文字の色が前景として判別される閾値を設定すればよい。処理対象の画像を用い、例えば濃度ヒストグラムなどから、この第1の閾値を生成するように構成してもよい。例えば特許文献1や特許文献2の技術を利用してもよい。もちろん、他の種々の技術により第1の閾値を設定してもよいし、手動で設定してもかまわない。文書画像を対象とする場合、ある程度の下地領域が存在する場合が想定され、基本的に固定閾値である第1の閾値による前景、背景の判定を行い、第1の閾値では誤判定の場合が想定される場合に、特徴量を用いた判定を行う。   The first threshold value is a fixed threshold value conventionally used for discriminating between the foreground and the background, and is given in advance. For example, it is only necessary to set a threshold value at which an assumed light character color is determined as the foreground. For example, the first threshold value may be generated from a density histogram using an image to be processed. For example, the techniques of Patent Document 1 and Patent Document 2 may be used. Of course, the first threshold may be set by other various techniques, or may be set manually. When a document image is a target, it is assumed that a certain background area exists, and foreground and background are basically determined based on a first threshold which is a fixed threshold. When assumed, the determination using the feature amount is performed.

画素値判定部11は、注目画素の画素値が、与えられた第1の閾値から予め決められた範囲内であるか否かを判定する。この範囲は、固定閾値である第1の閾値を用いた前景と背景の判定を行った場合に誤判定される場合がある範囲として設定するものである。範囲の設定は予め行っておけばよく、例えば第1の閾値からの相対的な範囲として設定しておいてもよい。   The pixel value determination unit 11 determines whether or not the pixel value of the target pixel is within a predetermined range from the given first threshold value. This range is set as a range that may be erroneously determined when the foreground and background are determined using the first threshold that is a fixed threshold. The range may be set in advance. For example, the range may be set as a relative range from the first threshold.

特徴量抽出部12は、注目画素を含む予め決められた範囲の画素から特徴量を抽出する。抽出する特徴量としては、注目画素を含む予め決められた範囲の画素の画素値から平均の画素値を特徴量とするとよい。もちろんそのほかにも、例えば1次微分、2次微分など、周囲の画素と注目画素との違いが得られる他の特徴量であってもよい。   The feature amount extraction unit 12 extracts a feature amount from pixels in a predetermined range including the target pixel. As the feature quantity to be extracted, an average pixel value from the pixel values of pixels in a predetermined range including the target pixel may be used as the feature quantity. Of course, in addition to this, for example, other feature amounts such as a first-order differentiation and a second-order differentiation that can obtain the difference between the surrounding pixels and the target pixel may be used.

前景背景判定部13は、注目画素の画素値と、第1の閾値と、画素値判定部11による判定結果と、特徴量抽出部12で抽出した特徴量に基づいて、注目画素が前景に属するか背景に属するかを判定する。具体的な例としては、画素値判定部11で注目画素の画素値が第1の閾値から予め決められた範囲外であると判定された場合に、注目画素の画素値と第1の閾値を比較して注目画素が前景に属するか背景に属するかを判定する。また、画素値判定部11で注目画素の画素値が第1の閾値から予め決められた範囲内であると判定された場合に、注目画素の画素値と特徴量抽出部12で抽出した特徴量に従って、注目画素が前景に属するか背景に属するかを判定する。特徴量抽出部12で抽出した特徴量が平均の画素値である場合には、平均の画素値に従って第2の閾値を設定し、その第2の閾値と注目画素の画素値とを比較し、注目画素が前景に属するか背景に属するかを判定すればよい。特徴量抽出部12で抽出する特徴量がそれ以外の特徴量である場合でも、その特徴量に応じた判定を行えばよい。   The foreground / background determination unit 13 includes the target pixel in the foreground based on the pixel value of the target pixel, the first threshold value, the determination result by the pixel value determination unit 11, and the feature amount extracted by the feature amount extraction unit 12. Or belonging to the background. As a specific example, when the pixel value determining unit 11 determines that the pixel value of the target pixel is outside the predetermined range from the first threshold, the pixel value of the target pixel and the first threshold are set. In comparison, it is determined whether the pixel of interest belongs to the foreground or the background. When the pixel value determination unit 11 determines that the pixel value of the target pixel is within a predetermined range from the first threshold, the pixel value of the target pixel and the feature amount extracted by the feature amount extraction unit 12 Thus, it is determined whether the target pixel belongs to the foreground or the background. When the feature amount extracted by the feature amount extraction unit 12 is an average pixel value, a second threshold value is set according to the average pixel value, and the second threshold value is compared with the pixel value of the target pixel. It may be determined whether the pixel of interest belongs to the foreground or the background. Even when the feature quantity extracted by the feature quantity extraction unit 12 is a feature quantity other than that, the determination according to the feature quantity may be performed.

図2は、本発明の実施の一形態における動作の一例を示す流れ図である。S21において、画像中の注目画素を設定し、その画素値を取得して各部に渡される。S22において、特徴量抽出部12は、注目画素を含む予め決められた範囲の画素から特徴量を抽出する。ここでは、平均の画素値を特徴量として抽出するものとする。なお、このS22の処理は、次のS23の処理と並行して、あるいはS23の処理の後に行ってもよい。   FIG. 2 is a flowchart showing an example of the operation in the embodiment of the present invention. In S21, the pixel of interest in the image is set, the pixel value is acquired and passed to each unit. In S22, the feature amount extraction unit 12 extracts feature amounts from pixels in a predetermined range including the target pixel. Here, an average pixel value is extracted as a feature amount. The process of S22 may be performed in parallel with the process of the next S23 or after the process of S23.

S23において、画素値判定部11は注目画素の画素値が、与えられた第1の閾値から予め決められた範囲内であるか否かを判定する。予め決められた範囲外である場合には、固定閾値である第1の閾値を用いた前景と背景の判定を行っても支障はないものとし、S24において、前景背景判定部13は注目画素の画素値と第1の閾値を比較して、注目画素が前景に属するか背景に属するかを判定する。例えば第1の閾値よりも暗い画素であれば前景として判定し、第1の閾値よりも明るい画素であれば背景として判定すればよい。   In S <b> 23, the pixel value determination unit 11 determines whether or not the pixel value of the pixel of interest is within a predetermined range from the given first threshold value. If it is outside the predetermined range, it is assumed that there is no problem even if the foreground and the background are determined using the first threshold which is a fixed threshold. In S24, the foreground / background determination unit 13 determines the target pixel. The pixel value is compared with the first threshold value to determine whether the target pixel belongs to the foreground or the background. For example, a pixel darker than the first threshold may be determined as the foreground, and a pixel brighter than the first threshold may be determined as the background.

一方、S23で注目画素の画素値が第1の閾値から予め決められた範囲内であると判定されている場合には、固定閾値である第1の閾値を用いた前景と背景の判定では誤判定される場合があるものとして、S25において、前景背景判定部13は特徴量抽出部12で抽出した平均の画素値に従って第2の閾値を設定し、この第2の閾値と注目画素の画素値とを比較し、注目画素が前景に属するか背景に属するかを判定する。第2の閾値は、平均の画素値そのもの、あるいは、雑音成分などによる変化量を見込んで平均の画素値に予め決めておいた値を加減算した値とするとよい。この注目画素の画素値が第1の閾値から予め決められた範囲内である場合には、周囲の画素に対して注目画素が異なる特徴を有していれば前景として判定し、周囲の画素と変わらぬ特徴を有していれば背景として判定するものである。具体的には第2の閾値よりも暗い画素であれば、その注目画素は周囲と異なる特徴を有しているものとして前景と判定し、第2の閾値よりも明るい画素であれば、その注目画素は周囲と変わらぬ特徴を有しているものとして背景と判定すればよい。   On the other hand, if it is determined in S23 that the pixel value of the pixel of interest is within a predetermined range from the first threshold, the foreground and background determination using the first threshold that is a fixed threshold is incorrect. In step S25, the foreground / background determination unit 13 sets a second threshold value in accordance with the average pixel value extracted by the feature amount extraction unit 12, and the second threshold value and the pixel value of the target pixel are determined. To determine whether the target pixel belongs to the foreground or the background. The second threshold value may be an average pixel value itself or a value obtained by adding or subtracting a predetermined value to the average pixel value in consideration of a change amount due to a noise component or the like. When the pixel value of the target pixel is within a predetermined range from the first threshold, if the target pixel has different characteristics from the surrounding pixels, it is determined as the foreground. If it has unchanging characteristics, it is determined as a background. Specifically, if the pixel is darker than the second threshold, the target pixel is determined to be the foreground as having a different characteristic from the surroundings, and if the pixel is brighter than the second threshold, the target The pixel may be determined as the background as having the same characteristics as the surroundings.

S26において、与えられた画像の各画素についてすべて注目画素として処理を行ったか否かを判定し、未処理の画素が残っている場合にはS21へ戻り、注目画素を変更して処理を繰り返す。未処理の画素がなくなれば処理を終了する。   In S26, it is determined whether or not each pixel of the given image has been processed as a target pixel. If any unprocessed pixels remain, the process returns to S21 to change the target pixel and repeat the process. If there are no unprocessed pixels, the process is terminated.

図3は、本発明の実施の一形態における前景、背景の分離処理の一例の説明図である。図3においては、曲線により画像中の画素値の変化を示している。また、一点鎖線で示す第1の閾値から±αの範囲を予め決められた範囲として、この範囲の内外判定を画素値判定部11で行うものとしている。   FIG. 3 is an explanatory diagram showing an example of foreground / background separation processing according to the embodiment of the present invention. In FIG. 3, the change of the pixel value in an image is shown by the curve. Further, the range of ± α from the first threshold indicated by the alternate long and short dash line is set as a predetermined range, and the inside / outside determination of this range is performed by the pixel value determination unit 11.

図3(A)は背景部分を示しており、この場合には第1の閾値から±αの範囲外であるので、第1の閾値との比較により前景、背景の判定を行う。この例では第1の閾値よりも明るいので、背景と判定する。   FIG. 3A shows the background portion. In this case, since it is outside the range of ± α from the first threshold value, the foreground and background are determined by comparison with the first threshold value. In this example, it is brighter than the first threshold value, so it is determined as the background.

図3(B)は濃い文字部分を示しており、この場合も第1の閾値から±αの範囲外であるので、第1の閾値との比較により前景、背景の判定を行う。この例では第1の閾値よりも暗いので、前景と判定する。   FIG. 3B shows a dark character portion, which is also outside the range of ± α from the first threshold value, and therefore the foreground and background are determined by comparison with the first threshold value. In this example, it is darker than the first threshold, so it is determined as the foreground.

図3(C)、(D)、(E)は注目画素の画素値が第1の閾値から±αの範囲内となっている場合を示している。この場合には、固定閾値である第1の閾値で前景、背景の判定を行うと前景と誤判定する場合がある。このような場合には、周囲の画素に対して注目画素が異なる特徴を有していれば前景として判定し、周囲の画素と変わらぬ特徴を有していれば背景として判定する。ここでは注目画素を含む予め決められた範囲の画素、すなわち周辺を含む画素の画素値から平均の画素値を特徴量として求め、この平均の画素値を暗い側にずらして(平均の画素値に予め決めておいた値を加算して)第2の閾値として、この第2の閾値を用いて前景か背景かの判定を行う。この第2の閾値を破線で示している。   3C, 3D, and 3E show cases where the pixel value of the target pixel is within a range of ± α from the first threshold value. In this case, if the foreground and background are determined using the first threshold that is a fixed threshold, the foreground may be erroneously determined. In such a case, if the pixel of interest has a characteristic different from the surrounding pixels, it is determined as the foreground, and if it has a characteristic that is not different from the surrounding pixels, it is determined as the background. Here, an average pixel value is obtained as a feature amount from pixel values of pixels in a predetermined range including the target pixel, that is, pixels including the periphery, and the average pixel value is shifted to the dark side (to the average pixel value). As a second threshold value (by adding a predetermined value), the second threshold value is used to determine whether the foreground or the background. This second threshold value is indicated by a broken line.

図3(C)は裏写りや紙面汚れ等の雑音成分が存在する部分を示しており、第1の閾値から±αの範囲内となっている。従って、注目画素と第2の閾値とを比較し、前景、背景の判定を行う。裏写りや紙面汚れ等の雑音成分は、ぼやけて広がりを有する場合が多く、注目画素と周囲の画素との特徴の違いは文字の場合と比べてはっきりとしない。そのため、注目画素の画素値は平均の画素値に類似した値となり、平均の画素値を暗くした第2の閾値よりも明るい、すなわち背景と判定されることになる。   FIG. 3C shows a portion where noise components such as show-through and paper stains exist, and is within a range of ± α from the first threshold. Therefore, the foreground and the background are determined by comparing the target pixel with the second threshold value. Noise components such as show-through and paper stains are often blurred and spread, and the difference in characteristics between the pixel of interest and surrounding pixels is not as clear as in the case of characters. Therefore, the pixel value of the target pixel becomes a value similar to the average pixel value, and is determined to be brighter than the second threshold value obtained by darkening the average pixel value, that is, the background.

図3(D)は淡い文字の場合を示しており、第1の閾値から±αの範囲内となっているので、注目画素と第2の閾値とを比較し、前景、背景の判定を行う。淡い文字では、その文字線は周囲と比べ、淡くても色の違いははっきりしており、特徴がある。そのため、平均の画素値から得た第2の閾値よりも注目画素の画素値は暗いと判断され、前景と判定される。   FIG. 3D shows a case of a light character, which is within a range of ± α from the first threshold value, and therefore, the foreground and the background are determined by comparing the target pixel with the second threshold value. . In light characters, the character line is lighter than the surroundings, but the color difference is clear and distinctive. Therefore, the pixel value of the target pixel is determined to be darker than the second threshold value obtained from the average pixel value, and is determined to be the foreground.

図3(E)に示す例では、図3(D)に示す例よりも淡い文字の場合を示している。この例では、固定閾値である第1の閾値を用いた前景、背景の判定では、注目画素の画素値が第1の閾値よりも明るいので背景と判定されてしまう。しかしこの例では、第1の閾値から±αの範囲内となっているので、第1の閾値との比較を行うのではなく、注目画素と第2の閾値とを比較し、前景、背景の判定を行う。この図3(E)に示した例でも、平均の画素値から得た第2の閾値よりも注目画素の画素値は暗いと判断され、前景と判定される。   In the example shown in FIG. 3E, the case of a lighter character than the example shown in FIG. In this example, in the foreground / background determination using the first threshold that is a fixed threshold, the pixel value of the target pixel is brighter than the first threshold, so that the background is determined. However, in this example, since it is within the range of ± α from the first threshold value, the pixel of interest is compared with the second threshold value instead of comparing with the first threshold value. Make a decision. Also in the example shown in FIG. 3E, the pixel value of the target pixel is determined to be darker than the second threshold value obtained from the average pixel value, and it is determined to be the foreground.

この例のように、この実施の形態では、図11に示した固定閾値では背景と判定されなかった雑音成分が存在する部分を背景として判定し、固定閾値では前景と判定されなかった淡い文字も前景として判定されている。   As in this example, in this embodiment, a portion where there is a noise component that is not determined to be the background by the fixed threshold shown in FIG. 11 is determined as the background, and light characters that are not determined to be the foreground by the fixed threshold are also included. It is determined as the foreground.

図4は、本発明の実施の一形態における具体的な画像に対する前景、背景の判定処理の一例の説明図である。図4(A)に示す画像の具体例では、領域aには色つきの矩形内に表題文字が描かれている。また、領域bには円グラフが、領域cには表が、領域dには写真が、領域eには淡い文字が、それぞれ描かれている。さらにこの画像には、雑音領域pが3カ所存在している。そして、前景と背景の判定結果を図4(B)に示しており、黒く示した領域が前景と判定された部分である。   FIG. 4 is an explanatory diagram showing an example of foreground / background determination processing for a specific image according to the embodiment of the present invention. In the specific example of the image shown in FIG. 4A, a title character is drawn in a colored rectangle in the area a. In addition, a pie chart is drawn in the area b, a table is drawn in the area c, a photograph is drawn in the area d, and light characters are drawn in the area e. Furthermore, there are three noise regions p in this image. The foreground / background determination result is shown in FIG. 4B, and the black area is the portion determined to be the foreground.

領域aについては、矩形の色が第1の閾値から予め決められた範囲外であるものとしており、矩形中に描かれている表題文字についても第1の閾値から予め決められた範囲外である。そのため、領域aは全体として前景と判定される。なお、第1の閾値を用いずに、従来の二値化技術で用いられている平均の画素値から得られる第2の閾値を用いて判定すると、矩形内に背景と判定される部分が生じ、異なった判定結果となる。   For area a, the color of the rectangle is outside the predetermined range from the first threshold, and the title character drawn in the rectangle is also outside the predetermined range from the first threshold. . Therefore, the region a is determined as the foreground as a whole. Note that if a determination is made using the second threshold value obtained from the average pixel value used in the conventional binarization technique without using the first threshold value, a portion determined to be the background is generated in the rectangle. Different judgment results are obtained.

領域b、領域dについては、全体として第1の閾値から予め決められた範囲外であるものとし、前景と判定される。また領域cについては、表の罫線や文字の線分などの画素がそのまま前景と判定され、図4(B)に示すように判定される。この場合、領域c全体が前景と判定されるわけではない。   The region b and the region d are assumed to be outside the predetermined range from the first threshold as a whole, and are determined to be the foreground. For the area c, the pixels such as the ruled line of the table and the line segment of the character are determined as the foreground as they are, and are determined as shown in FIG. In this case, the entire area c is not determined as the foreground.

領域eに描かれている淡い文字については、例えば第1の閾値から予め決められた範囲外となる濃さであれば前景と判定される。もし、第1の閾値から予め決められた範囲内である場合でも、周囲の画素の平均の画素値に従って得た第2の閾値を用いて判定することにより、前景と判定される。   For a light character drawn in the area e, for example, if the density is outside the range predetermined from the first threshold, it is determined as the foreground. Even if it is within a predetermined range from the first threshold, the foreground is determined by determining using the second threshold obtained according to the average pixel value of surrounding pixels.

雑音領域pについては、第1の閾値から予め決められた範囲外となる淡い雑音成分であれば背景と判定される。もし、第1の閾値から予め決められた範囲内である場合でも、周囲にも雑音成分の画素が広がっており、平均の画素値に従って得た第2の閾値を用いて判定することにより、背景と判定される。   As for the noise region p, if it is a light noise component that is outside the predetermined range from the first threshold, it is determined as the background. Even if it is within a predetermined range from the first threshold value, the pixels of the noise component are spread out in the surroundings, and the background is determined by using the second threshold value obtained according to the average pixel value. It is determined.

このようにして、図4(A)に示す画像の場合には、図4(B)に白(背景)と黒(前景)で示すような判定が行われることになる。   In this way, in the case of the image shown in FIG. 4A, the determination shown in white (background) and black (foreground) in FIG. 4B is performed.

図5は、本発明の実施の一形態の変形例を示す構成図である。この変形例では、画素値判定部11の判定結果を特徴量算出部12にも渡している。特徴量算出部12は注目画素を含む予め決められた範囲の画素から特徴量を抽出するが、この処理を、画素値判定部11で注目画素の画素値が第1の閾値から予め決められた範囲内であると判定された場合について行う。それ以外については上述したとおりである。この構成では、すべての注目画素について特徴量算出部12で特徴量を抽出する場合に比べて、特徴量の抽出処理が減ることになる。   FIG. 5 is a configuration diagram showing a modification of the embodiment of the present invention. In this modification, the determination result of the pixel value determination unit 11 is also passed to the feature amount calculation unit 12. The feature amount calculation unit 12 extracts a feature amount from pixels in a predetermined range including the target pixel. This process is performed by the pixel value determination unit 11 in which the pixel value of the target pixel is determined from the first threshold value. This is performed when it is determined to be within the range. Others are as described above. In this configuration, the feature amount extraction processing is reduced as compared with the case where the feature amount calculation unit 12 extracts feature amounts for all the target pixels.

図6は、本発明の実施の一形態の変形例における動作の一例を示す流れ図である。図2と比べて、S22の処理をS23により注目画素の画素値が第1の閾値から予め決められた範囲内であると判定された場合の処理に移動している点で異なっている。   FIG. 6 is a flowchart showing an example of the operation in the modification of the embodiment of the present invention. Compared with FIG. 2, the process of S22 is different in that the process moves to a process in the case where it is determined in S23 that the pixel value of the target pixel is within a predetermined range from the first threshold.

S21において、画像中の注目画素を設定し、S23において、画素値判定部11は注目画素の画素値が、与えられた第1の閾値から予め決められた範囲内であるか否かを判定する。予め決められた範囲外である場合には、S24において、前景背景判定部13は注目画素の画素値と第1の閾値を比較して、注目画素が前景に属するか背景に属するかを判定する。この処理の流れは図2で説明したとおりである。   In S21, a target pixel in the image is set, and in S23, the pixel value determination unit 11 determines whether or not the pixel value of the target pixel is within a predetermined range from a given first threshold value. . If it is outside the predetermined range, in S24, the foreground / background determination unit 13 compares the pixel value of the target pixel with the first threshold value to determine whether the target pixel belongs to the foreground or the background. . The flow of this process is as described in FIG.

一方、S23で注目画素の画素値が第1の閾値から予め決められた範囲内であると判定されている場合には、S22において、特徴量抽出部12は、注目画素を含む予め決められた範囲の画素から特徴量を抽出する。例えば、注目画素を含む予め決められた範囲の画素の平均の画素値を特徴量として抽出する。S25において、前景背景判定部13は特徴量抽出部12で抽出した平均の画素値に従って第2の閾値を設定し、この第2の閾値と注目画素の画素値とを比較し、注目画素が前景に属するか背景に属するかを判定する。このS22およびS25において行われる処理の内容自体は図2とともに説明したとおりである。   On the other hand, when it is determined in S23 that the pixel value of the target pixel is within a predetermined range from the first threshold, in S22, the feature amount extraction unit 12 determines a predetermined value including the target pixel. A feature amount is extracted from a range of pixels. For example, an average pixel value of pixels in a predetermined range including the target pixel is extracted as a feature amount. In step S25, the foreground / background determination unit 13 sets a second threshold value according to the average pixel value extracted by the feature amount extraction unit 12, compares the second threshold value with the pixel value of the target pixel, and determines that the target pixel is the foreground. Or belonging to the background. The contents of the processing performed in S22 and S25 are as described with reference to FIG.

S26において、与えられた画像の各画素についてすべて注目画素として処理を行ったか否かを判定し、未処理の画素が残っている場合にはS21へ戻り、注目画素を変更して処理を繰り返す。未処理の画素がなくなれば処理を終了する。   In S26, it is determined whether or not each pixel of the given image has been processed as a target pixel. If any unprocessed pixels remain, the process returns to S21 to change the target pixel and repeat the process. If there are no unprocessed pixels, the process is terminated.

カラー画像の場合、それぞれの画素の値は複数の色成分の値で構成されている。例えばYCbCr色空間であればY成分、Cb成分、Cr成分により画素値が構成される。また、例えばLAB色空間であれば、L*成分、a*成分、b*成分により画素値が構成される。他の色空間においても複数の成分により画素値が構成されることになる。カラー画像に対しては、例えば輝度あるいは明度成分に対して上述の判定を行えばよい。また、輝度あるいは明度成分以外の成分も用いて判定してもよく、その一例を応用例として示す。   In the case of a color image, each pixel value includes a plurality of color component values. For example, in the case of a YCbCr color space, a pixel value is composed of a Y component, a Cb component, and a Cr component. For example, in the LAB color space, a pixel value is composed of an L * component, an a * component, and a b * component. In other color spaces, pixel values are constituted by a plurality of components. For a color image, for example, the above-described determination may be performed on the luminance or lightness component. Further, the determination may be made using components other than the luminance or lightness components, and an example thereof is shown as an application example.

図7は、本発明の実施の一形態の第1の応用例の構成図である。図中、31は第1判定部、32は第2判定部である。ここでは一例として、画像の色空間がYCbCr色空間であるものとし、画素値はY成分,Cb成分,Cr成分により構成されているものとする。この第1の応用例は特許文献4に記載されている構成に本発明の実施の一形態あるいはその変形例を適用した例を示している。   FIG. 7 is a configuration diagram of a first application example of one embodiment of the present invention. In the figure, 31 is a first determination unit, and 32 is a second determination unit. Here, as an example, the color space of the image is assumed to be a YCbCr color space, and the pixel value is assumed to be composed of a Y component, a Cb component, and a Cr component. This first application example shows an example in which one embodiment of the present invention or a modification thereof is applied to the configuration described in Patent Document 4.

第1判定部31は、画素の輝度成分であるY成分を用い、上述の実施の形態あるいはその変形例において説明した方法により前景と背景の判定を行う。   The first determination unit 31 uses the Y component, which is a luminance component of the pixel, to determine the foreground and the background by the method described in the above embodiment or its modification.

第2判定部32は、画素の色差成分であるCb成分、Cr成分を用い、第1判定部31で背景と判定された画素について、さらに前景と背景の判定を行う。この判定は、基本的には上述の実施の形態あるいはその変形例において説明した方法により行う。その際に、画素値判定部11はCb成分、Cr成分のそれぞれについて、与えられた第1の閾値から予め決められた範囲内であるか否かを判定すればよい。あるいは、Cb成分とCr成分から色差、例えば√(Cb2 +Cr2 )などを算出して、この色差が与えられた第1の閾値から予め決められた範囲内であるか否かを判定してもよい。 The second determination unit 32 uses the Cb component and the Cr component, which are color difference components of the pixels, to further determine the foreground and the background for the pixels determined to be the background by the first determination unit 31. This determination is basically performed by the method described in the above-described embodiment or its modification. At this time, the pixel value determination unit 11 may determine whether each of the Cb component and the Cr component is within a predetermined range from the given first threshold value. Alternatively, a color difference such as √ (Cb 2 + Cr 2 ) is calculated from the Cb component and the Cr component, and it is determined whether or not the color difference is within a predetermined range from the given first threshold value. Also good.

図8は、本発明の実施の一形態の第1の応用例における第2判定部32の動作の一例を示す流れ図である。S41において、画像中の注目画素を設定し、その画素値を取得して各部に渡される。   FIG. 8 is a flowchart illustrating an example of the operation of the second determination unit 32 in the first application example of the embodiment of the invention. In S41, the pixel of interest in the image is set, the pixel value is acquired and passed to each unit.

S42において、注目画素のCb成分がCb成分に対応する第1の閾値から予め決められた範囲内か否かを判定する。またS43において、注目画素のCr成分がCr成分に対応する第1の閾値から予め決められた範囲内か否かを判定する。なお、この判定はいずれを先に行ってもかまわない。   In S42, it is determined whether or not the Cb component of the target pixel is within a predetermined range from the first threshold corresponding to the Cb component. In S43, it is determined whether or not the Cr component of the target pixel is within a predetermined range from the first threshold corresponding to the Cr component. Note that this determination may be made first.

S42でCb成分が対応する第1の閾値から予め決められた範囲外であると判定された場合、あるいは、S43でCr成分が対応する第1の閾値から予め決められた範囲外であると判定された場合には、固定閾値である第1の閾値を用いた前景と背景の判定を行っても支障はないものとし、S44において、前景背景判定部13で注目画素のCb成分とCb成分に対応する第1の閾値、Cr成分とCr成分に対応する第1の閾値を比較して、注目画素が前景に属するか背景に属するかを判定する。例えば、Cb成分がCb成分に対応する第1の閾値よりも大きい値であれば、Cr成分にかかわらず前景として判定し、Cr成分がCr成分に対応する第1の閾値よりも大きい値であれば、Cb成分にかかわらず前景として判定すればよい。また、Cb成分がCb成分に対応する第1の閾値よりも小さく、かつ、Cr成分がCr成分に対応する第1の閾値よりも小さい場合には、背景として判定すればよい。   When it is determined in S42 that the Cb component is outside the predetermined range from the corresponding first threshold value, or in S43, it is determined that the Cr component is outside the predetermined range from the corresponding first threshold value. In this case, it is assumed that there is no problem even if the foreground and the background are determined using the first threshold that is the fixed threshold, and the foreground / background determination unit 13 converts the Cb component and the Cb component of the target pixel in S44. The corresponding first threshold value, the Cr component and the first threshold value corresponding to the Cr component are compared to determine whether the pixel of interest belongs to the foreground or the background. For example, if the Cb component is larger than the first threshold value corresponding to the Cb component, it is determined as the foreground regardless of the Cr component, and the Cr component is larger than the first threshold value corresponding to the Cr component. For example, the foreground may be determined regardless of the Cb component. Moreover, what is necessary is just to determine as a background, when Cb component is smaller than the 1st threshold value corresponding to Cb component, and Cr component is smaller than the 1st threshold value corresponding to Cr component.

一方、S42で注目画素のCb成分がCb成分に対応する第1の閾値から予め決められた範囲内であると判定され、かつ、S43で注目画素のCr成分がCr成分に対応する第1の閾値から予め決められた範囲内であると判定された場合には、固定閾値である第1の閾値を用いた前景と背景の判定では誤判定される場合があるものとして、S45において、注目画素を含む予め決められた範囲の画素から特徴量を抽出する。この処理は上述の特徴量抽出部12の処理に対応するものであり、例えば、平均のCb成分、Cr成分の値を特徴量として抽出すればよい。もちろん、そのほかの特徴量を抽出してもよい。図2で説明した処理の流れに従い、S41の処理の後で行ってもよい。   On the other hand, in S42, it is determined that the Cb component of the pixel of interest is within a predetermined range from the first threshold corresponding to the Cb component, and the Cr component of the pixel of interest corresponds to the Cr component in S43. If it is determined that it is within a predetermined range from the threshold value, it may be erroneously determined in the foreground and background determination using the first threshold value which is a fixed threshold value. A feature amount is extracted from pixels in a predetermined range including. This process corresponds to the process of the feature amount extraction unit 12 described above. For example, the average Cb component and Cr component values may be extracted as feature amounts. Of course, other feature amounts may be extracted. According to the flow of the process described with reference to FIG.

S46において、S45で抽出した特徴量、例えば平均のCb成分、Cr成分の値に従ってそれぞれの成分の第2の閾値を設定し、Cb成分とCb成分に対応する第2の閾値、Cr成分とCr成分に対応する第2の閾値とを比較し、注目画素が前景に属するか背景に属するかを判定する。この処理は、上述の前景背景判定部13の処理に対応するものである。   In S46, the second threshold value of each component is set according to the feature values extracted in S45, for example, the average Cb component value and Cr component value, and the second threshold value corresponding to the Cb component and Cb component, Cr component and Cr component is set. The second threshold value corresponding to the component is compared to determine whether the target pixel belongs to the foreground or the background. This process corresponds to the process of the foreground / background determination unit 13 described above.

S47において、与えられた画像の各画素についてすべて注目画素として処理を行ったか否かを判定し、未処理の画素が残っている場合にはS41へ戻り、注目画素を変更して処理を繰り返す。未処理の画素がなくなれば処理を終了する。   In S47, it is determined whether or not each pixel of the given image has been processed as a target pixel. If any unprocessed pixels remain, the process returns to S41 to change the target pixel and repeat the process. If there are no unprocessed pixels, the process is terminated.

この第1の応用例では、第1判定部31で輝度成分であるY成分を用いて前景と背景の判定を行っている。背景と彩度が異なる前景となる領域でも、輝度では背景と判定されてしまう場合があり、第2判定部32で色差成分を用いて判定して、このような場合についても背景と前景を分離している。なお、この第1の応用例はYCbCr色空間に限らず、LAB色空間などの明度成分を含む各種の色空間を用いる場合であってもよい。また、例えばRGB色空間やCMY色空間、CMYK色空間などでは、輝度あるいは明度成分を算出して第1判定部31で前景と背景の判定を行い、背景と判定された画素について、第2判定部32で各色成分を用いて前景と背景の判定を行えばよい。   In the first application example, the first determination unit 31 determines the foreground and the background using the Y component that is a luminance component. Even in a foreground region having a different saturation from the background, the background may be determined as the background, and the second determination unit 32 determines using the color difference component, and in such a case also separates the background and the foreground. doing. The first application example is not limited to the YCbCr color space, and may be a case where various color spaces including lightness components such as a LAB color space are used. For example, in the RGB color space, the CMY color space, the CMYK color space, etc., the luminance or brightness component is calculated, the foreground and background are determined by the first determination unit 31, and the second determination is performed for the pixels determined as the background. The unit 32 may determine the foreground and the background using each color component.

図9は、本発明の実施の一形態の第2の応用例の構成図である。図中、51はR判定部、52はG判定部、53はB判定部、54は総合判定部である。この第2の応用例では、それぞれの色成分ごとに判定を行う場合について示しており、その一例としてRGB色空間の場合の構成を示している。   FIG. 9 is a configuration diagram of a second application example of the embodiment of the invention. In the figure, 51 is an R determination section, 52 is a G determination section, 53 is a B determination section, and 54 is a comprehensive determination section. This second application example shows a case where determination is performed for each color component, and as an example, a configuration in the case of an RGB color space is shown.

R判定部51は、画素のR成分を用い、上述の実施の形態あるいはその変形例において説明した方法により前景と背景の判定を行う。またG判定部52は、画素のG成分を用い、上述の実施の形態あるいはその変形例において説明した方法により前景と背景の判定を行う。さらにB判定部53は、画素のB成分を用い、上述の実施の形態あるいはその変形例において説明した方法により前景と背景の判定を行う。R判定部51、G判定部52、B判定部53とも、使用する色成分が異なるが、処理は上述の実施の形態あるいはその変形例において説明した方法により前景と背景の判定を行うものである。   The R determination unit 51 uses the R component of the pixel to determine the foreground and the background by the method described in the above embodiment or its modification. The G determination unit 52 determines the foreground and the background using the G component of the pixel by the method described in the above-described embodiment or its modification. Further, the B determination unit 53 uses the B component of the pixel to determine the foreground and the background by the method described in the above embodiment or its modification. The R determination unit 51, the G determination unit 52, and the B determination unit 53 use different color components, but the process determines the foreground and the background by the method described in the above-described embodiment or its modification. .

総合判定部54は、R判定部51、G判定部52、B判定部53の判定結果を総合して前景に属するか背景に属するかを判定する。具体例としては、R判定部51、G判定部52、B判定部53のいずれかが前景と判定していれば前景とし、R判定部51、G判定部52、B判定部53とも背景と判定している場合に背景とすればよい。   The overall determination unit 54 determines whether it belongs to the foreground or the background by combining the determination results of the R determination unit 51, the G determination unit 52, and the B determination unit 53. As a specific example, if any of the R determination unit 51, the G determination unit 52, and the B determination unit 53 determines the foreground, the foreground is used, and the R determination unit 51, the G determination unit 52, and the B determination unit 53 all have the background. If it is determined, the background may be used.

この例ではRGB色空間の場合を示したが、これに限らず、CMY色空間やCMYK色空間、あるいは第1の応用例で用いたYCbCr色空間やLAB色空間、さらにはその他の各種の色空間において、それぞれの色成分についての判定とその判定結果を総合した判定を行えばよい。   In this example, the case of the RGB color space is shown, but not limited to this, the CMY color space, the CMYK color space, the YCbCr color space and the LAB color space used in the first application example, and various other colors. In the space, a determination for each color component and a determination that combines the determination results may be performed.

図10は、本発明の実施の一形態またはその変形例、応用例で説明した機能をコンピュータプログラムで実現した場合におけるコンピュータプログラム及びそのコンピュータプログラムを格納した記憶媒体とコンピュータの一例の説明図である。図中、61はプログラム、62はコンピュータ、71は光磁気ディスク、72は光ディスク、73は磁気ディスク、74はメモリ、81はCPU、82は内部メモリ、83は読取部、84はハードディスク、85はインタフェース、86は通信部である。   FIG. 10 is an explanatory diagram of an example of a computer program, a storage medium storing the computer program, and an example of a computer when the functions described in the embodiment of the present invention or its modifications and application examples are realized by a computer program. . In the figure, 61 is a program, 62 is a computer, 71 is a magneto-optical disk, 72 is an optical disk, 73 is a magnetic disk, 74 is a memory, 81 is a CPU, 82 is an internal memory, 83 is a reading unit, 84 is a hard disk, and 85 is An interface 86 is a communication unit.

上述の本発明の実施の一形態またはその変形例、応用例で説明した各部の機能を全部あるいは部分的に、コンピュータに実行させるプログラム61によって実現してもよい。その場合、そのプログラム61およびそのプログラムが用いるデータなどは、コンピュータが読み取る記憶媒体に記憶させておけばよい。記憶媒体とは、コンピュータのハードウェア資源に備えられている読取部83に対して、プログラムの記述内容に応じて、磁気、光、電気等のエネルギーの変化状態を引き起こして、それに対応する信号の形式で、読取部83にプログラムの記述内容を伝達するものである。例えば、光磁気ディスク71,光ディスク72(CD、DVDなどを含む)、磁気ディスク73,メモリ74(ICカード、メモリカード、フラッシュメモリなどを含む)等である。もちろんこれらの記憶媒体は、可搬型に限られるものではない。   You may implement | achieve the function of each part demonstrated by one Embodiment of the above-mentioned embodiment of this invention or its modification example, and an application example entirely or partially with the program 61 which makes a computer perform. In that case, the program 61 and data used by the program may be stored in a storage medium read by the computer. A storage medium causes a state of change in energy such as magnetism, light, electricity, etc. to the reading unit 83 provided in the hardware resource of a computer according to the description content of the program, and a signal corresponding thereto. In this format, the description content of the program is transmitted to the reading unit 83. For example, a magneto-optical disk 71, an optical disk 72 (including CD, DVD, etc.), a magnetic disk 73, a memory 74 (including IC card, memory card, flash memory, etc.) and the like. Of course, these storage media are not limited to portable types.

これらの記憶媒体にプログラム61を格納しておき、例えばコンピュータ62の読取部83あるいはインタフェース85にこれらの記憶媒体を装着してコンピュータからプログラム61を読み出し、内部メモリ82またはハードディスク84(磁気ディスクやシリコンディスクなどを含む)に記憶し、CPU81によってプログラム61を実行することによって、上述の本発明の実施の一形態またはその変形例、応用例で説明した機能が全部あるいは部分的に実現される。あるいは、通信路を介してプログラム61をコンピュータ62に転送し、コンピュータ62では通信部86でプログラム61を受信して内部メモリ82またはハードディスク84に記憶し、CPU81によってプログラム61を実行することによって実現してもよい。   The program 61 is stored in these storage media. For example, the program 61 is read from the computer by mounting these storage media in the reading unit 83 or the interface 85 of the computer 62, and the internal memory 82 or the hard disk 84 (magnetic disk or silicon). And the functions described in the above-described embodiment of the present invention, its modified examples, and applied examples are realized in whole or in part. Alternatively, the program 61 is transferred to the computer 62 via the communication path, and the computer 62 receives the program 61 by the communication unit 86 and stores it in the internal memory 82 or the hard disk 84, and the program 81 is executed by the CPU 81. May be.

コンピュータ62には、このほかインタフェース85を介して様々な装置と接続してもよい。もちろん、部分的にハードウェアによって構成してもよいし、全部をハードウェアで構成してもよい。あるいは、他の構成とともに本発明の実施の一形態で説明した機能の全部あるいは部分的に含めたプログラムとして構成してもよい。例えば本発明の実施の一形態またはその変形例、応用例で説明した前景、背景の判定結果を用いる他のプログラムとを一体としたプログラムとしてもよい。他の用途に適用する場合についても、その用途におけるプログラムと一体化してもよい。   In addition, the computer 62 may be connected to various devices via an interface 85. Of course, it may be partially configured by hardware, or all may be configured by hardware. Or you may comprise as a program which included all or one part of the function demonstrated by one Embodiment of this invention with the other structure. For example, the program may be integrated with another program that uses the foreground and background determination results described in the embodiment of the present invention or its modifications and application examples. In the case of applying to other purposes, the program may be integrated with the program for that purpose.

11…画素値判定部、12…特徴量抽出部、13…前景背景判定部、31…第1判定部、32…第2判定部、51…R判定部、52…G判定部、53…B判定部、54…総合判定部、61…プログラム、62…コンピュータ、71…光磁気ディスク、72…光ディスク、73…磁気ディスク、74…メモリ、81…CPU、82…内部メモリ、83…読取部、84…ハードディスク、85…インタフェース、86…通信部。   DESCRIPTION OF SYMBOLS 11 ... Pixel value determination part, 12 ... Feature-value extraction part, 13 ... Foreground / background determination part, 31 ... 1st determination part, 32 ... 2nd determination part, 51 ... R determination part, 52 ... G determination part, 53 ... B Determining unit, 54 ... Comprehensive determining unit, 61 ... Program, 62 ... Computer, 71 ... Magneto-optical disk, 72 ... Optical disk, 73 ... Magnetic disk, 74 ... Memory, 81 ... CPU, 82 ... Internal memory, 83 ... Reading part, 84: hard disk, 85: interface, 86: communication unit.

Claims (7)

注目画素の画素値が予め決められた第1の閾値から予め決められた範囲内であるか否かを判定する画素値判定手段と、注目画素を含む予め決められた範囲の画素から特徴量を抽出する特徴量抽出手段と、注目画素の画素値と前記第1の閾値と前記画素値判定手段による判定結果と前記特徴量抽出手段で抽出した特徴量に基づいて注目画素が前景に属するか背景に属するかを判定する前景背景判定手段を有することを特徴とする画像処理装置。   A pixel value determination unit that determines whether or not the pixel value of the target pixel is within a predetermined range from a predetermined first threshold, and a feature amount from a pixel in a predetermined range including the target pixel Feature amount extraction means to extract, pixel value of target pixel, first threshold, determination result by pixel value determination means, and feature amount extracted by feature amount extraction means, whether target pixel belongs to foreground or background An image processing apparatus comprising foreground / background determination means for determining whether the image belongs to 前記前景背景判定手段は、前記画素値判定手段で注目画素の画素値が前記第1の閾値から予め決められた範囲内であると判定された場合に、注目画素の画素値と前記特徴量抽出手段で抽出した特徴量に従って注目画素が前景に属するか背景に属するかを判定することを特徴とする請求項1に記載の画像処理装置。   The foreground / background determination unit is configured to extract the pixel value of the target pixel and the feature amount when the pixel value determination unit determines that the pixel value of the target pixel is within a predetermined range from the first threshold value. The image processing apparatus according to claim 1, wherein it is determined whether the target pixel belongs to the foreground or the background according to the feature amount extracted by the means. 前記特徴量抽出手段は、注目画素を含む予め決められた範囲の画素の画素値から平均の画素値を特徴量として抽出し、前記前景背景判定手段は、前記特徴量抽出手段で抽出した平均の画素値に従って第2の閾値を設定し、該第2の閾値と注目画素の画素値とを比較し、注目画素が前景に属するか背景に属するかを判定することを特徴とする請求項2に記載の画像処理装置。   The feature amount extraction unit extracts an average pixel value as a feature amount from pixel values of pixels in a predetermined range including the target pixel, and the foreground / background determination unit extracts the average value extracted by the feature amount extraction unit. The second threshold value is set in accordance with the pixel value, and the second threshold value is compared with the pixel value of the target pixel to determine whether the target pixel belongs to the foreground or the background. The image processing apparatus described. 前記前景背景判定手段は、前記画素値判定手段で注目画素の画素値が前記第1の閾値から予め決められた範囲外であると判定された場合に、注目画素の画素値と前記第1の閾値を比較して注目画素が前景に属するか背景に属するかを判定することを特徴とする請求項1から請求項3のいずれか1項に記載の画像処理装置。   The foreground / background determination unit determines the pixel value of the target pixel and the first value when the pixel value determination unit determines that the pixel value of the target pixel is out of a predetermined range from the first threshold. 4. The image processing apparatus according to claim 1, wherein the threshold value is compared to determine whether the pixel of interest belongs to the foreground or the background. 5. 注目画素の輝度または明度について請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する第1の判定手段と、前記第1の判定手段で背景と判定された注目画素について該注目画素の輝度または明度成分以外の色成分について請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する第2の判定手段を有することを特徴とする画像処理装置。   A first determination unit that determines whether the target pixel belongs to the foreground or the background according to the configuration of the image processing device according to any one of claims 1 to 4 with respect to luminance or brightness of the target pixel; 5. The image processing apparatus according to claim 1, wherein color components other than luminance or brightness components of the target pixel are determined for the target pixel determined to be the background by the first determination unit. An image processing apparatus comprising: a second determination unit configured to determine whether a target pixel belongs to a foreground or a background. 注目画素の値を構成する複数の色成分についてそれぞれ請求項1から請求項4のいずれか1項に記載の画像処理装置の構成により前記注目画素が前景に属するか背景に属するかを判定する複数の色成分判定手段と、前記複数の色成分判定手段の判定結果に基づいて前記注目画素が前景に属するか背景に属するかを判定する総合判定手段を有することを特徴とする画像処理装置。   5. A plurality of color components constituting a value of a target pixel, each of which determines whether the target pixel belongs to the foreground or the background by the configuration of the image processing apparatus according to any one of claims 1 to 4. An image processing apparatus comprising: color component determination means; and comprehensive determination means for determining whether the target pixel belongs to a foreground or a background based on determination results of the plurality of color component determination means. コンピュータに、請求項1から請求項6のいずれか1項に記載の画像処理装置の機能を実行させるものであることを特徴とする画像処理プログラム。   An image processing program for causing a computer to execute the function of the image processing apparatus according to any one of claims 1 to 6.
JP2011196969A 2011-09-09 2011-09-09 Image processing apparatus and image processing program Active JP5867683B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011196969A JP5867683B2 (en) 2011-09-09 2011-09-09 Image processing apparatus and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011196969A JP5867683B2 (en) 2011-09-09 2011-09-09 Image processing apparatus and image processing program

Publications (2)

Publication Number Publication Date
JP2013058966A true JP2013058966A (en) 2013-03-28
JP5867683B2 JP5867683B2 (en) 2016-02-24

Family

ID=48134438

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011196969A Active JP5867683B2 (en) 2011-09-09 2011-09-09 Image processing apparatus and image processing program

Country Status (1)

Country Link
JP (1) JP5867683B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11120530B2 (en) 2017-05-22 2021-09-14 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11338976A (en) * 1998-05-27 1999-12-10 Fujitsu Ltd Document image recognition device, method therefor, and recording medium
JP2001275000A (en) * 2000-03-24 2001-10-05 Toshiba Corp Character reader, character reading method and computer readable information storage medium with character reading program recorded therein
JP2007149118A (en) * 2007-02-05 2007-06-14 Fujitsu Ltd Form reading device and program for form reading processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11338976A (en) * 1998-05-27 1999-12-10 Fujitsu Ltd Document image recognition device, method therefor, and recording medium
JP2001275000A (en) * 2000-03-24 2001-10-05 Toshiba Corp Character reader, character reading method and computer readable information storage medium with character reading program recorded therein
JP2007149118A (en) * 2007-02-05 2007-06-14 Fujitsu Ltd Form reading device and program for form reading processing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11120530B2 (en) 2017-05-22 2021-09-14 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and storage medium

Also Published As

Publication number Publication date
JP5867683B2 (en) 2016-02-24

Similar Documents

Publication Publication Date Title
US9807280B2 (en) Image processing apparatus, method, and storage medium
CN109214999B (en) Method and device for eliminating video subtitles
US9171224B2 (en) Method of improving contrast for text extraction and recognition applications
JP5455038B2 (en) Image processing apparatus, image processing method, and program
US10699110B2 (en) Image processing apparatus, image processing method, and non-transitory recording medium storing program for causing computer to execute image processing method
JP2008148298A (en) Method and apparatus for identifying regions of different content in image, and computer readable medium for embodying computer program for identifying regions of different content in image
US10438376B2 (en) Image processing apparatus replacing color of portion in image into single color, image processing method, and storage medium
CN107424137B (en) Text enhancement method and device, computer device and readable storage medium
WO2010055558A1 (en) Character area extracting device, image picking-up device provided with character area extracting function and character area extracting program
US8189236B2 (en) Image processing apparatus, image processing method and computer-readable medium
CN108965646B (en) Image processing apparatus, image processing method, and program
JP5640622B2 (en) Method for classifying red-eye object candidates, computer-readable medium, and image processing apparatus
JP4853560B2 (en) Image processing method, image processing apparatus, and computer program
JP2010074342A (en) Image processing apparatus, image forming apparatus, and program
JP5867683B2 (en) Image processing apparatus and image processing program
JP5725276B2 (en) Binarization processing apparatus, image processing apparatus, binarization processing program, image processing program
JP2010225047A (en) Noise component removing device, and medium with noise component removing program recorded thereon
US10140731B2 (en) Image processing apparatus, image processing method, and storage medium
US11570331B2 (en) Image processing apparatus, image processing method, and storage medium
US9977984B2 (en) Computer-readable storage medium storing image processing program, image processing device, and image processing method
JP6091400B2 (en) Image processing device
US9424664B2 (en) Image processing apparatus
CN110942420B (en) Method and device for eliminating image captions
JP5365817B2 (en) Image processing apparatus and image processing program
KR102660603B1 (en) Detection of high-resolution, machine-readable tags using a mosaic image sensor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140822

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150414

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150513

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150701

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: 20151209

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151222

R150 Certificate of patent or registration of utility model

Ref document number: 5867683

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350