Read a gray scale or monochrome image with alpha channel [closed]
Repeating a question from stackoverflow.
How can I read a gray scale image in OpenCV with alpha channel? For example, if I try to read the following image, all I get is 2d array of all zeros.
image = cv2.imread('1.png', cv2.IMREAD_UNCHANGED)
image.shape
(480, 960)
believe it or not, opencv is a computer-vision library, where alpha channels have no relevance at all.
which opencv version do you use ? you might be missing this
Saving/loading images with alpha channels come handy while working on problems related to foreground/background extraction, object segmentation
I am using opencv 3.1 with python 3.5, let me try out the development version
just don''t expect too much. even, if you can load it, imshow won't be able to blit it correctly.