public MainWindow(RsImage p) { InitializeComponent(); this._image = p; this.textOpenLoc.Text = p.GetFilePath(); SetRadioVisibility(p.Interleave); }
/// <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; } }
public HistoEqualization(RsImage img, int band) { _bandData = img.GetPicData(band); HistoData hd = new HistoData(img, band); _accData = hd.GetAccHistogramData(); StartEqualization(); }
/// <summary> /// 显示图像-RGB /// </summary> /// <param name="ig">图像</param> public KT(RsImage ig) { InitializeComponent(); InitMousePan(); InitCombo1(); this._img = ig.GetPicData(); }
/// <summary> /// 显示图像-RGB /// </summary> /// <param name="ig">图像</param> public ShowImage(RsImage ig) { InitializeComponent(); InitMousePan(); InitComboBox(ig.BandsCount); this._img = ig.GetPicData(); }
private void RsImageMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (RsImage.IsMouseCaptured) { return; } RsImage.CaptureMouse(); _mouseStart = e.GetPosition(border); _mouseOri.X = RsImage.RenderTransform.Value.OffsetX; _mouseOri.Y = RsImage.RenderTransform.Value.OffsetY; }
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> public HistoData(RsImage img, int band) { byte[,] p = img.GetPicData(band); int hang = p.GetLength(0); int lie = p.GetLength(1); _picData = new byte[hang * lie]; int count = 0; for (int i = 0; i < hang; i++) { for (int j = 0; j < lie; j++) { _picData[count++] = p[i, j]; } } CalcHistoData(); }
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); }
private void RsImageMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { RsImage.ReleaseMouseCapture(); }
public ContrastStretch(RsImage p, int band, double s, double o) { _bandData = p.GetPicData(band); DoStretch(s, o); }