Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Functions
jafar::rtslam::pinhole Namespace Reference

Namespace for operations related to the pin-hole model of a camera. More...


Detailed Description

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.

Function Documentation

template<class VK , class VC , class U >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
cthe radial undistortion parameters vector
uthe 2D pixel
depththe depth prior
Returns:
the back-projected 3D point

Definition at line 471 of file pinholeTools.hpp.

References backprojectPointFromNormalizedPlane(), and depixellizePoint().

template<class VK , class VC , class U , class P , class MP_u , class MP_depth >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
cthe radial undistortion parameters vector
uthe 2D pixel
depththe depth prior
pthe back-projected 3D point
P_uJacobian of p wrt u
P_depthJacobian of p wrt depth

Definition at line 486 of file pinholeTools.hpp.

References backprojectPointFromNormalizedPlane(), and depixellizePoint().

template<class U >
vec3 jafar::rtslam::pinhole::backprojectPointFromNormalizedPlane ( const U &  u,
double  depth = 1 
)

Canonical back-projection.

Parameters:
uthe 2D point in the image plane
depthpoint's depth orthogonal to image plane. Defaults to 1.0
Returns:
the 3D point

Definition at line 115 of file pinholeTools.hpp.

Referenced by backprojectPoint(), backProjectPoint(), and backprojectPointFromNormalizedPlane().

template<class U , class P , class MP_u , class MP_depth >
void jafar::rtslam::pinhole::backprojectPointFromNormalizedPlane ( const U &  u,
const double  depth,
P &  p,
MP_u &  P_u,
MP_depth &  P_depth 
)

Canonical back-projection.

Parameters:
uthe 2D point in the image plane.
depthpoint's depth orthogonal to image plane.
pthe 3D point.
P_uJacobian of p wrt u.
P_depthJacobian of p wrt depth.

Definition at line 133 of file pinholeTools.hpp.

References backprojectPointFromNormalizedPlane().

template<class Vk , class Vd , class Vc >
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.

Parameters:
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().

template<class VK , class VU >
jblas::vec2 jafar::rtslam::pinhole::depixellizePoint ( const VK &  k,
const VU &  u 
)

Depixellization from k = [u_0, v_0, a_u, a_v].

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
uthe point to depixellize, in pixels
Returns:
the depixellized point, adimensional

Definition at line 354 of file pinholeTools.hpp.

Referenced by backprojectPoint(), backProjectPoint(), and depixellizePoint().

template<class VK , class VUd , class VU , class MUD_u >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
uthe point to depixellize, in pixels
udthe depixellized point
UD_uthe Jacobian of ud wrt u

Definition at line 374 of file pinholeTools.hpp.

References depixellizePoint().

template<class VD >
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 + ...

Parameters:
r2the square of the radius to evaluate, r2 = r^2.
Returns:
the distortion factor so that rd = s*r

Definition at line 154 of file pinholeTools.hpp.

Referenced by computeCorrectionModel(), and distortPoint().

template<class VD , class VU >
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.

Parameters:
dthe distortion parameters vector
upthe point to distort
Returns:
the distorted point

Definition at line 173 of file pinholeTools.hpp.

References distortFactor().

Referenced by projectPoint().

template<class VD , class VUp , class VUd , class MUD_up >
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.

Parameters:
dthe radial distortion parameters vector
upthe point to distort
udthe distorted point
UD_upthe Jacobian of ud wrt up

Definition at line 200 of file pinholeTools.hpp.

template<class VPix >
bool jafar::rtslam::pinhole::isInImage ( const VPix &  pix,
const int &  width,
const int &  height 
)

Determine if a pixel is inside the image.

Parameters:
pixthe pixel to test
widththe image width, in pixels
heightthe image height, in pixels

Definition at line 515 of file pinholeTools.hpp.

References isInRoi().

template<class VPix >
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.

Parameters:
pixthe pixel to test
roithe region of interest, in pixels

Definition at line 504 of file pinholeTools.hpp.

Referenced by isInImage().

template<class VK , class VU >
jblas::vec2 jafar::rtslam::pinhole::pixellizePoint ( const VK &  k,
const VU &  ud 
)

Pixellization from k = [u_0, v_0, a_u, a_v].

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
udthe point to pixellize, adimensional
Returns:
the point in pixels coordinates

Definition at line 312 of file pinholeTools.hpp.

Referenced by pixellizePoint(), and projectPoint().

template<class VK , class VUd , class VU , class MU_ud >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
udthe point to pixellize, adimensional
uthe pixellized point
U_udthe Jacobian of u wrt ud

Definition at line 332 of file pinholeTools.hpp.

References pixellizePoint().

template<class VK , class VD , class V >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
dthe radial distortion parameters vector
vthe 3D point to project, or the 3D director vector
Returns:
the projected and distorted point

Definition at line 397 of file pinholeTools.hpp.

References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().

template<class VK , class VD , class V , class U >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
dthe radial distortion parameters vector
vthe 3D point to project, or the 3D director vector
uthe projected and distorted point

Definition at line 409 of file pinholeTools.hpp.

References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().

template<class VK , class VD , class V , class VU , class MU_v >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
dthe radial distortion parameters vector
vthe 3D point to project, or the 3D director vector
uthe projected and distorted point
U_vthe Jacobian of u wrt v

Definition at line 425 of file pinholeTools.hpp.

References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().

template<class VK , class VD , class V , class VU , class MU_v >
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.

Parameters:
kthe vector of intrinsic parameters, k = [u0, v0, au, av]
dthe radial distortion parameters vector
vthe 3D point to project, or the 3D director vector
uthe projected and distorted point
distthe distance from the camera to the point
U_vthe Jacobian of u wrt v

Definition at line 448 of file pinholeTools.hpp.

References distortPoint(), pixellizePoint(), and projectPointToNormalizedPlane().

template<class V >
vec2 jafar::rtslam::pinhole::projectPointToNormalizedPlane ( const V &  v)

Pin-hole canonical projection.

Returns:
the projected point in the normalized 2D plane
Parameters:
va 3D point

Definition at line 44 of file pinholeTools.hpp.

Referenced by projectPoint(), and projectPointToNormalizedPlane().

template<class V , class P >
void jafar::rtslam::pinhole::projectPointToNormalizedPlane ( const V &  v,
P &  up,
double &  dist 
)

Pin-hole canonical projection.

Give distance.

Parameters:
va 3D point
upthe projected point in the normalized 2D plane
distthe distance from the camera to the point

Definition at line 59 of file pinholeTools.hpp.

template<class V , class U , class MU_v >
void jafar::rtslam::pinhole::projectPointToNormalizedPlane ( const V &  v,
U &  up,
MU_v &  UP_v 
)

Pin-hole canonical projection, with jacobian.

Parameters:
vthe 3D point to project
upthe projected 2D point
UP_vthe Jacibian of u wrt v

Definition at line 74 of file pinholeTools.hpp.

References projectPointToNormalizedPlane().

template<class V , class U , class MU_v >
void jafar::rtslam::pinhole::projectPointToNormalizedPlane ( const V &  v,
U &  up,
double &  dist,
MU_v &  UP_v 
)

Pin-hole canonical projection, distance and with jacobian.

Parameters:
vthe 3D point to project
upthe projected 2D point
distthe distance from the camera to the point
UP_vthe Jacibian of u wrt v

Definition at line 95 of file pinholeTools.hpp.

References projectPointToNormalizedPlane().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:47 for Jafar by doxygen 1.7.6.1
LAAS-CNRS