Thanks for tuning in to Google I/O. View all sessions on demand

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.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]