Click or drag to resize
XDL

XDMBandGeoCorrect Class

XDMBandGeoCorrect클래스는 입력 영상과 3개 이상의 GCP을 이용해 기하학적 보정을 수행한다.
Inheritance Hierarchy

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

The XDMBandGeoCorrect type exposes the following members.

Constructors
  NameDescription
Public methodXDMBandGeoCorrect
XDMBandGeoCorrect클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
  NameDescription
Public methodCalcSourcePixelBound
파라미터로 입력된 XGCPSets객체로부터 Map to Image변환 관계를 이용하여 지리좌표로 부터 이미지 좌표계로 변환시킨다.
Public methodGetInputParam
기하보정 수행을 위한 입력 파라미터를 얻는다.
Public methodSetInputParam
기하보정을 위한 입력 파라미터를 설정한다.
Public methodWarpPointImage2Map
파라미터로 입력된 XGCPSets객체로부터 Image to Map변환 관계를 이용하여 이미지좌표를 지리 좌표로 변환시킨다.
Public methodWarpPointMap2Image
파라미터로 입력된 XGCPSets객체로부터 Map to Image변환 관계를 이용하여 지리좌표를 이미지 좌표로 변환시킨다.
Top
Remarks

Satellite images and aerial photographs have contains geometric distortions due to the elevation of the satellite or aerial sensor, position, speed, earth curvature, and atmosphere reflection. Distortions are classified as either systematic or non-systematic. Systematic distortions include scan skew, mirror-scan velocity, platform velocity, panoramic distortion, earth rotation, etc. Non-systematic distortion is the effect from the altitude of the sensor and an irregular change of the position. Systematic distortion can be corrected with the internal sensor of the satellite and with orbital information. Non-systematic distortion requires sufficient GCPs for correction. In geometric correction, the ground control point is defined as the corresponding point between the image coordinate system and the geographic coordinate system. Accurate selection and a sufficient number of GCPs are required for geometric correction. The selection of a GCP is the process of setting the image coordinates (of a pixel) and the geographic coordinates of the corresponding point.

Examples
로딩한 영상과 위경도 좌표의 GCP 4개를 입력으로 하여 affine식으로 기하학적 보정을 수행하고, 영상재배열 방법으로 bilinear를 사용한다. input param의 PixelSizeX, PixelSizeY 단위는 GCP 좌표계와 동일하다. 출력 영상은 GCP 좌표계와 동일한 좌표계를 갖는다.
using Pixoneer.NXDL;
using Pixoneer.NXDL.NRS;
using Pixoneer.NXDL.NIO;
using Pixoneer.NXDL.NCC;
// 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 GCPSet
// 위경도 좌표의 GCP 생성
XGCPSets gcpset = new XGCPSets();
XGCP gcp;
gcp = new XGCP();
gcp.ID = 0; gcp.imgCoord.x = 0; gcp.imgCoord.y = 0; gcp.refCoord.x = 127.35982299; gcp.refCoord.y = 36.38847486; gcp.Used = true;
gcpset.AddGCP(ref gcp);
gcp = new XGCP();
gcp.ID = 1; gcp.imgCoord.x = 2034.0; gcp.imgCoord.y = 0; gcp.refCoord.x = 127.38211805; gcp.refCoord.y = 36.38847486; gcp.Used = true;
gcpset.AddGCP(ref gcp);
gcp = new XGCP();
gcp.ID = 2; gcp.imgCoord.x = 2034.0; gcp.imgCoord.y = 2041.0; gcp.refCoord.x = 127.38211805; gcp.refCoord.y = 36.36976365; gcp.Used = true;
gcpset.AddGCP(ref gcp);
gcp = new XGCP();
gcp.ID = 3; gcp.imgCoord.x = 0.0; gcp.imgCoord.y = 2041.0; gcp.refCoord.x = 127.35982299; gcp.refCoord.y = 36.36976365; gcp.Used = true;
gcpset.AddGCP(ref gcp);
gcpset.SR = new XSpatialReference();
gcpset.SR.importFromEPSG(4326);

// Set input param
XBandParamGeoCorrect InputParam = new XBandParamGeoCorrect();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);
InputParam.ResampleMethod = eResampleMethod.BiLinear;
InputParam.WarpMethod = eWarpMethod.Affine;
InputParam.PixelSizeX = 0.000100;        // 해상도의 단위는 gcp 좌표계의 단위와 동일하며 여기에서는 degree
InputParam.PixelSizeY = 0.000100;        // 해상도의 단위는 gcp 좌표계의 단위와 동일하며 여기에서는 degree
InputParam.GcpSets = gcpset;

// Create New process band and set input param
XDMBandGeoCorrect bandProcess = new XDMBandGeoCorrect();
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);
    XBandParamGeoCorrect param = new XBandParamGeoCorrect(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandGeoCorrect bandTmp = new XDMBandGeoCorrect();
    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_GeoCorrect.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "XDM", out strError, thd))
{
    return;
}
See Also