Ejemplo n.º 1
0
        private void Clouds_ICP()
        {
            if (!GetFirstTwoCloudsFromOpenGLControl())
            {
                return;
            }



            //------------------
            //ICP
            ICPLib.IterativeClosestPointTransform icp = new ICPLib.IterativeClosestPointTransform();
            icp.Reset_RealData();

            icp.ICPSettings.ICPVersion = ICP_VersionUsed.Zinsser;
            icp.ICPSettings.MaximumNumberOfIterations = 50;


            PointCloud pointCloudResult = icp.PerformICP(this.pSource, this.pTarget);

            pointCloudResult.AddPointCloud(this.pTarget);
            SaveResultCloudAndShow(pointCloudResult);
            this.registrationMatrix = icp.Matrix;
            registrationMatrix.Save(GLSettings.Path + GLSettings.PathPointClouds, "registrationMatrix.txt");
        }
Ejemplo n.º 2
0
        private void Clouds_ICP()
        {
            if (!GetFirstTwoCloudsFromOpenGLControl())
            {
                return;
            }



            //------------------
            //ICP
            ICPLib.IterativeClosestPointTransform icpInstance = new ICPLib.IterativeClosestPointTransform();
            icpInstance.Settings_Reset_RealData();

            icpInstance.ICPSettings.ICPVersion = ICP_VersionUsed.Scaling_Zinsser;
            icpInstance.ICPSettings.MaximumNumberOfIterations = 50;
            //icpInstance.ICPSettings.KDTreeMode = KDTreeMode.Rednaxela_ExcludePoints;
            icpInstance.ICPSettings.KDTreeMode = KDTreeMode.Rednaxela;


            PointCloudVertices pointCloudResult = icpInstance.PerformICP(this.pSource.ToPointCloudVertices(), this.pTarget.ToPointCloudVertices());

            pointCloudResult.AddPointCloud(this.pTarget.ToPointCloudVertices());
            SaveResultCloudAndShow(pointCloudResult);
            this.registrationMatrix = icpInstance.Matrix;
            registrationMatrix.Save(GLSettings.PathModels, "registrationMatrix.txt");
        }
Ejemplo n.º 3
0
        private void testClouds_SecondIteration()
        {
            this.Cursor = Cursors.WaitCursor;

            ICPLib.IterativeClosestPointTransform icp = new ICPLib.IterativeClosestPointTransform();
            pTarget = icp.AlignCloudsFromDirectory_StartFirst(GLSettings.Path + GLSettings.PathPointClouds + "\\Nick\\Result", 10);
            SaveResultCloudAndShow(pTarget);

            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 4
0
        public void AlignFaces()
        {
            ICPLib.IterativeClosestPointTransform icp = new ICPLib.IterativeClosestPointTransform();
            //icp.ICPSettings.ShuffleEffect = true;
            icp.ICPSettings.MaximumNumberOfIterations  = 10;
            icp.ICPSettings.SingleSourceTargetMatching = true;

            icp.ICPSettings.ICPVersion = ICP_VersionUsed.NoScaling;
            icp.TakenAlgorithm         = true;
            FaceNew = icp.PerformICP(FaceCut, FaceNew);
        }
Ejemplo n.º 5
0
        private void testClouds_FirstIteration()
        {
            this.Cursor = Cursors.WaitCursor;

            ICPLib.IterativeClosestPointTransform icp = new ICPLib.IterativeClosestPointTransform();
            icp.ICPSettings.Prealign_PCA = true;

            pTarget = icp.AlignCloudsFromDirectory_StartFirst(GLSettings.Path + GLSettings.PathPointClouds + "\\Nick", 100);

            SaveResultCloudAndShow(pTarget);

            this.Cursor = Cursors.Default;


            //pTarget = icp.AlignCloudsFromDirectory(GLSettings.Path + GLSettings.PathModels + "\\Nick", 30);
            //pTarget = icp.AlignCloudsFromDirectory_StartLast(GLSettings.Path + GLSettings.PathModels + "\\Nick", 10);
        }
Ejemplo n.º 6
0
        private void testClouds()
        {
            ICPLib.IterativeClosestPointTransform icp = new ICPLib.IterativeClosestPointTransform();

            pTarget = null;

            for (int i = 0; i < 10; i++)
            {
                //first iteration
                if (pTarget == null)
                {
                    pTarget = PointCloud.FromObjFile(GLSettings.Path + GLSettings.PathPointClouds, "Nick\\PointCloudSequence#" + (i).ToString() + ".obj");
                }



                pSource = PointCloud.FromObjFile(GLSettings.Path + GLSettings.PathPointClouds, "Nick\\PointCloudSequence#" + (i + 1).ToString() + ".obj");

                //------------------
                //ICP

                icp.Reset_RealData();
                //icp.ICPSettings.ThresholdMergedPoints = 0f;
                icp.ICPSettings.MaximumNumberOfIterations = 15;


                pTarget = icp.PerformICP(pSource, this.pTarget);
                System.Diagnostics.Debug.WriteLine("###### ICP for point cloud: " + pTarget.Name + " - points added: " + icp.PointsAdded.ToString());


                //   this.registrationMatrix = icp.Matrix;
                //   registrationMatrix.Save(GLSettings.Path + GLSettings.PathPointClouds, "registrationMatrix.txt");
            }
            GlobalVariables.ShowLastTimeSpan("--> Time for ICP ");

            SaveResultCloudAndShow(pTarget);
        }