Exemplo n.º 1
0
        private void BrowseForUnitVideo()
        {
            string filePath = FileBrowser.BroseForVideoFiles();

            if (string.IsNullOrWhiteSpace(filePath))
            {
                return;
            }

            using (IVideo video = ModelResolver.Resolve <IVideo>())
            {
                video.SetVideo(filePath);

                using (Image <Bgr, Byte> image = video.GetFrameImage())
                {
                    Image = image.ToBitmap();

                    PickUnitsPointsViewModel viewModel = new PickUnitsPointsViewModel(Image);
                    PickUnitsPointsView      view      = new PickUnitsPointsView()
                    {
                        DataContext = viewModel,
                    };

                    view.ShowDialog();

                    if (viewModel.OkPressed)
                    {
                        PixelDistance = viewModel.GetDistance();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void BrowseForUnitVideo()
        {
            string filePath = FileBrowser.BroseForVideoFiles();

            if (string.IsNullOrWhiteSpace(filePath))
            {
                return;
            }

            using (IWhiskerVideo video = ModelResolver.Resolve<IWhiskerVideo>())
            {
                video.SetVideo(filePath);

                using (Image<Bgr, Byte> image = video.GetFrameImage())
                {
                    Image = image.ToBitmap();

                    PickUnitsPointsViewModel viewModel = new PickUnitsPointsViewModel(Image);
                    PickUnitsPointsView view = new PickUnitsPointsView()
                    {
                        DataContext = viewModel,
                    };

                    view.ShowDialog();

                    if (viewModel.OkPressed)
                    {
                        PixelDistance = viewModel.GetDistance();
                    }
                }
            }
        }