Ask Your Question

Revision history [back]

probably due to some wrong wrapping of imwrite() parameters from Python to C, cv2.IMWRITE_JPEG_QUALITY (which is of type "long") causes some weird problems... try to convert this constant to "int" type:

cv2.imwrite('img_CV2_90.jpg', a, [int(cv2.IMWRITE_JPEG_QUALITY), 90])

for me it solved the problem (python 2.7.2, opencv 2.4.1)

(answered on stackoverflow.com too)