Click or drag to resize
XDL

XDMBandHDRC Class

XDMBandHDRC클래스는 영상에 대한 HDRC 를 수행한다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NRSXDMBand
    Pixoneer.NXDL.NRSXDMBandHDRC

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

The XDMBandHDRC type exposes the following members.

Constructors
 NameDescription
Public methodXDMBandHDRC XDMBandHDRC클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Top
Methods
 NameDescription
Public methodDoHDRC HDRC 영상 처리 결과를 임시로 생성한다.
Public methodGetInputParam HDRC 영상처리를 위한 파라미터를 얻는다.
Public methodPreProcessPlateaueq HdrcType 중 Plateaueq 방법으로 HDRC 를 수행시 전체 영상에 대한 통계치값을 이용하여 전처리를 수행한다.
Public methodSetInputParam HDRC 영상처리를 위한 입력 파라미터를 설정.
Top
Example
HdrcType 중 Plateaueq 방법으로 HDRC 를 수행하는 예제.
C#
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
XBandParamHDRC InputParam = new XBandParamHDRC();
InputParam.SrcBand = xrsFileInput.GetBandAt(0);
InputParam.HdrcType = eHDRCType.Plateaueq;
InputParam.DrcPeConstrast = 0.1f;

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

if (!bandProcess.PreProcessPlateaueq(null))
{
    return;
}

// Display to ImageView in realtime
/// ....

// 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);
    XBandParamHDRC param = new XBandParamHDRC(ref InputParam);
    param.SrcBand = bandRaw;

    XDMBandHDRC bandTmp = new XDMBandHDRC();
    bandTmp.BandName = bandRaw.BandName;
    bandTmp.SetInputParam(ref param);
    bandTmp.PreProcessPlateaueq(null)

    XDMBand bandCast = (XDMBand)bandTmp;

    fileSave.AddBand(ref bandCast);
}
// Save output file
XThread thd = null;
String strFilePathSave = "D:\\Sample\\Out_Hdrc.xdm";
if (!RasterIO.Export(ref fileSave, strFilePathSave, "JP2", out strError, thd))
{
    return;
}
HdrcType 중 Contmap 방법으로 HDRC 를 수행하는 예제.
C#
using Pixoneer.NXDL;
using Pixoneer.NXDL.NRS;
using Pixoneer.NXDL.NIO;

string strError = "";
string strFilePath = @"D:\SAMPLE_IMAGE\Test.xdm";

XRSLoadFile xrsFile = RasterIO.LoadFile(strFilePath, out strError, false, eIOCreateXLDMode.All_NoMsg);

XDMBand band = xrsFile.GetBandAt(0);

int nBlockSize = band.XSize > band.YSize ? band.XSize : band.YSize;
nBlockSize = nBlockSize + 1;

// Set input param
XBandParamHDRC InputParam = new XBandParamHDRC();
InputParam.SrcBand = xrsFile.GetBandAt(0);
InputParam.HdrcType = eHDRCType.Contmap;
InputParam.DrcMtConstrast = 0.9f;
InputParam.DrcMtDetail = 0.2f;
InputParam.ProcessBlockSize = nBlockSize;


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

if (InputParam.HdrcType == eHDRCType.Contmap)
{
    if (!bandProcess.DoHDRC(null))
    {
        return;
    }
}

XRSSaveFile fileSave = new XRSSaveFile();
XDMBand bandCast = (XDMBand)bandProcess;
fileSave.AddBand(ref bandCast);

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