47 for (
size_t i = 0; i <
dist.SizeAtCompileTime; i++)
dist[i] = 0;
119 double fx,
double fy,
double cx,
double cy)
131 for (
size_t i = 0; i < 5; i++) distParVector.set_unsafe(0, i,
dist[i]);
137 std::vector<double>
v(5);
138 for (
size_t i = 0; i < 5; i++)
v[i] =
dist[i];
146 for (
size_t i = 0; i < 5; i++)
dist[i] = distParVector.get_unsafe(0, i);
151 template <
class VECTORLIKE>
154 size_t N =
static_cast<size_t>(distParVector.size());
157 for (
size_t i = 0; i < N; i++)
dist[i] = distParVector[i];
164 double k1,
double k2,
double p1,
double p2,
double k3 = 0)
190 inline double k1()
const {
return dist[0]; }
192 inline double k2()
const {
return dist[1]; }
194 inline double p1()
const {
return dist[2]; }
196 inline double p2()
const {
return dist[3]; }
198 inline double k3()
const {
return dist[4]; }
void k1(double val)
Get the value of the k1 distortion parameter.
void p1(double val)
Get the value of the p1 distortion parameter.
double focalLengthMeters
The focal length of the camera, in meters (can be used among 'intrinsicParams' to determine the pixel...
double p1() const
Get the value of the p1 distortion parameter.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
#define DECLARE_MEXPLUS_FROM(complete_type)
This must be inserted if a custom conversion method for MEX API is implemented in the class...
double cy() const
Get the value of the principal point y-coordinate (in pixels).
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...
bool operator==(const mrpt::utils::TCamera &a, const mrpt::utils::TCamera &b)
void setDistortionParamsVector(const VECTORLIKE &distParVector)
Set the whole vector of distortion params of the camera from a 4 or 5-vector.
This class allows loading and storing values and vectors of different types from a configuration text...
double fx() const
Get the value of the focal length x-value (in pixels).
double fy() const
Get the value of the focal length y-value (in pixels).
double k1() const
Get the value of the k1 distortion parameter.
bool operator!=(const mrpt::utils::TCamera &a, const mrpt::utils::TCamera &b)
#define DECLARE_MEX_CONVERSION
This must be inserted if a custom conversion method for MEX API is implemented in the class...
double p2() const
Get the value of the p2 distortion parameter.
void setDistortionParamsVector(const mrpt::math::CMatrixDouble15 &distParVector)
Set the whole vector of distortion params of the camera.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &cfg, const std::string §ion)
overload This signature is consistent with the rest of MRPT APIs
uint32_t ncols
Camera resolution.
void fy(double val)
Set the value of the focal length y-value (in pixels).
GLsizei const GLchar ** string
double cx() const
Get the value of the principal point x-coordinate (in pixels).
mrpt::math::CMatrixDouble33 intrinsicParams
Matrix of intrinsic parameters (containing the focal length and principal point coordinates) ...
void p2(double val)
Get the value of the p2 distortion parameter.
std::vector< double > getDistortionParamsAsVector() const
Get a vector with the distortion params of the camera.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void k3(double val)
Get the value of the k3 distortion parameter.
double k3() const
Get the value of the k3 distortion parameter.
mrpt::math::CArrayDouble< 5 > dist
[k1 k2 t1 t2 k3] -> k_i: parameters of radial distortion, t_i: parameters of tangential distortion (d...
void k2(double val)
Get the value of the k2 distortion parameter.
void cx(double val)
Set the value of the principal point x-coordinate (in pixels).
void fx(double val)
Set the value of the focal length x-value (in pixels).
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...
std::string dumpAsText() const
Dumps all the parameters as a multi-line string, with the same format than saveToConfigFile.
double k2() const
Get the value of the k2 distortion parameter.
void cy(double val)
Set the value of the principal point y-coordinate (in pixels).
unsigned __int32 uint32_t
GLubyte GLubyte GLubyte a
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...
void getDistortionParamsVector(mrpt::math::CMatrixDouble15 &distParVector) const
Get the vector of distortion params of the camera.
void loadFromConfigFile(const std::string §ion, const mrpt::utils::CConfigFileBase &cfg)
Load all the params from a config source, in the format used in saveToConfigFile(), that is:
Structure to hold the parameters of a pinhole camera model.
void saveToConfigFile(const std::string §ion, mrpt::utils::CConfigFileBase &cfg) const
Save as a config block: