Exemple #1
0
        /// <summary>
        /// calculates a start solution set in total of "myNumberPoints" points
        /// </summary>
        /// <param name="pointsTargetSubset"></param>
        /// <param name="pointsSourceSubset"></param>
        /// <returns></returns>
        private static ICPSolution CalculateStartSolution(ref PointCloudVertices pointsSourceSubset, ref PointCloudVertices pointsTargetSubset, int myNumberPoints,
                                                          LandmarkTransform myLandmarkTranform, PointCloudVertices pointsTarget, PointCloudVertices pointsSource, int maxNumberOfIterations)
        {
            try
            {
                if (CheckSourceTarget(pointsTarget, pointsSource))
                {
                    return(null);
                }
                pointsTargetSubset = PointCloudVertices.CopyVertices(pointsTarget);
                pointsSourceSubset = PointCloudVertices.CopyVertices(pointsSource);

                ICPSolution res = IterateStartPoints(pointsSourceSubset, pointsTargetSubset, myNumberPoints, myLandmarkTranform, maxNumberOfIterations);
                if (res == null)
                {
                    System.Windows.Forms.MessageBox.Show("Could not find starting points for ICP Iteration - bad matching");
                    return(null);
                }
                PointCloudVertices.RemoveEntriesByIndices(ref pointsSourceSubset, ref pointsTargetSubset, res.RandomIndices);

                return(res);
            }
            catch (Exception err)
            {
                System.Windows.Forms.MessageBox.Show("Error in CalculateStartSolution of ICP: " + err.Message);
                return(null);
            }
        }