Exemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of <see cref="EdgeDetection"/>.
        /// </summary>
        /// <param name="strength">The Edge detection strength.</param>
        public EdgeDetection(EDStrength strength)
        {
            switch (strength)
            {
            case EDStrength.Low:
                Kernel = new double[KernelWidth, KernelHeight]
                {
                    { -1, 0, 1 },
                    { 0, 0, 0 },
                    { 1, 0, -1 }
                };
                break;

            case EDStrength.Medium:
                Kernel = new double[KernelWidth, KernelHeight]
                {
                    { 0, 1, 0 },
                    { 1, -4, 1 },
                    { 0, 1, 0 }
                };
                break;

            case EDStrength.High:
                Kernel = new double[KernelWidth, KernelHeight]
                {
                    { -1, -1, -1 },
                    { -1, 8, -1 },
                    { -1, -1, -1 }
                };
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of <see cref="EdgeDetection"/> processor used to apply Edge detection convolution.
        /// </summary>
        /// <param name="strength">The Edge detection strength.</param>
        public EdgeDetection(EDStrength strength)
        {
            switch (strength)
            {
            case EDStrength.Low:
                Kernel = LowStrengthKernel;
                break;

            case EDStrength.Medium:
                Kernel = MediumStrengthKernel;
                break;

            case EDStrength.High:
                Kernel = HighStrengthKernel;
                break;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new instance of <see cref="EdgeDetection"/> processor used to apply Edge detection convolution.
 /// </summary>
 /// <param name="strength">The Edge detection strength.</param>
 /// <param name="horizontalCellCount">The number of columns to divide the image into.</param>
 /// <param name="verticalCellCount">The number of rows to divide the image into.</param>
 public EdgeDetection(EDStrength strength, int horizontalCellCount, int verticalCellCount)
     : base(horizontalCellCount, verticalCellCount)
 {
     _kernelType = (int)strength;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of <see cref="EdgeDetection"/> processor used to apply Edge detection convolution.
 /// </summary>
 /// <param name="strength">The Edge detection strength.</param>
 public EdgeDetection(EDStrength strength)
     : base()
 {
     _kernelType = (int)strength;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a new instance of <see cref="MotionConfig"/>.
 /// </summary>
 /// <param name="sensitivity">The edge detection sensitivity.</param>
 /// <param name="recordDuration">The record duration.</param>
 /// <param name="threshold">The threshold.</param>
 public MotionConfig(EDStrength sensitivity, DateTime recordDuration, int threshold)
 {
     this.Sensitivity    = sensitivity;
     this.RecordDuration = recordDuration;
     this.Threshold      = threshold;
 }