Chapter_02 sample2.cpp open defalut camera failed
vk8051 opened this issue · 2 comments
vk8051 commented
VideoCapture cap; // open the default camera
if(videoFile != "")
cap.open(videoFile);
else
cap.open("Recording3.webm"); <<==========Here can not open default camera
if(!cap.isOpened()) // check if we succeeded
return -1;
ViniGodoy commented
The correct would be
if(videoFile != "")
cap.open(videoFile);
else
cap.open(0);
if(!cap.isOpened()) // check if we succeeded
return -1;
ViniGodoy commented
Fixed in the source code.