OpenCV tips and tricks
- 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?
- 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).»
- Use cv.CV_FOURCC() for getting the code for video codecs (en c++ it's a macro).
- Load the classifiers (for face detection for example) using
classifier = cv.Load("/full/path/to/opencv/share/classifier.xml")
This entry was posted in Uncategorized
. Bookmark the permalink