private void FillData() { var ori = _img.GetPicData(); for (int b = 0; b < _img.BandsCount; b++) { var data = _data[b].ConvedData; for (int i = 0; i < _img.Lines; i++) { for (int j = 0; j < _img.Samples; j++) { Lapla[b, i, j] = (byte)(data[i, j] + ori[b, i, j]); } } } }
private void CalcX() { // 卷积核书P169 double[,] kernel = { { -1, 0, 1 }, { -2, 0, 2 }, { -1, 0, 1 } }; _dataX = new Conv[_img.BandsCount]; for (int i = 0; i < _img.BandsCount; i++) { _dataX[i] = new Conv(_img.GetPicData(i + 1), kernel); } }
private void Calc() { _data = new Conv[_img.BandsCount]; for (int i = 0; i < _img.BandsCount; i++) { _data[i] = new Conv(_img.GetPicData(i + 1), this._kernel); } }
/// <summary> /// 梯度倒数加权-3*3 /// </summary> public Grad(RsImage r) { this._img = r; this._oriData = r.GetPicData(); GradData = new byte[r.BandsCount, r.Lines, r.Samples]; ScanHoleImg(); }
/// <summary> /// 显示图像-RGB /// </summary> /// <param name="ig">图像</param> public HSI(RsImage ig) { InitializeComponent(); InitMousePan(); InitComboBox(ig.BandsCount); this._img = ig.GetPicData(); }
public ImageStats(RsImage p) { _bands = p.BandsCount; _lines = p.Lines; _samples = p.Samples; _picData = p.GetPicData(); CalcStats(); }
/// <summary> /// 显示图像-RGB /// </summary> /// <param name="ig">图像</param> public KT(RsImage ig) { InitializeComponent(); InitMousePan(); InitCombo1(); this._img = ig.GetPicData(); }
/// <summary> /// 中值滤波 /// </summary> /// <param name="r">图像</param> /// <param name="x">行大小</param> /// <param name="y">列大小</param> public Median(RsImage r, int x, int y) { this._img = r.GetPicData(); this._sizeX = x; this._sizeY = y; this.MedianData = new byte[r.BandsCount, r.Lines, r.Samples]; CheckSize(x, y); CalcMedian(); }
public Robert(RsImage img) { this._img = img; this._oriData = img.GetPicData(); this.RobertData = new byte[img.BandsCount, img.Lines, img.Samples]; this._robA = new double[img.BandsCount, img.Lines, img.Samples]; this._robB = new double[img.BandsCount, img.Lines, img.Samples]; ConvForEven(); FillData(); }
/// <summary> /// 极差纹理 /// </summary> /// <param name="ig">图像</param> public RangeFilt(RsImage ig) { InitializeComponent(); this._img = ig.GetPicData(); this._final = new byte[_img.GetLength(0)][,]; for (int i = 0; i < this._img.GetLength(0); i++) { _final[i] = new RS_Lib.RangeFilt(_img, i).JCWL; } InitMousePan(); InitCombo1(); LayerChoice.SelectedIndex = 0; }
private void CalcMean() { // 卷积核书P160 double[,] kernel = { { 0.125, 0.125, 0.125 }, { 0.125, 0, 0.125 }, { 0.125, 0.125, 0.125 } }; _data = new Conv[_img.BandsCount]; for (int i = 0; i < _img.BandsCount; i++) { _data[i] = new Conv(_img.GetPicData(i + 1), kernel); } }
/// <summary> /// 构造图像转换器函数 /// </summary> /// <param name="d">图像数据</param> /// <param name="t">转换格式(1-bsq,2-bip,3-bil</param> public PicConvert(RsImage d, int t) { this._data = d.GetPicData(); this._convType = t; this.Convert(); }