Emgu.CV.CvInvoke.cvCalcMotionGradient C# (CSharp) Метод

cvCalcMotionGradient() приватный Метод

private cvCalcMotionGradient ( IntPtr mhi, IntPtr mask, IntPtr orientation, double delta1, double delta2, int apertureSize ) : void
mhi IntPtr
mask IntPtr
orientation IntPtr
delta1 double
delta2 double
apertureSize int
Результат void
        public static extern void cvCalcMotionGradient(
          IntPtr mhi,
          IntPtr mask,
          IntPtr orientation,
          double delta1,
          double delta2,
          int apertureSize);

Usage Example

Пример #1
0
        /// <summary>
        /// Update the motion history with the specific image and the specific timestamp
        /// </summary>
        /// <param name="foregroundMask">The foreground of the image to be added to history</param>
        /// <param name="timestamp">The time when the image is captured</param>
        public void Update(Image <Gray, Byte> foregroundMask, DateTime timestamp)
        {
            _lastTime = timestamp;
            TimeSpan ts = _lastTime.Subtract(_initTime);

            _foregroundMask = foregroundMask;
            if (_mhi == null)
            {
                _mhi = new Image <Gray, float>(foregroundMask.Size);
            }
            if (_mask == null)
            {
                _mask = foregroundMask.CopyBlank();
            }
            if (_orientation == null)
            {
                _orientation = new Image <Gray, float>(foregroundMask.Size);
            }

            CvInvoke.cvUpdateMotionHistory(foregroundMask.Ptr, _mhi, ts.TotalSeconds, _mhiDuration);
            double scale = 255.0 / _mhiDuration;

            CvInvoke.cvConvertScale(_mhi.Ptr, _mask.Ptr, scale, (_mhiDuration - ts.TotalSeconds) * scale);

            CvInvoke.cvCalcMotionGradient(_mhi.Ptr, _mask.Ptr, _orientation.Ptr, _maxTimeDelta, _minTimeDelta, 3);
        }
CvInvoke