Advertisement

OpenCV学习笔记第6章基于VC与OpenCV结合使用DirectShow实现多摄像头同步运行

阅读量:

由于项目需求,需获取两个摄像头的数据以实现双目检测功能,最初使用了如下代码进行测试:

复制代码
    #include "stdafx.h"
    
    #include <cv.h>
    #include <cxcore.h>
    #include <highgui.h>
    
    int main(int argc, _TCHAR* argv[])
    {
    CvCapture* capture1 = cvCreateCameraCapture( 0 );
    CvCapture* capture2 = cvCreateCameraCapture( 1 );
    
    double w = 320, h = 240;
    cvSetCaptureProperty ( capture1, CV_CAP_PROP_FRAME_WIDTH,  w );  
    cvSetCaptureProperty ( capture1, CV_CAP_PROP_FRAME_HEIGHT, h );
    cvSetCaptureProperty ( capture2, CV_CAP_PROP_FRAME_WIDTH,  w );  
    cvSetCaptureProperty ( capture2, CV_CAP_PROP_FRAME

全部评论 (0)

还没有任何评论哟~