Esempio n. 1
0
        public static PointCloud FromPoints2d(List <System.Drawing.Point> pointList, PointCloud pointsTarget, List <System.Drawing.Point> pointOther)
        {
            PointCloud pointNew   = new PointCloud();
            bool       pointFound = false;

            for (int i = pointList.Count - 1; i >= 0; i--)
            {
                System.Drawing.Point pNew = pointList[i];
                for (int j = 0; j < pointsTarget.Count; j++)
                {
                    Vector3 p = pointsTarget.Vectors[j];
                    //add point only if it is found in the original point list
                    if (pNew.X == Convert.ToInt32(p[0]) && pNew.Y == Convert.ToInt32(p[1]))
                    {
                        pointFound = true;
                        pointNew.AddVector(p);
                        break;
                    }
                }
                //some error - have to check!
                if (!pointFound)
                {
                    System.Windows.Forms.MessageBox.Show("Error in identifying point from cloud with the stitched result: " + i.ToString());
                    pointOther.RemoveAt(i);
                }
            }
            return(pointNew);
        }