A lens distortion model. More...
#include <Common.hpp>
Public Member Functions | |
| Model () | |
| Default constructor, for no distortion. | |
| Model (const sal3d_lens_distortion &model) | |
| Constructor from a C sal3d_lens_distortion. | |
| Point2D | undistort (const Point2D &p) const |
| Undistort a point in pixel coordinates. | |
| ModelType | getType () const |
| Get the type of the distortion model. | |
| std::vector< float > | getCoeffs () const |
| Get the coefficients of the distortion model. | |
| const sal3d_lens_distortion & | c_lens_distortion () const |
| Returns a copy of the internal C model. | |
| float | getErrorMean () const |
| Return the mean of the error statistic. | |
| float | getErrorStdDev () const |
| Return the mean of the error statistic. | |
| float | getErrorMax () const |
| Return the max of the error statistic. | |
Static Public Member Functions | |
| static Model | createTsai (float x, float y, float k) |
| Create a Tsai Model out of coefficients. | |
Static Public Attributes | |
| static const int | TsaiNumCoeffs = 3 |
| Number of coefficients for the Tsai distortion model. | |
| static const int | CubicNumCoeffs = 20 |
| Number of coefficients for the Cubic distortion model. | |
A lens distortion model.
The lens distortion model holds the information that makes it possible to undistort the data captured from the camera prior to processing it with sal3d.
Currently the only model fully supported is the Tsai model, which corrects the radial distortion. The module LensCalibration has the functions needed to compute a calibration model out of a sal3d::Frame from a chessboard or dots pattern.
The lens model is then stored in the metric configuration when the metric calibration is performed. From that point on, every time that metric is used, the lens model is also applied, for example when converting a sal3d::RangeMap to a sal3d::COP.
| sal3d::LensDistortion::Model::Model | ( | const sal3d_lens_distortion & | model | ) | [inline] |
Constructor from a C sal3d_lens_distortion.
| [in] | model | The C sal3d_lens_distortion used to create this object. |
| const sal3d_lens_distortion& sal3d::LensDistortion::Model::c_lens_distortion | ( | ) | const [inline] |
Returns a copy of the internal C model.
Referenced by sal3d::AngularMetric::calibrate(), and sal3d::Metric::calibrate().
| static Model sal3d::LensDistortion::Model::createTsai | ( | float | x, |
| float | y, | ||
| float | k | ||
| ) | [inline, static] |
| std::vector<float> sal3d::LensDistortion::Model::getCoeffs | ( | ) | const [inline] |
Get the coefficients of the distortion model.
This function returns a vector with the coefficients of the distortion model. Depending on the ModelType, the number of coefficients varies.
References CubicNumCoeffs, and TsaiNumCoeffs.
| float sal3d::LensDistortion::Model::getErrorMax | ( | ) | const [inline] |
Return the max of the error statistic.
Please check the documentation of getErrorMean() for a detailed explanation.
| float sal3d::LensDistortion::Model::getErrorMean | ( | ) | const [inline] |
Return the mean of the error statistic.
The methods getErrorMean(), getErrorStdDev() and getErrorMax() return statistical results of the pixel distances between the corrected points and where should they ideally to fit the model perfectly.
Having big statistical measures can be caused both by a distortion not properly correctable by the calibration model, or by a bad adquisition of a calibration pattern. Depending on the resolutions involved, the calibration may require very acurate printing, flatness and focusing of the patterns.
For the case of Tsai model calibrations, the statistic is done over the signed distances between the corrected points and the lines of the pattern.
For the case of Cubic model calibrations, the statistic is done over the absolute distances between the corrected points, and ideal distortion-less points based on the pattern orientation.
| float sal3d::LensDistortion::Model::getErrorStdDev | ( | ) | const [inline] |
Return the mean of the error statistic.
Please check the documentation of getErrorMean() for a detailed explanation.
| ModelType sal3d::LensDistortion::Model::getType | ( | ) | const [inline] |
| Point2D sal3d::LensDistortion::Model::undistort | ( | const Point2D & | p | ) | const [inline] |
Undistort a point in pixel coordinates.
This function takes a Point2D in pixel coordinates and uses the lens model to undistort it.
| [in] | p | The point in pixel coordinates. |
References sal3d::Point2D::c_point_2d().
by
1.7.6.1