Given a vector describing a location in camera space in homogeneous coordinates, `(x/z, y/z, 1)`, squared_radius is `r^2 = (x/z)^2 + (y/z)^2`. distortion_factor multiplies `x/z` and `y/z` to obtain the distorted coordinates. In this function, `distortion_factor` is given by `1.0 + distortion_coefficient * squared_radius`.

In the following, A1 to An are optional batch dimensions, which must be broadcast compatible.

`squared_radius` A tensor of shape `[A1, ..., An, H, W]`, containing the radii of the image pixels computed as `(x/z)^2 + (y/z)^2`. We use squared radius rather than the radius itself to avoid an unnecessary `sqrt`, which may introduce gradient singularities. The non-negativity of squared radius is only enforced in debug mode.
`distortion_coefficient` A `scalar` or a tensor of shape `[A1, ..., An]`, which contains the distortion coefficients of each image.
`name` A name for this op. Defaults to "quadratic_radial_distortion_distortion_factor".

`distortion_factor` A tensor of shape `[A1, ..., An, H, W]`, the correction factor that should multiply the projective coordinates `(x/z)` and `(y/z)` to apply the distortion.
`overflow_mask` A boolean tensor of shape `[A1, ..., An, H, W]`, `True` where `squared_radius` is beyond the range where the distortion function is monotonically increasing. Wherever `overflow_mask` is True, `distortion_factor`'s value is meaningless.

[]
[]
{ "lastModified": "Last updated 2022-10-28 UTC.", "confidential": False }