Пример #1
0
        private bool initICP()
        {
            if (TWO_MESHS_sourceObj == null || TWO_MESHS_targetObj == null)
            {
                Form_ICPMeshSelection form_Selection = new Form_ICPMeshSelection(geometryRoot);
                if (form_Selection.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
                TWO_MESHS_sourceObj = geometryRoot[form_Selection.source];
                TWO_MESHS_targetObj = geometryRoot[form_Selection.target];

                SVDLoops = form_Selection.SVDLoops;

                SourceSamples = form_Selection.SourceSamples;
                TargetSamples = form_Selection.TargetSamples;
            }


            TWO_MESHS_sourceObj.Transform = new Transform();
            TWO_MESHS_targetObj.Transform = new Transform();

            inputMat_source = TWO_MESHS_sourceObj.ToSampledDataMat(SourceSamples);
            inputMat_target = TWO_MESHS_targetObj.ToSampledDataMat(TargetSamples);

            //checkMat_source = TWO_MESHS_sourceObj.ToSampledDataMat(NCheck);
            //checkMat_target = TWO_MESHS_targetObj.ToSampledDataMat(NCheck);

            PCATrans_source = Utils_PCA.DoPCA(inputMat_source);
            PCATrans_target = Utils_PCA.DoPCA(inputMat_target);

            //PCATrans_source = correctPCATransform(inputMat_source, inputMat_target, PCATrans_source, PCATrans_target);

            PCA_InvTransMat_source = PCATrans_source.GetMatrix().Inverse() as DenseMatrix;

            PCA_TransMat_target    = PCATrans_target.GetMatrix();
            PCA_InvTransMat_target = PCA_TransMat_target.Inverse() as DenseMatrix;

            inputMat_source = PCA_InvTransMat_source * inputMat_source;
            inputMat_target = PCA_InvTransMat_target * inputMat_target;

            errList = new List <double>();

            SVD_TransMat = DenseMatrix.CreateIdentity(4);

            return(true);
        }
Пример #2
0
        private void resetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_ICPMeshSelection form_Selection = new Form_ICPMeshSelection(geometryRoot);

            form_Selection.DisableSVD();
            if (form_Selection.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            TWO_MESHS_sourceObj = geometryRoot[form_Selection.source];
            TWO_MESHS_targetObj = geometryRoot[form_Selection.target];

            TWO_MESHS_sourceObj.Transform = new Transform();
            TWO_MESHS_targetObj.Transform = new Transform();

            displayMode = DisplayMode.TWO_MESHS;
        }