我正在尝试使用计算机上的网络摄像头实时捕获图像。我正在使用 Virtual Box 运行 Ubuntu,并且我知道我需要设置 USB 设置才能使用网络摄像头,但我还需要安装网络摄像头驱动程序吗?如果是的话我该怎么做!
我安装了virtualbox 5.0.6 ubuntu 14.04.3
我正在运行 Windows 10 机器
这是我正在运行的代码,我收到“错误:无法访问相机!” ..
能否请你帮忙 !
// Get access to the webcam.
void initWebcam(VideoCapture &videoCapture, int cameraNumber)
{
// Get access to the default camera.
try {
videoCapture.open(cameraNumber);
} catch (Exception &e) {}
if ( !videoCapture.isOpened() ) {
cerr << "ERROR: Could not access the camera!" << endl;
exit(1);
}
cout << "Loaded camera " << cameraNumber << "." << endl;
}
int main(int argc, char** argv) …Run Code Online (Sandbox Code Playgroud)