public static IVideoSource Create(VideoSourceType type, int cameraIndex)
        {
            switch (type)
            {
            case VideoSourceType.DirectShow:
                return(new DShowVideoSource(cameraIndex));

            case VideoSourceType.PSEye:
                return(new PSEyeVideoSource(cameraIndex));

            default:
                throw new ArgumentException($"Unknown video source type {type}");
            }
        }
Example #2
0
        public void SetVideo(VideoSourceType videoSourceType)
        {
            this.videoSourceType = videoSourceType;

            Title = videoSourceType.ToString();

            //create finger points
            for (int i = 0; i < NativeConstants.MAX_FINGER_NUM; i++)
            {
                Ellipse ellipse = new Ellipse()
                {
                    Width = FINGER_RADIUS * 2,
                    Height = FINGER_RADIUS * 2,
                    Fill = Brushes.Orange,
                    Stroke = Brushes.White,
                    StrokeThickness = 2,
                    Opacity = 0,
                };
                fingerPoints.Add(ellipse);
                canvas.Children.Add(ellipse);
            }

            //create hand points
            for (int i = 0; i < NativeConstants.MAX_HAND_NUM; i++)
            {
                Ellipse ellipse = new Ellipse()
                {
                    Width = HAND_RADIUS * 2,
                    Height = HAND_RADIUS * 2,
                    Stroke = Brushes.White,
                    StrokeThickness = 2,
                    Opacity = 0,
                };
                handPoints.Add(ellipse);
                canvas.Children.Add(ellipse);
            }

            //cropping
            if (this.videoSourceType == VideoSourceType.DepthHistogramed || this.videoSourceType == VideoSourceType.OmniTouch)
            {
                cropRect.Visibility = Visibility.Visible;
                cropButton.Visibility = Visibility.Visible;
                loadCropRect();
            }
        }
Example #3
0
        public ImageSource GetSource(VideoSourceType type)
        {
            switch (type)
            {
                case VideoSourceType.RGB:
                    return RGBSource;

                case VideoSourceType.DepthHistogramed:
                    return DepthHistogramedSource;

                case VideoSourceType.OmniTouch:
                    return OmniTouchSource;

                case VideoSourceType.RectifiedTabletopProduct:
                    return RectifiedTabletopSource;

                default:
                    return null;
            }
        }
Example #4
0
        /// <summary>
        /// 根据类型获取视频源
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        private VideoSourceBase getVideoSourceByType(VideoSourceType type)
        {
            var ret = this.m_VidoeSourceTable[type] as VideoSourceBase;

            if (ret != null)
            {
                return(ret);
            }

            switch (type)
            {
            case VideoSourceType.Hik8200Open:
                ret = new VideoSource_HikOpen8200();
                break;
            }

            ret.LogModule = this.LogModule;
            if (ret.Init() == false)
            {
                return(null);
            }
            return(ret);
        }
 private void LoadVideoURL()
 {
     video_source = VideoSourceType.URL;
     _video.audioOutputMode = VideoAudioOutputMode.Direct;
     InitializeVideo();
 }
 private void LoadVideoClip()
 {
     video_source = VideoSourceType.Clip;
     InitializeVideo();
 }
Example #7
0
        private void handleVideoToggleButtonClick(System.Windows.Controls.Primitives.ToggleButton button, ref VideoWindow window, VideoSourceType videoType)
        {
            if (button.IsChecked.GetValueOrDefault(false))
            {
                if (window != null)
                {
                    window.Close();
                }

                window = new VideoWindow();
                window.SetVideo(videoType);
                window.MainWindow = this;
                window.Closed += delegate(object cSender, EventArgs cArgs)
                {
                    button.IsChecked = false;
                };
                window.Show();
            }
            else
            {
                if (window != null)
                {
                    window.Close();
                    window = null;
                }
            }
        }