src/Foundation/Media/Gimela.Media.Vision.Motion/MotionProcessors/BlobCountingObjectsProcessing.cs
/// <summary>
/// Process video and motion frames doing further post processing after
/// performed motion detection.
/// </summary>
/// 
/// <param name="videoFrame">Original video frame.</param>
/// <param name="motionFrame">Motion frame provided by motion detection
/// algorithm (see <see cref="IMotionDetector"/>).</param>
/// 
/// <remarks><para>Processes provided motion frame and counts number of separate
/// objects, which size satisfies <see cref="MinObjectsWidth"/> and <see cref="MinObjectsHeight"/>
/// properties. In the case if <see cref="HighlightMotionRegions"/> property is
/// set to <see langword="true"/>, the found object are also highlighted on the
/// original video frame.
/// </para></remarks>
/// 
Process video and motion frames doing further post processing after
performed motion detection.
Process video and motion frames doing further post processing after performed motion detection .
public unsafe void ProcessFrame(UnmanagedImage videoFrame, UnmanagedImage motionFrame)
    {
      int width = videoFrame.Width;
      int height = videoFrame.Height;
      if ((motionFrame.Width != width) || (motionFrame.Height != height))
        return;
      lock (blobCounter)
      {
        blobCounter.ProcessImage(motionFrame);
      }
      if (highlightMotionRegions)
      {
        Rectangle[] rects = blobCounter.GetObjectsRectangles();
        foreach (Rectangle rect in rects)
        {
          DrawingHelper.Rectangle(videoFrame, rect, highlightColor);
        }
      }
    }
public unsafe void ProcessFrame ( UnmanagedImage videoFrame , UnmanagedImage motionFrame ) { int width = videoFrame . Width ; int height = videoFrame . Height ; if ( ( motionFrame . Width != width ) || ( motionFrame . Height != height ) ) return ; lock ( blobCounter ) { blobCounter . ProcessImage ( motionFrame ) ; } if ( highlightMotionRegions ) { Rectangle [ ] rects = blobCounter . GetObjectsRectangles ( ) ; foreach ( Rectangle rect in rects ) { DrawingHelper . Rectangle ( videoFrame , rect , highlightColor ) ; } } }
Process video and motion frames doing further post processing after
performed motion detection.
Process video and motion frames doing further post processing after performed motion detection .
// highlight each moving object
videoFrame
UnmanagedImage
Original video frame.
Original video frame .
motionFrame
UnmanagedImage
Motion frame provided by motion detection
algorithm (see


Motion frame provided by motion detection algorithm ( see
remarks
Processes provided motion frame and counts number of separate
objects, which size satisfies  and
properties. In the case if  property is
set to , the found object are also highlighted on the
original video frame.
Processes provided motion frame and counts number of separate objects which size satisfies and properties . In the case if property is set to the found object are also highlighted on the original video frame .