示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            LaneDetection Convert = new LaneDetection();

            src = capture.QueryFrame();

            if (src != null)
            {
                IplImage yw_canny = new IplImage(src.Size, BitDepth.U8, 3);
                IplImage y_canny  = new IplImage(src.Size, BitDepth.U8, 3);
                IplImage w_canny  = new IplImage(src.Size, BitDepth.U8, 3);

                w_canny  = Convert.CannyLine(src, 'w');
                y_canny  = Convert.CannyLine(src, 'y');
                yw_canny = w_canny + y_canny;
                pictureBoxIpl4.ImageIpl = yw_canny;

                pictureBoxIpl2.ImageIpl = Convert.HoughLines(src);
            }
            else
            {
                pictureBoxIpl2.ImageIpl = null;
                timer1.Enabled          = false;
            }
        }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                /*video*/

                capture = CvCapture.FromFile("../../../project_video.mp4");
                LaneDetection Convert = new LaneDetection();

                /* camera
                 * capture = CvCapture.FromCamera(CaptureDevice.DShow, 0);
                 * capture.SetCaptureProperty(capture.FrameWidth, 640);
                 * capture.SetCaptureProperty(capture.FrameHeight, 480);
                 */
            }
            catch
            {
                timer1.Enabled = false;
            }
        }