tfg.image.matting.linear_coefficients
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".
Args |
matte
|
A tensor of shape [B, H, W, 1] .
|
pseudo_inverse
|
A tensor of shape [B, H - pad, W - pad, C + 1, size^2]
containing the pseudo-inverse matrices computed by the build_matrices
function, where pad is equal to size - 1 and size is the patch size
used to compute this tensor.
|
name
|
A name for this op. Defaults to "matting_linear_coefficients".
|
Returns |
A tuple contraining two Tensors for the linear coefficients (a, b) of shape
[B, H, W, C] and [B, H, W, 1] .
|
Raises |
ValueError
|
If the last dimension of matte is not 1. If matte is not
of rank 4. If pseudo_inverse is not of rank 5. If B is different
between matte and pseudo_inverse .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-10-28 UTC.
[null,null,["Last updated 2022-10-28 UTC."],[],[]]