I have an image (a captcha) that I download from the web.

When I loaded to opencv it seems to loose its properties or simply mixes the transparent background with the dark/black colors:

Currently the code does nothing but loading a writing again:
captchaImg = cv2.imread('captcha1.png')
cv2.imwrite("captcha2.png", captchaImg)
I have tried loading also with options 0, 1, 2, 3 but the result is the same.
Using the provided constants might help. I do the equivalent of
captchaImg = cv2.imread('captcha1.png', cv2.IMREAD_UNCHANGED)
which reads the alpha channel (if there is one). The REPL says that cv2.IMREAD_UNCHANGED is -1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With