Example #1
0
        public FilterSizeElongationSparcityFloat64(FeatureGeneratorElementNode3DDouble generator, double[,] features,
                                                   double MinSize, double MaxSize,
                                                   double MinElongation, double MaxElongation,
                                                   double MinSparcity, double MaxSparcity)
        {
            filtered_nodes = new HashSet <int>();

            for (int node_index = 0; node_index < features.GetLength(0); node_index++)
            {
                double size       = features[node_index, generator.IndexSize];
                double elongation = features[node_index, generator.IndexElongation];
                double sparcity   = features[node_index, generator.IndexSparceness];
                if ((size < MinSize) || (MaxSize < size))
                {
                    filtered_nodes.Add(node_index);
                }
                else if ((elongation < MinElongation) || (MaxElongation < elongation))
                {
                    filtered_nodes.Add(node_index);
                }
                else if ((sparcity < MinSparcity) || (MaxSparcity < sparcity))
                {
                    filtered_nodes.Add(node_index);
                }
            }
        }
Example #2
0
 public MaxTreeFloat3DFeaturesDouble(IImageRaster <IRaster3DInteger, float> image, FeatureGeneratorElementNode3DDouble generator)
     : this(image, generator, null)
 {
 }
Example #3
0
 public MaxTreeFloat3DFeaturesDouble(IImageRaster <IRaster3DInteger, float> image, FeatureGeneratorElementNode3DDouble generator, IProgressReporter reporter)
 {
     this.raster         = image.Raster;
     this.inner_max_tree = new MaxTreeBuilderSingleQueue <float>().BuildMaxTree(image.GetElementValues(false), new ComparerNatural <float>(), new TopologyElementRaster3D6Connectivity(image.Raster), image.Raster.ElementCount);
     if (generator != null)
     {
         this.features = new double[inner_max_tree.NodeCount, generator.FeatureCount];
         generator.GenerateFeaturesTree(raster, inner_max_tree.BottomLevelNode, features);
     }
     else
     {
         this.features = null;
     }
 }