예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            pic1Copy = pic1.Clone();
            pic2Copy = pic2.Clone();
            Transformation.transformation(DNA1, DNA2, ref edgeMatch, ref centroid1, ref centroid2, ref angle);
            angle = angle * 180 / Math.PI;
            angle = -angle;
            Console.WriteLine(centroid1.ToString());
            Console.WriteLine(centroid2.ToString());
            Console.WriteLine(angle);
            mask1 = pic1Copy.Clone();
            mask2 = pic2Copy.Clone();
            ReturnColorImg result = Transformation.transformColor(pic1, mask1, pic2, mask2, joined, joined_mask, centroid1, centroid2, -angle + 180, p1Tweak, p2Tweak, blackOrWhite);

            joined = result.img;
            //pictureBox3.Image = result.img./*Resize(pictureBox1.Width, pictureBox1.Height, INTER.CV_INTER_LINEAR).*/ToBitmap();
            confidence          = edgeMatch.confidence;
            overlap             = result.overlap;
            ConfidenceView.Text = confidence.ToString();
            OverlapView.Text    = overlap.ToString();
            //AddMatchHistory();
            if (result.success)
            {
                DisplayImage dip = new DisplayImage(result.img, p1Tweak, p2Tweak, (int)overlap);
                dip.Show();
            }
            else
            {
                MessageBox.Show("You cannot tweak further in that direction");
            }
        }
 private void button2_Click(object sender, EventArgs e)
 {
     pic1Copy = pic1.Clone();
     pic2Copy = pic2.Clone();
     Transformation.transformation(DNA1, DNA2, ref edgeMatch, ref centroid1, ref centroid2, ref angle);
     angle = angle * 180 / Math.PI;
     angle = -angle;
     Console.WriteLine(centroid1.ToString());
     Console.WriteLine(centroid2.ToString());
     Console.WriteLine(angle);
     mask1 = pic1Copy.Clone();
     mask2 = pic2Copy.Clone();
     ReturnColorImg result = Transformation.transformColor(pic1, mask1, pic2, mask2, joined, joined_mask, centroid1, centroid2, -angle + 180, p1Tweak, p2Tweak,blackOrWhite);
     joined = result.img;
     //pictureBox3.Image = result.img./*Resize(pictureBox1.Width, pictureBox1.Height, INTER.CV_INTER_LINEAR).*/ToBitmap();
     confidence = edgeMatch.confidence;
     overlap = result.overlap;
     ConfidenceView.Text = confidence.ToString();
     OverlapView.Text = overlap.ToString();
     //AddMatchHistory();
     if (result.success)
     {
         DisplayImage dip = new DisplayImage(result.img, p1Tweak, p2Tweak, (int)overlap);
         dip.Show();
     }
     else
     {
         MessageBox.Show("You cannot tweak further in that direction");
     }
 }