Example #1
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");
        }
Example #2
0
        private void Clouds_AlignPCAAxes()
        {
            if (!GetFirstTwoCloudsFromOpenGLControl())
            {
                return;
            }



            PointCloudVertices pointCloudTarget = PointCloudVertices.FromPointCloud(this.pSource);

            pointCloudTarget = PCA.RotateToOriginAxes(pointCloudTarget);


            PointCloudVertices pointCloudSource = PointCloudVertices.FromPointCloud(this.pTarget);

            PointCloudVertices pointCloudResult = PCA.RotateToOriginAxes(pointCloudSource);

            pResult = pointCloudResult.ToPointCloud();
            //pResult.SetColor(new OpenTK.Vector3(1, 0, 0));

            pointCloudResult.AddPointCloud(this.pTarget.ToPointCloudVertices());
            SaveResultCloudAndShow(pointCloudResult);
            //DisplayResultPointCloud();
            //DisplayObjects();
        }
Example #3
0
        private void Clouds_PCA()
        {
            if (!GetFirstTwoCloudsFromOpenGLControl())
            {
                return;
            }


            PCA pca = new PCA();

            pca.MaxmimumIterations = 1;
            PointCloudVertices pointCloudResult = pca.AlignPointClouds_SVD(this.pSource.ToPointCloudVertices(), this.pTarget.ToPointCloudVertices());

            pointCloudResult.AddPointCloud(this.pTarget.ToPointCloudVertices());

            SaveResultCloudAndShow(pointCloudResult);
            this.registrationMatrix = pca.Matrix;
            registrationMatrix.Save(GLSettings.PathModels, "registrationMatrix.txt");
        }