Example #1
0
        private void InitCameras()
        {
            stereo_camera                  = new WebcamVisionStereoWin(left_camera_device_index.ToString(), right_camera_device_index.ToString(), 10010, frames_per_sec);
            stereo_camera.window           = this;
            stereo_camera.display_image[0] = picLeftImage;
            stereo_camera.display_image[1] = picRightImage;
            stereo_camera.Load(calibration_filename);
            stereo_camera.image_width     = image_width;
            stereo_camera.image_height    = image_height;
            stereo_camera.min_exposure    = min_exposure;
            stereo_camera.max_exposure    = max_exposure;
            stereo_camera.use_media_pause = use_pause;
            stereo_camera.endless_thread  = false;
            if (!File.Exists(calibration_filename))
            {
                stereo_camera.Save(calibration_filename);
                stereo_camera.disable_rectification     = true;
                stereo_camera.disable_radial_correction = true;
            }
            disable_rectification     = stereo_camera.disable_rectification;
            disable_radial_correction = stereo_camera.disable_radial_correction;
            stereo_camera.Run();

            dissableRectificationToolStripMenuItem.Checked   = disable_rectification;
            disableRadialCorrectionToolStripMenuItem.Checked = disable_radial_correction;
        }
Example #2
0
        private void InitCameras()
        {
            stereo_camera = new WebcamVisionStereoWin(left_camera_device_index.ToString(), right_camera_device_index.ToString(), 10010, frames_per_sec);
            stereo_camera.window = this;
            stereo_camera.display_image[0] = picLeftImage;
            stereo_camera.display_image[1] = picRightImage;
            stereo_camera.Load(calibration_filename);
            stereo_camera.image_width = image_width;
            stereo_camera.image_height = image_height;
            stereo_camera.min_exposure = min_exposure;
            stereo_camera.max_exposure = max_exposure;
            stereo_camera.use_media_pause = use_pause;
            stereo_camera.endless_thread = false;
            if (!File.Exists(calibration_filename))
            {
                stereo_camera.Save(calibration_filename);
                stereo_camera.disable_rectification = true;
                stereo_camera.disable_radial_correction = true;
            }
            disable_rectification = stereo_camera.disable_rectification;
            disable_radial_correction = stereo_camera.disable_radial_correction;
            stereo_camera.Run();

            dissableRectificationToolStripMenuItem.Checked = disable_rectification;
            disableRadialCorrectionToolStripMenuItem.Checked = disable_radial_correction;
        }
Example #3
0
        private static WebcamVisionStereoWin Init(
            string left_camera_device,
            string right_camera_device,
            string calibration_filename,
            int image_width, int image_height,
            int broadcast_port,
            int stereo_algorithm_type,
            float fps,
            string pause_file)
        {
            WebcamVisionStereoWin stereo_camera =
                new WebcamVisionStereoWin(
                    left_camera_device, right_camera_device,
                    broadcast_port, fps);

            PictureBox picLeftImage = new PictureBox();
            PictureBox picRightImage = new PictureBox();

            picLeftImage.Image = new Bitmap(image_width, image_height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            picRightImage.Image = new Bitmap(image_width, image_height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            stereo_camera.window = null;
            stereo_camera.display_image[0] = picLeftImage;
            stereo_camera.display_image[1] = picRightImage;
            stereo_camera.Load(calibration_filename);
            stereo_camera.image_width = image_width;
            stereo_camera.image_height = image_height;
            stereo_camera.stereo_algorithm_type = stereo_algorithm_type;
            stereo_camera.UpdateWhenClientsConnected = true;
            stereo_camera.random_rows = 5;
            stereo_camera.SetPauseFile(pause_file);
            
            return (stereo_camera);
        }