示例#1
0
        private static SurveyorVisionStereoWin Init(
            string stereo_camera_IP,
            string calibration_filename,
            int image_width, int image_height,
            int left_port, int right_port,
            int broadcast_port,
            int stereo_algorithm_type,
            float fps)
        {
            SurveyorVisionStereoWin stereo_camera =
                new SurveyorVisionStereoWin(stereo_camera_IP, left_port, right_port, 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.stereo_algorithm_type      = stereo_algorithm_type;
            stereo_camera.UpdateWhenClientsConnected = true;
            stereo_camera.random_rows = 5;

            return(stereo_camera);
        }
示例#2
0
        public void Init(
            string stereo_camera_IP,
            int leftport,
            int rightport)
        {
            this.stereo_camera_IP = stereo_camera_IP;
            left_port             = leftport;
            right_port            = rightport;

            string version = String.Format("{0}", AssemblyVersion);

            Console.WriteLine("surveyorstereo GUI version " + version);
            Console.WriteLine("SVS IP: " + stereo_camera_IP.ToString());
            Console.WriteLine("Left camera port: " + leftport.ToString());
            Console.WriteLine("Right camera port: " + rightport.ToString());

            stereo_camera = new SurveyorVisionStereoWin(stereo_camera_IP, left_port, right_port, broadcast_port, fps);
            stereo_camera.temporary_files_path = temporary_files_path;
            stereo_camera.recorded_images_path = recorded_images_path;
            stereo_camera.window           = this;
            stereo_camera.display_image[0] = picLeftImage;
            stereo_camera.display_image[1] = picRightImage;
            stereo_camera.Load(calibration_filename);
            stereo_camera.Run("M");

            if (stereo_camera.stereo_algorithm_type == StereoVision.EDGES)
            {
                denseToolStripMenuItem.Checked  = false;
                simpleToolStripMenuItem.Checked = true;
            }
            else
            {
                denseToolStripMenuItem.Checked  = true;
                simpleToolStripMenuItem.Checked = false;
            }

            txtLogging.Text = path_identifier;
            txtReplay.Text  = replay_path_identifier;

            SendCommand("M");

            motors_active = true;
            starting      = false;
        }