public void Dispose()
        {
            if (ForegroundMask != null)
            {
                ForegroundMask.Dispose();
            }

            if (ForegroundDetector != null)
            {
                ForegroundDetector.Dispose();
            }
        }
 public void ProcessFrame(IInputArray image)
 {
     ForegroundDetector.Apply(image, ForegroundMask);
 }