예제 #1
0
    public override void OnNodeUpdated()
    {
        Debug.Log("Multiplying...");

        var multiplyBy = this.GetInputValue("MultiplyBy", this.MultiplyBy);
        var values     = this.GetInputValue("Values", this.Values);

        this.Results = new EnumerableFloats(this.Mutliply(values.GetEnumerable(), multiplyBy));
    }
예제 #2
0
    public override void OnNodeUpdated()
    {
        Debug.Log("Updating Threshold...");

        var values    = this.GetInputValue("Values", this.Values);
        var threshold = this.GetInputValue("ThresholdValue", this.ThresholdValue);


        this.Results = new EnumerableFloats(this.DoThreshold(values.GetEnumerable(), threshold));
    }
예제 #3
0
    public override void OnNodeUpdated()
    {
        Debug.Log("Finding Extremas...");


        var values = this.GetInputValue("Values", this.Values);
        var width  = this.GetInputValue("Width", this.Width);
        var height = this.GetInputValue("Height", this.Height);

        this.Results = new EnumerableFloats(this.FindExtremas(values.GetEnumerable(), width, height));
    }
예제 #4
0
    public override void OnNodeUpdated()
    {
        Debug.Log("Subtracting...");

        var firstSet       = this.GetInputValue("FirstSet", this.FirstSet);
        var secondSet      = this.GetInputValue("SecondSet", this.SecondSet);
        var rescale        = this.GetInputValue("Rescale", this.Rescale);
        var absoluteValues = this.GetInputValue("AbsoluteValues", this.AbsoluteValues);

        this.Results = new EnumerableFloats(this.DoSubtraction(firstSet.GetEnumerable(), secondSet.GetEnumerable(), rescale, absoluteValues));
    }
예제 #5
0
    public override void OnNodeUpdated()
    {
        Debug.Log("Converting pixels to greyscale intensities...");

        var colors = this.GetInputValue <EnumerableColors>("RGBPixels");

        if (colors != null && colors.GetEnumerable() != null)
        {
            this.IntensityValues = new EnumerableFloats(this.GetGrayscaleValues(colors.GetEnumerable()));
        }
    }
예제 #6
0
    public override void OnNodeUpdated()
    {
        var xValues = this.GetInputValue <EnumerableFloats>("XValues");
        var yValues = this.GetInputValue <EnumerableFloats>("YValues");


        if (xValues != null && yValues != null)
        {
            var magnitudes = CalculateMagnitudes(xValues.GetEnumerable(), yValues.GetEnumerable());

            this.MagnitudeValues = new EnumerableFloats(magnitudes);
        }
    }
예제 #7
0
    public override void OnNodeUpdated()
    {
        var values    = this.GetInputValue("Values", this.Values);
        var width     = this.GetInputValue <int>("Width", this.Width);
        var height    = this.GetInputValue <int>("Height", this.Height);
        var doAverage = this.GetInputValue <bool>("Average", this.Average);
        var kernel    = this.GetInputValue <KernelValue>("Kernel", this.Kernel);

        if (values != null && values.GetEnumerable() != null)
        {
            Debug.Log("About to run kernel with doAverage: " + doAverage);

            this.Results = new EnumerableFloats(this.RunKernel(values.GetEnumerable(), width, height, kernel.Values, doAverage));
        }
    }
예제 #8
0
    public override void OnNodeUpdated()
    {
        Debug.LogError("Harris Node not finished!");

        var verticalEdges   = this.GetInputValue("VerticalEdges", this.VerticalEdges);
        var horizontalEdges = this.GetInputValue("HorizontalEdges", this.HorizontalEdges);


        if (verticalEdges != null && verticalEdges.GetEnumerable() != null && horizontalEdges != null && horizontalEdges.GetEnumerable() != null)
        {
            Debug.Log("About to run Harris Corner Detector!");

            this.Results = new EnumerableFloats(DetectCorners(horizontalEdges.GetEnumerable(), verticalEdges.GetEnumerable()));
        }
    }
예제 #9
0
    public override void OnNodeUpdated()
    {
        var width  = this.GetInputValue <int>("Width", this.Width);
        var height = this.GetInputValue <int>("Height", this.Height);
        var values = this.GetInputValue <EnumerableFloats>("Values", this.Values);
        var scale  = this.GetInputValue <int>("Scale", this.Scale);

        if (!this.IsPowerOfTwo(scale))
        {
            Debug.LogWarning("Scale must be a power of 2!");
        }

        this.Results = new EnumerableFloats(SubSample(values.GetEnumerable(), height, width, scale));

        this.NewHeight = height / scale;
        this.NewWidth  = width / scale;
    }