internal static bool FindBestLine(List <Vector2d> acceptablePoints, FeatureImageSize size, out Vector2d start, out Vector2d stop)
        {
            const double    epsilon      = 5;
            List <Vector2d> uniquePoints = new List <Vector2d>();

            foreach (Vector2d point in acceptablePoints)
            {
                if (IsUnique(point, uniquePoints, epsilon) && HasAcceptableValues(point, size))
                {
                    uniquePoints.Add(point);
                }
            }

            if (uniquePoints.Count < 2)
            {
                start = stop = new Vector2d();
                return(false);
            }

            if (uniquePoints.Count > 2)
            {
                FindMostDistantPoints(uniquePoints, out start, out stop);
                return(true);
            }

            start = uniquePoints[0];
            stop  = uniquePoints[1];
            return(true);
        }
 public FeatureExtractor()
 {
     // Setting up the divisions to respond when changed
     line3DCollection  = new Line3DCollection();
     limited2dLines    = new LimitedLine2DCollection();
     gridDivision      = new GridDivision(this);
     imageSize         = new FeatureImageSize(this);
     margin            = new FeatureMargin(this);
     fieldOfViews      = new FieldOfViews(this);
     planeCollection   = new PlaneClusterCollection(this);
     coordinateMatcher = new CoordinateMatcher(this);
 }
        private static bool HasAcceptableValues(Vector2d point, FeatureImageSize size)
        {
            const double epsilon = 1;

            return(point.X >= -epsilon && point.X <= size.Width + epsilon && point.Y >= -epsilon && point.Y <= size.Height + epsilon);
        }