Ejemplo n.º 1
0
        /// <summary>
        /// 均衡化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            imagestretch imst = new imagestretch(ColumnCounts, LineCounts, bands);

            imst.Equalization(BandsDataD);
            StretchTemp = imst.getresult();

            this.bandstemp = imst.TwoPercentStretch(StretchTemp);
            pictureBox1.Refresh();
            map = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            ImageShow ims = new ImageShow();

            ims.showimage(bandstemp, ColumnCounts, LineCounts, bands, map);
            pictureBox1.Image = map;
            isValue           = false;
            stretchtype       = "Equalization";
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 直方图匹配(窗口间)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (Form1.abl.Wins.Count == 1)
            {
                MessageBox.Show("窗口不足,不能实现直方图匹配!");
            }
            else
            {
                int            WinN1, WinN2;
                HistogramMatch hm = new HistogramMatch();
                WinN1 = Convert.ToInt32(this.windowname.Substring(windowname.Length - 1));
                for (int i = 0; i < Form1.abl.Wins.Count; i++)
                {
                    hm.listBox1.Items.Add(Form1.abl.Wins[i].windowname);
                }

                hm.listBox1.Items.Remove(this.windowname);
                hm.ShowDialog();

                if (hm.Winnumber2 != -9999)
                {
                    WinN2 = hm.Winnumber2;
                    /// <summary>
                    /// 直方图匹配采用0-255值域显示数据方便步骤
                    /// <summary>
                    BandpixelInitialize bpi = new BandpixelInitialize();
                    bpi.Initialization(out bandstemp, showdata, ColumnCounts, LineCounts, bands);
                    imagestretch imst = new imagestretch(ColumnCounts, LineCounts, bands);
                    imst.HistogramMatch(this.BandsDataD, Form1.abl.Wins[WinN2].BandsDataD, Form1.abl.Wins[WinN2].bands);
                    StretchTemp = imst.getresult();
                    imst.LinearShow(bandstemp, StretchTemp);
                    /// <summary>
                    /// 显示图像
                    /// <summary>
                    pictureBox1.Refresh();
                    map = new Bitmap(pictureBox1.Width, pictureBox1.Height);
                    ImageShow ims = new ImageShow();
                    ims.showimage(bandstemp, ColumnCounts, LineCounts, bands, map);
                    pictureBox1.Image = map;
                }
            }
            isValue     = false;
            stretchtype = "HistogramMatch";
        }