Example #1
0
 public MainWindow(RsImage p)
 {
     InitializeComponent();
     this._image           = p;
     this.textOpenLoc.Text = p.GetFilePath();
     SetRadioVisibility(p.Interleave);
 }
Example #2
0
        /// <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;
            }
        }
Example #3
0
        public HistoEqualization(RsImage img, int band)
        {
            _bandData = img.GetPicData(band);
            HistoData hd = new HistoData(img, band);
            _accData = hd.GetAccHistogramData();

            StartEqualization();
        }
Example #4
0
        /// <summary>
        /// 显示图像-RGB
        /// </summary>
        /// <param name="ig">图像</param>
        public KT(RsImage ig)
        {
            InitializeComponent();

            InitMousePan();
            InitCombo1();

            this._img = ig.GetPicData();
        }
Example #5
0
        /// <summary>
        /// 显示图像-RGB
        /// </summary>
        /// <param name="ig">图像</param>
        public ShowImage(RsImage ig)
        {
            InitializeComponent();

            InitMousePan();
            InitComboBox(ig.BandsCount);

            this._img = ig.GetPicData();
        }
Example #6
0
        public HistoEqualization(RsImage img, int band)
        {
            _bandData = img.GetPicData(band);
            HistoData hd = new HistoData(img, band);

            _accData = hd.GetAccHistogramData();

            StartEqualization();
        }
Example #7
0
        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;
        }
Example #8
0
        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;
        }
Example #9
0
        /// <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;
        }
Example #10
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();
        }
Example #11
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();
        }
Example #12
0
        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);
        }
Example #13
0
 private void RsImageMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     RsImage.ReleaseMouseCapture();
 }
Example #14
0
        public ContrastStretch(RsImage p, int band, double s, double o)
        {
            _bandData = p.GetPicData(band);

            DoStretch(s, o);
        }
Example #15
0
        public ContrastStretch(RsImage p, int band, double s, double o)
        {
            _bandData = p.GetPicData(band);

            DoStretch(s, o);
        }