/// <summary>
        /// Одновременное считывание и обработка кадра видеопотока
        /// </summary>
        /// <param name="sWTVideoTextDetection">Детектор текста</param>
        /// <param name="frameLoader">Загрузчик кадра</param>
        /// <param name="keyFrameIOInformation">Информация об извлекаемом кадре</param>
        /// <param name="videoFileName">Имя видеофайла</param>
        /// <param name="threadsNumber">Число потоков для выделения текста</param>
        /// <returns></returns>
        public async static Task LoadDetectTextVideo(SWTVideoTextDetection sWTVideoTextDetection, FrameLoader frameLoader,
            List<KeyFrameIOInformation> keyFrameIOInformation, string videoFileName, int threadsNumber)
        {
            try
            {
                if (sWTVideoTextDetection == null)
                    throw new ArgumentNullException("Null sWTVideoTextDetection in LoadDetectTextVideo");
                if (frameLoader == null)
                    throw new ArgumentNullException("Null frameLoader in LoadDetectTextVideo");
                if (keyFrameIOInformation == null)
                    throw new ArgumentNullException("Null keyFrameIOInformation in LoadDetectTextVideo");
                if (videoFileName == null)
                    throw new ArgumentNullException("Null videoFileName in LoadDetectTextVideo");              

                for (int i = 0; i < keyFrameIOInformation.Count; i++)
                {
                    GreyVideoFrame frame = await frameLoader.LoadFrameAsync(videoFileName, keyFrameIOInformation[i]);
                    await sWTVideoTextDetection.DetectText(frame, threadsNumber);
                    FrameWasProcessedEvent(frame);
                }               
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
        /// <summary>
        /// Выделение текста на ключевых кадрах видеоролика
        /// </summary>
        private async void DetectVideoTextFunction()
        {
            try
            {                
                if (this.keyFrameIOInformation != null)
                {
                    SWTVideoTextDetection SWTVideoTextDetection = new SWTVideoTextDetection(0.5);
                    FrameLoader frameLoader = new FrameLoader();
                    this.StartLoader(DETECT_TEXT_VIDEO_STRING);
                    LoadDetectTextVideoMediator.FrameWasProcessedEvent += this.AddProcessedFrameToBitmapArray;
                    await LoadDetectTextVideoMediator.LoadDetectTextVideo(SWTVideoTextDetection, frameLoader, this.keyFrameIOInformation, this.videoFileNameString, 4);                                   
                    this.StopLoader();
                }
                else
                {
                    EvristicsWindow evristicsWindow = EvristicsWindow.InitializeEvristicsWindow();
                    evristicsWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                    evristicsWindow.ShowDialog();

                    AlgorithmParametersWindow algorithmParametersWindow = AlgorithmParametersWindow.InitializeAlgorithmParametersWindow();
                    algorithmParametersWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                    algorithmParametersWindow.ShowDialog();

                    EvristicsWindowViewModel evristicsWindowDataContext = (EvristicsWindowViewModel)evristicsWindow.DataContext;
                    AlgorithmParametersViewModel algorithmParametersWindowDataContext = (AlgorithmParametersViewModel)algorithmParametersWindow.DataContext;

                    SWTVideoTextDetection SWTVideoTextDetection = new SWTVideoTextDetection(evristicsWindowDataContext.VarienceAverageSWRation,
                        algorithmParametersWindowDataContext.GaussFilterSize, algorithmParametersWindowDataContext.GaussSigma, algorithmParametersWindowDataContext.CannyLowTreshold,
                        algorithmParametersWindowDataContext.CannyHighTreshold, evristicsWindowDataContext.AspectRatio, evristicsWindowDataContext.DiamiterSWRatio,
                        evristicsWindowDataContext.BbPixelsNumberMinRatio, evristicsWindowDataContext.BbPixelsNumberMaxRatio,
                        evristicsWindowDataContext.ImageRegionHeightRationMin, evristicsWindowDataContext.ImageRegionWidthRatioMin, evristicsWindowDataContext.PairsHeightRatio,
                        evristicsWindowDataContext.PairsIntensityRatio, evristicsWindowDataContext.PairsSWRatio, evristicsWindowDataContext.PairsWidthDistanceSqrRatio,
                        evristicsWindowDataContext.PairsOccupationRatio, evristicsWindowDataContext.MinLettersNumberInTextRegion,
                        evristicsWindowDataContext.MergeByDirectionAndChainEnds, evristicsWindowDataContext.UseAdaptiveSmoothing);

                    this.StartLoader(DETECT_TEXT_VIDEO_STRING);
                    await SWTVideoTextDetection.DetectText(this.video, 4);
                    this.StopLoader();
                }
                OkButtonWindow okButtonWindow = OkButtonWindow.InitializeOkButtonWindow();
                okButtonWindow.capitalText.Text = VIDEO_PROCESS_STRING;
                okButtonWindow.textInformation.Text = VIDEO_PROCESS_SUCCESS_STRING;
                okButtonWindow.ShowDialog();
             
                if (this.keyFrameIOInformation == null)
                {
                    this.StartLoader(PROCESS_DATA_FOR_OUTPUT_STRING);
                    this.CreateBitmapsFromProcessedVideoFrames();
                    this.StopLoader();
                }
                this.InitializeProcessedVideoFramesGallery();            

                this.IsVideoFrameTabSelected = false;
                this.IsProcessedVideoFramesTabSelected = true;
                this.IsProcessedVideoFrameTabSelected = false;
                this.IsVideoTabSelected = false;
            }
            catch (Exception exception)
            {
                this.StopLoader();
                ShowExceptionMessage(exception.Message);              
            }
        }
        /// <summary>
        /// Выделение текста на на единичном кадре видео
        /// </summary>
        private async void DetectVideoFrameTextFunction()
        {
            try
            {
                EvristicsWindow evristicsWindow = EvristicsWindow.InitializeEvristicsWindow();
                evristicsWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                evristicsWindow.ShowDialog();

                AlgorithmParametersWindow algorithmParametersWindow = AlgorithmParametersWindow.InitializeAlgorithmParametersWindow();
                algorithmParametersWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                algorithmParametersWindow.ShowDialog();

                EvristicsWindowViewModel evristicsWindowDataContext = (EvristicsWindowViewModel)evristicsWindow.DataContext;
                AlgorithmParametersViewModel algorithmParametersWindowDataContext = (AlgorithmParametersViewModel)algorithmParametersWindow.DataContext;

                SWTVideoTextDetection SWTVideoTextDetection = new SWTVideoTextDetection(evristicsWindowDataContext.VarienceAverageSWRation,
                    algorithmParametersWindowDataContext.GaussFilterSize, algorithmParametersWindowDataContext.GaussSigma, algorithmParametersWindowDataContext.CannyLowTreshold,
                    algorithmParametersWindowDataContext.CannyHighTreshold, evristicsWindowDataContext.AspectRatio, evristicsWindowDataContext.DiamiterSWRatio,
                    evristicsWindowDataContext.BbPixelsNumberMinRatio, evristicsWindowDataContext.BbPixelsNumberMaxRatio,
                    evristicsWindowDataContext.ImageRegionHeightRationMin, evristicsWindowDataContext.ImageRegionWidthRatioMin, evristicsWindowDataContext.PairsHeightRatio,
                    evristicsWindowDataContext.PairsIntensityRatio, evristicsWindowDataContext.PairsSWRatio, evristicsWindowDataContext.PairsWidthDistanceSqrRatio,
                    evristicsWindowDataContext.PairsOccupationRatio, evristicsWindowDataContext.MinLettersNumberInTextRegion,
                    evristicsWindowDataContext.MergeByDirectionAndChainEnds, evristicsWindowDataContext.UseAdaptiveSmoothing);

                this.StartLoader(DETECT_TEXT_VIDEO_FRAME_STRING);
                await SWTVideoTextDetection.DetectText(this.videoFrame, 4);
                this.StopLoader();

                OkButtonWindow okButtonWindow = OkButtonWindow.InitializeOkButtonWindow();
                okButtonWindow.capitalText.Text = FRAME_PROCESS_STRING;
                okButtonWindow.textInformation.Text = FRAME_PROCESS_SUCCESS_STRING;
                okButtonWindow.ShowDialog();

                BitmapConvertor bitmapConvertor = new BitmapConvertor();
                Bitmap bitmapFrame = bitmapConvertor.ToBitmap(this.videoFrame.Frame);
                Draw.DrawTextBoundingBoxes(bitmapFrame, this.videoFrame.Frame.TextRegions, new System.Drawing.Pen(System.Drawing.Color.Red, 2));

                BitmapImageConvertor bitmapImageConvertor = new Convertors.BitmapImageConvertor();
                this.ProcessedFrameSource = bitmapImageConvertor.BitmapToBitmapImage(bitmapFrame);

                this.IsVideoFrameTabSelected = false;
                this.IsProcessedVideoFramesTabSelected = false;
                this.IsProcessedVideoFrameTabSelected = true;
                this.IsVideoTabSelected = false;
            }
            catch (Exception exception)
            {
                this.StopLoader();
                ShowExceptionMessage(exception.Message);
            }
        }