/// <summary> /// 构造函数-任意两波段或图像 /// </summary> /// <param name="a">原始图像</param> /// <param name="b">拟合到的图像</param> public HistoMatch(byte[,] a, byte[,] b) { _oriImg = a; _oriAcc = new HistoData(a).GetAccHistogramData(); _targetAcc = new HistoData(b).GetAccHistogramData(); _mappingTable = new int[256]; GMLMatch(); }
/// <summary> /// 构造函数-任意两波段或图像 /// </summary> /// <param name="a">原始图像</param> /// <param name="b">拟合到的图像</param> public HistoMatch(byte[,] a, byte[,] b) { _oriImg = a; HistoData dat = new HistoData(a); _oriAcc = dat.GetAccHistogramData(); dat = new HistoData(b); _targetAcc = dat.GetAccHistogramData(); _mappingTable = new int[_oriAcc.Length]; StartMatch(); }
/// <summary> /// 按照波段号画图 /// </summary> /// <param name="band">波段号</param> private void DrawByBand(int band) { chart1.Series.Clear(); chart1.Titles.Clear(); HistoData histo = new HistoData(_image, band); if (_type==1) { chart1.ChartAreas[0].AxisY.Maximum = histo.GetHistogramData().Max() + 1000; MadeChart(chart1, band, histo.GetHistogramData()); } else { chart1.ChartAreas[0].AxisY.Maximum = histo.GetAccHistogramData().Max() + 1000; MadeChart(chart1, band, histo.GetAccHistogramData()); } }