public MainWindow(RsImage p) { InitializeComponent(); this._image = p; this.textOpenLoc.Text = p.GetFilePath(); SetRadioVisibility(p.Interleave); }
/// <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> /// 均值滤波 /// </summary> /// <param name="r"></param> public Lap(RsImage r) { this._img = r; this.Lapla = new byte[r.BandsCount, r.Lines, r.Samples]; CalcMean(); FillData(); }
/// <summary> /// 均值滤波 /// </summary> /// <param name="r"></param> public Mean(RsImage r) { this._img = r; this.MeanFilter = new byte[r.BandsCount, r.Lines, r.Samples]; CalcMean(); FillData(); }
public CalcOIF(RsImage img) { _imgBands = img.BandsCount; _stats = new ImageStats(img); ResultOIF = new List <string[]>(); CalcOif(); }
public CalcOIF(RsImage img) { _imgBands = img.BandsCount; _stats = new ImageStats(img); ResultOIF=new List<string[]>(); CalcOif(); }
/// <summary> /// 显示图像-RGB /// </summary> /// <param name="ig">图像</param> public KT(RsImage ig) { InitializeComponent(); InitMousePan(); InitCombo1(); 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 HSI(RsImage ig) { InitializeComponent(); InitMousePan(); InitComboBox(ig.BandsCount); 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(); }
/// <summary> /// Sobel /// </summary> /// <param name="r"></param> public Sobel(RsImage r) { this._img = r; this.SobelData = new byte[r.BandsCount, r.Lines, r.Samples]; CalcX(); CalcY(); FillData(); }
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(); }
public Histogram(RsImage p,byte type) { InitializeComponent(); _image = p; _type = type; var bandName = new string[p.BandsCount]; for (int i = 0; i < p.BandsCount; i++) { bandName[i] = "Band " + (i + 1); } bandList.DataSource = bandName; }
/// <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; }
/// <summary> /// 高斯低通 /// </summary> /// <param name="r">图像</param> /// <param name="x">卷积行</param> /// <param name="y">卷积列</param> /// <param name="o">方差</param> public GaussLow(RsImage r, int x, int y, int o) { this._img = r; CheckSize(x, y, o); this._o = o; this._x = x; this._y = y; MakeKernel(); GaussLowData = new byte[r.BandsCount, r.Lines, r.Samples]; Calc(); FillData(); }
/// <summary> /// 高斯低通 /// </summary> /// <param name="r">图像</param> /// <param name="x">卷积行</param> /// <param name="y">卷积列</param> /// <param name="o">方差</param> public GaussLow(RsImage r, int x,int y,int o) { this._img = r; CheckSize(x, y, o); this._o = o; this._x = x; this._y = y; MakeKernel(); GaussLowData = new byte[r.BandsCount, r.Lines, r.Samples]; Calc(); FillData(); }
private void OpenFiles() { _numOfFiles = _fileNames.GetLength(0); _mergeImages = new RsImage[_numOfFiles]; for (int i = 0; i < _numOfFiles; i++) { _mergeImages[i] = new RsImage(_fileNames[i]); if (_mergeImages[i].Lines != _mergeImages[0].Lines | _mergeImages[i].Samples != _mergeImages[0].Samples | _mergeImages[i].Interleave != "bsq") { _mergeImages = null; return; } if (_mergeImages[i].GetPicData() == null) { _mergeImages = null; return; } } }
/// <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(); }
private void HistoMatch(RsImage a, RsImage b) { var w = new RS_Diag.HistoMatch(a, b); if (w.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; var data = w.MatchedData; byte[,,] res = new byte[1, data.GetLength(0), data.GetLength(1)]; for (int i = 0; i < data.GetLength(0); i++) { for (int j = 0; j < data.GetLength(1); j++) { res[0, i, j] = data[i, j]; } } AddNewPic(res, a.FileName + "-直方图规定化结果", false); }
/// <summary> /// 直方图规定化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonUniHistogram_Click(object sender, RoutedEventArgs e) { if (!CheckImage()) return; var cho = _image[_fChoose.ChoosedFile]; OpenFileDialog ofd = new OpenFileDialog { Title = "选择目标直方图", Filter = "ENVI遥感数据头文件(*.HDR)|*.HDR;*.hdr" }; if (ofd.ShowDialog() != true) return; try { RS_Lib.RsImage img = new RsImage(ofd.FileName); HistoMatch(cho, img); } catch (Exception ex) { MessageBox.Show(ex.Message, "TonyZ", MessageBoxButton.OK, MessageBoxImage.Error); return; } }