Example #1
0
        public static double Test7_Face_KnownTransformation_PCA_15000(ref PointCloudVertices myPCLTarget, ref PointCloudVertices myPCLSource, ref PointCloudVertices myPCLResult)
        {
            string path          = AppDomain.CurrentDomain.BaseDirectory + "Models\\UnitTests";
            Model  model3DTarget = new Model(path + "\\KinectFace_1_15000.obj");

            myPCLTarget = model3DTarget.PointCloudVertices;

            myPCLSource = PointCloudVertices.CloneVertices(myPCLTarget);


            PointCloudVertices.ScaleByFactor(myPCLSource, 0.9f);
            Matrix3d R = new Matrix3d();

            R = R.RotationXYZDegrees(60, 60, 60);
            PointCloudVertices.Rotate(myPCLSource, R);
            PointCloudVertices.Translate(myPCLSource, 0.3f, 0.5f, -0.4f);

            PCA pca = new PCA();

            myPCLResult = pca.AlignPointClouds_SVD(myPCLSource, myPCLTarget);
            myPCLSource = myPCLResult;

            myPCLResult = IterativeClosestPointTransform.Instance.PerformICP(myPCLSource, myPCLTarget);
            return(IterativeClosestPointTransform.Instance.MeanDistance);
        }
Example #2
0
        public static double Test5_CubeScale_Uniform(ref PointCloudVertices myPCLTarget, ref PointCloudVertices myPCLSource, ref PointCloudVertices myPCLResult)
        {
            myPCLTarget = PointCloudVertices.CreateCube_Corners(50);

            myPCLSource = PointCloudVertices.CloneVertices(myPCLTarget);
            PointCloudVertices.ScaleByFactor(myPCLSource, 0.2f);

            myPCLResult = IterativeClosestPointTransform.Instance.PerformICP(myPCLSource, myPCLTarget);
            return(IterativeClosestPointTransform.Instance.MeanDistance);
        }
Example #3
0
        public static double Test10_Cube8pRotateTranslateScaleShuffle(ref PointCloudVertices myPCLTarget, ref PointCloudVertices myPCLSource, ref PointCloudVertices myPCLResult, float cubeSize)
        {
            myPCLTarget = PointCloudVertices.CreateCube_RegularGrid_Empty(cubeSize, 1);
            myPCLSource = PointCloudVertices.CloneVertices(myPCLTarget);

            PointCloudVertices.Translate(myPCLSource, cubeSize * 1.2f, -cubeSize * 2.5f, cubeSize * 2);
            PointCloudVertices.ScaleByFactor(myPCLSource, 0.2f);
            Matrix3d R = CreateAndPrintMatrix(65, -123, 35);

            PointCloudVertices.Rotate(myPCLSource, R);

            PointCloudVertices.ShuffleTest(myPCLSource);


            myPCLResult = IterativeClosestPointTransform.Instance.PerformICP(myPCLSource, myPCLTarget);
            return(IterativeClosestPointTransform.Instance.MeanDistance);
        }
Example #4
0
        public static double Test6_Bunny(ref PointCloudVertices myPCLTarget, ref PointCloudVertices myPCLSource, ref PointCloudVertices myPCLResult)
        {
            string path = AppDomain.CurrentDomain.BaseDirectory + "TestData";

            Model model3DTarget = new Model(path + "\\bunny.obj");

            myPCLTarget = model3DTarget.PointCloudVertices;


            myPCLSource = PointCloudVertices.CloneVertices(myPCLTarget);

            PointCloudVertices.Translate(myPCLSource, -0.15f, 0.05f, 0.02f);
            Matrix3d R = new Matrix3d();

            R = R.RotationXYZDegrees(30, 30, 30);
            PointCloudVertices.Rotate(myPCLSource, R);
            PointCloudVertices.ScaleByFactor(myPCLSource, 0.8f);


            myPCLResult = IterativeClosestPointTransform.Instance.PerformICP(myPCLSource, myPCLTarget);

            return(IterativeClosestPointTransform.Instance.MeanDistance);
        }