public MorphologyFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Morphology;
            SourceType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            IntPropertys["Kern"] = new NumProperty <int>()
            {
                Value = 1, MaxVal = 7, MinVal = 1
            };

            IntPropertys["Count"] = new NumProperty <int>()
            {
                Value = 1, MaxVal = 7, MinVal = 1
            };


            EnumPropertys["Type"] = new EnumProperty(typeof(MorphologyEnum));
            EnumPropertys["Type"].Set("Erode");

            EnumPropertys["KernType"] = new EnumProperty(typeof(ElementShape));
            EnumPropertys["KernType"].Set("Ellipse");
        }
        public MergeInSrcFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Merge;
            SourceType = new DataType()
            {
                Source = true, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                Source = true, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            FloatPropertys["Src1"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0.5
            };
            FloatPropertys["Src2"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0.5
            };
            FloatPropertys["Gamma"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0
            };

            IntPropertys["Src1ID"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 0
            };
            IntPropertys["Src2ID"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 1
            };
        }
        public ResizeAbsFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.ResizeAbs;
            SourceType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            IntPropertys["Width"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 320
            };
            IntPropertys["Height"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 240
            };

            FloatPropertys["fx"] = new NumProperty <double>()
            {
                MaxVal = 4096, MinVal = 0, Value = 0
            };
            FloatPropertys["fy"] = new NumProperty <double>()
            {
                MaxVal = 4096, MinVal = 0, Value = 0
            };

            EnumPropertys["Inter"] = new EnumProperty(typeof(Inter));
            EnumPropertys["Inter"].Set("Area");
        }
Exemple #4
0
        public GradientFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Gradient;
            SourceType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };


            EnumPropertys["Type"] = new EnumProperty(typeof(GradientEnum));
            EnumPropertys["Type"].Set("Sobel");

            IntPropertys["Kern"] = new NumProperty <int>()
            {
                Value = 1, MaxVal = 7, MinVal = 1
            };

            IntPropertys["Low"] = new NumProperty <int>()
            {
                Value = 0, MaxVal = 255, MinVal = 0
            };
            IntPropertys["Hight"] = new NumProperty <int>()
            {
                Value = 255, MaxVal = 255, MinVal = 0
            };
        }
        public CreateBgrFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type       = FilterType.BGRBlank;
            SourceType = new DataType()
            {
                Source = true
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            EnumPropertys["FreeMode"] = new EnumProperty(typeof(FilterLogicMode));

            IntPropertys["Width"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 320
            };
            IntPropertys["Height"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 240
            };

            IntPropertys["Red"] = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
            IntPropertys["Green"] = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
            IntPropertys["Blue"] = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
        }
        private List <double[, ]> histogramsResults = new List <double[, ]>(); // чтобы не пересчитывать гистограммы на каждый чих, буду делать это
                                                                               // только на bReqFullUpdate

        public HistogramFilter(GraphFilter graph, string name) : base(graph, name)
        {
            Type = FilterType.Histogram;

            IntPropertys["x_show"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };
            IntPropertys["y_show"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            FloatPropertys["scaleX"] = new NumProperty <double>()
            {
                MinVal = 0.1, MaxVal = 5, Value = 1
            };
            FloatPropertys["scaleY"] = new NumProperty <double>()
            {
                MinVal = 0.001, MaxVal = 1, Value = 0.1
            };

            EnumPropertys["MovingType"] = new EnumProperty(typeof(MovingPredictType));
            IntPropertys["MovingRange"] = new NumProperty <int>()
            {
                MinVal = 1, MaxVal = 10, Value = 1
            };
        }
Exemple #7
0
        public SelectSingleContourFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourSingleSelect;
            EnumPropertys["DrawOn"]       = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["BoundingRect"] = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["SelectMode"]   = new EnumProperty(typeof(FilterSelectMode));

            IntPropertys["X"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            IntPropertys["Y"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };


            EnumPropertys["FillMode"] = new EnumProperty(typeof(FillDrawModeEnum));
            IntPropertys["Red"]       = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
            IntPropertys["Green"] = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
            IntPropertys["Blue"] = new NumProperty <int>()
            {
                MaxVal = 255, MinVal = 0, Value = 0
            };
        }
Exemple #8
0
        public RectDataAddFilter(GraphFilter graph, string name) : base(graph, name)
        {
            Type = FilterType.AddRect;
            EnumPropertys["DrawOn"] = new EnumProperty(typeof(FilterDrawMode));
            IntPropertys["Color"]   = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 0
            };

            IntPropertys["x"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };
            IntPropertys["y"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };

            IntPropertys["width"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };
            IntPropertys["height"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };

            EnumPropertys["PixelSumCenter"] = new EnumProperty(typeof(FilterLogicMode));
            EnumPropertys["PixelSumCenter"].Set("Off");
        }
        public ThresholdFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Threshold;
            SourceType = new DataType()
            {
                channels = 1, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 1, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            EnumPropertys["Type"] = new EnumProperty(typeof(ThresholdEnum));
            EnumPropertys["Type"].Set("Binary");

            IntPropertys["Threshold"] = new NumProperty <int>()
            {
                Value = 0, MaxVal = 255, MinVal = 0
            };
            IntPropertys["ValueSet"] = new NumProperty <int>()
            {
                Value = 0, MaxVal = 255, MinVal = 0
            };

            IntPropertys["Kern"] = new NumProperty <int>()
            {
                Value = 1, MaxVal = 7, MinVal = 1
            };
            IntPropertys["SubtractedFromMean"] = new NumProperty <int>()
            {
                Value = 0, MaxVal = 255, MinVal = 0
            };
        }
Exemple #10
0
        public RectShiftFilter(GraphFilter graph, string name) : base(graph, name)
        {
            Type = FilterType.RectShift;
            EnumPropertys["DrawOn"] = new EnumProperty(typeof(FilterDrawMode));
            IntPropertys["Color"]   = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 0
            };

            IntPropertys["ShiftX"] = new NumProperty <int>()
            {
                MinVal = -2048, MaxVal = 2048, Value = 0
            };
            IntPropertys["ShiftY"] = new NumProperty <int>()
            {
                MinVal = -2048, MaxVal = 2048, Value = 0
            };

            if (graph != null)
            {
                var names = graph.GetAddedNames();
                EnumPropertys["DrawSource"] = new EnumProperty(names);

                if (names.Length > 0)
                {
                    EnumPropertys["DrawSource"].Set(names[names.Length - 1]);
                }
            }
        }
Exemple #11
0
        public ContourSortFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourSort;

            EnumPropertys["DrawOn"]   = new EnumProperty(typeof(FilterDrawMode));
            IntPropertys["Thickness"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 3
            };
            EnumPropertys["BoundingRect"]   = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["CenterDrawMode"] = new EnumProperty(typeof(CenterDrawMode));
            EnumPropertys["FillMode"]       = new EnumProperty(typeof(FillDrawModeEnum));

            EnumPropertys["Histogram"] = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["Histogram"].Set("Hide");

            FloatPropertys["MinArea"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 50000, Value = 0
            };
            FloatPropertys["MaxArea"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 50000, Value = 50000
            };

            FloatPropertys["MinPerimeter"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 50000, Value = 0
            };
            FloatPropertys["MaxPerimeter"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 50000, Value = 50000
            };

            IntPropertys["MinHeight"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };
            IntPropertys["MaxHeight"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 4096
            };

            IntPropertys["MinWidth"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 0
            };
            IntPropertys["MaxWidth"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 4096
            };
        }
Exemple #12
0
        public ContourShiftFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourShift;
            EnumPropertys["DrawOn"]       = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["BoundingRect"] = new EnumProperty(typeof(FilterDrawMode));

            IntPropertys["ShiftX"] = new NumProperty <int>()
            {
                MinVal = -2048, MaxVal = 2048, Value = 0
            };
            IntPropertys["ShiftY"] = new NumProperty <int>()
            {
                MinVal = -2048, MaxVal = 2048, Value = 0
            };
        }
        public SplitFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type       = FilterType.Split;
            SourceType = new DataType()
            {
                Source = true
            };
            DestinationType = new DataType()
            {
                Source = true
            };

            IntPropertys["Count"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 1, Value = 1
            };
        }
        public BlurFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Blur;
            SourceType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            IntPropertys["Kern"] = new NumProperty <int>()
            {
                Value = 1, MaxVal = 7, MinVal = 1
            };
            EnumPropertys["Type"] = new EnumProperty(typeof(BlurEnum));
            EnumPropertys["Type"].Set("Gaussian");
        }
        public ResizeFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type       = FilterType.Resize;
            SourceType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                channels = 3, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            FloatPropertys["Scale"] = new NumProperty <double>()
            {
                MaxVal = 1000, MinVal = 0, Value = 1
            };

            EnumPropertys["Inter"] = new EnumProperty(typeof(Inter));
            EnumPropertys["Inter"].Set("Area");
        }
        public SelectFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type       = FilterType.Select;
            SourceType = new DataType()
            {
                Source = true
            };
            DestinationType = new DataType()
            {
                Source = true
            };

            IntPropertys["SourcesID"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 0
            };
            IntPropertys["OutID"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 0
            };
        }
        private List <double> pixelSumResults = new List <double>(); // пересчитывается только на bReqFullUpdate = !m_isSelfClearOut || (pixelSumResults.Count == 0)

        public PixelSumFilter(GraphFilter graph, string name) : base(graph, name)
        {
            Type = FilterType.PixelSum;
            EnumPropertys["Draw"] = new EnumProperty(typeof(FilterDrawMode));
            IntPropertys["y"]     = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 30
            };

            IntPropertys["r"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 255
            };
            IntPropertys["g"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 0
            };
            IntPropertys["b"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 255, Value = 0
            };
        }
        public string GetPropertyStr()
        {
            string ans = "";

            foreach (var nProp in IntPropertys)
            {
                NumProperty <int> prop = nProp.Value;
                ans += nProp.Key + "=" + prop.Value.ToString() + "\n";
            }

            foreach (var nProp in FloatPropertys)
            {
                NumProperty <double> prop = nProp.Value;
                ans += nProp.Key + "=" + prop.Value.ToString() + "\n";
            }

            foreach (var nProp in TablePropertys)
            {
                ans += nProp.Key + ":\n" + nProp.ToString() + "\n";
            }

            foreach (var nProp in EnumPropertys)
            {
                EnumProperty prop = nProp.Value;
                ans += nProp.Key + "=" + prop.ToString() + "\n";
            }

            foreach (var nProp in FilePropertys)
            {
                ans += nProp.Key + "= '" + nProp.Value + "'\n";
            }

            foreach (var nProp in DataPropertys)
            {
                ans += nProp.Key + "=" + nProp.Value.ToString() + "\n";
            }

            return(ans);
        }
Exemple #19
0
        public ContourSearchFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourSearch;
            EnumPropertys["DrawOn"]   = new EnumProperty(typeof(FilterDrawMode));
            IntPropertys["Thickness"] = new NumProperty <int>()
            {
                MaxVal = 10, MinVal = 0, Value = 3
            };
            EnumPropertys["BoundingRect"]   = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["CenterDrawMode"] = new EnumProperty(typeof(CenterDrawMode));
            EnumPropertys["FillMode"]       = new EnumProperty(typeof(FillDrawModeEnum));

            EnumPropertys["Histogram"] = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["Histogram"].Set("Hide");


            EnumPropertys["SourceMode"] = new EnumProperty(typeof(SourceDrawModeEnum));
            if (graph != null)
            {
                EnumPropertys["DrawSource"] = new EnumProperty(graph.GetAddedNames());
            }
        }
        public RotationFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type = FilterType.Rotation;
            FloatPropertys["Deg"] = new NumProperty <double>()
            {
                MaxVal = 360, MinVal = 0, Value = 0
            };
            FloatPropertys["Scale"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = 0, Value = 1
            };

            FloatPropertys["xc"] = new NumProperty <double>()
            {
                MaxVal = 1, MinVal = 0, Value = 0.5
            };
            FloatPropertys["yc"] = new NumProperty <double>()
            {
                MaxVal = 1, MinVal = 0, Value = 0.5
            };


            IntPropertys["NewSize"] = new NumProperty <int>()
            {
                MaxVal = 1, MinVal = 0, Value = 0
            };
            IntPropertys["Width"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 320
            };
            IntPropertys["Height"] = new NumProperty <int>()
            {
                MaxVal = 4096, MinVal = 0, Value = 240
            };

            EnumPropertys["Inter"] = new EnumProperty(typeof(Inter));
            EnumPropertys["Inter"].Set("Area");
        }
Exemple #21
0
        public ContourAreaSelectFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourAreaSelect;
            EnumPropertys["DrawOn"]       = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["BoundingRect"] = new EnumProperty(typeof(FilterDrawMode));

            IntPropertys["X"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            IntPropertys["Y"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            IntPropertys["SizeX"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            IntPropertys["SizeY"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
        }
        public MergeFilter(GraphFilter graph = null, string name = null) : base(graph, name)
        {
            Type       = FilterType.Merge;
            SourceType = new DataType()
            {
                Source = true, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };
            DestinationType = new DataType()
            {
                Source = true, depth = Emgu.CV.CvEnum.DepthType.Cv8U
            };

            FloatPropertys["Alpha"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0.5
            };
            FloatPropertys["Beta"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0.5
            };
            FloatPropertys["Gamma"] = new NumProperty <double>()
            {
                MaxVal = 10, MinVal = -10, Value = 0
            };


            if (graph != null)
            {
                EnumPropertys["BetaSource"] = new EnumProperty(graph.GetAddedNames());
            }

            //IntPropertys["SourcesID"] = new NumProperty<int>() { MaxVal = 10, MinVal = 0, Value = 0 };
            //IntPropertys["OutID"] = new NumProperty<int>() { MaxVal = 10, MinVal = 0, Value = 0 };

            FilePropertys["BetaFileImg"] = new FileInfo("");
        }
Exemple #23
0
        public RectExportFilter(GraphFilter graph, string name) : base(graph, name)
        {
            Type = FilterType.RectExport;
            EnumPropertys["DrawOn"]     = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["ExportMode"] = new EnumProperty(typeof(RectExportMode));

            IntPropertys["AbsWidth"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };
            IntPropertys["AbsHeight"] = new NumProperty <int>()
            {
                MinVal = 0, MaxVal = 4096, Value = 100
            };

            FloatPropertys["ScaleWidth"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 20, Value = 1
            };
            FloatPropertys["ScaleHeight"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 20, Value = 1
            };
        }
Exemple #24
0
        public ToAraundContourFilter(GraphFilter graph, string name = null) : base(graph, name)
        {
            Type = FilterType.ContourAraund;
            EnumPropertys["DrawOn"]       = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["BoundingRect"] = new EnumProperty(typeof(FilterDrawMode));
            EnumPropertys["FillMode"]     = new EnumProperty(typeof(FillDrawModeEnum));

            EnumPropertys["CenterMode"] = new EnumProperty(typeof(CenterDrawMode));
            IntPropertys["HScale"]      = new NumProperty <int>()
            {
                MinVal = 1, MaxVal = 50, Value = 1
            };
            FloatPropertys["RScale"] = new NumProperty <double>()
            {
                MinVal = 0, MaxVal = 2, Value = 1
            };


            EnumPropertys["MovingType"] = new EnumProperty(typeof(MovingPredictType));
            IntPropertys["MovingRange"] = new NumProperty <int>()
            {
                MinVal = 1, MaxVal = 10, Value = 1
            };
        }