Generates the closed form matting Laplacian.
tfg.image.matting.build_matrices(
image: type_alias.TensorLike,
size: int = 3,
eps: type_alias.Float = 1e-05,
name: str = 'matting_build_matrices'
) -> Tuple[tf.Tensor, tf.Tensor]
Generates the closed form matting Laplacian as proposed by Levin et al. in "A Closed Form Solution to Natural Image Matting". This function also return the pseudo-inverse matrix allowing to retrieve the matting linear coefficient.
Returns | |
---|---|
A tensor of shape [B, H - pad, W - pad, size^2, size^2] containing
the matting Laplacian matrices. A tensor of shape
[B, H - pad, W - pad, C + 1, size^2] containing the pseudo-inverse
matrices which can be used to retrieve the matting linear coefficients.
The padding pad is equal to size - 1 .
|