28 : s_(0), u0_((double)w / 2.0), v0_((double)h / 2.0) {
29 double a = fov *
M_PI / 360.0;
30 fx_ = double(w) / (2.0 *
tan(a));
36 const auto buffer = path + std::string(
"/calibration_info.txt");
37 std::ifstream infile(
buffer, std::ios::in);
39 if (infile && !infile.eof()) {
42 throw std::runtime_error(
"Cal3: Unable to load the calibration");
50 os <<
"fx: " << cal.
fx() <<
", fy: " << cal.
fy() <<
", s: " << cal.
skew()
51 <<
", px: " << cal.
px() <<
", py: " << cal.
py();
68 K_inverse << 1.0 /
fx_, -
s_ / fxy, (sv0 - fyu0) / fxy, 0.0, 1.0 / fy_,
69 -v0_ / fy_, 0.0, 0.0, 1.0;
void print(const Matrix &A, const string &s, ostream &stream)
virtual void print(const std::string &s="") const
print with optional string
double fy() const
focal length y
GTSAM_EXPORT friend std::ostream & operator<<(std::ostream &os, const Cal3 &cal)
Output stream operator.
virtual Matrix3 K() const
return calibration matrix K
double py() const
image center in y
EIGEN_DEVICE_FUNC const TanReturnType tan() const
Common code for all Calibration models.
Cal3()=default
Create a default calibration that leaves coordinates unchanged.
bool equals(const Cal3 &K, double tol=10e-9) const
Check if equal up to specified tolerance.
double v0_
principal point
ofstream os("timeSchurFactors.csv")
double px() const
image center in x
double fx() const
focal length x
Matrix3 inverse() const
Return inverted calibration matrix inv(K)