/// <summary>
        /// Загрузка видео
        /// </summary>
        private async void LoadVideoFileFunction()
        {
            try
            {
                this.video = new GreyVideo();

                progressWindow = ProgressWindow.InitializeProgressWindow();
                OkButtonWindow okButtonWindow = OkButtonWindow.InitializeOkButtonWindow();

                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Filter = "MP4 Image (.mp4)|*.mp4|3gp (.3gp)|*.3gp|Avi (.avi)|*.avi";
                dialog.ShowDialog();

                FrameSizeWindow frameSizeWindow = FrameSizeWindow.InitializeFrameSizeWindow();
                frameSizeWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                frameSizeWindow.ShowDialog();

                FrameSizeViewModel frameSizeViewModel = (FrameSizeViewModel)frameSizeWindow.DataContext;

                progressWindow.capitalText.Text = LOAD_VIDEO_STRING;
                progressWindow.textInformation.Text = VIDEO_INITIALIZATION_STRING;
                progressWindow.Show();

                string videoFilePath = System.IO.Path.GetDirectoryName(dialog.FileName);
                string videoFileName = System.IO.Path.GetFileNameWithoutExtension(dialog.FileName);
                string keyFramesInormatyionFilePath = System.IO.Path.Combine(videoFilePath, videoFileName + ".txt");

                IOData ioData = new IOData() { FileName = dialog.FileName, FrameHeight = frameSizeViewModel.FrameHeight, FrameWidth = frameSizeViewModel.FrameWidth };

                VideoLoader videoLoader = new VideoLoader();
                int framesNumber = await videoLoader.CountFramesNumberAsync(ioData);            
                progressWindow.pbStatus.SmallChange = (double)progressWindow.pbStatus.Maximum / (double)framesNumber;

                /// Если существует файл с информацией о ключевых кадрах
                if (System.IO.File.Exists(keyFramesInormatyionFilePath))
                {
                    FileReader fileReader = new FileReader();
                    FileReader.ExceptionOccuredEvent += this.ExceptionOccuredEventHandler;
                    keyFrameIOInformation = await fileReader.ReadKeyFramesInformationAsync(keyFramesInormatyionFilePath, frameSizeViewModel.FrameWidth, frameSizeViewModel.FrameHeight);
                    ioData.KeyFrameIOInformation = keyFrameIOInformation;                    

                   // EdgeBasedKeyFrameExtractor.keyFrameExtractedEvent += this.KeyFramesExtractionProcessing;
                   // EdgeBasedKeyFrameExtractor edgeBasedKeyFrameExtractor = new EdgeBasedKeyFrameExtractor();
                  //  this.video.Frames = await edgeBasedKeyFrameExtractor.ExtractKeyFramesByListNumberAsync(ioData);
                }
                else   /// Если нет, то выделяем кадры алгоритмически
                {
                    EdgeBasedKeyFrameExtractor.keyFrameExtractedEvent += this.KeyFramesExtractionProcessing;
                    EdgeBasedKeyFrameExtractor.framesDifferenceEvent += this.FramesDifferenceCalculateProcessing;
                    EdgeBasedKeyFrameExtractor edgeBasedKeyFrameExtractor = new EdgeBasedKeyFrameExtractor();
                    this.video.Frames = await edgeBasedKeyFrameExtractor.ExtractKeyFramesTwoPassAsync(ioData);
                }
                okButtonWindow = OkButtonWindow.InitializeOkButtonWindow();
                okButtonWindow.capitalText.Text = LOAD_VIDEO_STRING;
                okButtonWindow.textInformation.Text = LOAD_VIDEO_SUCCESS_STRING;
                okButtonWindow.ShowDialog();

                progressWindow.Close();                
                this.VideoFileName = new Uri(dialog.FileName);
                this.videoFileNameString = dialog.FileName;
                this.MediaPlayerNavigationVisibility = Visibility.Visible;
                this.VideoWasNotLoaded = Visibility.Hidden;

                this.IsVideoFrameTabSelected = false;
                this.IsProcessedVideoFramesTabSelected = false;
                this.IsProcessedVideoFrameTabSelected = false;
                this.IsVideoTabSelected = true;
            }
            catch (Exception exception)
            {
                progressWindow.Hide();
                ShowExceptionMessage(exception.Message);             
            }
        }
        /// <summary>
        /// Загрузка единичного кадра видео 
        /// </summary>
        private async void LoadVideoFrameFunction()
        {
            try
            {
                OpenFileDialog dialog = new OpenFileDialog();
                dialog.Filter = "JPEG Image (.jpg)|*.jpg";
                dialog.ShowDialog();

                FrameSizeWindow frameSizeWindow = FrameSizeWindow.InitializeFrameSizeWindow();
                frameSizeWindow.capitalText.Text = PARAMETERS_SETTING_STRING;
                frameSizeWindow.ShowDialog();

                FrameSizeViewModel frameSizeViewModel = (FrameSizeViewModel)frameSizeWindow.DataContext;

                IOData ioData = new IOData() { FileName = dialog.FileName, FrameHeight = frameSizeViewModel.FrameHeight, FrameWidth = frameSizeViewModel.FrameWidth };
                VideoLoader.frameLoadedEvent += this.LoadingFramesProcessing;
                VideoLoader videoLoader = new VideoLoader();

                FrameLoader frameLoader = new FrameLoader();
                videoFrame = await frameLoader.LoadFrameAsync(ioData);

                OkButtonWindow okButtonWindow = OkButtonWindow.InitializeOkButtonWindow();
                okButtonWindow.textInformation.Text = LOAD_FRAME_SUCCESS_STRING;
                okButtonWindow.capitalText.Text = LOAD_FRAME_STRING;
                okButtonWindow.ShowDialog();

                Bitmap bitmapFrame = new Bitmap(dialog.FileName);
                BitmapImageConvertor bitmapImageConvertor = new Convertors.BitmapImageConvertor();
                this.FrameSource = bitmapImageConvertor.BitmapToBitmapImage(bitmapFrame);
                this.ProcessedFrameSource = null;

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