Ejemplo n.º 1
0
        private void btnApplyTransformation_Click(object sender, EventArgs e)
        {
            Transformation T = ICPTransformation.ComputeTransformation(Shape1, Shape2);

            MessageBox.Show("Cost = " + ICPTransformation.ComputeCost(Shape1, Shape2, T).ToString());
            List <Point> Shape2T = ApplyTransformation(T, Shape2);
            Pen          pBlue   = new Pen(Brushes.Blue, 1);
            Pen          pRed    = new Pen(Brushes.Red, 1);
            Graphics     g       = panShape2.CreateGraphics();

            DisplayShape(Shape1, pBlue, g);
            DisplayShape(Shape2T, pRed, g);
        }
Ejemplo n.º 2
0
        private void btnOutlierRemoval_Click(object sender, EventArgs e)
        {
            Transformation T       = ICPTransformation.ComputeTransformation(Shape1, Shape2);
            double         Cost    = ICPTransformation.ComputeCost(Shape1, Shape2, T);
            List <Point>   Shape2T = ApplyTransformation(T, Shape2);

            ComputeModel(Shape1, Shape2T);

            Transformation T2    = ICPTransformation.ComputeTransformation(Shape1, Shape2T);
            double         Cost2 = ICPTransformation.ComputeCost(Shape1, Shape2T, T2);

            MessageBox.Show("Cost = " + Cost2.ToString());
            List <Point> Shape2T2 = ApplyTransformation(T2, Shape2T);

            Pen      pBlue = new Pen(Brushes.Blue, 1);
            Pen      pRed  = new Pen(Brushes.Red, 1);
            Graphics g     = panShape3.CreateGraphics();

            DisplayShape(Shape1, pBlue, g);
            DisplayShape(Shape2T2, pRed, g);
        }