An algorithm has published on this recently whose results shown here. You can see that in the original image they expand the boundary to get the black out of contour of the black region shrink it to get inner contour and then those do alpha estimation where you estimate how much bleeding of one colour in one region happens into the other region, and then they move that to place the object in another region. | ![]() |