Пример #1
0
        public void AdjustEdsFaceToModel_Ed1()
        {
            this.faceMatcher = new FaceMatcher();

            this.faceMatcher.LoadHumanoid(4);
            this.faceMatcher.LoadFace(this.pathModels + "\\FaceMatching", "EdFace1.obj");
            this.faceMatcher.Rotate_AdjustFaceDepth();
            this.faceMatcher.LoadSkeleton(this.pathModels + "\\FaceMatching", "EdJoints1.json");
            this.faceMatcher.UpdateModel_Joints();
            this.faceMatcher.CutFace();
            this.faceMatcher.Humanoid.ToJson(this.pathModels + "\\FaceMatching\\ModelWithoutFace1.json");

            this.faceMatcher.AdjustFaceToHumanoid();

            //PointCloud result = this.faceMatcher.MergeResultModelAndSave_FullFace(this.pathModels + "\\FaceMatching", "EdResult1.obj");
            PointCloud result = this.faceMatcher.MergeResultModelAndSave(this.pathModels + "\\FaceMatching", "EdResult1.obj");



            this.pointCloudSource = this.faceMatcher.Skeleton.PointCloud;
            this.pointCloudTarget = null;
            this.pointCloudResult = result;

            this.faceMatcher.SaveCutFace(this.pathModels + "\\FaceMatching\\CutFace1.json");
            this.faceMatcher.Humanoid.ToJson(this.pathModels + "\\FaceMatching\\ModelWithNewFace1.json");


            Show3PointCloudsInWindow(false);
        }
Пример #2
0
        public void AlignFace()
        {
            this.faceMatcher = new FaceMatcher();


            PointCloud faceCut  = PointCloud.FromJsonFile(this.pathModels + "\\FaceMatching\\CutFace2.json");
            PointCloud facenNew = PointCloud.FromObjFile(this.pathModels + "\\FaceMatching", "EdFace1.obj");

            facenNew.RotateDegrees(0, 180, 0);



            //this.faceMatcher.SaveCutFace(this.pathModels + "\\FaceMatching\\CutFace2.json");
            //this.faceMatcher.Humanoid.SaveVectors(this.pathModels + "\\FaceMatching\\ModelWithNewFace2.json");


            this.pointCloudSource = faceCut;
            this.pointCloudTarget = facenNew;

            //icp.ICPSettings.ShuffleEffect = true;
            icp.ICPSettings.MaximumNumberOfIterations  = 10;
            icp.ICPSettings.SingleSourceTargetMatching = true;

            icp.ICPSettings.ICPVersion = ICP_VersionUsed.NoScaling;
            icp.TakenAlgorithm         = true;
            pointCloudResult           = IterativeClosestPointTransform.Instance.PerformICP(pointCloudSource, pointCloudTarget);



            Show3PointCloudsInWindow(false);
        }