[OpenCV]How to get the number of camera [closed]

asked 2016-12-14 01:58:58 -0600

Jack_Wellem gravatar image

updated 2016-12-14 20:42:05 -0600

  1. How to get the total number of camera?
  2. The following is my code, but i find that it will make the memory leak

    int CvCaptureCAM_DShow::getDeviceCount(){
    int deviceNumber = VI.listDevices(true);
    return deviceNumber;}
    
    
    int  cvGetDeviceCount_DShow(){
    CvCaptureCAM_DShow* capture = new CvCaptureCAM_DShow;
    
    int deviceCount = capture->getDeviceCount();
    
    delete capture;
    capture = NULL;
    
    return deviceCount;
    

    }

edit retag flag offensive reopen merge delete

Closed for the following reason not a real question by Jack_Wellem
close date 2016-12-15 21:28:35.979164