Computes the matting linear coefficients.
tfg.image.matting.linear_coefficients(
matte: type_alias.TensorLike,
pseudo_inverse: type_alias.TensorLike,
name: str = 'matting_linear_coefficients'
) -> Tuple[tf.Tensor, tf.Tensor]
Computes the matting linear coefficients (a, b) based on the pseudo_inverse
generated by the build_matrices
function which implements the approach
proposed by Levin et al. in "A Closed Form Solution to Natural Image Matting".
Returns | |
---|---|
A tuple contraining two Tensors for the linear coefficients (a, b) of shape
[B, H, W, C] and [B, H, W, 1] .
|