예제 #1
0
        /// <summary>
        /// returns arbNumber many planes, sliced height wise, which have been averaged, subsampled and clock sorted.
        /// </summary>
        /// <param name="pc">PointCloud</param>
        /// <param name="arbNumber">int</param>
        /// <returns>Tuple(List(List(Point3D)),double)</returns>
        public static Tuple <List <List <Point3D> >, double> pullAll(PointCloud pc, int arbNumber)
        {
            double xmin = pc.getxMin();
            double xmax = pc.getxMax();
            double zmin = pc.getzMin();
            double zmax = pc.getzMax();

            double[] limits = { xmin, zmin, xmax, zmax };

            double ymin      = pc.getyMin();
            double ymax      = pc.getyMax();
            double increment = (ymax - ymin) / arbNumber;

            List <List <Point3D> > output = new List <List <Point3D> >();

            for (double i = ymin + (increment / 2); i <= ymax - (increment / 2); i = i + increment)
            {
                List <Point3D> plane = pc.getKDTree().getAllPointsAt(i, increment / 2, limits);

                plane = SubSampler.averageSubSample(plane, sampleNumber);
                plane = PointSorter.clockSort(plane);
                output.Add(plane);
            }

            return(Tuple.Create(output, increment));
        }
예제 #2
0
 /// <summary>
 /// iterates through the list and subsamples by factor and then averages factor many points together.
 /// </summary>
 /// <param name="input">List(Point3D)</param>
 /// <param name="factor">int</param>
 /// <returns>List(Point3D)</returns>
 public static List <Point3D> averageSubSample(List <Point3D> input, int factor)
 {
     return(SubSampler.averageSample(SubSampler.subSample(input, factor), factor));
 }
예제 #3
0
 /// <summary>
 /// iterates through the list and subsamples by subSampleFactor and then averages averageFactor many points together.
 /// </summary>
 /// <param name="input">List(Point3D)</param>
 /// <param name="factor">int</param>
 /// <returns>List(Point3D)</returns>
 public static List <Point3D> averageSubSample(List <Point3D> input, int subSampleFactor, int averageFactor)
 {
     return(SubSampler.averageSample(SubSampler.subSample(input, subSampleFactor), averageFactor));
 }