![]() | XDMBandMask Class |
Namespace: Pixoneer.NXDL.NRS
public class XDMBandMask : XDMBand
The XDMBandMask type exposes the following members.
Name | Description | |
---|---|---|
![]() | XDMBandMask | XDMBandMask클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. |
Name | Description | |
---|---|---|
![]() | GetInputParam | 영상 마스킹 처리에 대한 입력 파라미터를 얻는다. |
![]() | SetInputParam | 영상 마스킹 처리를 위한 입력 파라미터를 설정한다. |
The Mask Area is used to set the masking area. Polygons can be created by NXMapView or by NXDLvc Objects
using Pixoneer.NXDL; using Pixoneer.NXDL.NRS; using Pixoneer.NXDL.NIO; using Pixoneer.NXDL.NVC; // 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); // Create mask polygon XvcPolygon polygon = new XvcPolygon(); // 영상 마스킹에 사용하는 벡터 객체는 world 좌표로 이루어져야 함. double x, y; XDMBand band = xrsFileInput.GetBandAt(0); x = 100; y = 100; band.PixelToSpace(ref x, ref y); polygon.Add(new XVertex3d(x, y, 0)); x = 300; y = 100; band.PixelToSpace(ref x, ref y); polygon.Add(new XVertex3d(x, y, 0)); x = 300; y = 300; band.PixelToSpace(ref x, ref y); polygon.Add(new XVertex3d(x, y, 0)); x = 100; y = 300; band.PixelToSpace(ref x, ref y); polygon.Add(new XVertex3d(x, y, 0)); // Set input param XBandParamMask InputParam = new XBandParamMask(); InputParam.SrcBand = xrsFileInput.GetBandAt(0); InputParam.BorderSmoothWidth = 0; InputParam.BlankValue = 0; InputParam.MaskPolygonMode = eMaskPolygonMode.OutsideAnd; InputParam.ListMaskPolygon.Add(polygon); // Create New process band and set input param XDMBandMask bandProcess = new XDMBandMask(); 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); XBandParamMask param = new XBandParamMask(ref InputParam); param.SrcBand = bandRaw; XDMBandMask bandTmp = new XDMBandMask(); 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\\Output_Mask.xdm"; if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd)) { return; }