Click or drag to resize
XDL

XDMBandUnSuperClass Class

XDMBandUnSuperClass 클래스는 무감독 분류를 수행하는 클래스이다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NRSXDMBand
    Pixoneer.NXDL.NRSXDMBandUnSuperClass

Namespace:  Pixoneer.NXDL.NRS
Assembly:  NXDLrs (in NXDLrs.dll) Version: 1.2.817.72
Syntax
C#
public class XDMBandUnSuperClass : XDMBand

The XDMBandUnSuperClass type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandUnSuperClass
XDMBandUnSuperClass 클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
  NameDescription
Public methodClustering
무감독 분류시 사전 분광 통계 정보를 계산한다. 입력 파라미터 설정 후 분광 통계 정보를 설정을 위해 반드시 호출해야 하는 함수이다.
Public methodGetClusterDistance
Cluster Index와 Band Index에 해당하는 거리를 얻는다.
Public methodGetClusterMean
Cluster Index와 Band Index에 해당하는 평균값을 얻는다.
Public methodGetClusterPopulation
입력 Cluster Index에 해당하는 Population값을 얻는다.
Public methodGetClusterSum
Cluster Index와 Band Index에 해당하는 합계를 얻는다.
Public methodGetClusterSum2
Cluster Index와 Band Index에 해당하는 제곱합을 얻는다.
Public methodGetClusterVariance
Cluster Index와 Band Index에 해당하는 분산값을 얻는다.
Public methodGetInputParam
무감독 분류 영상처리를 위한 파라미터를 얻는다.
Public methodGetNumClusters
Clustering 후 군집 개수를 가져온다.
Public methodSetInputParam
무감독 분류 영상처리를 위한 입력 파라미터를 설정.
Top
Examples
Sequential 방법을 적용하여 무감독 분류를 수행한다. 최대 5개의 군집으로 분류하는 데에 영상의 모든 밴드와 전체 영역 데이터를 이용한다.
// IO initialize to load image file
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
    return;
}

// Image load
String strFilePathLoad = "D:\\Sample\\RS_Sample\\UnSuperClass\\etm.xdm";

XRSLoadFile xrsFileInput = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);

eUnSuperClassMethod Method;
Method = eUnSuperClassMethod.Sequential;

// Set input param 
XBandParamUnSuperClass InputParam = null;
if (Method == eUnSuperClassMethod.Sequential)
{
    InputParam = new XBandParamUnSuperClassSequential();
    ((XBandParamUnSuperClassSequential)InputParam).PercentForMerge = 20;
}
else if (Method == eUnSuperClassMethod.KMeans)
{
    InputParam = new XBandParamUnSuperClassKMeans();
    ((XBandParamUnSuperClassKMeans)InputParam).MaxIteration = 10;
    ((XBandParamUnSuperClassKMeans)InputParam).ExitPercentOfChange = 0;
}
else if (Method == eUnSuperClassMethod.Isodata)
{
    InputParam = new XBandParamUnSuperClassIsodata();
    ((XBandParamUnSuperClassIsodata)InputParam).MaxIteration = 10;
    ((XBandParamUnSuperClassIsodata)InputParam).ExitPercentOfChange = 0;
    ((XBandParamUnSuperClassIsodata)InputParam).MaxStdDevCluster = 10;
}
else if (Method == eUnSuperClassMethod.Fuzzy)
{
    InputParam = new XBandParamUnSuperClassFuzzy();
    ((XBandParamUnSuperClassFuzzy)InputParam).FuzzyPrecision = 0.001;
}

// Common
for (int i = 0; i < xrsFileInput.NumBand; i++)
{
    InputParam.ArrBandList.Add(xrsFileInput.GetBandAt(i));
}
InputParam.MaxNumberCluster = 5;
InputParam.MaxRadiusCluster = 30;
InputParam.MinDistanceCluster = 20;
InputParam.MinNumPixelsInCluster = 100;
InputParam.NullValue =0;
InputParam.X1C = 0;
InputParam.X2C = xrsFileInput.GetBandAt(0).XSize - 1;
InputParam.Y1C = 0;
InputParam.Y2C = xrsFileInput.GetBandAt(0).YSize - 1;
InputParam.LevelC = xrsFileInput.GetBandAt(0).GetLevel();

// Create New process band and set input param
XDMBandUnSuperClass bandProcess = new XDMBandUnSuperClass();
bandProcess.BandName = xrsFileInput.FileName;
bandProcess.SetInputParam(ref InputParam);

// Clustering
if (!bandProcess.Clustering(null))
{
    MessageBox.Show("It could not execute clustering");
    return ;
}

// create XRSSaveFile to save realtime band(XDMBandXXXX)
// load another file to protect thread lock(it is stable and faster).
XRSSaveFile fileSave = new XRSSaveFile();
XDMBand bandCast = (XDMBand)bandProcess;
fileSave.AddBand(ref bandCast);

// Save output file
XThread thd = null;
String strFilePathSave = "D:\\Sample\\Out_UnSuperClass.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd)) 
{
    return;
}
See Also