一段时间以来,我一直在尝试使用在 Windows 笔记本电脑上运行的 opencv 将图像从 axis 205 网络摄像头加载到我的 qt 程序中。根据相机配置页面
The Motion JPEG image stream is fetched from the file:
http://192.168.0.90/axis-cgi/mjpg/video.cgi?resolution=640x480
摄像头的登录是用户名root,密码pass
我尝试了几种代码变体,但我无法让程序显示图像
VideoCapture * cap = new VideoCapture("http://192.168.0.90/axis-cgi/mjpg/video.cgi?resolution=640x480");
垫子框架;
cap->read(frame);
我尝试的所有结果都是一个空框,感谢您的帮助
~吉比
最佳答案
经过一番折腾,我发现正确的代码是
VideoCapture * cap = new VideoCapture("http://root:pass@192.168.0.90/axis-cgi/mjpg/video.cgi?resolution=640x480.mjpg");
无论出于何种原因,url 必须以 mjpg 结尾。
关于c++ - 使用opencv在qt中加载轴相机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20339727/