Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unfortunately, given the weird and complicated pipeline you used, when creating this image, ALL information is in the alpha channel.

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.

unfortunately, given the weird and complicated pipeline you used, when creating this image, ALL information is in the alpha channel.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.