Jafar
|
Namespace for operations related to the pin-hole model of a camera. More...
Namespace for operations related to the pin-hole model of a camera.
The model incorporates radial distortion.
Functions | |
template<class V > | |
vec2 | projectPointToNormalizedPlane (const V &v) |
Pin-hole canonical projection. | |
template<class V , class P > | |
void | projectPointToNormalizedPlane (const V &v, P &up, double &dist) |
Pin-hole canonical projection. | |
template<class V , class U , class MU_v > | |
void | projectPointToNormalizedPlane (const V &v, U &up, MU_v &UP_v) |
Pin-hole canonical projection, with jacobian. | |
template<class V , class U , class MU_v > | |
void | projectPointToNormalizedPlane (const V &v, U &up, double &dist, MU_v &UP_v) |
Pin-hole canonical projection, distance and with jacobian. | |
template<class U > | |
vec3 | backprojectPointFromNormalizedPlane (const U &u, double depth=1) |
Canonical back-projection. | |
template<class U , class P , class MP_u , class MP_depth > | |
void | backprojectPointFromNormalizedPlane (const U &u, const double depth, P &p, MP_u &P_u, MP_depth &P_depth) |
Canonical back-projection. | |
template<class VD > | |
double | distortFactor (const VD &d, double r2) |
Distortion factor for the model s = 1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + ... | |
template<class VD , class VU > | |
jblas::vec2 | distortPoint (const VD &d, const VU &up, double r2max) |
Radial distortion: ud = (1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + etc) * u. | |
template<class VD , class VUp , class VUd , class MUD_up > | |
void | distortPoint (const VD &d, const VUp &up, VUd &ud, double r2max, MUD_up &UD_up) |
Radial distortion: ud = (1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + etc) * u, with jacobians. | |
template<class VC , class VU > | |
jblas::vec2 | undistortPoint (const VC &c, const VU &ud) |
template<class VC , class VUd , class VUp , class MUP_ud > | |
void | undistortPoint (const VC &c, const VUd &ud, VUp &up, MUP_ud &UP_ud) |
template<class VK , class VU > | |
jblas::vec2 | pixellizePoint (const VK &k, const VU &ud) |
Pixellization from k = [u_0, v_0, a_u, a_v]. | |
template<class VK , class VUd , class VU , class MU_ud > | |
void | pixellizePoint (const VK &k, const VUd &ud, VU &u, MU_ud &U_ud) |
Pixellization from k = [u_0, v_0, a_u, a_v] with jacobians. | |
template<class VK , class VU > | |
jblas::vec2 | depixellizePoint (const VK &k, const VU &u) |
Depixellization from k = [u_0, v_0, a_u, a_v]. | |
template<class VK , class VUd , class VU , class MUD_u > | |
void | depixellizePoint (const VK &k, const VU &u, VUd &ud, MUD_u &UD_u) |
Depixellization from k = [u_0, v_0, a_u, a_v], with Jacobians. | |
template<class VK , class VD , class V > | |
vec2 | projectPoint (const VK &k, const VD &d, const V &v, double r2max) |
Project a point into a pin-hole camera with radial distortion. | |
template<class VK , class VD , class V , class U > | |
void | projectPoint (const VK &k, const VD &d, const V &v, U &u, double r2max, double &dist) |
Project a point into a pin-hole camera with radial distortion. | |
template<class VK , class VD , class V , class VU , class MU_v > | |
void | projectPoint (const VK &k, const VD &d, const V &v, VU &u, double r2max, MU_v &U_v) |
Project a point into a pin-hole camera with radial distortion. | |
template<class VK , class VD , class V , class VU , class MU_v > | |
void | projectPoint (const VK &k, const VD &d, const V &v, VU &u, double r2max, double &dist, MU_v &U_v) |
Project a point into a pin-hole camera with radial distortion. | |
template<class VK , class VC , class U > | |
vec3 | backprojectPoint (const VK &k, const VC &c, const U &u, const double depth=1.0) |
Back-Project a point from a pin-hole camera with radial distortion. | |
template<class VK , class VC , class U , class P , class MP_u , class MP_depth > | |
void | backProjectPoint (const VK &k, const VC &c, const U &u, double depth, P &p, MP_u &P_u, MP_depth &P_depth) |
Back-Project a point from a pin-hole camera with radial distortion; give Jacobians. | |
template<class VPix > | |
bool | isInRoi (const VPix &pix, const int x, const int y, const int width, const int height) |
Determine if a pixel is inside the region of interest. | |
template<class VPix > | |
bool | isInImage (const VPix &pix, const int &width, const int &height) |
Determine if a pixel is inside the image. | |
template<class Vk , class Vd , class Vc > | |
void | computeCorrectionModel (const int width, const int height, const Vk &k, const Vd &d, Vc &c, double &r_max) |
Compute distortion correction parameters. |
vec3 jafar::rtslam::pinhole::backprojectPoint | ( | const VK & | k, |
const VC & | c, | ||
const U & | u, | ||
const double | depth = 1.0 |
||
) |
Back-Project a point from a pin-hole camera with radial distortion.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
c | the radial undistortion parameters vector |
u | the 2D pixel |
depth | the depth prior |
Definition at line 471 of file pinholeTools.hpp.
References backprojectPointFromNormalizedPlane(), and depixellizePoint().
void jafar::rtslam::pinhole::backProjectPoint | ( | const VK & | k, |
const VC & | c, | ||
const U & | u, | ||
double | depth, | ||
P & | p, | ||
MP_u & | P_u, | ||
MP_depth & | P_depth | ||
) |
Back-Project a point from a pin-hole camera with radial distortion; give Jacobians.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
c | the radial undistortion parameters vector |
u | the 2D pixel |
depth | the depth prior |
p | the back-projected 3D point |
P_u | Jacobian of p wrt u |
P_depth | Jacobian of p wrt depth |
Definition at line 486 of file pinholeTools.hpp.
References backprojectPointFromNormalizedPlane(), and depixellizePoint().
vec3 jafar::rtslam::pinhole::backprojectPointFromNormalizedPlane | ( | const U & | u, |
double | depth = 1 |
||
) |
Canonical back-projection.
u | the 2D point in the image plane |
depth | point's depth orthogonal to image plane. Defaults to 1.0 |
Definition at line 115 of file pinholeTools.hpp.
Referenced by backprojectPoint(), backProjectPoint(), and backprojectPointFromNormalizedPlane().
void jafar::rtslam::pinhole::backprojectPointFromNormalizedPlane | ( | const U & | u, |
const double | depth, | ||
P & | p, | ||
MP_u & | P_u, | ||
MP_depth & | P_depth | ||
) |
Canonical back-projection.
u | the 2D point in the image plane. |
depth | point's depth orthogonal to image plane. |
p | the 3D point. |
P_u | Jacobian of p wrt u. |
P_depth | Jacobian of p wrt depth. |
Definition at line 133 of file pinholeTools.hpp.
References backprojectPointFromNormalizedPlane().
void jafar::rtslam::pinhole::computeCorrectionModel | ( | const int | width, |
const int | height, | ||
const Vk & | k, | ||
const Vd & | d, | ||
Vc & | c, | ||
double & | r_max | ||
) |
Compute distortion correction parameters.
This method follows the one in Joan Sola's thesis [1], pag 46--49.
size,: | the size of the desired correction vector. |
r_max,: | return r_max to be used to avoid bringing back landmarks outside of the image inside because of invalidity of model |
Definition at line 529 of file pinholeTools.hpp.
References distortFactor().
Referenced by jafar::rtslam::SensorImageParameters::setIntrinsicCalibration().
jblas::vec2 jafar::rtslam::pinhole::depixellizePoint | ( | const VK & | k, |
const VU & | u | ||
) |
Depixellization from k = [u_0, v_0, a_u, a_v].
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
u | the point to depixellize, in pixels |
Definition at line 354 of file pinholeTools.hpp.
Referenced by backprojectPoint(), backProjectPoint(), and depixellizePoint().
void jafar::rtslam::pinhole::depixellizePoint | ( | const VK & | k, |
const VU & | u, | ||
VUd & | ud, | ||
MUD_u & | UD_u | ||
) |
Depixellization from k = [u_0, v_0, a_u, a_v], with Jacobians.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
u | the point to depixellize, in pixels |
ud | the depixellized point |
UD_u | the Jacobian of ud wrt u |
Definition at line 374 of file pinholeTools.hpp.
References depixellizePoint().
double jafar::rtslam::pinhole::distortFactor | ( | const VD & | d, |
double | r2 | ||
) |
Distortion factor for the model s = 1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + ...
r2 | the square of the radius to evaluate, r2 = r^2. |
Definition at line 154 of file pinholeTools.hpp.
Referenced by computeCorrectionModel(), and distortPoint().
jblas::vec2 jafar::rtslam::pinhole::distortPoint | ( | const VD & | d, |
const VU & | up, | ||
double | r2max | ||
) |
Radial distortion: ud = (1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + etc) * u.
d | the distortion parameters vector |
up | the point to distort |
Definition at line 173 of file pinholeTools.hpp.
References distortFactor().
Referenced by projectPoint().
void jafar::rtslam::pinhole::distortPoint | ( | const VD & | d, |
const VUp & | up, | ||
VUd & | ud, | ||
double | r2max, | ||
MUD_up & | UD_up | ||
) |
Radial distortion: ud = (1 + d_0 * r^2 + d_1 * r^4 + d_2 * r^6 + etc) * u, with jacobians.
d | the radial distortion parameters vector |
up | the point to distort |
ud | the distorted point |
UD_up | the Jacobian of ud wrt up |
Definition at line 200 of file pinholeTools.hpp.
bool jafar::rtslam::pinhole::isInImage | ( | const VPix & | pix, |
const int & | width, | ||
const int & | height | ||
) |
Determine if a pixel is inside the image.
pix | the pixel to test |
width | the image width, in pixels |
height | the image height, in pixels |
Definition at line 515 of file pinholeTools.hpp.
References isInRoi().
bool jafar::rtslam::pinhole::isInRoi | ( | const VPix & | pix, |
const int | x, | ||
const int | y, | ||
const int | width, | ||
const int | height | ||
) |
Determine if a pixel is inside the region of interest.
pix | the pixel to test |
roi | the region of interest, in pixels |
Definition at line 504 of file pinholeTools.hpp.
Referenced by isInImage().
jblas::vec2 jafar::rtslam::pinhole::pixellizePoint | ( | const VK & | k, |
const VU & | ud | ||
) |
Pixellization from k = [u_0, v_0, a_u, a_v].
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
ud | the point to pixellize, adimensional |
Definition at line 312 of file pinholeTools.hpp.
Referenced by pixellizePoint(), and projectPoint().
void jafar::rtslam::pinhole::pixellizePoint | ( | const VK & | k, |
const VUd & | ud, | ||
VU & | u, | ||
MU_ud & | U_ud | ||
) |
Pixellization from k = [u_0, v_0, a_u, a_v] with jacobians.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
ud | the point to pixellize, adimensional |
u | the pixellized point |
U_ud | the Jacobian of u wrt ud |
Definition at line 332 of file pinholeTools.hpp.
References pixellizePoint().
vec2 jafar::rtslam::pinhole::projectPoint | ( | const VK & | k, |
const VD & | d, | ||
const V & | v, | ||
double | r2max | ||
) |
Project a point into a pin-hole camera with radial distortion.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
d | the radial distortion parameters vector |
v | the 3D point to project, or the 3D director vector |
Definition at line 397 of file pinholeTools.hpp.
References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().
void jafar::rtslam::pinhole::projectPoint | ( | const VK & | k, |
const VD & | d, | ||
const V & | v, | ||
U & | u, | ||
double | r2max, | ||
double & | dist | ||
) |
Project a point into a pin-hole camera with radial distortion.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
d | the radial distortion parameters vector |
v | the 3D point to project, or the 3D director vector |
u | the projected and distorted point |
Definition at line 409 of file pinholeTools.hpp.
References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().
void jafar::rtslam::pinhole::projectPoint | ( | const VK & | k, |
const VD & | d, | ||
const V & | v, | ||
VU & | u, | ||
double | r2max, | ||
MU_v & | U_v | ||
) |
Project a point into a pin-hole camera with radial distortion.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
d | the radial distortion parameters vector |
v | the 3D point to project, or the 3D director vector |
u | the projected and distorted point |
U_v | the Jacobian of u wrt v |
Definition at line 425 of file pinholeTools.hpp.
References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().
void jafar::rtslam::pinhole::projectPoint | ( | const VK & | k, |
const VD & | d, | ||
const V & | v, | ||
VU & | u, | ||
double | r2max, | ||
double & | dist, | ||
MU_v & | U_v | ||
) |
Project a point into a pin-hole camera with radial distortion.
k | the vector of intrinsic parameters, k = [u0, v0, au, av] |
d | the radial distortion parameters vector |
v | the 3D point to project, or the 3D director vector |
u | the projected and distorted point |
dist | the distance from the camera to the point |
U_v | the Jacobian of u wrt v |
Definition at line 448 of file pinholeTools.hpp.
References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().
vec2 jafar::rtslam::pinhole::projectPointToNormalizedPlane | ( | const V & | v | ) |
Pin-hole canonical projection.
v | a 3D point |
Definition at line 44 of file pinholeTools.hpp.
Referenced by projectPoint(), and projectPointToNormalizedPlane().
void jafar::rtslam::pinhole::projectPointToNormalizedPlane | ( | const V & | v, |
P & | up, | ||
double & | dist | ||
) |
Pin-hole canonical projection.
Give distance.
v | a 3D point |
up | the projected point in the normalized 2D plane |
dist | the distance from the camera to the point |
Definition at line 59 of file pinholeTools.hpp.
void jafar::rtslam::pinhole::projectPointToNormalizedPlane | ( | const V & | v, |
U & | up, | ||
MU_v & | UP_v | ||
) |
Pin-hole canonical projection, with jacobian.
v | the 3D point to project |
up | the projected 2D point |
UP_v | the Jacibian of u wrt v |
Definition at line 74 of file pinholeTools.hpp.
References projectPointToNormalizedPlane().
void jafar::rtslam::pinhole::projectPointToNormalizedPlane | ( | const V & | v, |
U & | up, | ||
double & | dist, | ||
MU_v & | UP_v | ||
) |
Pin-hole canonical projection, distance and with jacobian.
v | the 3D point to project |
up | the projected 2D point |
dist | the distance from the camera to the point |
UP_v | the Jacibian of u wrt v |
Definition at line 95 of file pinholeTools.hpp.
References projectPointToNormalizedPlane().
Generated on Wed Oct 15 2014 00:37:47 for Jafar by doxygen 1.7.6.1 |