# tfg.image.matting.reconstruct

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/image/matting.py#L265-L303) |

Reconstruct the matte from the image using the linear coefficients.

    tfg.image.matting.reconstruct(
        image: type_alias.TensorLike,
        coeff_mul: type_alias.TensorLike,
        coeff_add: type_alias.TensorLike,
        name: str = 'matting_reconstruct'
    ) -> tf.Tensor

Reconstruct the matte from the image using the linear coefficients (a, b)
returned by the linear_coefficients function.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `image` | A tensor of shape `[B, H, W, C]` . |
| `coeff_mul` | A tensor of shape `[B, H, W, C]` representing the multiplicative part of the linear coefficients. |
| `coeff_add` | A tensor of shape `[B, H, W, 1]` representing the additive part of the linear coefficients. |
| `name` | A name for this op. Defaults to "matting_reconstruct". |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape `[B, H, W, 1]` containing the mattes. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If `image`, `coeff_mul`, or `coeff_add` are not of rank 4. If the last dimension of `coeff_add` is not 1. If the batch dimensions of `image`, `coeff_mul`, and `coeff_add` do not match. |

<br />