- Install:
-
sudo apt-get install libavformat-dev libavcodec-dev libavfilter-dev libswscale-dev
- Download an compile OpenCV, it's better and it takes only a few minutes to compile.
- OpenCV changed the API, all these examples that import "highgui" and "cv2.cv" and so are wrong! Now you have to use:
import cv
- Problem capturing keys? waitKey() doesn't return strings or chars! instead it returns a that number you need to mask with 255:
my_key = chr(cv.waitKey(10) & 255)
- Cannot capture from your camera?
http://stackoverflow.com/questions/4749498/cant-access-webcam-with-opencv
- Install libv4l-dev before compiling in Ubuntu or your camera will not capture anything (empty window).
- «if you only have one camera, or you don't care which camera is the correct one, then use "-1" as the index. Ie for your example capture = cv.CaptureFromCAM(-1).»
http://stackoverflow.com/questions/2601194/displaying-webcam-feed-using-opencv-and-python
- Use cv.CV_FOURCC() for getting the code for video codecs (en c++ it's a macro).
http://stackoverflow.com/questions/5426637/writing-video-with-opencv-python-mac
- Load the classifiers (for face detection for example) using
classifier = cv.Load("/full/path/to/opencv/share/classifier.xml")