open cv 4.0 c ++ internal camera not detected
Hi, after using this code my internal camera is not detected.My camera work when i'm using cheese.
I'm using
-Linux 4.15.0-23-generic x86_64
-Open cv 4.0
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main( int argc, const char** argv )
{
Mat image;
VideoCapture cap;
if(!cap.isOpened()){
cerr << "No camera detected on this system" << endl;
return -1;
}
while(true){
cap >> image;
if(image.empty()){
cerr << "Frame invalid and skipped!" << endl;
continue;
}
imshow("test", image);
waitKey(5);
}
return 0;
}