How to create a transparent mask in opencv-python
问题 I have sign (signs with arbitrary shape) images with white background and I want to get an image of the sign with transparent background. I have managed to create a mask and apply it to the image and thought making the mask transparent would be doable. I searched a lot here and elsewhere, but nothing really helped me. import cv2 import numpy as np file_name = "/path/to/input/img/Unbenannt.jpg" # can be also .png img = cv2.imread(file_name) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) th,