VideoCapture did not detect an unopened camera
This commit is contained in:
parent
4b84d5d2c1
commit
a0e4600364
@ -621,15 +621,15 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
|
||||
{
|
||||
#ifdef HAVE_DSHOW
|
||||
case CV_CAP_DSHOW:
|
||||
capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
|
||||
if (capture)
|
||||
capture = makePtr<VideoCapture_DShow>(index);
|
||||
if (capture && capture.dynamicCast<VideoCapture_DShow>()->isOpened())
|
||||
return capture;
|
||||
break; // CV_CAP_DSHOW
|
||||
#endif
|
||||
#ifdef HAVE_INTELPERC
|
||||
case CV_CAP_INTELPERC:
|
||||
capture = Ptr<IVideoCapture>(new cv::VideoCapture_IntelPerC());
|
||||
if (capture)
|
||||
capture = makePtr<VideoCapture_IntelPerC>();
|
||||
if (capture && capture.dynamicCast<VideoCapture_IntelPerC>()->isOpened())
|
||||
return capture;
|
||||
break; // CV_CAP_INTEL_PERC
|
||||
#endif
|
||||
|
@ -1590,7 +1590,7 @@ bool videoInput::isFrameNew(int id){
|
||||
|
||||
bool videoInput::isDeviceSetup(int id){
|
||||
|
||||
if(id<devicesFound && VDList[id]->readyToCapture)return true;
|
||||
if(id>=0 && id<devicesFound && VDList[id]->readyToCapture)return true;
|
||||
else return false;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user