Go to the documentation of this file.
53 std::array<double, 8>
dist{{.0, .0, .0, .0, .0, .0, .0, .0}};
112 double fx,
double fy,
double cx,
double cy)
126 for (
size_t i = 0; i < distParVector.
size(); i++)
127 distParVector(0, i) =
dist[i];
133 std::vector<double> v(8);
134 for (
size_t i = 0; i < 8; i++) v[i] =
dist[i];
143 for (
size_t i = 0; i < 5; i++)
dist[i] = distParVector(0, i);
148 template <
class VECTORLIKE>
151 auto N =
static_cast<size_t>(distParVector.size());
152 ASSERT_(N == 4 || N == 5 || N == 8);
154 for (
size_t i = 0; i < N; i++)
dist[i] = distParVector[i];
161 double k1,
double k2,
double p1,
double p2,
double k3 = 0)
187 inline double k1()
const {
return dist[0]; }
189 inline double k2()
const {
return dist[1]; }
191 inline double p1()
const {
return dist[2]; }
193 inline double p2()
const {
return dist[3]; }
195 inline double k3()
const {
return dist[4]; }
197 inline double k4()
const {
return dist[5]; }
199 inline double k5()
const {
return dist[6]; }
201 inline double k6()
const {
return dist[7]; }
232 struct hash<
mrpt::img::TCamera>
237 res = res * 31 + hash<double>()(k.
cx());
238 res = res * 31 + hash<double>()(k.
cy());
239 res = res * 31 + hash<double>()(k.
fx());
240 res = res * 31 + hash<double>()(k.
fy());
241 res = res * 31 + hash<uint32_t>()(k.
ncols);
242 res = res * 31 + hash<uint32_t>()(k.
nrows);
243 for (
unsigned int i = 0; i < k.
dist.size(); i++)
244 res = res * 31 + hash<double>()(k.
dist[i]);
void k4(double val)
Set the value of the k4 distortion parameter.
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates):
void fy(double val)
Set the value of the focal length y-value (in pixels).
void k1(double val)
Set the value of the k1 distortion parameter.
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
double k6() const
Get the value of the k6 distortion parameter.
double fx() const
Get the value of the focal length x-value (in pixels).
void p2(double val)
Set the value of the p2 distortion parameter.
void loadFromConfigFile(const std::string §ion, const mrpt::config::CConfigFileBase &cfg)
Load all the params from a config source, in the format used in saveToConfigFile(),...
double k1() const
Get the value of the k1 distortion parameter.
void setDistortionParamsFromValues(double k1, double k2, double p1, double p2, double k3=0)
Set the vector of distortion params of the camera from the individual values of the distortion coeffi...
void p1(double val)
Set the value of the p1 distortion parameter.
double k4() const
Get the value of the k4 distortion parameter.
std::array< double, 8 > dist
[k1 k2 t1 t2 k3 k4 k5 k6] -> k_i: parameters of radial distortion, t_i: parameters of tangential dist...
void getDistortionParamsVector(mrpt::math::CMatrixDouble15 &distParVector) const
Get the vector of distortion params of the camera
std::vector< double > getDistortionParamsAsVector() const
Get a vector with the distortion params of the camera
uint32_t ncols
Camera resolution.
void scaleToResolution(unsigned int new_ncols, unsigned int new_nrows)
Rescale all the parameters for a new camera resolution (it raises an exception if the aspect ratio is...
void cy(double val)
Set the value of the principal point y-coordinate (in pixels).
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool operator==(const mrpt::img::TCamera &a, const mrpt::img::TCamera &b)
#define ASSERT_(f)
Defines an assertion mechanism.
double cy() const
Get the value of the principal point y-coordinate (in pixels).
double focalLengthMeters
The focal length of the camera, in meters (can be used among 'intrinsicParams' to determine the pixel...
void setDistortionParamsVector(const mrpt::math::CMatrixDouble15 &distParVector)
Set the whole vector of distortion params of the camera.
double fy() const
Get the value of the focal length y-value (in pixels).
std::string dumpAsText() const
Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.
constexpr matrix_size_t size() const
Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x))
double cx() const
Get the value of the principal point x-coordinate (in pixels).
void loadFromConfigFile(const mrpt::config::CConfigFileBase &cfg, const std::string §ion)
overload This signature is consistent with the rest of MRPT APIs
This class allows loading and storing values and vectors of different types from a configuration text...
void k6(double val)
Set the value of the k6 distortion parameter.
DECLARE_MEXPLUS_FROM(mrpt::img::TCamera) namespace std
The virtual base class which provides a unified interface for all persistent objects in MRPT.
Parameters for the Brown-Conrady camera lens distortion model.
void saveToConfigFile(const std::string §ion, mrpt::config::CConfigFileBase &cfg) const
Save as a config block:
void setDistortionParamsVector(const VECTORLIKE &distParVector)
Set the whole vector of distortion params of the camera from a 4, 5, or 8-vector (see definition of d...
void setIntrinsicParamsFromValues(double fx, double fy, double cx, double cy)
Set the matrix of intrinsic params of the camera from the individual values of focal length and princ...
bool operator!=(const mrpt::img::TCamera &a, const mrpt::img::TCamera &b)
double k3() const
Get the value of the k3 distortion parameter.
void k3(double val)
Set the value of the k3 distortion parameter.
void cx(double val)
Set the value of the principal point x-coordinate (in pixels).
double k2() const
Get the value of the k2 distortion parameter.
void k5(double val)
Set the value of the k5 distortion parameter.
void k2(double val)
Set the value of the k2 distortion parameter.
double p2() const
Get the value of the p2 distortion parameter.
#define DECLARE_MEX_CONVERSION
This must be inserted if a custom conversion method for MEX API is implemented in the class.
double p1() const
Get the value of the p1 distortion parameter.
void fx(double val)
Set the value of the focal length x-value (in pixels).
double k5() const
Get the value of the k5 distortion parameter.
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sat Jun 27 14:00:59 UTC 2020 | |