小编H.K*_*H.K的帖子

虚拟机上的opencv视频采集和摄像头访问

我正在尝试使用计算机上的网络摄像头实时捕获图像。我正在使用 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)

c++ ubuntu opencv video-capture virtual-machine

5
推荐指数
1
解决办法
4723
查看次数

标签 统计

c++ ×1

opencv ×1

ubuntu ×1

video-capture ×1

virtual-machine ×1