You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many feasible ways to merge two foreground images and a background together. Here, we see fg2 as a background image, and we composite fg and fg2 for a new foreground image by coefficients alpha and (1-alpha). alpha_tmp is a synthesized and acceptable alpha image. If the coefficients are alpha and (1-alpha2), it is not a convex combination and might overflow.
If you want the merging to be more reasonable, you can let fg = alpha1*(1-alpha2)/(1-(1-alpha1)*(1-alpha2))fg1 + alpha2/(1-(1-alpha1)(1-alpha2))*fg2, and still alpha = 1 - (1 - alpha) * (1 - alpha2). It means you merge fg1 with bg by alpha1 first, and then merge fg2 with the composition by alpha2.
in dataloader/data_gernerator.py _composite_fg function
alpha_tmp = 1 - (1 - alpha) * (1 - alpha2)
fg = fg.astype(np.float32) * alpha[:,:,None] + fg2.astype(np.float32) * (1 - alpha[:,:,None])
when compute new fg, the fg2 multiple (1-alpha) , but should fg2 muliple (1-alpha2) ?
https://github.com/Yaoyi-Li/GCA-Matting/blob/master/dataloader/data_generator.py#L520
The text was updated successfully, but these errors were encountered: