I'm trying to get OpenCV working with Python on my Ubuntu machine. I've downloaded and installed OpenCV, but when I attempt to run the following python code (which should capture images from a webcam and push them to the screen)
capture = cv.CaptureFromCAM(0)
frame = cv.QueryFrame(capture)
The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or
Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and
pkg-config, then re-run cmake or configure script
sudo make uninstall
sudo make install
If it's giving you errors with gtk, try qt.
sudo apt-get install libqt4-dev cmake -D WITH_QT=ON .. make sudo make install
If this doesn't work, there's an easy way out.
sudo apt-get install libopencv-*
This will download all the required dependencies(although it seems that you have all the required libraries installed, but still you could try it once). This will probably install OpenCV 2.3.1 (Ubuntu 12.04). But since you have OpenCV 2.4.3 in
/usr/local/lib include this path in
/etc/ld.so.conf and do
ldconfig. So now whenever you use OpenCV, you'd use the latest version. This is not the best way to do it but if you're still having problems with qt or gtk, try this once. This should work.