在 OpenCV 2.2 中设置视频捕获属性不再起作用?
在 OpenCV 2.2 之前,我能够
VideoCapture capture(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH, 640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
修改帧大小。但是当我针对 OpenCV 2.2 编译应用程序后,设置属性不再起作用(尽管视频显示正确)。如果我获取这些值,则会返回 0。如果我查看捕获的帧的大小,它是 160 x 120。
我在网上搜索,但大多数帖子都是关于 Linux 中的问题,而我运行的是 Windows 7 64 位。我的网络摄像头是 Logitech QuickCam Ultra Vision。
有没有人遇到同样的问题?或者根本就没有问题?
提前致谢!
Prior OpenCV 2.2, I was able to do
VideoCapture capture(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH, 640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
in order to modify the frame size. But after when I compiled my application against OpenCV 2.2, setting the properties no longer works (the video is displayed correctly though). If I do a get of these values, 0 is returned. And if I look at the size of the captured frame, it is 160 x 120.
I searched online but most of the posts were about the problem in Linux whereas I am running Windows 7 64-bit. My webcam is a Logitech QuickCam Ultra Vision.
Is there anyone experiencing the same problem? Or no problem at all?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题在 OpenCV 2.3 中已经得到解决,即使使用我的旧 Logitech QuickCam Ultra Vision 网络摄像头也是如此。
This problem has been solved in OpenCV 2.3, even with my old Logitech QuickCam Ultra Vision webcam.
也许您应该尝试使用 VideoInput,它也受 OpenCV 支持,并包含在 OpenCV 2.0.3 中。
请参阅 http://opencv.willowgarage.com/wiki/CameraCapture 中的示例
May be you should try with VideoInput, which is also supported by OpenCV, and included in OpenCV 2.0.3.
See an example at http://opencv.willowgarage.com/wiki/CameraCapture