I am trying to remove a greyish background from a photo and replace it with a white one
so far I have this code:
image = cv2.imread(args[\"image\"])
First convert to GRAY and then threshold with cv2.threshold and then use numpy masking...
ret, thresh = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), 220, 255, cv2.THRESH_BINARY) img[thresh == 255] = 255
If need black background set RHS to zero instead of 255