imshow can not correctly show a png file
when I try to imshow a png
it show noting.
But I can use the chrome open the png file and show it.
when I try to imshow a png
it show noting.
But I can use the chrome open the png file and show it.
unfortunately, given the weird and complicated pipeline you used, when creating this image, ALL information is in the alpha channel (ONLY!).
so, needs a small detour to make it visible:
im = cv2.imread("platine.png", -1) # keep alpha
alpha = im[:,:,3] # extract it
binary = ~alpha # invert b/w
cv2.imshow("P",binary)
cv2.waitKey()
imho you should avoid anything with alpha in it, it only causes trouble.
you probably should try to change your pipeline, so it saves a single channel image, with black contours on white bg, instead of trying to mend it later like above.
Asked: 2018-03-22 11:16:17 -0600
Seen: 8,486 times
Last updated: Mar 23 '18
It shows nothing ? What does it mean? opencv is an image processing library It does not process alpha channel
please show your code. most likely, there's something simple missing, like a waitkey().
Well, your image is transparent. So when you display it, every pixel is either background (black) or black. That's why you don't see anything.
So how should I display it. I export a pcb file to pdf, and then I open pdf by office word2016, and then I save this picture to png file, and I can not imshow it .
you use word for image manipulation ? lol. that sounds bad.