Jetson TK1 @ubuntu14.04 opencv 双目相机

来源:互联网 发布:unity3d asset store 编辑:程序博客网 时间:2024/06/05 04:50

#确保两个相机通过USB/microUSB接入board

#include <highgui.h>

#include <cxcore.h>

using namespace cv;

int main()
{
   VideoCapture cap_l(1);
   if(!cap_l.isOpened())
   {
      return -1;
   }


   VideoCapture cap_r(2);
   if(!cap_r.isOpened())
   {
      return -1;
   }
   
   Mat frame_l, frame_r;
   bool stop = false;

   

    while(!stop)

   {
cap_l>>frame_l;
imshow("camer_l",frame_l);

cap_r>>frame_r;
imshow("camer_r",frame_r);

if(waitKey(30) >= 0)
  stop = true;
   }
   return 0;
}
0 0
原创粉丝点击