roblourens/facealign — Issue #1: Add FAQ explaining the solution to common errors
Author: daviddoria
Created: 2012-02-03 21:29:59+00:00
State: open

Here are two that I ran into that are easy to solve, but not obvious by their error output:
-------------
Q: I get this error, what do I do?
File "/home/doriad/src/facealign/src/FaceImage.py", line 1, in
import cv
ImportError: No module named cv

A) (at least on Ubuntu 11.10):
sudo apt-get install python-opencv

-----------------
Q) I get this error, what do I do?
*** Incomplete: data/1.jpg ***
Traceback (most recent call last):
File "/home/doriad/src/facealign/src/FaceImage.py", line 133, in runFaceImage
fi.cropToFace()
File "/home/doriad/src/facealign/src/FaceImage.py", line 23, in cropToFace
face = self._getFaceCoords()
File "/home/doriad/src/facealign/src/FaceImage.py", line 68, in _getFaceCoords
cascade = cv.Load(HCPATH)
TypeError: OpenCV returned NULL

A) This means you have not set your HCDIR variable correctly. Open src/config.py and set HCDIR to
[yourOpenCVDir]/opencv/data/haarcascades/, for example:
HCDIR = '/home/doriad/src/OpenCV/opencv/data/haarcascades/'