Example #1
0
        private void projectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int[] HistY = new int[img.Height];
            int[] HistX = new int[img.Width];
            List <ComparingThread> ComparingList = new List <ComparingThread>();
            List <Thread>          ThreadList = new List <Thread>();
            int xMaxPos = 0, xMinPos = 0, yMaxPos = 0, yMinPos = 0;

            if (img == null) // protege de executar a função sem ainda ter aberto a imagem
            {
                return;
            }

            Cursor = Cursors.WaitCursor; // cursor relogio
            DateTime d1 = DateTime.Now;

            ImageClass.projection(img, HistX, HistY, out xMaxPos, out xMinPos, out yMaxPos, out yMinPos);

            HistogramXY histForm = new HistogramXY(HistX, "X");
            HistogramXY histForm2 = new HistogramXY(HistY, "Y");

            histForm.Show();
            histForm2.Show();


            ImageViewer.Image = img.Bitmap;
            ImageViewer.Refresh(); // atualiza imagem no ecrã
            DateTime d2 = DateTime.Now;

            Cursor = Cursors.Default; // cursor normal

            MessageBox.Show((d2 - d1).ToString());
        }
Example #2
0
File: MainForm.cs Project: jmdbo/SS
        private void projectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int[] HistY = new int[img.Height];
            int[] HistX = new int[img.Width];
            List<ComparingThread> ComparingList = new List<ComparingThread>();
            List<Thread> ThreadList = new List<Thread>();
            int xMaxPos = 0, xMinPos = 0, yMaxPos = 0, yMinPos = 0;

            if (img == null) // protege de executar a função sem ainda ter aberto a imagem
                return;

            Cursor = Cursors.WaitCursor; // cursor relogio
            DateTime d1 = DateTime.Now;

            ImageClass.projection(img, HistX, HistY, out xMaxPos, out xMinPos, out yMaxPos, out yMinPos);

            HistogramXY histForm = new HistogramXY(HistX, "X");
            HistogramXY histForm2 = new HistogramXY(HistY, "Y");

            histForm.Show();
            histForm2.Show();

            ImageViewer.Image = img.Bitmap;
            ImageViewer.Refresh(); // atualiza imagem no ecrã
            DateTime d2 = DateTime.Now;
            Cursor = Cursors.Default; // cursor normal

            MessageBox.Show((d2 - d1).ToString());
        }