Ejemplo n.º 1
0
        private void btnSelectCamera_Click(object sender, EventArgs e)
        {
            VideoCaptureDeviceForm form = new VideoCaptureDeviceForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                int deviceId = form.DeviceId;

                kinectDevice = Kinect.GetDevice(deviceId);

                if (videoCamera == null)
                {
                    videoCamera            = kinectDevice.GetVideoCamera();
                    videoCamera.CameraMode = VideoCameraMode.Color;

                    controller.Device = videoCamera;
                    controller.Start();
                    controller.NewFrame += new AForge.Video.NewFrameEventHandler(controller_NewFrame);
                }

                if (depthCamera == null)
                {
                    //depthCamera = kinectDevice.GetDepthCamera();
                    depthCamera = new KinectDepthCamera(deviceId, CameraResolution.Medium, true);

                    videoSourcePlayer1.VideoSource = depthCamera;
                    videoSourcePlayer1.Start();
                }


                toolStripStatusLabel1.Text = "Initializing...";
            }
        }
Ejemplo n.º 2
0
        private void btnSelectCamera_Click(object sender, EventArgs e)
        {
            VideoCaptureDeviceForm form = new VideoCaptureDeviceForm();

            if (form.ShowDialog() == DialogResult.OK)
            {
                int deviceId = form.DeviceId;

                kinectDevice = Kinect.GetDevice(deviceId);

                if (videoCamera == null)
                {
                    videoCamera = kinectDevice.GetVideoCamera();
                    videoCamera.CameraMode = VideoCameraMode.Color;

                    controller.Device = videoCamera;
                    controller.Start();
                    controller.NewFrame += new AForge.Video.NewFrameEventHandler(controller_NewFrame);
                }

                if (depthCamera == null)
                {
                    //depthCamera = kinectDevice.GetDepthCamera();
                    depthCamera = new KinectDepthCamera(deviceId, CameraResolution.Medium, true);

                    videoSourcePlayer1.VideoSource = depthCamera;
                    videoSourcePlayer1.Start();
                }


                toolStripStatusLabel1.Text = "Initializing...";
            }
        }