示例#1
0
        public void Reset()
        {
            instance = this;
            this.ICPSettings.ICPVersion          = ICP_VersionUsed.Scaling_Umeyama;
            this.ICPSettings.SimulatedAnnealing  = false;
            this.ICPSettings.Normal_RemovePoints = false;
            this.ICPSettings.Normal_SortPoints   = false;

            this.ICPSettings.FixedTestPoints           = false;
            this.ICPSettings.MaximumNumberOfIterations = 100;
            this.ICPSettings.ResetVertexToOrigin       = true;
            this.ICPSettings.DistanceOptimization      = false;
            this.ICPSettings.MaximumMeanDistance       = 1.0e-3f;
        }
        public void ICP_OnCurrentModels()
        {
            //convert Points
            if (this.OpenGLControl.GLrender.Models3D.Count > 1)
            {
                List <Vertex> myVertexReference   = this.OpenGLControl.GLrender.Models3D[0].VertexList;
                List <Vertex> myVertexToBeMatched = this.OpenGLControl.GLrender.Models3D[1].VertexList;


                ResetModelsToOrigin();

                IterativeClosestPointTransform icpSharp = new IterativeClosestPointTransform();
                List <Vertex> myVertexTransformed       = icpSharp.PerformICP(myVertexReference, myVertexToBeMatched);

                if (myVertexTransformed != null)
                {
                    //show result
                    Vertices.SetColorOfListTo(myVertexTransformed, 1, 0, 0, 1);
                    this.OpenGLControl.ShowPointCloud("IPC Solution", myVertexTransformed);
                }
            }
        }