Stay organized with collections Save and categorize content based on your preferences.
Defines all required parameters to correct the distortion caused by the lenses.
Public Constructors Public Methods static Distortion float distort(float radius)
Distorts a radius by its distortion factor from the center of the lenses.
float boolean equals(
Objectother)
Compares this instance with the specified object and indicates if they are equal.
Distortion float[] getCoefficients()
Returns the current coefficients for lens distortion correction.
void setCoefficients(float[] coefficients)
Sets the coefficients for lens distortion correction.
String toString()
Returns a string containing a concise, human-readable description of this object.
Inherited Methods From class java.lang.Object boolean final Class<?>getClass()
inthashCode()
final voidnotify()
final voidnotifyAll()
StringtoString()
final voidwait(long arg0, int arg1)
final voidwait(long arg0)
final voidwait()
Public Constructors public Distortion (Distortion other)Constructs a copy of another distortion object.
Parameters other The distortion object to copy from. Public Methods public static Distortion cardboardV1Distortion ()Return distortion parameters for Cardboard v1.0.0.
public float distort (float radius)Distorts a radius by its distortion factor from the center of the lenses.
Parameters radius Radius from the lens center in tan-angle units. ReturnsReturns the distortion factor of a point.
Parameters radius Radius of the point from the lens center in tan-angle units. ReturnsCompares this instance with the specified object and indicates if they are equal.
Parameters other The object to compare this instance with. Returnstrue
if the objects are equal, false
otherwise.Builds an inverse-distortion object with least-squares-fitted coefficients.
This is intended for implementing application-side custom distortion. Use .getCoefficients() on the returned object to retrieve the inverse distortion function's coefficients.
This is an approximate inverse, and using .distort() on the returned object will be faster but less accurate than using the distortInverse() method on the original. For useful results, the input distortion must be well-behaved in the 0..maxRadius range.
Example for 50 degree half-angle FOV (100 degrees total), this will create an inverse distortion where inverse.distort(r) approximately equals distortion.distortInverse(r) in the range r = 0 ... maxFovHalfAngle.
float maxFovHalfAngle = 50.0f * Math.PI / 180.0f; float maxRadiusLens = distortion.distortInverse(maxFovHalfAngle); Distortion inverse = distortion.getApproximateInverseDistortion( maxRadiusLens, 6);Parameters maxRadius Maximum supported radius in tan-angle units in lens space (after applying barrel distortion). Should be set to inverseDistort(tan(maximum expected FOV angle)) to create an inverse that will be usable for inputs up to tan(maximum expected FOV angle). numCoefficients Number of desired coefficients, more provide a better fit. Does not need to match the number of coefficients in the input distortion object. 6 coefficients recommended for current GVR viewers, using more can get numerically unstable. Returns
Returns the current coefficients for lens distortion correction.
ReturnsSets the coefficients for lens distortion correction.
The coefficients Ki correspond to the pincushion distortion equation:
p' = p (1 + K1 r^2 + K2 r^4 + ... + Kn r^(2n))
Where r is the distance from the optical center, p the input point and p' the output point.
Parameters coefficients Barrel distortion coefficients to set. public String toString ()Returns a string containing a concise, human-readable description of this object.
ReturnsAll rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-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 2024-10-09 UTC."],[[["The `Distortion` class defines parameters for correcting lens distortion in VR applications."],["It provides methods to distort and undistort points based on lens characteristics."],["You can retrieve or set distortion coefficients to customize the correction process."],["A pre-calculated distortion for Cardboard v1.0.0 is available through `cardboardV1Distortion()`."],["It's possible to create an approximate inverse distortion for custom application-side distortion implementations."]]],["The `Distortion` class defines parameters for correcting lens distortion. It allows creating distortion objects, including copying existing ones or retrieving Cardboard v1.0.0 distortion parameters. Key actions include: distorting a radius, getting a point's distortion factor, comparing objects for equality, and generating an inverse-distortion object. Users can set or retrieve distortion correction coefficients. Methods are provided to convert to String, get coefficient values, and set coefficients. It can build an inverse distortion with a given number of coefficients.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4