OpenCV를 사용하여 두 번째 카메라를 열려면 어떻게합니까? 나는 VS2008, OpenCV 2.4.13을 사용하고 있으며, 2 종류의 USB 카메라가 부착되어 있습니다. 두 번째 카메라를 열 수 없습니다
나는 아래의 코드를 사용하여 시도,하지만 난 오류 얻을 :Capture1 can't be opened
코드는 다음과 같습니다
int _tmain(int argc, _TCHAR* argv[])
{
VideoCapture capture(0);
if(!capture.isOpened())
std::cout << "Capture0 can't be opened\n" << std::endl;
VideoCapture capture1(1);
if(!capture1.isOpened())
std::cout << "Capture1 can't be opened\n" << std::endl;
return 0;
}
당신은 –
당신이 할 수있는 http://docs.opencv.org/2.4/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-grab을 잡아()를 검색()를 사용한다 아래 내 경험 기반 대답을 확인 :) 그것이 도움이되기를 바랍니다. –
VideoCapture capture1 (DSHOW +1)은 어떻게됩니까? –