1 | initial version |
For the instance you can write a function that will try to open video capture devices by enurator started from the 0:
cv::VideoCapture _videocapture;
std::vector<std::pair<int,cv::String>> v_videodevices
int _devid = 0;
while(true) {
if(_videocapture.open(_devid)) {
v_devices.push_back( std::make_pair<int,cv::String>(_devid, "Device " + std::to_string(_devid)) );
_devid++;
} else {
break;
}
}
Alternativelly you can use Qt library and QCamera class to enumerate all available video devices.
2 | No.2 Revision |
For the instance you can write a function that will try to open video capture devices by enurator started from the 0:
cv::VideoCapture _videocapture;
std::vector<std::pair<int,cv::String>> v_videodevices
int _devid = 0;
while(true) {
if(_videocapture.open(_devid)) {
v_devices.push_back( std::make_pair<int,cv::String>(_devid, "Device " + std::to_string(_devid)) );
_devid++;
} else {
break;
}
}
_videocapture.release();
Alternativelly you can use Qt library and QCamera class to enumerate all available video devices.