Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #imgname = input(str)
- imgname = "E:\\Desktop\\CCG\\Greenshoes\\segmentation\\in\\0_mask_.png"
- def PaintImageWhite(g):
- image = cv.imread(g, cv.IMREAD_UNCHANGED)
- altura,largura=image.shape[:2]
- print(str(image.shape))
- for y in range(altura):
- for x in range(largura):
- if image[y,x][3] == 0:
- image[y,x] = [255,255,255,255]
- return image
- imga = PaintImageWhite(imgname)
- imgClone = "E:\\Desktop\\" +"ola_clone"+".png"
- cv.imwrite(imgClone, imga)
- #cv.imshow('imga',imga)
- imgc = cv.cvtColor(imga, cv.COLOR_BGRA2BGR)
- #cv.imshow('imgc',imgc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement