MarcoForte / closed-form-matting

Python implementation of A. Levin D. Lischinski and Y. Weiss. A Closed Form Solution to Natural Image Matting. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), June 2006, New York
MIT License
435 stars 107 forks source link

Difference with Laplacian code of PhotoWCT #12

Closed vadimkantorov closed 6 years ago

vadimkantorov commented 6 years ago

Hi! The code is very similar compared to the PhotoWCT code of NVidia, except one line:

https://github.com/NVIDIA/FastPhotoStyle/blob/master/photo_smooth.py#L79 : vals = (1/win_size)*(1 + np.einsum('...ij,...kj->...ik', X, winI - win_mu))

https://github.com/MarcoForte/closed-form-matting/blob/master/closed_form_matting.py#L100 : vals = np.eye(win_size) - (1.0/win_size)*(1 + np.einsum('...ij,...kj->...ik', X, winI - win_mu))

Does it mean your function computes 1 - L intead?