raisim::CameraPinholeDistortion
struct · #include <raisim/sensors/CameraLens.hpp>
OpenCV pinhole distortion of a PINHOLE lens (cv::projectPoints). With x = X/Z and y = Y/Z in the OpenCV optical frame and r2 = x^2 + y^2: radial = (1 + k1 r2 + k2 r2^2 + k3 r2^3) / (1 + k4 r2 + k5 r2^2 + k6 r2^3), xd = x radial + 2 p1 x y + p2 (r2 + 2 x^2) + s1 r2 + s2 r2^2, yd = y radial + p1 (r2 + 2 y^2) + 2 p2 x y + s3 r2 + s4 r2^2, followed by the sensor tilt (tauX, tauY), and u = fx xd + cx, v = fy yd + cy. PLUMB_BOB uses k1, k2, p1, p2 and k3 only; the other coefficients must be zero.
Public member functions
openCvCoefficients
std::array<double, 14> openCvCoefficients() constReturns The 14 coefficients in OpenCV order (k1, k2, p1, p2, k3, k4, k5, k6, s1..s4, tauX, tauY).
setOpenCvCoefficients
void setOpenCvCoefficients(const std::vector<double> &values)Set the coefficients from an OpenCV distCoeffs vector of 4, 5, 8, 12 or 14 values. Missing coefficients become zero. Four or five values select PLUMB_BOB, more select RATIONAL_POLYNOMIAL, an empty vector selects NONE. Any other count is a fatal error.
Parameters
| Parameter | Description |
|---|---|
values (in) | Coefficients in OpenCV order. |
isIdentity
bool isIdentity() constReturns true if the model is NONE or every coefficient is zero.
Public attributes
model
CameraDistortionModel modelDistortion model.
k1
double k1Radial coefficient k1.
k2
double k2Radial coefficient k2.
p1
double p1Tangential coefficient p1.
p2
double p2Tangential coefficient p2.
k3
double k3Radial coefficient k3.
k4
double k4Rational denominator coefficient k4.
k5
double k5Rational denominator coefficient k5.
k6
double k6Rational denominator coefficient k6.
s1
double s1Thin-prism coefficient s1.
s2
double s2Thin-prism coefficient s2.
s3
double s3Thin-prism coefficient s3.
s4
double s4Thin-prism coefficient s4.
tauX
double tauXSensor tilt about the x axis in radians.
tauY
double tauYSensor tilt about the y axis in radians.