JP3708042B2 - Image processing method and program - Google Patents

Image processing method and program Download PDF

Info

Publication number
JP3708042B2
JP3708042B2 JP2001358350A JP2001358350A JP3708042B2 JP 3708042 B2 JP3708042 B2 JP 3708042B2 JP 2001358350 A JP2001358350 A JP 2001358350A JP 2001358350 A JP2001358350 A JP 2001358350A JP 3708042 B2 JP3708042 B2 JP 3708042B2
Authority
JP
Japan
Prior art keywords
hue
image
cluster
clustering
clusters
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
JP2001358350A
Other languages
Japanese (ja)
Other versions
JP2003162718A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2001358350A priority Critical patent/JP3708042B2/en
Publication of JP2003162718A publication Critical patent/JP2003162718A/en
Application granted granted Critical
Publication of JP3708042B2 publication Critical patent/JP3708042B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、カラー画像のセグメンテーションを行う画像処理方法及びプログラムに関する。
【0002】
【従来の技術】
画像平面上で知覚的に一様な色領域をなす画素群は、均等色空間の中で稠密なクラスタを形成する。これを利用し、均等色空間においてクラスタリングを行い、カラー画像のセグメンテーションを行う方法が知られている(参考文献「コンピュータビジョン 技術評論と将来展望、新技術コミュニケーションズ、pp.68−71」)。
【0003】
人間の知覚に近いセグメンテーションを行うためにはCIE−LABやCIE−LUVといった表色系を用い、均等色空間を表現するのが適しているという知見がある。また、クラスタリングには、パターン認識におけるパターン分類法として知られているk−means法やISODATAのような手法を利用するのが一般的である。
【0004】
実際の画像はハイライトや陰影を含んでおり、クラスタリングにおいて同一の色相を持つ画素が別々のクラスタに分類されてしまうことがある。そこで、ハイライトや陰影に依存しないセグメンテーションが必要な場合には、上記の方法により基本的なクラスタリングを先ず行い、これにより抽出されたクラスタの代表色を色相差で再分類する方法が採られる。再分類においては、色相差がしきい値以下のクラスタ同士を併合することにより、明度に違いはあるが色相は近い領域を同一の領域として分割(セグメンテーション)する。
【0005】
【発明が解決しようとする課題】
かかるセグメンテーション方法では、色相差によるクラスタの再分類のためのしきい値をチューニングする必要がある。この作業は、従来、人手により行われており熟練を要する上、手間が掛かるという問題点がある。そこで、初期設定も含めこのようなチューニングを必要としないで自動的にセグメンテーションを行えるような画像処理技術の提供が望まれている。
【0006】
また、画像を一様な色領域へ分割するのみならず、画像中の対象物体を他の色に置き換えたり、隠蔽するなどといったいわゆる画像編集技術についても実現の要請がある。かかる画像編集は、例えば映像中の残酷なシーンを低年齢者に見せない配慮のために、画像中の血の領域を隠蔽したり、ぼかすなどの編集を施すことなどである。そして、ハイライトや陰影を含んだ実際の画像では同じ血の領域であっても明度が大きく異なる場合が多く、人間の知覚に近いセグメンテーションを行う画像処理がこのような画像編集技術に好適であることからも上述した技術的課題の解決が必須である。
【0007】
【課題を解決するための手段】
本発明の画像処理方法は、入力画像中の少なくとも一部の画素を似通った色相を有するクラスタに分類するためのパラメータを計算する画像処理方法であって、前記画素の色相値を計算するステップと、色相を表す色相円の周上に前記画素をマッピングするステップと、前記色相円を可変の分割数で分割すると共に当該分割された色相円を可変の回転角で回転させることにより、前記画素をクラスタリングするステップと、前記クラスタリングの結果に基づく評価値を計算するステップと、前記評価値を最適化するよう前記分割数及び回転角を変化させて前記パラメータを決定するステップと、を具備することを特徴とする。
【0008】
【発明の実施の形態】
以下、図面を参照しながら発明の実施の形態を説明する。
【0009】
図1は本発明の一実施形態に係る画像処理システムの概略構成を示すブロック図である。図1に示すように、本実施形態の画像処理システムは、基本分類部102と、パラメータ計算部103と、再分類部104とを有する。これらの構成要素は、例えばハードディスク等の記憶装置から入力画像101を読み出して作業メモリ106に一旦記憶させ、同作業メモリ106上で本発明に係る画像処理を施し、その処理結果105を出力するよう構成されている。このような本実施形態の画像処理システムは、例えば汎用のコンピュータと、同コンピュータ上で動作するプログラムとにより実現される。
【0010】
図2は、本実施形態の画像処理システムにおけるセグメンテーション手順の一例を示すフローチャートである。
【0011】
まず、入力画像101が作業メモリ106に読み出されるとともに、このうち、処理対象の画像データが基本分類部102に入力される。基本分類部102は、かかる画像データに対し必要に応じて表色系の変換を行ってから、均等色空間の中で1つ以上のクラスタ分類を行う(ステップS202)。ここで、入力画像101に処理の対象となる画素を特定するための情報が付加されている場合、分類対象となる画素を限定して処理を行うものとする。もし、これらの付加情報がない場合は、画像データの全ての画素が分類対象となる。
【0012】
次に、入力画像101はパラメータ計算部103に送られる。ここでは、基本分類部102で得られたクラスタの中で色相が近いクラスタを併合するための、色相差のしきい値を計算する(ステップS203)。
【0013】
再分類部104では、基本分類部102において得られたクラスタを、パラメータ計算部103において得られたパラメータを用いて再分類する(ステップS204)。ここまでの処理によって、カラー画像のセグメンテーションが完了し、処理結果105が出力される。
【0014】
以下、基本分類部102、パラメータ計算部103、および再分類部104の各々の内部処理について詳細に説明する。
【0015】
図3は、基本分類部102におけるクラスタリング手順の一例を示すフローチャートである。基本分類部102では、パターン認識においてよく知られているk−means法などのクラスタリング手法が用いられる。k−means法はクラスタ数が既知である場合に有効である。図3は、GLA(Generalized Lloyd Algorithm)法を基本的な枠組みとして用いた例である。GLA法は、クラスタ数の上限を指定するのみでクラスタリングを行える方法である。条件に応じて、これらの方法を使い分けてもよい。
【0016】
また、クラスタリングを行う前に、入力画像101をCIE−LABもしくはCIE−LUVのような表色系に変換しておくことが望ましい。これらの表色系を用いることによって、人間の知覚に近いセグメンテーションが行えるようになる。クラスタリングは、これらの表色系で表される均等色空間において行うことが好ましい。
【0017】
まず、初期値としてクラスタ数を1に設定し、全ての画素が1つのクラスタに属するものとする(ステップS301)。次に、ステップS302からS312までの処理を繰り返すことによってクラスタリングを行う。ステップS302においては、それぞれのクラスタの重心を求める。画素と各クラスタの重心とのユークリッド距離(これを「色差」と呼ぶ)を求め(ステップS303)、距離が最小となるクラスタにその画素を割り当てる(ステップS304)。各画素とその画素が属するクラスタの重心との距離の総和を求め、これを画素数で割ることにより平均二乗誤差を求める(ステップS305)。ここで、現状でのクラスタの総数が設定したしきい値T1を上回っている場合、処理の終了判定に移行する(ステップS306)。すなわち、ステップS305において計算した平均二乗誤差の変化率としきい値T3とを比較する(ステップS308)。平均二乗誤差の変化率は、例えば以下の数式で定義される。
【0018】
【数1】

Figure 0003708042
【0019】
この変化率が、しきい値T3以下の場合、クラスタリングが十分収束したものとみなして処理を終了する。変化率がT3を上回る場合はステップS302に戻る。
【0020】
一方、ステップS306においてクラスタの総数がしきい値T1以下であると判定されたとき、クラスタの分割を行うかどうかの判定を行う。すなわち、平均二乗誤差の変化率をしきい値T2と比較する(ステップS307)。なお、本実施形態では、T2>=T3のように設定する。
【0021】
平均二乗誤差の変化率がT2を上回る場合、ステップS302に戻る。一方、平均二乗誤差の変化率がT2を上回らない場合は、ステップS309に進む。
【0022】
ステップS309では、各クラスタ内の分散を計算する。分散は、クラスタの重心とクラスタに属する画素の距離の2乗をクラスタ内の画素数で割ることによって求める。すべてのクラスタの中での分散の最大値がしきい値T4未満である場合に処理を終了する(ステップS310)。
【0023】
一方、分散の最大値がしきい値T4以上である場合は、分散が最大となるクラスタを分割する。クラスタを分割するためには、まずそのクラスタに主成分分析を施す(ステップS311)。主成分分析によって、図4に示すように固有ベクトルが得られる。最も分布の広がりがある方向を示す第1主成分ベクトルに垂直であって、かつ、クラスタの重心を通る平面の方程式を求め、その平面でクラスタを分割する(ステップS312)。ステップS302に戻り、終了判定条件を満たすまで処理を繰り返す。前述したように、ハイライトや陰影のような明度変化を多く含む画像に対して、以上のクラスタリング処理を行うと、ハイライトや陰影の領域を別のクラスタとしてしまうという問題が発生する。細分化され過ぎたクラスタ群を、同一の色相のクラスタ同士を併合することによって再分類する方法を以下に説明する。
【0024】
図5は、パラメータ計算部103における処理手順の一例を示すフローチャートである。まず、ステップS501において各画素の色相値を計算する。通常、入力画像101はRGBの値を画素値として持つ。RGB値から色相を計算するためには、HSIやHSVといった表色系への変換式を用いてH成分を求める。変換式としては、例えば、上述した参考文献(「コンピュータビジョン 技術評論と将来展望、新技術コミュニケーションズ、pp.65−66」)に紹介されている以下の式を利用することができる。
【0025】
【数2】
Figure 0003708042
【0026】
色相の取り得る範囲は、[0,2π]である。ただし、無彩色の色相は計算できないので、ステップS501以降では有彩色の画素のみを対象とする。次に、各画素の色相値を、設定した分割数と回転角によってクラスタリングする。上式によって求めた色相は角度で表現され、例えば図6に示すような円の周上に各画素がマッピングされる。この円を、設定した分割数で分割する。図6は分割数=4の場合を示しており、実線によって4つの分割クラスタが得られている。この円を、設定した角度で回転させると、それぞれのクラスタに分類される画素の分類パターンが変化する。そして分割数及び回転角を様々な値で変更し、最も当てはまりのよいクラスタの分割の仕方を自動的に選ぶ。
【0027】
分割数の変更方法としては、例えば最大の分割数を設定しておき、1から順に分割数を大きくしていく方法がある。しかし、分割数が大きくなるにつれ、クラスタ1つあたりに含まれる色相の範囲はほとんど変化しなくなる。そこで、例えば分割数を{1,2,3,4,5,6,7,8,9,10,12,15,18,24,36…}のように段階的に増やし、1つのクラスタに含まれる色相の範囲を一定の角度以上で変化させていくようにすると効率がよい。
【0028】
回転角については、本実施形態では、予め設定しておいた固定の値を用いることし、この回転角で色相マップの円を回転させる(図6参照)。分割数の最大値が36のとき、1つのクラスタは10度の範囲を持つので、回転角を5度に設定すれば、効率よく異なったクラスタ分類パターンを調べることが可能である。例えば、分割数が10で回転角が5度のときは、合計8通りの回転角を試すことになる。
【0029】
次にステップS502においては、全ての分割数を試したかどうかチェックする。全ての分割数を試した場合は、処理が終了となる。そうでない場合、分割数を設定する(ステップS503)。ステップS504で全ての回転角を試したかチェックする。回転角の試行回数は分割数に依存して決定される。全ての回転角を試した場合、ステップS502に戻る。そうでない場合は、回転角を設定する(ステップS505)。以上のステップにより設定された分割数と回転角で、各画素をクラスタ分類する。各画素の色相値を参照して、その画素を含むクラスタに割り当てる(ステップS506)。各画素と割り当てられたクラスタの中心との平均二乗誤差を計算する(ステップS507)。
【0030】
分割数を大きくすればするほど、平均二乗誤差の値は小さくなる。しかし、それでは分類されるクラスタ数が増大するだけである。分割数をできるだけ小さくし、かつ当てはまりのよいクラスタ分類を行うことが重要となる。そこで分割数と計算された平均二乗誤差とから、情報量規準を計算する(ステップS508)。情報量規準の値が最小となる分割数と回転角を更新し(ステップS509)、ステップS504に戻る。情報量規準は、分割数とクラスタへの当てはまりの良さを同時に最適化するための評価値として利用できる。情報量規準としてはAIC(Akaike Information Criterion;赤池情報量基準)と記述長最小化原理(MDL;Minimum Description Length)が最もよく利用される。それらの計算方法を以下に示す。
【0031】
画素数をnとし、各色相クラスタの中心と画素との平均2乗誤差(LMS:Least Mean Squared Error)が、
【数3】
Figure 0003708042
で表されるとき、誤差εが平均0であって分散がσ2の正規分布に従うと仮定すると、情報量規準MDLは、
【数4】
Figure 0003708042
のようにして求めることができる。また、情報量規準AICは、
【数5】
Figure 0003708042
によって求められる。ここで、Fは分割数+1である。
【0032】
この計算式により、ステップS508で情報量規準を計算する。AICもしくはMDLのどちらを利用してもよい。この値は小さいほど、クラスタ分類が良いということになる。
【0033】
以上の処理により、カラー画像を色相によってセグメンテーションする際の、色相の分割数と回転角を求めることができる。
【0034】
再分類部104では、基本分類の結果とパラメータ計算の結果(最適な色相の分割数と回転角)に基づいて、クラスタの再分類を行う。
【0035】
図7は再分類部104における処理の手順の一例を示すフローチャートである。まず、基本分類によって得られたクラスタの代表色(例えば、クラスタの重心)の色相を計算する(ステップS701)。次に、この代表色を、該当する色相のクラスタへ分類する(ステップS702)。例えば、基本分類によって得られた2つのクラスタの代表色が、それぞれ、同一の色相クラスタへ分類された場合、これらのクラスタは色相が同一であるとみなし、クラスタを併合する(ステップS703)。ここまでの処理により、カラー画像のセグメンテーションが終了する。
【0036】
このような本発明の実施形態に係る画像処理システムによれば、色相差によるクラスタの再分類のためのしきい値をチューニングする必要が不要であり、自動的にセグメンテーションを行える。
【0037】
次に、画像中の対象物体を他の色に置き換えたり隠蔽するための画像編集について説明する。図8は、セグメンテーションの結果をユーザが参照して画像を編集する際の手順を示すフローチャート、図9は、この画像編集に適用されるユーザインタフェースの一例を示す図である。
【0038】
図9に示すユーザインターフェースは、入力画像表示領域904(図9(b))と、代表色表示領域902および各クラスタの画像上での面積占有率等を表示する領域903を有するクラスタリング結果表示画面901(図9(a))とにより構成されている。このようなユーザインターフェースを用いて、各クラスタの代表色を表示する(ステップS801)。領域903に表示する内容としては、各クラスタの面積占有率以外に、代表色のRGB値や色相値を表示してもよい。ユーザはマウス等のポインティングデバイスを用いて、加工したい色クラスタを選択する(ステップS802)。選択するクラスタの数は1つでも複数でも構わない。さらにユーザはそのクラスタに対して行う編集方法を指定する(ステップS803)。編集方法としては、指定したクラスタに属する画素を除くことや、指定したクラスタに属する画素のみを残すなどが挙げられる。最後に、編集結果を表示する(ステップS804)。図9(b)は、指定したクラスタに属する画素を除いて生成した画像905と、指定したクラスタのみを残して生成した画像906を例として示している。
【0039】
以上説明したように、本発明に係る画像処理方法によれば、パラメータのチューニングを行わなくとも、より人間の知覚に近いカラー画像のセグメンテーションを簡単かつ速やかに行うことが可能となる。これにより、セグメンテーション結果を利用した画像編集作業を効率化することができるようになる。
【0040】
なお、本発明は上述した実施形態に限定されず種々変形して実施可能である。
【0041】
【発明の効果】
以上説明したように、本発明によれば、チューニングを必要とせず、より人間の知覚に近いカラー画像セグメンテーションを行うことのできる画像処理方法及びプログラムを提供できる。
【図面の簡単な説明】
【図1】本発明の一実施形態に係る画像処理システムの概略構成を示すブロック図。
【図2】上記実施形態におけるセグメンテーション手順の一例を示すフローチャート
【図3】上記実施形態の基本分類部におけるクラスタリング手順の一例を示すフローチャート
【図4】主成分分析により得られた固有ベクトルの一例を示す図
【図5】上記実施形態のパラメータ計算部における処理手順の一例を示すフローチャート
【図6】クラスタリングを行うための円周状の色相マップを示す図
【図7】上記実施形態の再分類部における処理の手順の一例を示すフローチャート
【図8】上記実施形態を応用した画像編集の手順を示すフローチャート
【図9】上記画像編集に適用されるユーザインタフェースの一例を示す図
【符号の説明】
101…入力画像
102…基本分類部
103…パラメータ計算部
104…再分類部
105…処理結果
106…作業メモリ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing method and program for performing color image segmentation.
[0002]
[Prior art]
A group of pixels forming a perceptually uniform color area on the image plane forms a dense cluster in the uniform color space. A method of performing clustering in a uniform color space and performing color image segmentation using this is known (reference document “Computer Vision Technical Review and Future Prospects, New Technology Communications, pp. 68-71”).
[0003]
In order to perform segmentation close to human perception, there is a finding that it is suitable to express a uniform color space using a color system such as CIE-LAB or CIE-LUV. For clustering, a technique such as k-means method or ISODATA, which is known as a pattern classification method in pattern recognition, is generally used.
[0004]
An actual image includes highlights and shadows, and pixels having the same hue may be classified into different clusters in clustering. Therefore, when segmentation that does not depend on highlights or shadows is required, basic clustering is first performed by the above-described method, and a method of reclassifying the representative colors of the clusters extracted by this is used. In the reclassification, the clusters having the hue difference equal to or smaller than the threshold value are merged to divide (segment) areas having different hues but having similar hues into the same area.
[0005]
[Problems to be solved by the invention]
In such a segmentation method, it is necessary to tune a threshold for cluster reclassification due to a hue difference. Conventionally, this operation has been performed manually, requiring skill and labor. Therefore, it is desired to provide an image processing technique that can automatically perform segmentation without requiring such tuning including initial setting.
[0006]
In addition to dividing an image into uniform color regions, there is a demand for realization of so-called image editing techniques such as replacing or hiding a target object in an image with another color. Such image editing is, for example, concealing a blood region in an image or performing editing such as blurring in order not to show a cruel scene in a video to a younger person. In an actual image including highlights and shadows, the lightness often varies greatly even in the same blood region, and image processing that performs segmentation close to human perception is suitable for such image editing technology. Therefore, it is essential to solve the technical problems described above.
[0007]
[Means for Solving the Problems]
An image processing method of the present invention is an image processing method for calculating a parameter for classifying at least some pixels in an input image into clusters having similar hues, the step of calculating a hue value of the pixels; Mapping the pixels on a circumference of a hue circle representing a hue; dividing the hue circle by a variable number of divisions; and rotating the divided hue circle by a variable rotation angle. Clustering, calculating an evaluation value based on the clustering result, and determining the parameter by changing the number of divisions and the rotation angle so as to optimize the evaluation value. Features.
[0008]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the invention will be described with reference to the drawings.
[0009]
FIG. 1 is a block diagram showing a schematic configuration of an image processing system according to an embodiment of the present invention. As illustrated in FIG. 1, the image processing system according to the present embodiment includes a basic classification unit 102, a parameter calculation unit 103, and a reclassification unit 104. These components read out the input image 101 from, for example, a storage device such as a hard disk, temporarily store it in the work memory 106, perform image processing according to the present invention on the work memory 106, and output the processing result 105. It is configured. Such an image processing system of the present embodiment is realized by, for example, a general-purpose computer and a program operating on the computer.
[0010]
FIG. 2 is a flowchart showing an example of a segmentation procedure in the image processing system of this embodiment.
[0011]
First, the input image 101 is read to the work memory 106, and among these, the image data to be processed is input to the basic classification unit 102. The basic classification unit 102 performs color system conversion on the image data as necessary, and then performs one or more cluster classifications in the uniform color space (step S202). Here, when information for specifying a pixel to be processed is added to the input image 101, processing is limited to the pixels to be classified. If there is no such additional information, all the pixels of the image data are to be classified.
[0012]
Next, the input image 101 is sent to the parameter calculation unit 103. Here, a threshold value of hue difference for merging clusters having similar hues among the clusters obtained by the basic classification unit 102 is calculated (step S203).
[0013]
The reclassification unit 104 reclassifies the clusters obtained by the basic classification unit 102 using the parameters obtained by the parameter calculation unit 103 (step S204). Through the processing so far, the segmentation of the color image is completed, and the processing result 105 is output.
[0014]
Hereinafter, each internal process of the basic classification unit 102, the parameter calculation unit 103, and the reclassification unit 104 will be described in detail.
[0015]
FIG. 3 is a flowchart illustrating an example of a clustering procedure in the basic classification unit 102. In the basic classification unit 102, a clustering method such as a k-means method well known in pattern recognition is used. The k-means method is effective when the number of clusters is known. FIG. 3 shows an example in which a GLA (Generalized Lloyd Algorithm) method is used as a basic framework. The GLA method is a method that can perform clustering only by specifying the upper limit of the number of clusters. You may use these methods properly according to conditions.
[0016]
Further, it is desirable to convert the input image 101 into a color system such as CIE-LAB or CIE-LUV before performing clustering. By using these color systems, segmentation close to human perception can be performed. Clustering is preferably performed in a uniform color space represented by these color systems.
[0017]
First, the number of clusters is set to 1 as an initial value, and all pixels belong to one cluster (step S301). Next, clustering is performed by repeating the processing from step S302 to S312. In step S302, the center of gravity of each cluster is obtained. A Euclidean distance (referred to as “color difference”) between the pixel and the center of gravity of each cluster is obtained (step S303), and the pixel is assigned to the cluster having the smallest distance (step S304). The sum of the distances between each pixel and the center of gravity of the cluster to which the pixel belongs is obtained, and this is divided by the number of pixels to obtain the mean square error (step S305). Here, if the current total number of clusters exceeds the set threshold value T1, the process shifts to a process end determination (step S306). That is, the change rate of the mean square error calculated in step S305 is compared with the threshold value T3 (step S308). The change rate of the mean square error is defined by the following formula, for example.
[0018]
[Expression 1]
Figure 0003708042
[0019]
If this rate of change is equal to or less than the threshold value T3, it is considered that the clustering has sufficiently converged, and the process is terminated. If the rate of change exceeds T3, the process returns to step S302.
[0020]
On the other hand, when it is determined in step S306 that the total number of clusters is equal to or less than the threshold value T1, it is determined whether to divide the clusters. That is, the change rate of the mean square error is compared with the threshold value T2 (step S307). In this embodiment, T2> = T3 is set.
[0021]
If the change rate of the mean square error exceeds T2, the process returns to step S302. On the other hand, if the rate of change of the mean square error does not exceed T2, the process proceeds to step S309.
[0022]
In step S309, the variance within each cluster is calculated. The variance is obtained by dividing the center of gravity of the cluster and the square of the distance between the pixels belonging to the cluster by the number of pixels in the cluster. If the maximum value of variance among all clusters is less than the threshold value T4, the process is terminated (step S310).
[0023]
On the other hand, when the maximum value of the variance is equal to or greater than the threshold value T4, the cluster having the maximum variance is divided. In order to divide a cluster, first, principal component analysis is performed on the cluster (step S311). By the principal component analysis, eigenvectors are obtained as shown in FIG. An equation of a plane perpendicular to the first principal component vector indicating the direction in which the distribution spreads most and passing through the center of gravity of the cluster is obtained, and the cluster is divided on the plane (step S312). Returning to step S302, the processing is repeated until the end determination condition is satisfied. As described above, if the above-described clustering process is performed on an image including many changes in brightness such as highlights and shadows, a problem arises in that the areas of highlights and shadows become different clusters. A method of reclassifying the cluster group that has been subdivided too much by merging clusters of the same hue will be described below.
[0024]
FIG. 5 is a flowchart illustrating an example of a processing procedure in the parameter calculation unit 103. First, in step S501, the hue value of each pixel is calculated. Usually, the input image 101 has RGB values as pixel values. In order to calculate the hue from the RGB values, the H component is obtained using a conversion formula to a color system such as HSI or HSV. As the conversion formula, for example, the following formula introduced in the above-mentioned reference (“Computer Vision Technical Review and Future Prospects, New Technology Communications, pp. 65-66”) can be used.
[0025]
[Expression 2]
Figure 0003708042
[0026]
The range that the hue can take is [0, 2π]. However, since an achromatic hue cannot be calculated, only chromatic pixels are targeted in step S501 and subsequent steps. Next, the hue value of each pixel is clustered according to the set division number and rotation angle. The hue obtained by the above equation is expressed by an angle. For example, each pixel is mapped on the circumference of a circle as shown in FIG. This circle is divided by the set number of divisions. FIG. 6 shows a case where the number of divisions = 4, and four divided clusters are obtained by solid lines. When this circle is rotated at a set angle, the classification pattern of the pixels classified into the respective clusters changes. Then, the number of divisions and the rotation angle are changed with various values, and the most suitable method of cluster division is automatically selected.
[0027]
As a method of changing the number of divisions, for example, there is a method of setting the maximum number of divisions and increasing the number of divisions in order from 1. However, as the number of divisions increases, the range of hues included per cluster hardly changes. Therefore, for example, the number of divisions is increased step by step like {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 18, 24, 36 ...} into one cluster. It is efficient to change the included hue range over a certain angle.
[0028]
In this embodiment, a fixed value set in advance is used for the rotation angle, and the circle of the hue map is rotated at this rotation angle (see FIG. 6). When the maximum value of the number of divisions is 36, one cluster has a range of 10 degrees. Therefore, if the rotation angle is set to 5 degrees, different cluster classification patterns can be examined efficiently. For example, when the number of divisions is 10 and the rotation angle is 5 degrees, a total of 8 rotation angles are tried.
[0029]
In step S502, it is checked whether all the division numbers have been tried. If all the division numbers have been tried, the process ends. Otherwise, the division number is set (step S503). In step S504, it is checked whether all rotation angles have been tried. The number of rotation angle trials is determined depending on the number of divisions. If all the rotation angles have been tried, the process returns to step S502. Otherwise, the rotation angle is set (step S505). Each pixel is classified into clusters according to the number of divisions and the rotation angle set by the above steps. The hue value of each pixel is referred to and assigned to a cluster including that pixel (step S506). The mean square error between each pixel and the assigned cluster center is calculated (step S507).
[0030]
The larger the number of divisions, the smaller the mean square error value. However, this only increases the number of clusters that are classified. It is important to reduce the number of divisions as much as possible and perform cluster classification with good fit. Therefore, an information criterion is calculated from the number of divisions and the calculated mean square error (step S508). The number of divisions and the rotation angle at which the information criterion is minimized are updated (step S509), and the process returns to step S504. The information criterion can be used as an evaluation value for simultaneously optimizing the number of divisions and the goodness of fit to the cluster. As information criteria, AIC (Akaike Information Criterion) and description length minimization principle (MDL) are most often used. The calculation method is shown below.
[0031]
The number of pixels is n, and the mean square error (LMS) between the center of each hue cluster and the pixel is
[Equation 3]
Figure 0003708042
Assuming that the error ε follows a normal distribution with mean 0 and variance σ 2 , the information criterion MDL is
[Expression 4]
Figure 0003708042
It can be obtained as follows. The information criterion AIC is
[Equation 5]
Figure 0003708042
Sought by. Here, F is the number of divisions + 1.
[0032]
Based on this calculation formula, the information criterion is calculated in step S508. Either AIC or MDL may be used. The smaller this value, the better the cluster classification.
[0033]
Through the above processing, the number of hue divisions and the rotation angle when a color image is segmented by hue can be obtained.
[0034]
The reclassifying unit 104 reclassifies clusters based on the result of basic classification and the result of parameter calculation (optimum hue division number and rotation angle).
[0035]
FIG. 7 is a flowchart illustrating an example of a processing procedure in the reclassifying unit 104. First, the hue of the representative color (for example, the center of gravity of the cluster) obtained by the basic classification is calculated (step S701). Next, this representative color is classified into a cluster of the corresponding hue (step S702). For example, when the representative colors of two clusters obtained by the basic classification are classified into the same hue cluster, these clusters are regarded as having the same hue, and the clusters are merged (step S703). Through the processing so far, the segmentation of the color image is completed.
[0036]
According to such an image processing system according to the embodiment of the present invention, it is not necessary to tune a threshold for cluster reclassification based on a hue difference, and segmentation can be performed automatically.
[0037]
Next, image editing for replacing or hiding the target object in the image with another color will be described. FIG. 8 is a flowchart showing a procedure for editing an image by referring to the segmentation result, and FIG. 9 is a diagram showing an example of a user interface applied to this image editing.
[0038]
The user interface shown in FIG. 9 includes an input image display area 904 (FIG. 9B), a clustering result display screen having a representative color display area 902 and an area 903 for displaying the area occupancy ratio of each cluster on the image. 901 (FIG. 9A). The representative color of each cluster is displayed using such a user interface (step S801). As contents displayed in the area 903, in addition to the area occupancy of each cluster, RGB values and hue values of representative colors may be displayed. The user selects a color cluster to be processed using a pointing device such as a mouse (step S802). One or a plurality of clusters may be selected. Further, the user designates an editing method to be performed on the cluster (step S803). Examples of the editing method include removing pixels belonging to a designated cluster or leaving only pixels belonging to a designated cluster. Finally, the editing result is displayed (step S804). FIG. 9B shows an example of an image 905 generated by removing pixels belonging to the designated cluster, and an image 906 generated by leaving only the designated cluster.
[0039]
As described above, according to the image processing method of the present invention, it is possible to easily and quickly perform color image segmentation closer to human perception without tuning parameters. As a result, the image editing work using the segmentation result can be made more efficient.
[0040]
The present invention is not limited to the above-described embodiment, and can be implemented with various modifications.
[0041]
【The invention's effect】
As described above, according to the present invention, it is possible to provide an image processing method and program capable of performing color image segmentation closer to human perception without requiring tuning.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a schematic configuration of an image processing system according to an embodiment of the present invention.
FIG. 2 is a flowchart showing an example of a segmentation procedure in the embodiment. FIG. 3 is a flowchart showing an example of a clustering procedure in the basic classification unit of the embodiment. FIG. FIG. 5 is a flowchart showing an example of a processing procedure in the parameter calculation unit of the embodiment. FIG. 6 is a diagram showing a circumferential hue map for performing clustering. FIG. 8 is a flowchart showing an example of a processing procedure. FIG. 8 is a flowchart showing an image editing procedure to which the embodiment is applied. FIG. 9 is a diagram showing an example of a user interface applied to the image editing.
101 ... Input image 102 ... Basic classification unit 103 ... Parameter calculation unit 104 ... Re-classification unit 105 ... Processing result 106 ... Working memory

Claims (6)

入力画像中の少なくとも一部の画素を似通った色相を有するクラスタに分類するためのパラメータを計算する画像処理方法であって、
前記入力画像中の少なくとも一部の画素をその色差に応じてクラスタリングするステップと、
前記画素の色相値を計算するステップと、
色相を表す色相円を可変の分割数の分割クラスタに分割するとともに、前記分割された色相円を可変の回転角で回転させて前記各分割クラスタに対応する色相値の範囲を変化させることにより、前記画素の色相値をクラスタリングするステップと、
前記クラスタリングの結果に基づく評価値を計算するステップと、
前記評価値を最適化するよう前記分割数及び回転角を変化させて前記パラメータを決定するステップと、
前記色差に応じたクラスタリング結果を、前記パラメータに基づいて再分類するステップと、
を具備することを特徴とする画像処理方法。
An image processing method for calculating parameters for classifying at least some pixels in an input image into clusters having similar hues, comprising:
Clustering at least some of the pixels in the input image according to the color difference;
Calculating a hue value of the pixel;
By dividing the hue circle representing the hue into a variable number of divided clusters and rotating the divided hue circle at a variable rotation angle to change the range of hue values corresponding to each divided cluster, Clustering the hue values of the pixels;
Calculating an evaluation value based on the result of the clustering;
Determining the parameter by changing the number of divisions and the rotation angle so as to optimize the evaluation value;
Reclassifying the clustering result according to the color difference based on the parameter;
An image processing method comprising:
前記再分類ステップは、第1のクラスタと第2のクラスタの各々の代表色の色相差を前記パラメータと比較し、その比較結果に応じて当該第1、第2のクラスタ同士を併合するステップを含むことを特徴とする請求項1に記載の画像処理方法。  The reclassification step includes a step of comparing a hue difference between representative colors of each of the first cluster and the second cluster with the parameter, and merging the first and second clusters according to the comparison result. The image processing method according to claim 1, further comprising: 前記再分類されたクラスタリング結果を参照し、似通った色相を有する画像中の対象物を隠蔽し、又は該対象物に装飾を施すことを含む画像編集ステップをさらに具備することを特徴とする請求項1又は2に記載の画像処理方法。  The method further comprises an image editing step that includes referring to the reclassified clustering result and hiding or decorating an object in an image having a similar hue. 3. The image processing method according to 1 or 2. 前記画像編集ステップは、
複数のクラスタの代表色を一覧表示するステップと、
前記複数のクラスタのうちの少なくとも一つのクラスタの選択をユーザから受け付けるステップと、
選択された前記クラスタに属する画素のみから構成される画像又は選択された前記クラスタに属する画素を前記入力画像から除いて成る画像を生成するステップと、
を具備することを特徴とする請求項3に記載の画像処理方法。
The image editing step includes
Listing representative colors of multiple clusters;
Receiving a selection of at least one of the plurality of clusters from a user;
Generating an image composed only of pixels belonging to the selected cluster or an image formed by removing pixels belonging to the selected cluster from the input image;
The image processing method according to claim 3, further comprising:
前記評価値として、赤池情報量基準又は記述長最小化原理(MDLを計算することを特徴とする請求項1に記載の画像処理方法。The image processing method according to claim 1, wherein an Akaike information criterion or a description length minimization principle (MDL ) is calculated as the evaluation value. 入力画像中の少なくとも一部の画素を似通った色相を有するクラスタに分類するためのパラメータを計算する画像処理プログラムであって、
コンピュータに、
前記入力画像中の少なくとも一部の画素をその色差に応じてクラスタリングする手順と、
前記画素の色相値を計算する手順と、
色相を表す色相円を可変の分割数の分割クラスタに分割するとともに、前記分割された色相円を可変の回転角で回転させて前記各分割クラスタに対応する色相値の範囲を変化させることにより、前記画素の色相値をクラスタリングする手順と、
前記クラスタリングの結果に基づく評価値を計算する手順と、
前記評価値を最適化するよう前記分割数及び回転角を変化させて前記パラメータを決定する手順と、
前記色差に応じたクラスタリング結果を、前記パラメータに基づいて再分類する手順と、を実行させる画像処理プログラム。
An image processing program for calculating parameters for classifying at least some pixels in an input image into clusters having similar hues,
On the computer,
Clustering at least some of the pixels in the input image according to the color difference;
Calculating the hue value of the pixel;
By dividing the hue circle representing the hue into a variable number of divided clusters and rotating the divided hue circle at a variable rotation angle to change the range of hue values corresponding to each divided cluster, A procedure for clustering the hue values of the pixels;
Calculating an evaluation value based on the result of the clustering;
Determining the parameters by changing the number of divisions and the rotation angle so as to optimize the evaluation value;
And a procedure for reclassifying the clustering result according to the color difference based on the parameter.
JP2001358350A 2001-11-22 2001-11-22 Image processing method and program Expired - Fee Related JP3708042B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001358350A JP3708042B2 (en) 2001-11-22 2001-11-22 Image processing method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001358350A JP3708042B2 (en) 2001-11-22 2001-11-22 Image processing method and program

Publications (2)

Publication Number Publication Date
JP2003162718A JP2003162718A (en) 2003-06-06
JP3708042B2 true JP3708042B2 (en) 2005-10-19

Family

ID=19169542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001358350A Expired - Fee Related JP3708042B2 (en) 2001-11-22 2001-11-22 Image processing method and program

Country Status (1)

Country Link
JP (1) JP3708042B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8139852B2 (en) 2006-06-29 2012-03-20 Fujitsu Limited Color classification method, color recognition method, color classification apparatus, color recognition apparatus, color recognition system, computer program, and recording medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4329475B2 (en) 2003-10-02 2009-09-09 セイコーエプソン株式会社 Decorative image selection
US7693683B2 (en) * 2004-11-25 2010-04-06 Sharp Kabushiki Kaisha Information classifying device, information classifying method, information classifying program, information classifying system
JP2006301696A (en) * 2005-04-15 2006-11-02 Ricoh Co Ltd Image evaluation device, image evaluation method and storage medium
JP4603512B2 (en) * 2006-06-16 2010-12-22 独立行政法人産業技術総合研究所 Abnormal region detection apparatus and abnormal region detection method
JP4215781B2 (en) 2006-06-16 2009-01-28 独立行政法人産業技術総合研究所 Abnormal operation detection device and abnormal operation detection method
JP4949996B2 (en) * 2007-10-29 2012-06-13 株式会社リコー Image processing apparatus, image processing method, program, and recording medium
JP5123870B2 (en) * 2009-02-10 2013-01-23 キヤノン株式会社 Image processing method, image processing apparatus, and program
US8756010B2 (en) 2009-10-12 2014-06-17 Qualcomm Incorporated Method and apparatus for identification of points of interest within a predefined area
JP5639797B2 (en) 2010-07-01 2014-12-10 株式会社日立ハイテクノロジーズ Pattern matching method, image processing apparatus, and computer program
JP6955156B2 (en) 2017-10-23 2021-10-27 富士通株式会社 Image processing program, image processing device and image processing method
CN116109933B (en) * 2023-04-13 2023-06-23 山东省土地发展集团有限公司 Dynamic identification method for ecological restoration of abandoned mine

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8139852B2 (en) 2006-06-29 2012-03-20 Fujitsu Limited Color classification method, color recognition method, color classification apparatus, color recognition apparatus, color recognition system, computer program, and recording medium

Also Published As

Publication number Publication date
JP2003162718A (en) 2003-06-06

Similar Documents

Publication Publication Date Title
EP1168247A2 (en) Method for varying an image processing path based on image emphasis and appeal
US8995761B2 (en) Image processing apparatus, image processing method, and computer-readable medium
US20010051004A1 (en) Method for determining a correlation between images using multi-element image descriptors
JPWO2006082979A1 (en) Image processing apparatus and image processing method
JP3708042B2 (en) Image processing method and program
Ikonomatakis et al. Region growing and region merging image segmentation
JP4098021B2 (en) Scene identification method, apparatus, and program
JPH1153525A (en) Facial organ detector and medium
US20100231995A1 (en) Image processing apparatus, image processing apparatus control method, and storage medium storing program
US8718401B2 (en) Image processing device, method and program
JP2015011585A (en) Image processing apparatus, image forming apparatus, image forming system, image processing method, and program
JP2013536960A (en) System and method for synthesizing portrait sketches from photographs
CN112634125A (en) Automatic face replacement method based on off-line face database
EP2782065B1 (en) Image-processing device removing encircling lines for identifying sub-regions of image
US7397945B2 (en) Method and system of image segmentation using regression clustering
JPH09171552A (en) Picture recognizing device
JP2005353101A (en) Image-feature extraction method and computer-readable recording medium stored with program for executing on computer each step of the method
JP2721107B2 (en) Video feature processing method
JP5786838B2 (en) Image region dividing apparatus, method, and program
JP4248947B2 (en) Image color reduction device, image color reduction method, and image color reduction program
JP3724525B2 (en) Image processing method and image processing apparatus
JP3065332B2 (en) Image processing method
Busin et al. Colour space selection for unsupervised colour image segmentation by analysis of connectedness properties
JP4998496B2 (en) Image processing apparatus, information processing apparatus, and image reading apparatus
JPH08167028A (en) Image processing method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040820

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041116

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050117

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050405

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050606

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050802

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

Free format text: PAYMENT UNTIL: 20090812

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090812

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100812

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100812

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110812

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110812

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120812

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120812

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130812

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees