1

I have this script part:

image = cv2.imdecode(data, 1)                
cv2.putText(image,"Hello World!", (10,10), cv2.FONT_HERSHEY_SIMPLEX, 1, 255)
cv2.imwrite("/temp/image.jpg", image)

This works fine.

But I want to encode the edited image with imencode():

result, img = cv2.imencode('.jpg', image, [1, 90])

And I get this error message: result, encimg = cv2.imencode('.jpg', image, [1, 90])

TypeError: 'bool' object is not iterable

Anyone know what's wrong with this?

1
  • 2
    Instead of excerpting the part of the error you think is relevant to us, please edit your question to include the full traceback Commented Feb 2, 2014 at 0:52

1 Answer 1

1

This looks like an older opencv version, where the signature was result=imencode(ext, img, outBuffer)

Hopefully you can get a newer opencv library version.

See http://opencv-users.1802565.n2.nabble.com/Bug-Python-cv2-imencode-td7185380.html for a similar report.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.