Softening edges of segmented image? (blend without background) [closed]

asked 2017-04-15 16:45:28 -0600

I am segmenting an image using GrabCut. However, Grabcut is very slow, so I am downscaling the image before running the algorithm and getting a mask. This mask is then upscaled and applied to the original image. I then put my segmented foreground into a background of purely transparent alpha value. This works decently well but the edges are super rough. What I mean is that, since my segmentation was done on a low res photo, the outline isn't perfect. What I'd like to do is transition the edges of my foreground so that the alpha value gradually goes from opaque foreground to transparent background.

Is there a good, established algorithm for transitioning alpha values from opaque foreground to transparent background? It seems almost like a blending algorithm without the background image.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-15 14:22:21.745563

Comments

Have you try MultiBandBlender class ?

LBerger gravatar imageLBerger ( 2017-04-16 03:13:58 -0600 )edit