2016-08-16 5 views
0

안녕하세요는이 부분에서 나에게 오류 을 보여스트림 카메라의 IP emgucv

Mat frame = new Mat(); 
_capture.Retrieve(frame, 0); 
captureImageBox.Image = frame; 

오류가

을 언급 emgu.cv.imag의 유형 emgu.cv.mat을 변환 할 수 없습니다

...

코드의 어떤 라인 내가 제대로 실행 변경해야 할 ....

사양

  • 비주얼 스튜디오 2015
  • emgucv 3.1 64

    public partial class Form1 : Form 
    { 
    private Capture _capture = null; 
    private bool _captureInProgress; 
    public Form1() 
    { 
        InitializeComponent(); 
        CvInvoke.UseOpenCL = false; 
        try 
        { 
         _capture = new Capture("http://webcam.st-malo.com/axis-cgi/mjpg/video.cgi?"); 
         _capture.ImageGrabbed += ProcessFrame; 
        } 
        catch (NullReferenceException excpt) 
        { 
         MessageBox.Show(excpt.Message); 
        } 
    } 
    
    private void ProcessFrame(object sender, EventArgs arg) 
    { 
        Mat frame = new Mat(); 
        _capture.Retrieve(frame, 0); 
    
        captureImageBox.Image = frame; 
    
    } 
    
    private void captureButton_Click(object sender, EventArgs e) 
    { 
        if (_capture != null) 
        { 
         if (_captureInProgress) 
         { //stop the capture 
          captureButton.Text = "Start Capture"; 
          _capture.Pause(); 
         } 
         else 
         { 
          //start the capture 
          captureButton.Text = "Stop"; 
          _capture.Start(); 
         } 
    
         _captureInProgress = !_captureInProgress; 
        } 
    } 
    

    }

+0

당신은'ToImage'를 사용하여'image' 데이터 유형 (http://www.emgu.com/wiki/files/3.1.0/document/html/8e55d304-에'Mat' 변환해야 16cb-c8a1-bb1b-702cb567a069.htm) – Ash

답변

0

이를 사용하여 이미지 에 매트를 구문 분석 시도

Mat frame = new Mat(); 
_capture.Retrieve(frame, 0); 

captureImageBox.Image = frame.ToImage<Bgr, Byte>(); 
관련 문제