昨天我在一個全新的HD安裝了Ubuntu 12.04,跑了所有的更新(sudo apt-get updates && sudo apt-get upgrade
),安裝了APT(sudo apt-get install git libsdl1.2-dev python-dev python-setuptools python-numpy python-scipy python-nose ipython python-pygame libcv-dev python-opencv
)一堆東西,然後從已安裝的OpenCV 2.4來源(按照說明here)。然而,當我嘗試使用Python接口從攝像頭拍攝圖像(我試過羅技C910都和C920機型),我得到「沒有」的結果:攝像頭不使用Python接口合作的OpenCV 2.4在Ubuntu 12.04
>>> import cv
>>> webcam_stream = cv.CaptureFromCAM(0) #I've also tried cv.CaptureFromCAM(-1) with the same results
>>> this_image = cv.QueryFrame(webcam_stream)
>>> print(this_image)
None
任何想法,爲什麼這是失敗的? Ubuntu軟件中心提供的網絡攝像頭應用程序(如奶酪)似乎很好地抓取攝像頭的圖像,所以我非常困惑!
我正在考慮購買C910和C920。我想知道你能否讓你的相機在Ubuntu 12.04和OpenCV上工作?我問,因爲我的設置與你的設置相同。 – cagatayodabasi