Ask Your Question

Revision history [back]

Which OpenCV version are you using? I have built my OpenCV some days ago and it doesn't have problems with cv2.IMREAD_GRAYSCALE, see:

philipp@mango:~$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.IMREAD_GRAYSCALE
0L

If something like the above already fails for you, chances are good your OpenCV version is too old.