Click or drag to resize
XDL

XDMBandMosaicLT Class

XDMBandMosaicLT 클래스는 여러 장의 영상을 모자이크하여 하나의 영상으로 생성한다.
Inheritance Hierarchy

Namespace:  Pixoneer.NXDL.NRSEX
Assembly:  NXDLrsEx (in NXDLrsEx.dll) Version: 2.0.3.30
Syntax
C#
public class XDMBandMosaicLT : XDMBand

The XDMBandMosaicLT type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandMosaicLT
XDMBandMosaicLT클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Public methodXDMBandMosaicLT(XDMBandMosaicLT*)
XDMBandMosaicLT객체를 생성하는 생성자이다. 외부 XDMBandMosaicLT객체를 입력 받아 멤버 변수를 초기화한다.
Top
Methods
  NameDescription
Public methodGetBandTransparent
모자이크를 수행할 영상 밴드의 transparent 값을 가져온다.
Public methodGetInputParam
화소 추출을 위한 입력 파라미터를 얻는다.
Public methodRemoveMaskAllPolygons
입력 밴드가 속해 있는 XRSLoadFile 과 관련된 마스킹을 위한 polygon 을 모두 삭제한다.
Public methodSetBandTransparent
모자이크를 수행할 영상 밴드의 transparent 값을 설정.
Public methodSetInputParam
화소 추출을 위한 입력 파라미터를 설정.
Public methodSetMaskPolygon
입력 밴드가 속해 있는 XRSLoadFile 과 관련된 마스킹을 위한 polygon 을 설정한다.
Public methodSetMaskPolygonMode
입력 밴드가 속해 있는 XRSLoadFile 과 관련된 폴리곤의 영상 마스킹 모드를 설정한다.
Top
Examples
This is example C# : 여러 장의 영상을 모자이크하는 예제
// IO initialize to load image file
XRasterIO RasterIO = new XRasterIO();
String strError = "";
if (RasterIO.Initialize(out strError) == false)
{
    return;
}

// Image load
String strFilePathLoad1 = @"E:\SampleImage\mosaic\001.xdm";
String strFilePathLoad2 = @"E:\SampleImage\mosaic\002.xdm";
XRSLoadFile xrsFileInput1 = RasterIO.LoadFile(strFilePathLoad1, out strError, false, eIOCreateXLDMode.All_NoMsg);
XRSLoadFile xrsFileInput2 = RasterIO.LoadFile(strFilePathLoad2, out strError, false, eIOCreateXLDMode.All_NoMsg);

// Set input param
XBandParamMosaicLT inputParam = new XBandParamMosaicLT();
XDMBandMosaicLT bandMosaic = new XDMBandMosaicLT();

// Create Mosaic Parameter Info
BandInfoLT info = new BandInfoLT();
info.SrcBand = xrsFileInput1.GetBandAt(0);
info.HistoMethod = eMosaicHisto.None;
info.Transparent = 0.0;
//info.HistoCovariance = 0.5;    // info.HistoMethod 가 Mean_StdDev, Hue_Adjustment 일 경우 값 설정 필요
//info.HistoMaxMain = 0.2;
//info.HistoMaxSub = 0.1;
//info.HistoMeanMain = 0.05;
//info.HistoMeanSub = 0.01;
//info.HistoMinMain = 0.7;
//info.HistoMinSub = 0.08;
//info.HistoVariance = 0.001;
inputParam.ArrBandInfo.Add(info);

info = new BandInfoLT();
info.SrcBand = xrsFileInput2.GetBandAt(0);
info.HistoMethod = eMosaicHisto.None;
info.Transparent = 0.0;
//info.HistoCovariance = 0.5;    // info.HistoMethod 가 Mean_StdDev, Hue_Adjustment 일 경우 값 설정 필요
//info.HistoMaxMain = 0.2;
//info.HistoMaxSub = 0.1;
//info.HistoMeanMain = 0.05;
//info.HistoMeanSub = 0.01;
//info.HistoMinMain = 0.7;
//info.HistoMinSub = 0.08;
//info.HistoVariance = 0.001;
inputParam.ArrBandInfo.Add(info);

// set Mosaic Input Parameter
inputParam.PixelSizeX = info.SrcBand.XPixelSize;    // 출력 해상도 설정
inputParam.PixelSizeY = info.SrcBand.YPixelSize;
inputParam.BlankValue = 0.0;                        // 모자이크 결과 빈 공간에 0값으로 채움
inputParam.ResampleMethod = eResampleMethod.Nearest;

if (!bandMosaic.SetInputParam(ref inputParam))
{
    MessageBox.Show("false");
    return;
}

bandMosaic.SR = xrsFileInput1.SR;

// create output file
XRSSaveFile fileSave = new XRSSaveFile();
XDMBand bandCast = (XDMBand)bandMosaic;
fileSave.AddBand(ref bandCast);

// Save output file
XThread thd = null;
String strFilePathSave = @"E:\SampleImage\mosaic\MosaicResult.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
    MessageBox.Show(strError);
    return;
}
See Also