Code: Select all
cv::VideoCapture capture(0); // open the first camera
you may need to make some tuning, like select Video 4 Linux or any other API
Code: Select all
cv::VideoCapture capture("/dev/video0", cv::CAP_V4L); // open the first camera
capture.set(cv::CAP_PROP_FRAME_WIDTH, 640);
capture.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
for USB cameras it can be issue with second camera - it's not a /dev/video1, but /dev/video2
In case if you need to use qt way to get to camera, you may look in QtWidgetStub and QtQuickStub as examples.