Module: tfg.rendering.camera.quadratic_radial_distortion
Stay organized with collections
Save and categorize content based on your preferences.
Quadratic radial lens distortion and un-distortion functions.
Given a vector in homogeneous coordinates, (x/z, y/z, 1)
, we define
r^2 = (x/z)^2 + (y/z)^2
. We use the simplest form of distortion function,
f(r) = 1 + k * r^2
. The distorted vector is given by
(f(r) * x/z, f(r) * y/z, 1)
.
To apply the undistortion, we need the inverse of f(r), g = f^{-1}. In this
library we use the approximate formula for the undistortion function given here
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4934233/, and refine the solution
using Newton-Raphson iterations (https://en.wikipedia.org/wiki/Newtons_method).
Restricting the distortion function to quadratic form allows to easily detect
the cases where r
goes beyond the monotonically-increasing range of f
(which
we refer to as overflow).
Functions
distortion_factor(...)
: Calculates a quadratic distortion factor given squared radii.
undistortion_factor(...)
: Calculates the inverse quadratic distortion function given squared radii.
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 2021-08-09 UTC.
[{
"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"
}]
{"lastModified": "Last updated 2021-08-09 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-08-09 UTC."],[],[]]