JP3901540B2 - Clustering program - Google Patents

Clustering program Download PDF

Info

Publication number
JP3901540B2
JP3901540B2 JP2002039485A JP2002039485A JP3901540B2 JP 3901540 B2 JP3901540 B2 JP 3901540B2 JP 2002039485 A JP2002039485 A JP 2002039485A JP 2002039485 A JP2002039485 A JP 2002039485A JP 3901540 B2 JP3901540 B2 JP 3901540B2
Authority
JP
Japan
Prior art keywords
clustering
cluster
value
clusters
sum
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
JP2002039485A
Other languages
Japanese (ja)
Other versions
JP2003242508A (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.)
ATR Advanced Telecommunications Research Institute International
Original Assignee
ATR Advanced Telecommunications Research Institute International
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 ATR Advanced Telecommunications Research Institute International filed Critical ATR Advanced Telecommunications Research Institute International
Priority to JP2002039485A priority Critical patent/JP3901540B2/en
Publication of JP2003242508A publication Critical patent/JP2003242508A/en
Application granted granted Critical
Publication of JP3901540B2 publication Critical patent/JP3901540B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
この発明はクラスタリング方法に関し、特にたとえば複数の標本点をクラスタリングする、クラスタリング方法に関する。
【0002】
【従来の技術】
従来のこの種のクラスタリング方法としては、単純クラスタリング方法がある。これは、「画像工学(増補)−画像のエレクトロニクス−(テレビジョン学会教科書シリーズ1)」(コロナ社、2000年4月20日発行)の4.6.1節に記述されている。
【0003】
具体的に説明すると、n個のベクトル(X1,X2,…,Xn)をクラスタリングする場合には、まず、任意のベクトル、たとえば、Xiをとり、これを第1クラスタC1の中心Y1(Y1=Xi)とする。
【0004】
次に、ベクトルXjをとり、Y1とXjとの距離D1,jを求める。ここで、Di,j>Tであれば、Xjを第2のクラスタC2の中心Y2(Y2=Xj)とする。しかし、Di,j≦Tであれば、Xj∈C1とする。
【0005】
続いて、Xkをとり、Y1およびY2とXkとの距離D1,k,D2,kを求める。ここで、D1,k>Tであり、かつD2,k>Tであれば、Xkを第3クラスタC3の中心Y3(Y3=Xk)とする。しかし、D1,k≦TまたはD2,k≦Tであれば、Xkの中心との距離の短い方のクラスタに所属するものとする。
【0006】
このような処理をすべてのベクトルについて実行することにより、クラスタリングが完了する。
【0007】
【発明が解決しようとする課題】
しかし、従来の方法では、決定したクラスタ数が妥当であるかどうか明確でなく、クラスタリングの結果から人間がその妥当性を判断するため、場合によってはあまり好ましくないクラスタ数であることがあった。このため、その後の解析処理等に支障を来たしていた。
【0008】
それゆえに、この発明の主たる目的は、クラスタリング結果の利便性を向上できる、クラスタリング方法を提供することである。
【0009】
【課題を解決するための手段】
第1の発明は、複数の標本点をクラスタリングするクラスタリングプログラムであって、コンピュータを、各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離をすべての標本点のそれぞれについて検出する距離検出手段、距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、クラスタ数を最大値から最小値に向けて変化させたときに第2総和値算出手段によって求めた第2総和値が急激に変化する個所を挟む前後数箇所の第2総和値のいずれかに対応するクラスタ数を最適クラスタ数に決定する最適クラス数決定手段、および最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラムである。
【0010】
第2の発明は、複数の標本点をクラスタリングするクラスタリングプログラムであって、コンピュータを、各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離をすべての標本点のそれぞれについて検出する距離検出手段、距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、クラスタ数を最大値から最小値に向けてn(nは自然数)個ずつ減少させるとき、前回のクラスタリング結果において最もクラスタ間距離が短い2つのクラスタを1つのクラスタにまとめる操作をn回繰り返すことにより、クラスタ数をn個減少させたときのクラスタリングを決定して第2総和値を求める第2総和値再計算手段、第2総和値再計算手段によって求めた第2総和値が急激に変化する個所を挟む前後数箇所の第2総和値のいずれかに対応するクラスタ数を最適クラスタ数に決定する最適クラスタリング数決定手段、および最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラムである。
【0011】
第3の発明は、複数の標本点をクラスタリングするクラスタリングプログラムであって、コンピュータを、各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離をすべての標本点のそれぞれについて検出する距離検出手段、距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、クラスタ数を最大値から最小値に向けて変化させるときに各クラスタ数に分けるすべての分け方について第2総和値を求める第2総和値再計算手段、第2総和値再計算手段によって求めた複数の第2総和値の中で最も小さいものを第3総和値として算出する第3総和値算出手段、クラスタ数を最大値から最小値に向けて変化させたときに第3総和値算出手段によって算出した第3総和値が急激に変化する前後いずれかの第3総和値に対応するクラスタ数を最適クラスタ数に決定する最適クラス多数決定手段、および最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラムである。
【0012】
【作用】
第1の発明では、クラスタリングには、重心法が用いられ、まず、クラスタ内の標本点とクラスタの代表点(重心点)との距離を当該クラスタに属する全標本点に渡って総和を取った第1総和値を求める。この第1総和値は、各クラスタについて求められ、それらの総和を取った第2総和値が求められる。たとえば、クラスタ数を最大値から最小値に向かって変化させたとき、第2総和値が急激に変化する前後いずれかの第2総和値に対応するクラスタ数を最適クラスタ数に決定する。そして、決定された最適クラスタ数で標本点がクラスタリングされる。
【0013】
第2の発明は、第1の発明とほとんど同じであるが、クラスタ数を最大値から最小値に向けてn(nは自然数)個ずつ減少させるときに、前回のクラスタ間距離が最も短い2つのクラスタを1つにまとめる操作をn回繰り返すことにより、クラスタ数をn個減少させたときのクラスタリングについて第2総和値を求める。そして、第2総和値が急減に変化する個所を挟む前後数箇所の第2総和値のいずれかに対応するクラスタ数を最適クラスタ数に決定する。つまり、前回のクラスタ数におけるクラスタリング結果を利用できるので、演算処理の負担を軽くできる。
【0014】
第3の発明もまた、第1の発明とほとんど同じであるが、クラスタ数をn個減らす場合には、クラスタ数をn個減少させたときのすべてのクラスタリングについての第2総和値を求め、その中の最小値を第3総和値とし、クラスタ数を最大値から最小値に向けて変更する場合に第3総和値が急激に変化した前後いずれかの第3総和値に対応するクラスタ数が最適クラスタ数に決定される。つまり、上述の発明よりも正確な(適切な)クラスタ数を決定することができる。
【0015】
【発明の効果】
この発明によれば、最適なクラスタ数へのクラスタリングが可能であるため、クラスタリング結果の信頼性が高く、その後の処理における利便性を向上させることができる。
【0016】
この発明の上述の目的,その他の目的,特徴および利点は、図面を参照して行う以下の実施例の詳細な説明から一層明らかとなろう。
【0017】
【実施例】
この実施例のクラスタリングシステムは、図示は省略するが、パーソナルコンピュータ或いはワークステーションのようなコンピュータとデータベースとを備える。
【0018】
なお、データベースは、コンピュータの内部に設けられてもよく、直接或いはインターネット等を介してコンピュータと通信可能に外部接続されてもよい。
【0019】
データベースは、たとえば航空機や衛星から撮影した写真(航空写真、衛星写真)或いは絵画に対応する様々な画像(自然画像)の画像データが記憶(蓄積)される画像データベースである。また、複数の画像データについてのテクスチャの特徴量(後で詳細に説明する、D,V,P)を取得(算出)した結果である結果データも、対応する画像データと関連付けて記憶される。
【0020】
図1に示すように、この実施例では、画像のサイズは、2048画素×2048画素である。また、テクスチャの平坦度を判別する単位(画像領域)は、この実施例では、32画素×32画素の大きさであり、これを小領域aiとする。したがって、この実施例では、小領域aiの個数は4096である。
【0021】
たとえば、ユーザから標本点(テクスチャ特徴量)の抽出指示が入力されると、コンピュータ、実際には、コンピュータ内部に設けられたCPU(図示せず)が図2に示すフロー図に従ってテクスチャの特徴量を(抽出)取得する特徴量取得処理を実行して、上述したような結果データ(標本点)を得る。
【0022】
図2を参照して、ユーザからの指示に応じて、コンピュータのCPUが処理を開始すると、ステップS1では、ユーザの指示に従って特徴量を取得すべき所望の画像に対応する画像データを読み出す。続くステップS3では、読み出した画像を小領域aiに分割する。上述したように、小領域aiは32画素×32画素の大きさであるため、分割される小領域aiの個数は4096である。
【0023】
続いて、ステップS5では、CPUはカウンタのカウント値を初期化(i=1)し、後で詳細に説明するように、ステップS7ではi番目の小領域aiについてのテクスチャ特徴量D(第1特徴量),V(第2特徴量)およびP(第3特徴量)の計算処理を実行して、ステップS9でカウント値iが4096かどうかを判断する。つまり、すべての小領域aiについてのテクスチャ特徴量を計算したかどうかを判断する。
【0024】
ステップS9で“NO”であれば、つまりカウント値iが4096でなければ、すべての小領域aiについてのテクスチャ特徴量を終了していないと判断して、ステップS11でカウント値iをインクリメント(i=i+1)してからステップS7に戻る。一方、ステップS9で“YES”であれば、つまりカウント値iが4096であれば、すべての小領域aiについてテクスチャ特徴量の計算処理を終了したと判断して、ステップS13に進む。ステップS13では、4096個の小領域aiについてのテクスチャ特徴量(D,V,P)を画像データに関連付けてデータベースに記憶する。
【0025】
図3は、図2に示したステップS7の小領域aiのテクスチャ特徴量の計算処理を示すフロー図であり、特徴量の計算処理が開始されると、CPUは、ステップS21で小領域aiの画像データをR,G,BデータからYデータに変換する。たとえば、小領域ai上の位置(n,m)における画素データをqi(n,m)とすると、各画素はR,G,Bの3種類の画素値を持つので、数1のように表記することができる。
【0026】
【数1】

Figure 0003901540
【0027】
ただし、n,mは、それぞれ、1≦n≦32,1≦m≦32を満たす自然数である。ここで、位置すなわち座標系(n,m)は、画像に対する一般的な座標系(行列座標系)であり、水平位置nは右向きを正の方向とし、垂直位置mは下向きを正の方向とする。したがって、小領域aiの画像の左上が(1,1)であり、右下が(32,32)である。
【0028】
以後の処理においては、テクスチャは濃淡画像として扱うため、CPUは、数2に従って各画素のR,G,BデータをYデータに変換する。
【0029】
【数2】
Figure 0003901540
【0030】
また、これ以降の処理では、テクスチャの平均的な明るさ(平均輝度)は問題にしないので、次のステップS23では、Yデータから小領域aiの平均輝度を除去する。
【0031】
まず、数3に従って小領域aiの平均輝度を求める。
【0032】
【数3】
Figure 0003901540
【0033】
次に、小領域aiの各画素の輝度値Yi(n,m)から小領域aiの平均輝度を減算した減算値(減算データ)YTi(n,m)を数4に従って求める。
【0034】
【数4】
Figure 0003901540
【0035】
ただし、1≦n≦32,1≦m≦32
次に、ステップS25では、小領域aiの減算データYTi(n,m)を2次元離散的フーリエ変換(2次元DFT)する。つまり、数5に従って演算し、複素数Fi(u,v)を算出する。
【0036】
【数5】
Figure 0003901540
【0037】
ただし、jは1単位虚数であり、u,vは、それぞれ、−16≦u≦16,−16≦v≦16を満たす整数である。この複素数Fi(u,v)は32画素×32画素の減算データYTi(n,m)の2次元周波数(u,v)における周波数成分を表す。
【0038】
ここで、uの単位は[cpw : cycle per picture width]であり、vの単位は[cph : cycle per picture hight]である。
【0039】
一般的に、或る物理量が複素数で表される場合、その物理量の大きさや強さ(強度)は、その複素数の大きさすなわち絶対値で表すことができる。そこで、CPUは、続くステップS27で2次元周波数平面上に数5によって得られた複素数Fi(u,v)の絶対値を取る(算出する)。具体的には、数6に従って複素数Fi(u,v)の絶対値(「Wi(u,v)」と表記する。)を取り、絶対値Wi(u,v)をもって2次元周波数成分Fi(u,v)の強度とする。
【0040】
【数6】
Figure 0003901540
【0041】
ただし、上述したように、u,vは、それぞれ、−16≦u≦16,−16≦v≦16を満たす整数である。
【0042】
また、座標系(n,m)に対応して、2次元周波数座標系(u,v)についても、水平周波数uは右向きを正の方向とし、垂直周波数vは下向きを正の方向とする。このような2次元周波数座標系(平面上)に、2次元周波数強度分布Wi(u,v)を等高線表示した一例が図4のように示される。この図4では、グレースケールによって周波数分布の強度を表しており、黒に近いほど、強度が弱く、白に近いほど、強度が強い。
【0043】
続いて、ステップS29では、この強度分布Wi(u,v)を2次元周波数平面上の荷重分布とみなし、その重心位置を決定する(求める)。ただし、図4から分かるように、荷重分布(強度分布)は点(原点)対称であるため、重心位置が常に原点となることを避けるように、この実施例では、周波数平面の右半分の領域(水平周波数uが0から+16cpw、垂直周波数vが−16から+16cphの範囲)についての重心Giの位置(uiG,viG)が数7に従って求められる。
【0044】
【数7】
Figure 0003901540
【0045】
ここで、SWiは小領域aiの周波数強度分布の右半分の領域における総荷重を表し、数8で与えられる。また、重心位置の測定例が図4内に点Pで示される。
【0046】
【数8】
Figure 0003901540
【0047】
なお、この実施例では、重心位置を周波数平面の右半分の領域で求めたが、これに限定する必要はなく、周波数平面の左半分、上半分或いは下半分の領域で求めてもよい。
【0048】
また、計算の煩わしさを考慮しなければ、上、下、左、右半分の領域以外の場合で、原点を通る直線で周波数平面を2分割した一方の領域(範囲)内で重心位置を求めるようにしてもよい。
【0049】
次に、この実施例では、テクスチャの方向は問題にしていないので、ステップS31では、CPUは重心位置によらず,原点から重心位置までの距離Diを小領域aiのテクスチャの第1特徴量(テクスチャ特徴量D)として数9により算出する。
【0050】
【数9】
Figure 0003901540
【0051】
続いて、ステップS33で、小領域aiのテクスチャの第2特徴量(テクスチャ特徴量V)として、上述したような周波数平面の右半分の領域の周波数範囲で、周波数強度分布の重心周りの分散viを数10により求める。このとき、周波数範囲の強度分布が、この小領域aiに関する全サンプルであるので、不偏分散を求める必要はない。このため、数10においては、分母がSWi-1ではなく、SWiとされる。
【0052】
【数10】
Figure 0003901540
【0053】
ここで、小領域のテクスチャに関して、右半分の領域における水平周波数uを第1変量、垂直周波数vを第2変量とすると、この2つの変量u,vを次のように統合して新しい2つの変量、すなわち第1主成分zi1および第2主成分zi2に変換することができる。
【0054】
まず、第1変量uの分散(水平周波数uに沿って分布する荷重による分散)Viuu、第2変量vの分散(垂直周波数vに沿って分布する荷重による分散)Vivv、および第1変量u、第2変量vの共分散Viuvは数11〜数13によってそれぞれ求められる。
【0055】
【数11】
Figure 0003901540
【0056】
【数12】
Figure 0003901540
【0057】
【数13】
Figure 0003901540
【0058】
ここで、これらの分散値を要素とする分散・共分散行列(実対称行列)Viは数14で示される。
【0059】
【数14】
Figure 0003901540
【0060】
この実対称行列Viの固有値λi1,λi2(ただし、λi1≧λi2≧0である。)および固有値λi1,λi2に対応する固有ベクトルli1,li2は次のように求められる。具体的には、固有値λi1,λi2は、Viの固有多項式(λに関する2次方程式)、すなわち数15の根として求められる。また、固有ベクトルli1,li2は、数16を解くことにより求められる。
【0061】
【数15】
Figure 0003901540
【0062】
【数16】
Figure 0003901540
【0063】
次に、新しい変量である第1主成分zi1および第2主成分zi2は、u,vの1次結合であり、数17によってそれぞれ定義される。
【0064】
【数17】
Figure 0003901540
【0065】
ここで、固有ベクトルli1,li2は、それぞれ、数18のように表している。
【0066】
【数18】
Figure 0003901540
【0067】
以上より、CPUは、ステップS35で、2次元周波数平面の右半分の領域で第1主成分の寄与率Piを小領域aiのテクスチャの第3特徴量(テクスチャ特徴量P)として求める。すなわち、第1主成分の寄与率Piは数19で算出することができる。
【0068】
【数19】
Figure 0003901540
【0069】
しかし、第1固有値λi1は、第1主成分zi1の分散Vimに等しく、第2固有値λi2は、第2主成分zi2の分散Visに等しいことが知られており、また、この実施例では、全変量の個数は2個であることから、第1主成分zi1の分散Vimと第2主成分zi2の分散Visの和は、全分散Viすなわち重心周りの分散に等しくなる。このため、寄与率Piは、第1主成分zi1の分散Vimが全分散Viに占める割合であるということもでき、数20が成立する。
【0070】
【数20】
Figure 0003901540
【0071】
なお、この第1主成分zi1の座標軸は、重心を通るあらゆる軸の中で、その軸に沿った分散が最も大きくなる軸を意味する。第1主成分軸と第2主成分軸との測定例は、図4においてそれぞれ実線と点線とで示される。
【0072】
以上のように、S31,S33およびS35の処理を経て、この小領域aiのテクスチャ特徴量すなわち、距離Di、分散Vi、第1主成分の寄与率Piが得られる。これらが、上述したように、標本値としてデータベースに記憶される。
【0073】
たとえば、標本値としての結果データが最適なクラスタ数にクラスタリングされ、そのクラスタリング結果を用いて、テクスチャ平坦度の判別等のようなその後の処理に役立てることができる。
【0074】
ただし、上述したテクスチャ特徴量は、個別に得た値であり、すなわちそれぞれ単位が異なるため、少なくともクラスタリングの開始時において、3つの特徴量を正規化する必要がある。具体的には、3種類の特徴量Di,Vi,Piのそれぞれについて、その4096個の測定データに渡る平均値が0、分散が1になるように正規化が行なわれる。以下においては、正規化された特徴量(正規化特徴量)を、それぞれ、ZDi,ZVi,ZPiと表記することにする。
【0075】
まず、テクスチャ特徴量Diは、数21に従って正規化される。
【0076】
【数21】
Figure 0003901540
【0077】
ここで、DM,σDは、それぞれDiの平均および標準偏差を表し、数22および数23によって計算される。
【0078】
【数22】
Figure 0003901540
【0079】
【数23】
Figure 0003901540
【0080】
また、テクスチャ特徴量Viは、数24に従って正規化される。
【0081】
【数24】
Figure 0003901540
【0082】
ここで、VM,σVは、それぞれViの平均および標準偏差を表し、数25および数26によって計算される。
【0083】
【数25】
Figure 0003901540
【0084】
【数26】
Figure 0003901540
【0085】
さらに、テクスチャ特徴量Piは、数27に従って正規化される。
【0086】
【数27】
Figure 0003901540
【0087】
ここで、PM,σPは、それぞれPiの平均および標準偏差を表し、数28および数29によって計算される。
【0088】
【数28】
Figure 0003901540
【0089】
【数29】
Figure 0003901540
【0090】
続いて、クラスタリングについて簡単に説明すると、クラスタ数aがN個(全標本個数と同じ数)の場合に、クラスタ間の距離の決め方としてたとえば重心法に基づいてクラスタリングすると、クラスタリングは一意に決まる。
【0091】
クラスタ数がa(ただし、a=N,N−1,…,2,1)のときのi番目のクラスタをC(a,i)と表記する。ここで、i=1,2,…,aである。また、クラスタC(a,i)に含まれる標本点の個数をb(a,i)とし、クラスタC(a,i)に含まれるk番目の標本点をS(a,i,k)と表記する。ここで、k=1,2,…,b(a,i)である。さらに、クラスタC(a,i)の重心をG(a,i)とし、重心G(a,i)と標本点S(a,i,k)との距離をd(a,i,k)と表記すると、クラスタC(a,i)内の各標本点を重心G(a,i)で代表させたことによるクラスタC(a,i)についてのクラスタリング誤差は、数30で示される。
【0092】
【数30】
Figure 0003901540
【0093】
なお、以下においては、簡単のため、このD(a,i)をi番目のクラスタC(a,i)の誤差と呼ぶことにする。
【0094】
最初のクラスタ数a=Nのときには、各クラスタC(N,i)(ただし、i=1,2,…,N)は1個の標本点のみを含むので、各クラスタC(N,i)内の標本点と各クラスタの重心G(N,i)は一致する。したがって、b(N,i)=1,k=1,d(N,i,k)=0となるので、D(a,i)=0となる。すなわち、a=Nのとき、どのクラスタC(a,i)についても、クラスタC(a,i)の誤差は0である。
【0095】
また、i番目のクラスタC(a,i)の誤差D(a,i)を(クラスタ数がaのときの)全クラスタ(i=1,2,…,a)について加算した誤差D(a,i)の総和SD(a)は、数31で算出される。
【0096】
【数31】
Figure 0003901540
【0097】
つまり、SD(a)は、N個の標本点をa個のクラスタにクラスタリングしたことによるクラスタリングの誤差を表していると考えられる。以下、この実施例では、このSD(a)をa個へのクラスタリングの誤差と呼ぶことにする。最初のクラスタ数a=Nのときのクラスタリングについては、上述したように各クラスタの誤差D(a,i)は0であるので、SD(a)=SD(N)=0となる。すなわちクラスタ数a=Nのとき、a個へのクラスタリングの誤差は0である。
【0098】
次に、クラスタ数a=N−1の場合に、重心法に基づいてN個の全標本点をクラスタリングすると、N個の標本点の内、最も近い2点をまとめて1つのクラスタとし、残りのクラスタはクラスタ数a=Nの場合のままとして、クラスタ数a=N−1個へのクラスタリングを決定する。そして、決定されたクラスタリングについて、上記の諸量を求める処理(数31を用いた誤差の総和の算出処理)を繰り返せば、最も誤差の少ないクラスタ数a=N−1個へのクラスタリングの誤差SD(a)=SD(N−1)を得ることができる。
【0099】
続いて、クラスタ数a=N−2の場合には、重心法に基づいて、現在のクラスタ数a=N−1個のクラスタリングがクラスタ数a=N−2個へのクラスタリングに変更される。この場合、N−1個の重心の内、最も近い2つの重心を1つのクラスタにまとめるように、クラスタ数a=N−2個へのクラスタリングを決定する。
【0100】
なお、このようなクラスタリングの分け方の列挙は、一般に流通している統計解析ソフトウェアを使用するか、自分でプログラムを作成すれば、可能であり、さらに自動化することも容易である。以下、クラスタリングする場合については同様のことが言える。また、一般的に流通している統計処理ソフトウェアとしては、SPSS lnc.社製の「SPSS」やStatSoft社製の「STATISTICA」を用いることができる。
【0101】
そして、決定されたクラスタリングで、上記の諸量を求める処理(数31を用いた誤差の総和の算出処理)を繰り返せば、実用上差し支えのない程度に誤差の少ないクラスタ数a=N−2個へのクラスタリングの誤差SD(a)=SD(N−2)を得ることができる。
【0102】
ただし、N−2個へのクラスタリングを決める場合には、前回のクラスタリングの結果、すなわちN−1個へのクラスタリングの結果を用いずに、N個の標本をN−2個のクラスタに分けるすべての分け方について、上記の手順によってSD(a)=SD(N−2)を算出し、その中で最も小さいものを真のSD(a)とするようにしてもよい。
【0103】
この後者の方法の方がSD(a)の評価としてはより正確ではあるが、全標本の個数Nが非常に大きい場合には、コンピュータの処理能力にもよるが、現実的な方法ではなくなってしまう。このような場合には、前者の方法を用いて、実用上差し支えのない程度に誤差の少ないSD(a)を求めるのがよいと考えられる。
【0104】
ここで、クラスタに分けるすべての分け方について具体的に説明することにする。たとえば、5個(N=5)の標本点を3個のクラスタに分ける(クラスタリングする)すべての分け方は次のように、場合分けすることができる。ただし、5個の標本点(要素)は1〜5の数字で表すことにする。
【0105】
(i)要素の数が3,1,1の3つのクラスタに分ける場合には、クラスタの組み合わせは次のようになる。なお、組み合わせ数は10(53)である。
【0106】
(1,2,3),(4),(5)
(1,2,4),(3),(5)
(1,2,5),(3),(4)
(1,3,4),(2),(5)
(1,3,5),(2),(4)
(1,4,5),(2),(3)
(2,3,4),(1),(5)
(2,3,5),(1),(4)
(2,4,5),(1),(3)
(3,4,5),(1),(2)
(ii)要素の数が2,2,1の3つのクラスタに分ける場合には、クラスタの組み合わせは次のようになる。
【0107】
(1,2),(3,4),(5)
(1,3),(2,4),(5)
(1,4),(2,3),(5)
(1,2),(3,5),(4)
(1,3),(2,5),(4)
(1,5),(2,3),(4)
(1,2),(4,5),(3)
(1,4),(2,5),(3)
(1,5),(2,4),(3)
(1,3),(4,5),(2)
(1,4),(3,5),(2)
(1,5),(3,4),(2)
(2,3),(4,5),(1)
(2,4),(3,5),(1)
(2,5),(3,4),(1)
以上、(i),(ii)で示すように、5個の標本点を3つのクラスタにクラスタリングする場合には、25通りのクラスタリング方法がある。このように、分け方は多数存在するため、上述したように、前回の結果を利用してクラスタリングすることにより、コンピュータ(CPU)の処理量を軽減してもよい。
【0108】
さらに、クラスタ数a=N−3の場合には、重心法に基づいて、現在のクラスタ数a=N−2個のクラスタリングがクラスタ数a=N−3個へのクラスタリングに変更される。この場合、N−2個の重心の内、最も近い2つの重心を1つのクラスタにまとめるように、クラスタ数a=N−3個へのクラスタリングを決め、上記の諸量を求める処理(数31を用いた誤差の総和の算出処理)を繰り返せば、実用上差し支えのない程度に誤差の少ないクラスタ数a=N−3個へのクラスタリングの誤差SD(a)=SD(N−3)を得ることができる。
【0109】
ただし、上述した場合と同様に、N−3個へのクラスタリングを決める場合には、前回のクラスタリングの結果、すなわちN−2個へのクラスタリングの結果を用いずに、N個の標本をN−3個のクラスタに分けるすべての分け方について上記の手順にてSD(a)=SD(N−3)を算出し、その中で最も小さいものを真のSD(a)とするようにしてもよい。
【0110】
このようにして、クラスタリングが繰り返され、クラスタ数a=N−(N−2)=2の場合には、重心法に基づいて、現在のクラスタ数a=3個のクラスタリングが2個のクラスタリングに変更される。この場合、3個の重心の内、最も近い2つの重心を1つのクラスタにまとめるように、クラスタ数a=2個へのクラスタリングを決め、上記の諸量を求める処理(数31を用いた誤差の総和の算出処理)を繰り返せば、実用上差し支えのない程度に誤差の少ないクラスタ数(a=2)へのクラスタリングの誤差SD(a)=SD(2)を得ることができる。
【0111】
ただし、2個へのクラスタリングを決める場合には、前回のクラスタリングの結果、つまり、3個へのクラスタリングの結果を用いずに、N個の標本を2個のクラスタに分けるすべての分け方について、上記の手順によってSD(a)=SD(2)を算出し、その中で最も小さいものを真のSD(a)とするようにしてもよい。
【0112】
最後に、a=N−(N−1)=1の場合には、重心法に基づいて、現在のクラスタ数a=2個のクラスタリングをクラスタ数a=1個へのクラスタリングに変える。この場合のクラスタリングは一意に決まる。統合された1つのクラスタの重心は2個の重心の中点となる。このクラスタリングについて、上記の諸量を求める処理(数31を用いた誤差の総和の算出処理)を繰り返せば、最も誤差の少ないa=1個へのクラスタリングの誤差SD(a)=SD(1)を得ることができる。
【0113】
上述のようにして得たa個へのクラスタリングの誤差SD(a)(ただし、a=N,N−1,…,2,1)を、横軸をクラスタ数aとしてプロットする。この実施例では、N=18であり、前回のクラスタリングの結果を用いる方法で得たSD(a)をプロットした一例を図5に示す。
【0114】
図5を参照して、最適なクラスタ数(最適クラスタ数)aoptは、クラスタ数aをNから1に向かって減少させたときに、急激にSD(a)が増大(変化)する個所を含む変化前(直前)のクラスタ数a、または、それより大きなクラスタ数aであって、許せる程度の大きさ(許容範囲)のSD(a)を与えるクラスタ数aに決定する。したがって、図5に示す例では、最適クラスタ数aoptは「3」である。
【0115】
ただし、この実施例では、許容範囲は最大誤差の20パーセント未満としてあるが、設計者や使用者等によって自由に変更可能である。また、最適クラスタ数aoptは、急激にSD(a)が変化する変化後(直後)のクラスタ数aであって、許容範囲を超えないクラスタ数aに決定するようにしてもよい。したがって、許容範囲の決め方によっては、数個所の最適クラスタ数aoptの候補が存在することとなり、その中から1つを決定する場合がある。
【0116】
具体的なクラスタリングの処理は、図6および図7のフロー図によって示される。図6を参照して、ユーザによってクラスタリングの指示が与えられると、CPUは処理を開始し、ステップS41でクラスタリング指示に応じた4096個の標本値をデータベースから読み出す。続くステップS43では、読み出した標本値すなわち(テクスチャ)特徴量(D,V,P)を正規化し、正規化した特徴量(正規化特徴量)ZD,ZVおよびZPを求める。
【0117】
そして、ステップS45では、正規化特徴量ZD,ZVおよびZPを正規化特徴量空間すなわちZD,ZV,ZP(3次元)空間上にプロットし、図8に示すような散布図を描く。
【0118】
以下、この実施例において、4096個の小領域aiのテクスチャ特徴量Di,Vi,Piをまとめて(D,V,P)と表記することとする。同様に、正規化特徴量ZDi,ZVi,ZPiをまとめて(ZD,ZV,ZP)と表記することにする。
【0119】
また、上述したステップS45では、4096個の正規化特徴量の測定値(ZD,ZV,ZP)が、ZD,ZV,ZP空間上にプロットされる。ただし、この実施例では、簡単に説明するため、或る画像について、18個の測定値(ZD,ZV,ZP)がプロットされた例を図8に示してある。
【0120】
次にステップS47では、クラスタ数aを初期化(a=N)する。続いて、ステップS49では、重心法によりN個の全標本値をクラスタリングする。そして、ステップS51でカウンタのカウント値iを初期化(i=1)して、ステップS53でクラスタC(a,i)の重心G(a,i)を算出する。
【0121】
ステップS55では、カウンタのカウント値kを初期化(k=1)し、ステップS57では、クラスタC(a,i)内の重心G(a,i)と各標本点S(a,i,k)との距離d(a,i,k)を算出する。
【0122】
次に図7に示すように、次のステップS59では、k=b(a,i)かどうかを判断する。つまり、クラスタC(a,i)における全標本点との距離d(a,i,k)を算出したかどうかを判断する。
【0123】
ステップS59で“NO”であれば、つまりk=b(a,i)でなければ、クラスタC(a,i)における全標本点との距離d(a,i,k)を算出していないと判断し、ステップS61でカウント値kをインクリメント(k=k+1)して、図6に示したステップS57に戻る。
【0124】
一方、ステップS59で“YES”であれば、つまりk=b(a,i)であれば、クラスタC(a,i)における全標本点との距離d(a,i,k)を算出した判断し、ステップS63でi番目のクラスタC(a,i)の誤差D(a,i)を数30に従って算出する。
【0125】
続くステップS65では、カウント値iがクラスタ数aと等しいかどうかを判断する。このステップS65で“NO”であれば、つまりカウント値iがクラスタ数aと等しくなければ、ステップS67でカウンタをインクリメント(i=i+1)して、図6に示したステップS53に戻る。
【0126】
一方、ステップS65で“YES”であれば、つまりカウント値iがクラスタ数aと等しければ、ステップS69でa個へのクラスタリングの誤差SD(a)を算出する。具体的には、数31を用いて、a個のクラスタにクラスタリングしたことによるクラスタリングの誤差を求める。
【0127】
続いて、ステップS71では、クラスタ数aが1かどうかを判断する。このステップS71で“NO”であれば、つまりクラスタ数aが1でなければ、ステップS73でクラスタ数aをデクリメントし(a=a−1)し、重心法に基づいて、今回の(デクリメント後の)クラスタ数a(a個)のクラスタにクラスタリングしてから、図6に示したステップS51に戻る。
【0128】
一方、ステップS71で“YES”であれば、つまりクラスタ数aが1であれば、ステップS75で誤差SD(a)が急激に増大する直前のクラスタ数a、または、それより大きなクラスタ数aで許容できる大きさ(許容範囲)における誤差SD(a)を与えるaを最適クラスタ数aoptに決定してから処理を終了する。
【0129】
ただし、この実施例では、誤差SD(a)の許容範囲は、最大誤差(約55)の1/5(約10)とし、誤差SD(a)が10を超えない範囲で最適クラスタ数aoptが決定される。つまり、許容範囲は、プログラム(ソフト)の設計者や使用者が任意に設定できる値である。
【0130】
この実施例によれば、クラスタ数を最適(妥当)な値に決定してクラスタリングできるので、単なる統計として検証する際の信頼性が高く、その後の処理においてクラスタリング結果が悪影響を与えることはない。つまり、クラスタリング結果の利便性を向上させることができる。
【0131】
なお、上述の実施例では、クラスタ数aを1個ずつ減らすようにしたが、全標本個数Nが膨大である場合には、クラスタ数aを複数個(たとえば、10個)ずつ減らすようにしてもよい。
【0132】
また、上述の実施例では、クラスタリングの手法として、ユークリッド距離に基づく重心法を適用した場合についてのみ説明したが、類似度を表す距離としてはユークリッド距離に限定する必要はない。たとえば、ユークリッド距離の2乗、マハラノビス距離、相関係数等を用いるようにしてもよい。
【0133】
さらに、クラスタ間の距離の決め方についても、重心法に限定する必要はなく、最短距離法、最長距離法、群平均法、メディアン法またはウォード法等を用いることも可能である。
【0134】
さらにまた、上述の実施例では、テクスチャ特徴量(標本値)を正規化するようにしたが、予め正規化されているデータが標本値である場合には正規化する必要はない。また、標本値はテクスチャ特徴量に限定される必要はなく、他の様々なデータを標本値にすることができる。
【0135】
また、上述の実施例では、小領域aiに対する前処理としてR,G,BデータからYデータを求めるようにしたが、R,G,Bデータから色相H,彩度S,明度I(または、Vと表記されることもある。)のデータすなわちHSI空間のデータに変換し、その結果である明度Iのデータを用いるようにしてもよい。
【0136】
さらに、上述の実施例では、2次元周波数成分の算出にあたり、2次元離散的フーリエ変換(DFT)を用いたが、特に2次元高速フーリエ変換(FFT)、或いは、2次元離散的コサイン変換(DCT)を用いてもよい。
【図面の簡単な説明】
【図1】この発明の一実施例のクラスタリングで取り扱われる画像を示す図解図である。
【図2】テクスチャ特徴量の抽出処理を示すフロー図である。
【図3】テクスチャ特徴量の計算処理を示すフロー図である。
【図4】テクスチャ特徴量の計算処理において、減算データを2次元DFTして得られた複素数の絶対値を2次元周波数平面上に等高線表示した図解図である。
【図5】クラスタリング処理のクラスタ数に対する誤差の一例を示すグラフである。
【図6】クラスタリング処理の一部を示すフロー図である。
【図7】クラスタリング処理の他の一部を示すフロー図である。
【図8】テクスチャ特徴量の抽出処理で抽出したテクスチャ特徴量に従ってプロットした一例を示すグラフである。[0001]
[Industrial application fields]
The present invention relates to a clustering method, and more particularly to a clustering method for clustering a plurality of sample points, for example.
[0002]
[Prior art]
A conventional clustering method of this kind is a simple clustering method. This is described in section 4.6.1 of “Image Engineering (amplification)-Electronics of Image-(Television Society Textbook Series 1)” (Corona Inc., issued April 20, 2000).
[0003]
More specifically, n vectors (X 1 , X 2 , ..., X n ) Is first clustered with an arbitrary vector, eg, X i And take this as the first cluster C 1 Center of Y 1 (Y 1 = X i ).
[0004]
Next, the vector X j Take Y 1 And X j Distance D to 1, j Ask for. Where D i, j > T, X j To the second cluster C 2 Center of Y 2 (Y 2 = X j ). However, D i, j If ≦ T, X j ∈C 1 And
[0005]
Next, X k Take Y 1 And Y 2 And X k Distance D to 1, k , D 2, k Ask for. Where D 1, k > T and D 2, k > T, X k The third cluster C Three Center of Y Three (Y Three = X k ). However, D 1, k ≦ T or D 2, k If ≦ T, X k It belongs to the cluster with the shorter distance from the center of.
[0006]
Clustering is completed by executing such processing for all vectors.
[0007]
[Problems to be solved by the invention]
However, in the conventional method, it is not clear whether or not the determined number of clusters is appropriate, and humans judge the validity from the result of clustering, so that the number of clusters is not so preferable in some cases. This hindered the subsequent analysis processing and the like.
[0008]
Therefore, a main object of the present invention is to provide a clustering method that can improve the convenience of the clustering result.
[0009]
[Means for Solving the Problems]
A first invention is a clustering program for clustering a plurality of sample points, wherein a computer is connected to each cluster. All The Euclidean distance between the sample point and the representative point that is the center of gravity in the cluster All Distance detection means for detecting each of the sample points, first summation value calculation means for obtaining the first summation value of the Euclidean distance detected by the distance detection means, and the first summation value obtained by the first summation value calculation means for each cluster. The second total value calculation means for obtaining the second total value obtained by taking the sum across the second total value, the second total value calculated by the second total value calculation means when the number of clusters is changed from the maximum value to the minimum value. The optimal class number determining means for determining the optimal number of clusters corresponding to any of the second total values at several points before and after the portion that changes to the optimal cluster number, and clustering to the optimal number of clusters determined by the optimal cluster number determining means This is a clustering program that functions as a clustering means.
[0010]
A second invention is a clustering program for clustering a plurality of sample points, wherein a computer is connected to each cluster. All The Euclidean distance between the sample point and the representative point that is the center of gravity in the cluster All Distance detection means for detecting each of the sample points, first summation value calculation means for obtaining the first summation value of the Euclidean distance detected by the distance detection means, and the first summation value obtained by the first summation value calculation means for each cluster. A second sum total value calculating means for obtaining a second sum value obtained by summing across, when the number of clusters is decreased by n (n is a natural number) from the maximum value to the minimum value, the most clustering result in the previous clustering result A second total value recalculating means for determining a cluster when the number of clusters is reduced by n and repeating the operation of combining two clusters having a short distance into one cluster to obtain a second total value; 2 Optimum number of clusters corresponding to any of the second total values at several points before and after the point where the second total value obtained by the recalculation means rapidly changes. Optimal clustering number determining means for determining the number of rasters, and to function as a clustering unit for clustering the optimal number of clusters determined by the optimum cluster number determination unit, a clustering program.
[0011]
A third invention is a clustering program for clustering a plurality of sample points, wherein a computer is connected to each cluster. All The Euclidean distance between the sample point and the representative point that is the center of gravity in the cluster All Distance detection means for detecting each of the sample points, first summation value calculation means for obtaining the first summation value of the Euclidean distance detected by the distance detection means, and the first summation value obtained by the first summation value calculation means for each cluster. A second total value calculating means for calculating a second total value obtained by taking the sum across the second total value, and determining the second total value for all division methods for dividing each cluster number when the number of clusters is changed from the maximum value to the minimum value; Second sum total value recalculating means, third sum total value calculating means for calculating the smallest one of the plurality of second sum values calculated by the second sum total value recalculating means as the third sum value, and the maximum number of clusters. The number of clusters corresponding to the third total value before or after the third total value calculated by the third total value calculation means changes abruptly when the value is changed from 1 to the minimum value is set as the optimum cluster number. Optimal Class number determining means for constant, and to function as a clustering unit for clustering the optimal number of clusters determined by the optimum cluster number determination unit, a clustering program.
[0012]
[Action]
In the first invention, the centroid method is used for clustering. First, the distance between the sample point in the cluster and the representative point (centroid point) of the cluster is summed over all the sample points belonging to the cluster. The first sum value is obtained. This first sum value is obtained for each cluster, and a second sum value obtained by taking the sum is obtained. For example, when the number of clusters is changed from the maximum value to the minimum value, the number of clusters corresponding to the second total value before or after the second total value suddenly changes is determined as the optimum cluster number. Then, the sample points are clustered with the determined optimum number of clusters.
[0013]
The second invention is almost the same as the first invention, but when the number of clusters is decreased by n (n is a natural number) from the maximum value to the minimum value, the previous inter-cluster distance is the shortest 2 A second total value is obtained for clustering when the number of clusters is reduced by repeating the operation of combining one cluster n times n times. Then, the optimal number of clusters is determined as the number of clusters corresponding to any of the second total values at several points before and after the portion where the second total value changes rapidly. That is, since the clustering result in the previous number of clusters can be used, the burden of calculation processing can be reduced.
[0014]
The third invention is also almost the same as the first invention, but if the number of clusters is reduced by n, Number 2nd sum total value for all clustering when n is reduced, the minimum value among them is set as the third sum value, and the third sum total is changed when the number of clusters is changed from the maximum value to the minimum value. The number of clusters corresponding to the third total value either before or after the value suddenly changes is determined as the optimum number of clusters. That is, it is possible to determine a more accurate (appropriate) number of clusters than the above-described invention.
[0015]
【The invention's effect】
According to the present invention, clustering to the optimum number of clusters is possible, so the reliability of the clustering result is high, and convenience in subsequent processing can be improved.
[0016]
The above object, other objects, features and advantages of the present invention will become more apparent from the following detailed description of embodiments with reference to the drawings.
[0017]
【Example】
Although not shown, the clustering system of this embodiment includes a computer such as a personal computer or a workstation and a database.
[0018]
The database may be provided inside the computer, or may be externally connected so as to be communicable with the computer directly or via the Internet.
[0019]
The database is an image database in which image data of various images (natural images) corresponding to photographs (aerial photographs, satellite photographs) or pictures taken from, for example, an aircraft or a satellite are stored (accumulated). In addition, result data that is a result of obtaining (calculating) texture feature amounts (D, V, and P described in detail later) for a plurality of image data is also stored in association with the corresponding image data.
[0020]
As shown in FIG. 1, in this embodiment, the size of the image is 2048 pixels × 2048 pixels. Further, in this embodiment, the unit (image area) for determining the flatness of the texture has a size of 32 pixels × 32 pixels. i And Therefore, in this embodiment, the small area a i Is 4096.
[0021]
For example, when a sample point (texture feature amount) extraction instruction is input from a user, a texture feature amount of a computer, actually a CPU (not shown) provided in the computer, according to the flowchart shown in FIG. (Extraction) acquisition of feature quantity acquisition processing is executed to obtain result data (sample points) as described above.
[0022]
Referring to FIG. 2, when the CPU of the computer starts processing in response to an instruction from the user, in step S1, image data corresponding to a desired image whose feature value is to be acquired is read in accordance with the instruction from the user. In the subsequent step S3, the read image is stored in the small area a i Divide into As described above, the small area a i Is 32 pixels × 32 pixels in size, so that the small area a to be divided is i Is 4096.
[0023]
In step S5, the CPU initializes the count value of the counter (i = 1). In step S7, the i-th small area a is initialized as will be described in detail later. i A calculation process of texture feature amount D (first feature amount), V (second feature amount) and P (third feature amount) is executed for, and it is determined whether or not the count value i is 4096 in step S9. That is, all the small areas a i It is determined whether or not the texture feature amount for the is calculated.
[0024]
If “NO” in the step S9, that is, if the count value i is not 4096, all the small regions a i It is determined that the texture feature amount for is not finished, the count value i is incremented (i = i + 1) in step S11, and the process returns to step S7. On the other hand, if “YES” in the step S9, that is, if the count value i is 4096, all the small regions a i It is determined that the texture feature amount calculation processing has ended for step S13, and the process proceeds to step S13. In step S13, 4096 small areas a i Is stored in the database in association with the image data.
[0025]
FIG. 3 shows a small area a in step S7 shown in FIG. i FIG. 6 is a flowchart showing the calculation process of the texture feature amount, and when the calculation process of the feature amount is started, the CPU i Are converted from R, G, B data to Y data. For example, the small area a i The pixel data at the upper position (n, m) is q i Assuming that (n, m), each pixel has three types of pixel values, R, G, and B, and therefore can be expressed as in Equation (1).
[0026]
[Expression 1]
Figure 0003901540
[0027]
Here, n and m are natural numbers that satisfy 1 ≦ n ≦ 32 and 1 ≦ m ≦ 32. Here, the position, that is, the coordinate system (n, m) is a general coordinate system (matrix coordinate system) for the image, and the horizontal position n has a rightward direction as a positive direction, and the vertical position m has a downward direction as a positive direction. To do. Therefore, the small area a i The upper left of the image is (1, 1) and the lower right is (32, 32).
[0028]
In the subsequent processing, since the texture is handled as a gray image, the CPU converts the R, G, B data of each pixel into Y data according to Equation 2.
[0029]
[Expression 2]
Figure 0003901540
[0030]
In the subsequent processing, the average brightness (average luminance) of the texture does not matter, so in the next step S23, the small area a is obtained from the Y data. i Remove the average brightness of.
[0031]
First, according to Equation 3, the small area a i Find the average brightness of.
[0032]
[Equation 3]
Figure 0003901540
[0033]
Next, the small area a i Luminance value Y of each pixel i (N, m) to small area a i Subtraction value (subtraction data) YT i (N, m) is obtained according to Equation 4.
[0034]
[Expression 4]
Figure 0003901540
[0035]
However, 1 ≦ n ≦ 32, 1 ≦ m ≦ 32
Next, in step S25, the small area a i Subtraction data YT i (N, m) is subjected to a two-dimensional discrete Fourier transform (two-dimensional DFT). That is, the calculation is performed according to Equation 5, and the complex number F i (U, v) is calculated.
[0036]
[Equation 5]
Figure 0003901540
[0037]
However, j is a 1-unit imaginary number, and u and v are integers satisfying −16 ≦ u ≦ 16 and −16 ≦ v ≦ 16, respectively. This complex number F i (U, v) is subtraction data YT of 32 pixels × 32 pixels. i It represents a frequency component at a two-dimensional frequency (u, v) of (n, m).
[0038]
Here, the unit of u is [cpw: cycle per picture width], and the unit of v is [cph: cycle per picture hight].
[0039]
Generally, when a certain physical quantity is represented by a complex number, the magnitude or strength (intensity) of the physical quantity can be represented by the magnitude of the complex number, that is, an absolute value. Therefore, the CPU proceeds to the next step S27 where the complex number F obtained by Equation 5 on the two-dimensional frequency plane is obtained. i The absolute value of (u, v) is taken (calculated). Specifically, the complex number F according to Equation 6 i The absolute value of (u, v) ("W i (U, v) ”. ), Absolute value W i With (u, v), the two-dimensional frequency component F i The intensity is (u, v).
[0040]
[Formula 6]
Figure 0003901540
[0041]
However, as described above, u and v are integers that satisfy −16 ≦ u ≦ 16 and −16 ≦ v ≦ 16, respectively.
[0042]
Also, in the two-dimensional frequency coordinate system (u, v) corresponding to the coordinate system (n, m), the horizontal frequency u has a positive direction in the right direction, and the vertical frequency v has a positive direction in the downward direction. In such a two-dimensional frequency coordinate system (on a plane), a two-dimensional frequency intensity distribution W i An example in which (u, v) is displayed as a contour line is shown in FIG. In FIG. 4, the intensity of the frequency distribution is represented by a gray scale. The closer to black, the weaker the intensity and the closer to white, the stronger the intensity.
[0043]
Subsequently, in step S29, the intensity distribution W i (U, v) is regarded as a load distribution on the two-dimensional frequency plane, and the position of the center of gravity is determined (obtained). However, as can be seen from FIG. 4, the load distribution (intensity distribution) is symmetric with respect to the point (origin), so in this embodiment, the right half region of the frequency plane is used to avoid the center of gravity position always being the origin. The center of gravity G for (the horizontal frequency u is in the range of 0 to +16 cpw and the vertical frequency v is in the range of −16 to +16 cph). i Position (u iG , V iG ) Is obtained according to Equation 7.
[0044]
[Expression 7]
Figure 0003901540
[0045]
Where SW i Is a small area a i This represents the total load in the right half region of the frequency intensity distribution, and is given by Equation 8. In addition, an example of measuring the position of the center of gravity is indicated by a point P in FIG.
[0046]
[Equation 8]
Figure 0003901540
[0047]
In this embodiment, the center-of-gravity position is obtained in the right half region of the frequency plane, but is not limited to this, and may be obtained in the left half region, upper half region, or lower half region of the frequency plane.
[0048]
If the computational complexity is not taken into consideration, the position of the center of gravity is obtained in one area (range) obtained by dividing the frequency plane into two by a straight line passing through the origin in cases other than the upper, lower, left, and right half areas. You may do it.
[0049]
Next, in this embodiment, since the direction of the texture is not a problem, in step S31, the CPU does not depend on the position of the center of gravity, but the distance D from the origin to the position of the center of gravity. i A small area a i The first feature amount of the texture (texture feature amount D) is calculated by Equation 9.
[0050]
[Equation 9]
Figure 0003901540
[0051]
Subsequently, in step S33, the small area a i As the second feature amount of the texture (texture feature amount V), the variance v around the centroid of the frequency intensity distribution in the frequency range of the right half region of the frequency plane as described above i Is determined by Equation (10). At this time, the intensity distribution in the frequency range is the small region a. i There is no need to find unbiased variance. Therefore, in Equation 10, the denominator is SW i -1, not SW i It is said.
[0052]
[Expression 10]
Figure 0003901540
[0053]
Here, regarding the texture of the small region, when the horizontal frequency u in the right half region is the first variable and the vertical frequency v is the second variable, the two variables u and v are integrated as follows. Variable, ie first principal component z i1 And the second principal component z i2 Can be converted to
[0054]
First, the variance of the first variable u (dispersion due to the load distributed along the horizontal frequency u) V iuu , Dispersion of second variable v (dispersion due to load distributed along vertical frequency v) V ivv , And the covariance V of the first variable u and the second variable v iuv Are obtained by Equations 11 to 13, respectively.
[0055]
[Expression 11]
Figure 0003901540
[0056]
[Expression 12]
Figure 0003901540
[0057]
[Formula 13]
Figure 0003901540
[0058]
Here, a variance / covariance matrix (real symmetric matrix) V having these variance values as elements. i Is shown in Equation 14.
[0059]
[Expression 14]
Figure 0003901540
[0060]
This real symmetric matrix V i Eigenvalue of λ i1 , Λ i2 (However, λ i1 ≧ λ i2 ≧ 0. ) And eigenvalue λ i1 , Λ i2 The eigenvector l corresponding to i1 , L i2 Is obtained as follows. Specifically, the eigenvalue λ i1 , Λ i2 Is V i Is obtained as a root of equation (15). The eigenvector l i1 , L i2 Is obtained by solving equation (16).
[0061]
[Expression 15]
Figure 0003901540
[0062]
[Expression 16]
Figure 0003901540
[0063]
Next, the first principal component z which is a new variable i1 And the second principal component z i2 Is a linear combination of u and v, and is defined by Equation 17, respectively.
[0064]
[Expression 17]
Figure 0003901540
[0065]
Where eigenvector l i1 , L i2 Are respectively expressed as in Equation 18.
[0066]
[Formula 18]
Figure 0003901540
[0067]
As described above, the CPU calculates the contribution P of the first principal component in the right half region of the two-dimensional frequency plane in step S35. i A small area a i Is obtained as the third feature amount (texture feature amount P). That is, the contribution ratio P of the first principal component i Can be calculated by Equation 19.
[0068]
[Equation 19]
Figure 0003901540
[0069]
However, the first eigenvalue λ i1 Is the first principal component z i1 Variance V im Equal to the second eigenvalue λ i2 Is the second principal component z i2 Variance V is And in this example, the number of total variables is two, so the first principal component z i1 Variance V im And the second principal component z i2 Variance V is Is the total variance V i That is, it is equal to the variance around the center of gravity. For this reason, contribution rate P i Is the first principal component z i1 Variance V im Is the total variance V i It can also be said that it is the ratio occupied in the equation (20).
[0070]
[Expression 20]
Figure 0003901540
[0071]
The first principal component z i1 The coordinate axis of means the axis having the greatest variance among the axes passing through the center of gravity. Measurement examples of the first principal component axis and the second principal component axis are indicated by a solid line and a dotted line in FIG. 4, respectively.
[0072]
As described above, the small area a is obtained through the processing of S31, S33, and S35. i Texture feature, ie, distance D i , Distributed V i , Contribution ratio P of the first principal component i Is obtained. These are stored in the database as sample values as described above.
[0073]
For example, the result data as sample values are clustered to the optimum number of clusters, and the clustering result can be used for subsequent processing such as discrimination of texture flatness.
[0074]
However, the above-described texture feature values are individually obtained values, that is, the units are different from each other. Therefore, at least at the start of clustering, it is necessary to normalize the three feature values. Specifically, three types of feature amount D i , V i , P i Is normalized so that the average value over the 4096 measurement data is 0 and the variance is 1. In the following, normalized feature values (normalized feature values) are respectively expressed as ZD. i , ZV i , ZP i Will be written.
[0075]
First, the texture feature amount D i Is normalized according to Equation 21.
[0076]
[Expression 21]
Figure 0003901540
[0077]
Where D M , Σ D Respectively i And is calculated by Equations (22) and (23).
[0078]
[Expression 22]
Figure 0003901540
[0079]
[Expression 23]
Figure 0003901540
[0080]
Also, texture feature V i Is normalized according to Equation 24.
[0081]
[Expression 24]
Figure 0003901540
[0082]
Where V M , Σ V Are respectively V i And is calculated by Equation 25 and Equation 26.
[0083]
[Expression 25]
Figure 0003901540
[0084]
[Equation 26]
Figure 0003901540
[0085]
Furthermore, the texture feature amount P i Is normalized according to Equation 27.
[0086]
[Expression 27]
Figure 0003901540
[0087]
Where P M , Σ P Are respectively P i And is calculated by Equation 28 and Equation 29.
[0088]
[Expression 28]
Figure 0003901540
[0089]
[Expression 29]
Figure 0003901540
[0090]
Subsequently, clustering will be briefly described. When the number of clusters a is N (the same number as the total number of samples), clustering is uniquely determined by clustering based on, for example, the centroid method as a method of determining the distance between clusters.
[0091]
The i-th cluster when the number of clusters is a (where a = N, N-1,..., 2, 1) is denoted as C (a, i). Here, i = 1, 2,..., A. Further, the number of sample points included in the cluster C (a, i) is b (a, i), and the kth sample point included in the cluster C (a, i) is S (a, i, k). write. Here, k = 1, 2,..., B (a, i). Further, the center of gravity of the cluster C (a, i) is G (a, i), and the distance between the center of gravity G (a, i) and the sample point S (a, i, k) is d (a, i, k). In this case, the clustering error for the cluster C (a, i) caused by representing each sample point in the cluster C (a, i) by the center of gravity G (a, i) is expressed by Equation 30.
[0092]
[30]
Figure 0003901540
[0093]
In the following, for simplicity, this D (a, i) will be referred to as an error of the i-th cluster C (a, i).
[0094]
When the initial number of clusters a = N, each cluster C (N, i) (where i = 1, 2,..., N) includes only one sample point, so each cluster C (N, i) The sample points in each and the centroid G (N, i) of each cluster coincide. Therefore, since b (N, i) = 1, k = 1, and d (N, i, k) = 0, D (a, i) = 0. That is, when a = N, the error of cluster C (a, i) is zero for any cluster C (a, i).
[0095]
Further, an error D (a) obtained by adding the error D (a, i) of the i-th cluster C (a, i) to all the clusters (i = 1, 2,..., A) (when the number of clusters is a). , I) is calculated by Equation 31.
[0096]
[31]
Figure 0003901540
[0097]
That is, SD (a) is considered to represent a clustering error caused by clustering N sample points into a clusters. Hereinafter, in this embodiment, this SD (a) is referred to as an error of clustering to a. For clustering when the number of clusters a = N for the first time, the error D (a, i) of each cluster is 0 as described above, so SD (a) = SD (N) = 0. That is, when the number of clusters a = N, the error of clustering to a is zero.
[0098]
Next, when all the N sample points are clustered based on the centroid method when the number of clusters is a = N−1, the nearest two points out of the N sample points are combined into one cluster, and the rest The cluster is determined to be the cluster number a = N, and clustering to the cluster number a = N−1 is determined. For the determined clustering, if the above-described processing for obtaining various quantities (calculation of the sum of errors using Equation 31) is repeated, the clustering error SD to the cluster number a = N−1 with the smallest error is obtained. (A) = SD (N−1) can be obtained.
[0099]
Subsequently, when the cluster number a = N−2, the clustering of the current cluster number a = N−1 is changed to clustering to the cluster number a = N−2 based on the centroid method. In this case, the clustering to cluster number a = N−2 is determined so that the nearest two centroids out of N−1 centroids are combined into one cluster.
[0100]
Such clustering can be enumerated by using generally available statistical analysis software or by creating a program yourself, and it is also easy to automate. Hereinafter, the same can be said for clustering. In addition, as statistical processing software that is generally distributed, SPSS Inc. “SPSS” manufactured by KK and “STATISTICA” manufactured by StatSoft can be used.
[0101]
Then, if the above-described processing for obtaining various quantities (processing for calculating the total sum of errors using Equation 31) is repeated in the determined clustering, the number of clusters a = N−2 with few errors to the extent that there is no practical problem. The error SD (a) = SD (N−2) for clustering to can be obtained.
[0102]
However, when determining clustering to N-2, all N samples are divided into N-2 clusters without using the result of previous clustering, that is, the result of clustering to N-1. SD (a) = SD (N−2) may be calculated by the above procedure, and the smallest of them may be set as true SD (a).
[0103]
This latter method is more accurate as an evaluation of SD (a). However, when the number N of all samples is very large, although it depends on the processing capability of the computer, it is no longer a realistic method. End up. In such a case, it is considered that the former method should be used to obtain SD (a) with as little error as is practically acceptable.
[0104]
Here, all the ways of dividing into clusters will be specifically described. For example, all the ways of dividing (clustering) 5 (N = 5) sample points into 3 clusters can be divided as follows. However, five sample points (elements) are represented by numbers 1 to 5.
[0105]
(I) When the number of elements is divided into three clusters of 3, 1 and 1, the combinations of clusters are as follows. The number of combinations is 10 ( Five C Three ).
[0106]
(1, 2, 3), (4), (5)
(1, 2, 4), (3), (5)
(1,2,5), (3), (4)
(1, 3, 4), (2), (5)
(1, 3, 5), (2), (4)
(1, 4, 5), (2), (3)
(2, 3, 4), (1), (5)
(2, 3, 5), (1), (4)
(2, 4, 5), (1), (3)
(3,4,5), (1), (2)
(Ii) When the number of elements is divided into three clusters of 2, 2, and 1, the combinations of clusters are as follows.
[0107]
(1,2), (3,4), (5)
(1,3), (2,4), (5)
(1,4), (2,3), (5)
(1,2), (3,5), (4)
(1,3), (2,5), (4)
(1,5), (2,3), (4)
(1,2), (4,5), (3)
(1,4), (2,5), (3)
(1,5), (2,4), (3)
(1,3), (4,5), (2)
(1,4), (3,5), (2)
(1,5), (3,4), (2)
(2,3), (4,5), (1)
(2,4), (3,5), (1)
(2,5), (3,4), (1)
As described above, as shown in (i) and (ii), when five sample points are clustered into three clusters, there are 25 clustering methods. As described above, since there are a large number of division methods, as described above, the processing amount of the computer (CPU) may be reduced by clustering using the previous result.
[0108]
Further, when the number of clusters a = N−3, the clustering of the current number of clusters a = N−2 is changed to clustering to the number of clusters a = N−3 based on the centroid method. In this case, the clustering to cluster number a = N−3 is determined so that the two nearest centroids out of N−2 centroids are combined into one cluster, and the above-mentioned various quantities are calculated (formula 31). (Summary of error sum calculation using) is repeated to obtain a clustering error SD (a) = SD (N−3) to a cluster number a = N−3 with few errors to a practical extent. be able to.
[0109]
However, as in the case described above, when deciding on clustering to N-3, N-samples are not changed to N- without using the previous clustering result, that is, the result of clustering to N-2. SD (a) = SD (N−3) is calculated according to the above procedure for all the division methods into three clusters, and the smallest one among them is assumed to be true SD (a). Good.
[0110]
In this way, when the clustering is repeated and the number of clusters a = N− (N−2) = 2, the clustering of the current number of clusters a = 3 becomes two clusters based on the centroid method. Be changed. In this case, the clustering to the number of clusters a = 2 is determined so that the two nearest centroids among the three centroids are combined into one cluster, and the above-mentioned various quantities are obtained (error using Equation 31). If the total sum calculation process) is repeated, the clustering error SD (a) = SD (2) to the number of clusters (a = 2) with few errors to the extent that there is no practical problem can be obtained.
[0111]
However, when deciding clustering to two, the result of the previous clustering, that is, all the ways of dividing N samples into two clusters without using the result of clustering to three, SD (a) = SD (2) may be calculated according to the above procedure, and the smallest of them may be set as true SD (a).
[0112]
Finally, when a = N− (N−1) = 1, the clustering of the current cluster number a = 2 is changed to clustering to the cluster number a = 1 based on the centroid method. The clustering in this case is uniquely determined. The center of gravity of one integrated cluster is the midpoint between the two centers of gravity. For this clustering, if the above-described processing for determining various quantities (calculation of the sum of errors using Equation 31) is repeated, the error SD (a) = SD (1) for clustering to a = 1 with the least error. Can be obtained.
[0113]
The clustering error SD (a) (a = N, N−1,..., 2, 1) obtained as described above is plotted with the horizontal axis as the number of clusters a. In this embodiment, N = 18, and FIG. 5 shows an example in which SD (a) obtained by the method using the previous clustering result is plotted.
[0114]
Referring to FIG. 5, the optimum number of clusters (the optimum number of clusters) a opt Is the number of clusters before change (immediately before) including the point where SD (a) suddenly increases (changes) when the number of clusters a decreases from N to 1, or the number of clusters larger than that The number of clusters a that gives SD (a) having an allowable size (allowable range) is determined. Therefore, in the example shown in FIG. opt Is “3”.
[0115]
However, in this embodiment, the allowable range is less than 20% of the maximum error, but can be freely changed by a designer, a user, or the like. In addition, the optimal number of clusters a opt May be determined to be the cluster number a after the change (immediately after) in which SD (a) changes suddenly and not exceeding the allowable range. Therefore, depending on how the allowable range is determined, the optimal number of clusters a in several places opt There are cases where one candidate is determined.
[0116]
The specific clustering process is shown by the flowcharts in FIGS. Referring to FIG. 6, when a clustering instruction is given by the user, the CPU starts processing, and reads 4096 sample values corresponding to the clustering instruction from the database in step S41. In the subsequent step S43, the read sample values, ie, (texture) feature amounts (D, V, P) are normalized, and normalized feature amounts (normalized feature amounts) ZD, ZV, and ZP are obtained.
[0117]
In step S45, the normalized feature values ZD, ZV, and ZP are plotted on the normalized feature value space, that is, ZD, ZV, ZP (three-dimensional) space, and a scatter diagram as shown in FIG. 8 is drawn.
[0118]
Hereinafter, in this embodiment, 4096 subregions a i Texture feature amount D i , V i , P i Are collectively expressed as (D, V, P). Similarly, normalized feature quantity ZD i , ZV i , ZP i Are collectively expressed as (ZD, ZV, ZP).
[0119]
In step S45 described above, 4096 measured values of normalized features (ZD, ZV, ZP) are plotted on the ZD, ZV, ZP space. However, in this embodiment, for simplicity of explanation, FIG. 8 shows an example in which 18 measurement values (ZD, ZV, ZP) are plotted for a certain image.
[0120]
In step S47, the cluster number a is initialized (a = N). Subsequently, in step S49, all N sample values are clustered by the centroid method. In step S51, the count value i of the counter is initialized (i = 1), and in step S53, the center of gravity G (a, i) of the cluster C (a, i) is calculated.
[0121]
In step S55, the count value k of the counter is initialized (k = 1), and in step S57, the center of gravity G (a, i) in the cluster C (a, i) and each sample point S (a, i, k). ) To the distance d (a, i, k).
[0122]
Next, as shown in FIG. 7, in the next step S59, it is determined whether k = b (a, i). That is, it is determined whether the distance d (a, i, k) from all the sample points in the cluster C (a, i) has been calculated.
[0123]
If “NO” in the step S59, that is, unless k = b (a, i), the distance d (a, i, k) from all the sample points in the cluster C (a, i) is not calculated. In step S61, the count value k is incremented (k = k + 1), and the process returns to step S57 shown in FIG.
[0124]
On the other hand, if “YES” in the step S59, that is, if k = b (a, i), the distance d (a, i, k) from all sample points in the cluster C (a, i) is calculated. In step S63, the error D (a, i) of the i-th cluster C (a, i) is calculated according to Equation 30.
[0125]
In a succeeding step S65, it is determined whether or not the count value i is equal to the cluster number a. If “NO” in the step S65, that is, if the count value i is not equal to the cluster number a, the counter is incremented (i = i + 1) in a step S67, and the process returns to the step S53 shown in FIG.
[0126]
On the other hand, if “YES” in the step S65, that is, if the count value i is equal to the cluster number a, an error SD (a) for clustering to a is calculated in a step S69. Specifically, using Equation 31, the clustering error due to clustering into a clusters is obtained.
[0127]
Subsequently, in step S71, it is determined whether or not the cluster number a is 1. If “NO” in this step S71, that is, if the cluster number a is not 1, the cluster number a is decremented (a = a−1) in step S73, and the current (after decrementing) is performed based on the centroid method. After clustering into clusters having a cluster number a (a), the process returns to step S51 shown in FIG.
[0128]
On the other hand, if “YES” in the step S71, that is, if the cluster number a is 1, the cluster number a immediately before the error SD (a) suddenly increases in the step S75 or a larger cluster number a. A which gives an error SD (a) in an allowable size (allowable range) is an optimum number of clusters a opt The process is terminated after the determination.
[0129]
However, in this embodiment, the allowable range of the error SD (a) is 1/5 (about 10) of the maximum error (about 55), and the optimum number of clusters a is within a range where the error SD (a) does not exceed 10. opt Is determined. That is, the allowable range is a value that can be arbitrarily set by a program (software) designer or user.
[0130]
According to this embodiment, since the number of clusters can be determined to an optimal (reasonable) value and clustering can be performed, the reliability when verifying as simple statistics is high, and the clustering result does not adversely affect the subsequent processing. That is, the convenience of the clustering result can be improved.
[0131]
In the above embodiment, the number of clusters a is reduced by one. However, when the total number of samples N is enormous, the number of clusters a is reduced by a plurality (for example, 10). Also good.
[0132]
In the above-described embodiment, only the case where the center of gravity method based on the Euclidean distance is applied as the clustering method has been described. However, the distance representing the similarity need not be limited to the Euclidean distance. For example, the square of Euclidean distance, Mahalanobis distance, correlation coefficient, or the like may be used.
[0133]
Furthermore, the method for determining the distance between the clusters is not limited to the centroid method, and the shortest distance method, the longest distance method, the group average method, the median method, the Ward method, or the like can be used.
[0134]
Furthermore, in the above-described embodiment, the texture feature amount (sample value) is normalized, but it is not necessary to normalize when the data that has been normalized in advance is a sample value. The sample value need not be limited to the texture feature amount, and other various data can be used as the sample value.
[0135]
In the above-described embodiment, the small area a i Although Y data is obtained from R, G, B data as a pre-processing for R, G, B, hue H, saturation S, lightness I (or V may be written). Data, that is, data in the HSI space may be converted, and the resulting lightness I data may be used.
[0136]
Furthermore, in the above-described embodiment, the two-dimensional frequency component is calculated by using the two-dimensional discrete Fourier transform (DFT). In particular, the two-dimensional fast Fourier transform (FFT) or the two-dimensional discrete cosine transform (DCT) is used. ) May be used.
[Brief description of the drawings]
FIG. 1 is an illustrative view showing an image handled in clustering according to an embodiment of the present invention;
FIG. 2 is a flowchart showing a texture feature amount extraction process;
FIG. 3 is a flowchart showing calculation processing of a texture feature amount.
FIG. 4 is an illustrative view showing the absolute value of a complex number obtained by performing two-dimensional DFT on subtraction data in a contour calculation on a two-dimensional frequency plane in a texture feature amount calculation process;
FIG. 5 is a graph showing an example of an error with respect to the number of clusters in the clustering process.
FIG. 6 is a flowchart showing a part of clustering processing;
FIG. 7 is a flowchart showing another part of the clustering process.
FIG. 8 is a graph showing an example plotted according to a texture feature amount extracted by a texture feature amount extraction process;

Claims (3)

複数の標本点をクラスタリングするクラスタリングプログラムであって、
コンピュータを、
各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離を前記すべての標本点のそれぞれについて検出する距離検出手段、
前記距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、
前記第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、
クラスタ数を最大値から最小値に向けて変化させたときに前記第2総和値算出手段によって求めた第2総和値が急激に変化する個所を挟む前後数箇所の前記第2総和値のいずれかに対応するクラスタ数を最適クラスタ数に決定する最適クラス数決定手段、および
前記最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラム。
A clustering program for clustering a plurality of sample points,
Computer
Distance detecting means for detecting for each of all sample points and the Euclidean distance said all sampling points of the representative point as a center of gravity in the cluster in each cluster,
First sum value calculating means for obtaining a first sum value of Euclidean distances detected by the distance detecting means;
Second sum value calculating means for obtaining a second sum value obtained by summing the first sum value obtained by the first sum value calculating means over each cluster;
Any of the second total values at several points before and after the point where the second total value calculated by the second total value calculation means changes suddenly when the number of clusters is changed from the maximum value to the minimum value. And a clustering program that functions as clustering means for clustering to the optimum cluster number determined by the optimum cluster number determining means.
複数の標本点をクラスタリングするクラスタリングプログラムであって、
コンピュータを、
各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離を前記すべての標本点のそれぞれについて検出する距離検出手段、
前記距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、
前記第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、
クラスタ数を最大値から最小値に向けてn(nは自然数)個ずつ減少させるとき、前回のクラスタリング結果において最もクラスタ間距離が短い2つのクラスタを1つのクラスタにまとめる操作をn回繰り返すことにより、クラスタ数をn個減少させたときのクラスタリングを決定して前記第2総和値を求める第2総和値再計算手段、
前記第2総和値再計算手段によって求めた第2総和値が急激に変化する個所を挟む前後数箇所の前記第2総和値のいずれかに対応するクラスタ数を最適クラスタ数に決定する最適クラスタリング数決定手段、および
前記最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラム。
A clustering program for clustering a plurality of sample points,
Computer
Distance detecting means for detecting for each of all sample points and the Euclidean distance said all sampling points of the representative point as a center of gravity in the cluster in each cluster,
First sum value calculating means for obtaining a first sum value of Euclidean distances detected by the distance detecting means;
Second sum value calculating means for obtaining a second sum value obtained by summing the first sum value obtained by the first sum value calculating means over each cluster;
When the number of clusters is decreased by n (n is a natural number) from the maximum value to the minimum value, the operation of combining two clusters with the shortest inter-cluster distance into one cluster in the previous clustering result is repeated n times. , Second total value recalculating means for determining clustering when the number of clusters is decreased by n and obtaining the second total value;
The optimal clustering number for determining the optimal cluster number as the number of clusters corresponding to any of the second total values at several points before and after the point where the second total value obtained by the second total value recalculating means changes rapidly. A clustering program that functions as a determining unit, and a clustering unit that performs clustering to the optimal cluster number determined by the optimal cluster number determining unit.
複数の標本点をクラスタリングするクラスタリングプログラムであって、
コンピュータを、
各クラスタ内のすべての標本点と当該クラスタ内の重心となる代表点とのユークリッド距離を前記すべての標本点のそれぞれについて検出する距離検出手段、
前記距離検出手段によって検出したユークリッド距離の第1総和値を求める第1総和値算出手段、
前記第1総和値算出手段によって求めた第1総和値を各クラスタに渡って総和を取った第2総和値を求める第2総和値算出手段、
クラスタ数を最大値から最小値に向けて変化させるときに各クラスタ数に分けるすべての分け方について前記第2総和値を求める第2総和値再計算手段、
前記第2総和値再計算手段によって求めた複数の前記第2総和値の中で最も小さいものを第3総和値として算出する第3総和値算出手段、
前記クラスタ数を最大値から最小値に向けて変化させたときに前記第3総和値算出手段によって算出した第3総和値が急激に変化する前後いずれかの前記第3総和値に対応するクラスタ数を前記最適クラスタ数に決定する最適クラス多数決定手段、および
前記最適クラスタ数決定手段によって決定した最適クラスタ数へクラスタリングするクラスタリング手段として機能させる、クラスタリングプログラム。
A clustering program for clustering a plurality of sample points,
Computer
Distance detecting means for detecting for each of all sample points and the Euclidean distance said all sampling points of the representative point as a center of gravity in the cluster in each cluster,
First sum value calculating means for obtaining a first sum value of Euclidean distances detected by the distance detecting means;
Second sum value calculating means for obtaining a second sum value obtained by summing the first sum value obtained by the first sum value calculating means over each cluster;
Second total value recalculating means for obtaining the second total value for all the division methods for dividing each cluster number when the number of clusters is changed from the maximum value to the minimum value;
Third sum total value calculating means for calculating the smallest one of the plurality of second sum total values obtained by the second sum total value recalculating means as a third sum value;
The number of clusters corresponding to the third total value either before or after the third total value calculated by the third total value calculating means suddenly changes when the number of clusters is changed from the maximum value to the minimum value. And a clustering program that functions as clustering means for clustering to the optimal number of clusters determined by the optimal cluster number determining means.
JP2002039485A 2002-02-18 2002-02-18 Clustering program Expired - Fee Related JP3901540B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002039485A JP3901540B2 (en) 2002-02-18 2002-02-18 Clustering program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002039485A JP3901540B2 (en) 2002-02-18 2002-02-18 Clustering program

Publications (2)

Publication Number Publication Date
JP2003242508A JP2003242508A (en) 2003-08-29
JP3901540B2 true JP3901540B2 (en) 2007-04-04

Family

ID=27780492

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002039485A Expired - Fee Related JP3901540B2 (en) 2002-02-18 2002-02-18 Clustering program

Country Status (1)

Country Link
JP (1) JP3901540B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4931220B2 (en) 2007-03-12 2012-05-16 インターナショナル・ビジネス・マシーンズ・コーポレーション Detection apparatus, system, program, and detection method
US10262222B2 (en) 2016-04-13 2019-04-16 Sick Inc. Method and system for measuring dimensions of a target object

Also Published As

Publication number Publication date
JP2003242508A (en) 2003-08-29

Similar Documents

Publication Publication Date Title
CN108304820B (en) Face detection method and device and terminal equipment
DE60036780T2 (en) A method of comparing a two-dimensional image to one of a plurality of three-dimensional candidate models stored in a database
US20020012451A1 (en) Method for target detection and identification by using proximity pixel information
WO2006129791A1 (en) Image processing system, 3-dimensional shape estimation system, object position posture estimation system, and image generation system
US6621926B1 (en) Image retrieval system and method using image histogram
CN110930387A (en) Fabric defect detection method based on depth separable convolutional neural network
CN113420640B (en) Mangrove hyperspectral image classification method and device, electronic equipment and storage medium
KR20140109463A (en) Method and system for comparing images
US20100266212A1 (en) Estimating Vanishing Points in Images
CN110399820B (en) Visual recognition analysis method for roadside scene of highway
Gardiner et al. Multiscale edge detection using a finite element framework for hexagonal pixel-based images
JPWO2019106850A1 (en) SAR image analysis system, image processing equipment, image processing method and image processing program
Haris et al. Superresolution for UAV images via adaptive multiple sparse representation and its application to 3-D reconstruction
CN113435282A (en) Unmanned aerial vehicle image ear recognition method based on deep learning
CN109376689B (en) Crowd analysis method and device
CN110793441A (en) High-precision object geometric dimension measuring method and device
JP3901540B2 (en) Clustering program
CN112017221B (en) Multi-modal image registration method, device and equipment based on scale space
JP3894802B2 (en) Texture flatness discrimination program
CN116205886A (en) Point cloud quality assessment method based on relative entropy
CN112380967B (en) Spatial artificial target spectrum unmixing method and system based on image information
CN106296688B (en) Image blur detection method and system based on overall situation estimation
CN112131968A (en) Double-time-phase remote sensing image change detection method based on DCNN
JP3483113B2 (en) Time series image search method and apparatus, and recording medium recording time series image search program
CN113506266A (en) Method, device and equipment for detecting tongue greasy coating and storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060914

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060926

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061003

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061107

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061120

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061226

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees