Example #1
0
        public static Matrix4 TryoutPointsSA(PointCloud pointsTarget, PointCloud pointsSource, ICPSolution res, LandmarkTransform myLandmarkTransform)
        {
            //transform:
            MathUtilsVTK.FindTransformationMatrix(res.PointsSource, res.PointsTarget, myLandmarkTransform);//, accumulate);

            res.Matrix = myLandmarkTransform.Matrix;

            return(res.Matrix);
        }
Example #2
0
        public static Matrix4d TryoutPoints(PointCloudVertices pointsTarget, PointCloudVertices pointsSource, ICPSolution res, LandmarkTransform myLandmarkTransform)
        {
            res.PointsTarget = RandomUtils.ExtractPoints(pointsTarget, res.RandomIndices);
            res.PointsSource = RandomUtils.ExtractPoints(pointsSource, res.RandomIndices);

            //transform:
            MathUtilsVTK.FindTransformationMatrix(PointCloudVertices.ToVectors(res.PointsSource), PointCloudVertices.ToVectors(res.PointsTarget), myLandmarkTransform);//, accumulate);

            res.Matrix = myLandmarkTransform.Matrix;

            return(res.Matrix);
        }
Example #3
0
        private Matrix4 Helper_FindTransformationMatrixOld(PointCloud pointsSource, PointCloud pointsTarget)
        {
            Matrix4 myMatrix;

            if (ICPSettings.ICPVersion == ICP_VersionUsed.Horn)
            {
                MathUtilsVTK.FindTransformationMatrix(pointsSource, pointsTarget, this.LandmarkTransform);
                myMatrix = LandmarkTransform.Matrix;
            }
            else
            {
                myMatrix = SVD_Float.FindTransformationMatrix(pointsSource, pointsTarget, ICPSettings.ICPVersion);
            }
            return(myMatrix);
        }
Example #4
0
        private Matrix4d Helper_FindTransformationMatrix(PointCloudVertices pointsSource, PointCloudVertices pointsTarget)
        {
            Matrix4d myMatrix;

            if (ICPSettings.ICPVersion == ICP_VersionUsed.Horn)
            {
                MathUtilsVTK.FindTransformationMatrix(PointCloudVertices.ToVectors(pointsSource), PointCloudVertices.ToVectors(pointsTarget), this.LandmarkTransform);
                myMatrix = LandmarkTransform.Matrix;
            }
            else
            {
                myMatrix = SVD.FindTransformationMatrix(PointCloudVertices.ToVectors(pointsSource), PointCloudVertices.ToVectors(pointsTarget), ICPSettings.ICPVersion);
            }
            return(myMatrix);
        }
Example #5
0
        private static Matrix4d TryoutNewPoint(int iPoint, PointCloudVertices pointsTarget, PointCloudVertices pointsSource, PointCloudVertices pointsTargetTrial, PointCloudVertices pointsSourceTrial, LandmarkTransform myLandmarkTransform)
        {
            Vertex p1 = pointsTarget[iPoint];
            Vertex p2 = pointsSource[iPoint];

            pointsTargetTrial.Add(p1);
            pointsSourceTrial.Add(p2);



            MathUtilsVTK.FindTransformationMatrix(PointCloudVertices.ToVectors(pointsSourceTrial), PointCloudVertices.ToVectors(pointsTargetTrial), myLandmarkTransform);//, accumulate);

            Matrix4d myMatrix = myLandmarkTransform.Matrix;


            return(myMatrix);
        }
Example #6
0
        private static Matrix4 TryoutNewPoint(int iPoint, PointCloud pointsTarget, PointCloud pointsSource, PointCloud pointsTargetTrial, PointCloud pointsSourceTrial, LandmarkTransform myLandmarkTransform)
        {
            Vector3 p1 = pointsTarget.Vectors[iPoint];
            Vector3 p2 = pointsSource.Vectors[iPoint];


            pointsTargetTrial.AddVector(p1);
            pointsSourceTrial.AddVector(p2);



            MathUtilsVTK.FindTransformationMatrix(pointsSourceTrial, pointsTargetTrial, myLandmarkTransform);//, accumulate);

            Matrix4 myMatrix = myLandmarkTransform.Matrix;


            return(myMatrix);
        }
Example #7
0
        private Matrix4 Helper_FindTransformationMatrix(PointCloud resultKDTree)
        {
            Matrix4 myMatrix;

            if (ICPSettings.ICPVersion == ICP_VersionUsed.Horn)
            {
                MathUtilsVTK.FindTransformationMatrix(pointsSource, resultKDTree, this.LandmarkTransform);
                myMatrix = LandmarkTransform.Matrix;
            }
            else
            {
                if (ICPSettings.IgnoreFarPoints)
                {
                    myMatrix = SVD.FindTransformationMatrix_MinimumDistance(pointsSource, resultKDTree, ICPSettings.ICPVersion, this.MeanDistance).ToMatrix4();
                }
                else
                {
                    myMatrix = SVD.FindTransformationMatrix(pointsSource, resultKDTree, ICPSettings.ICPVersion).ToMatrix4();
                }
            }
            return(myMatrix);
        }