如何使用相机与OpenCV [英] How to use a camera with OpenCV
问题描述
我想学习OpenCV。我一直在玩它一整天,试图让它识别我的相机。我只是不能让它工作,我找不到任何有关它的信息。
I'm trying to learn OpenCV. I have been playing around with it for an entire day trying to get it to recognize my camera. I just can't get it to work and I can't find any information about it.
我的相机是一个usb xbox实时摄像头,一旦我连接
My camera is a usb xbox live webcam, as soon as I connected it to my computer windows recognized it as if it were its own child and installed the drivers.
免责声明 我完全无法理解,因为我有自己的孩子和安装的驱动程序。在代码中从来没有使用过相机,我不知道使用它有多难或困难,我也不知道从哪里开始,什么信息要查找,或者类似的东西。 :( 免责声明
DISCLAIMER I'm like completely clueless as I have never worked with cameras before in code and I don't know how hard or difficult it would be to use one, nor do I know where to start, what information to look up, or anything like that. :( DISCLAIMER
我在opencv网站上找到这个网址:
http://opencv.willowgarage.com/wiki/CameraCapture
I found this example on the opencv website at this url: http://opencv.willowgarage.com/wiki/CameraCapture
我复制并粘贴第一个这是一个简单的框架连接到一个摄像头,并在一个窗口中显示图像。我正确地格式化,并得到它的编译和运行完美,但它给出错误错误:捕获(不是编译器错误,它在应用程序中的错误)
I copy and pasted the first one which says "Here is a simple framework to connect to a camera and show the images in a Window.". I formatted it correctly and got it to compile and run perfectly, but it gives the error "ERROR: capture is NULL" when I execute it(not a compiler error, its an error in the application)
推荐答案
我认为有更多在stackoverflow足够的代码,显示如何做的诀窍:
I think there are more than enough code on stackoverflow that shows how to do the trick:
OpenCV'cvQueryFrame'在OS X上无阻塞?
这篇关于如何使用相机与OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!