Calibration of a camera with radial distortion.
Uses same distortionmodel as OpenCV, with http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html but using only k1,k2,p1, and p2 coefficients. K = [ fx s u0 ; 0 fy v0 ; 0 0 1 ] r² = P.x² + P.y² P̂ = (1 + k1*r² + k2*r⁴) P + [ (2*p1 P.x P.y) + p2 (r² + 2 Pn.x²) p1 (r² + 2 Pn.y²) + (2*p2 Pn.x Pn.y) ] pi = K*P̂
|
|
class | boost::serialization::access |
| | Serialization function.
|
|
|
GTSAM_EXPORT friend std::ostream & | operator<< (std::ostream &os, const Cal3DS2_Base &cal) |
| | Output stream operator.
|
| void | print (const std::string &s="") const override |
| | print with optional string
|
|
bool | equals (const Cal3DS2_Base &K, double tol=1e-8) const |
| | assert equality up to a tolerance
|
|
|
| Cal3DS2_Base ()=default |
| | Default Constructor with only unit focal length.
|
|
| Cal3DS2_Base (double fx, double fy, double s, double u0, double v0, double k1, double k2, double p1=0.0, double p2=0.0, double tol=1e-5) |
|
|
| Cal3DS2_Base (const Vector9 &v) |
|
|
double | k1 () const |
| | First distortion coefficient.
|
|
double | k2 () const |
| | Second distortion coefficient.
|
|
double | p1 () const |
| | First tangential distortion coefficient.
|
|
double | p2 () const |
| | Second tangential distortion coefficient.
|
|
Vector4 | k () const |
| | return distortion parameter vector
|
|
Vector9 | vector () const |
| | Return all parameters as a vector.
|
| Point2 | uncalibrate (const Point2 &p, OptionalJacobian< 2, 9 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const |
| | convert intrinsic coordinates xy to (distorted) image coordinates uv
|
|
Point2 | calibrate (const Point2 &p, OptionalJacobian< 2, 9 > Dcal=boost::none, OptionalJacobian< 2, 2 > Dp=boost::none) const |
| | Convert (distorted) image coordinates uv to intrinsic coordinates xy.
|
|
Matrix2 | D2d_intrinsic (const Point2 &p) const |
| | Derivative of uncalibrate wrpt intrinsic coordinates.
|
|
Matrix29 | D2d_calibration (const Point2 &p) const |
| | Derivative of uncalibrate wrpt the calibration parameters.
|
| size_t | dim () const override |
| | return DOF, dimensionality of tangent space
|
|
static size_t | Dim () |
| | return DOF, dimensionality of tangent space
|
|
| enum | { dimension = 9
} |
|
using | shared_ptr = boost::shared_ptr<Cal3DS2_Base> |
| enum | { dimension = 5
} |
|
using | shared_ptr = boost::shared_ptr<Cal3> |
|
|
double | k1_ = 0.0f |
|
double | k2_ = 0.0f |
| | radial 2nd-order and 4th-order
|
|
double | p1_ = 0.0f |
|
double | p2_ = 0.0f |
| | tangential distortion
|
|
double | tol_ = 1e-5 |
| | tolerance value when calibrating
|
|
double | fx_ = 1.0f |
|
double | fy_ = 1.0f |
| | focal length
|
|
double | s_ = 0.0f |
| | skew
|
|
double | u0_ = 0.0f |
|
double | v0_ = 0.0f |
| | principal point
|
|
|
bool | equals (const Cal3 &K, double tol=10e-9) const |
| | Check if equal up to specified tolerance.
|
|
| Cal3 ()=default |
| | Create a default calibration that leaves coordinates unchanged.
|
|
| Cal3 (double fx, double fy, double s, double u0, double v0) |
| | constructor from doubles
|
|
| Cal3 (const Vector5 &d) |
| | constructor from vector
|
| | Cal3 (double fov, int w, int h) |
| | Easy constructor, takes fov in degrees, asssumes zero skew, unit aspect.
|
|
virtual | ~Cal3 () |
| | Virtual destructor.
|
| | Cal3 (const std::string &path) |
| | Load calibration parameters from calibration_info.txt file located in path directory.
|
|
double | fx () const |
| | focal length x
|
|
double | fy () const |
| | focal length y
|
|
double | aspectRatio () const |
| | aspect ratio
|
|
double | skew () const |
| | skew
|
|
double | px () const |
| | image center in x
|
|
double | py () const |
| | image center in y
|
|
Point2 | principalPoint () const |
| | return the principal point
|
|
Vector5 | vector () const |
| | vectorized form (column-wise)
|
| virtual Matrix3 | K () const |
| | return calibration matrix K
|
|
Matrix3 | inverse () const |
| | Return inverted calibration matrix inv(K).
|
|
static size_t | Dim () |
| | return DOF, dimensionality of tangent space
|
◆ clone()
| virtual boost::shared_ptr< Cal3DS2_Base > gtsam::Cal3DS2_Base::clone |
( |
| ) |
const |
|
inlinevirtual |
◆ dim()
| size_t gtsam::Cal3DS2_Base::dim |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ print()
| void gtsam::Cal3DS2_Base::print |
( |
const std::string & | s = "" | ) |
const |
|
overridevirtual |
◆ uncalibrate()
convert intrinsic coordinates xy to (distorted) image coordinates uv
- Parameters
-
| p | point in intrinsic coordinates |
| Dcal | optional 2*9 Jacobian wrpt Cal3DS2 parameters |
| Dp | optional 2*2 Jacobian wrpt intrinsic coordinates |
- Returns
- point in (distorted) image coordinates
The documentation for this class was generated from the following files: