Click or drag to resize
XDL

XDMBandSpatialFilter Class

XDMBandSpatialFilter 클래스는 Smoothing, Sharpening 등 공간 필터링을 수행한다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NRSXDMBand
    Pixoneer.NXDL.NRSXDMBandSpatialFilter

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

The XDMBandSpatialFilter type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandSpatialFilter
XDMBandSpatialFilter클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
  NameDescription
Public methodGetInputParam
공간 필터에 대한 입력 파라미터를 얻는다.
Public methodSetInputParam
공간 필터에 대한 입력 파라미터를 설정.
Top
Examples
입력 영상을 Kenel 3x3을 이용하여 average filter를 적용해 부드럽게 만들어 XDM 파일로 저장한다.
using Pixoneer.NXDL;
using Pixoneer.NXDL.NRS;
using Pixoneer.NXDL.NIO;

// 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\\IKONOS.xdm";
XRSLoadFile xrsFileInput = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);

// Set input param
XBandParamSpatialFilter InputParam = new XBandParamSpatialFilter();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);
InputParam.FilterMethod = eSpatialFilterMethod.Average;
InputParam.KernelSize = 3;

// Create New process band and set input param
XDMBandSpatialFilter bandProcess = new XDMBandSpatialFilter();
if (!bandProcess.SetInputParam(ref InputParam))
{
    return;
}

// create XRSSaveFile to save realtime band(XDMBandXXXX)
// load another file to protect thread lock(it is stable and faster).
XRSLoadFile fileLoad = RasterIO.LoadFile(strFilePathLoad, out strError, false, eIOCreateXLDMode.All_NoMsg);
XRSSaveFile fileSave = new XRSSaveFile();
for (int i = 0; i < fileLoad.NumBand; i++)
{
    XDMBand bandRaw = fileLoad.GetBandAt(i);
    XBandParamSpatialFilter param = new XBandParamSpatialFilter(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandSpatialFilter bandTmp = new XDMBandSpatialFilter();
    bandTmp.BandName = bandRaw.BandName;
    bandTmp.SetInputParam(ref param);

    XDMBand bandCast = (XDMBand)bandTmp;

    fileSave.AddBand(ref bandCast);
}

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