A camera model based on ratios of cubic polynomials. More...
#include <iostream>#include <string>#include <utility>#include <vector>#include <vgl/vgl_fwd.h>#include <vnl/vnl_matrix_fixed.h>#include <vnl/vnl_vector_fixed.h>#include <vpgl/vpgl_camera.h>Go to the source code of this file.
Classes | |
| class | vpgl_scale_offset< T > |
| class | vpgl_rational_camera< T > |
Macros | |
| #define | VPGL_RATIONAL_CAMERA_INSTANTIATE(T) extern "please include vgl/vpgl_rational_camera.hxx first" |
Functions | |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &s, const vpgl_rational_camera< T > &p) |
| Write to stream. More... | |
| template<class T > | |
| std::istream & | operator>> (std::istream &is, vpgl_rational_camera< T > &p) |
| Read from stream. More... | |
| template<class T > | |
| vpgl_rational_camera< T > * | read_rational_camera (std::string cam_path) |
| Creates a rational camera from a file. More... | |
| template<class T > | |
| vpgl_rational_camera< T > * | read_rational_camera (std::istream &istr) |
| Creates a rational camera from a stream. More... | |
| template<class T > | |
| vpgl_rational_camera< T > * | read_rational_camera_from_txt (std::string cam_path) |
| Creates a rational camera from a txt file. More... | |
A camera model based on ratios of cubic polynomials.
A camera that projects 3-d world points according to ratios of cubic polynomials. That is,
neu_u(X,Y,Z) neu_v(X,Y,Z)
u = ------------ v = ------------
den_u(X,Y,Z) den_v(X,Y,X)where u is the image column index and v is the image row index.
neu_u(X,Y,Z),den_u(X,Y,Z), neu_v(X,Y,Z), den_v(X,Y,Z) are cubic polynomials in three variables and there are 20 coefficients each, e.g.,
R(X,Y,Z) = a300 x^3 + a210 x^2y + a201 x^2z + a200 x^2 + ... + a001z + a000
The normal ordering of multi-variate polynomial coefficients is as shown above, the highest powers in x followed by highest powers in y, followed by powers in z. The full monomial sequence is: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 x^3 x^2y x^2z x^2 xy^2 xyz xy xz^2 xz x y^3 y^2z y^2 yz^2 yz y z^3 z^2 z 1 The highest powers are in the lowest index of the coefficient vector.
Polynomial calculations are often ill-conditioned if the variables are not normalized. Common practice is to normalize all variables to the range [-1, 1]. This normalization requires 10 additional offset and scale parameters for a total of 90 parameters.
The scale and offset transformation is applied to (X,Y,Z) before applying the polynomial mapping. The resulting (u,v) is normalized and must be mapped back (un-normalized) to the image coordinate system to obtain the actual projection.
In order to facilitate the scale offset transformation process, a helper class, scale_offset, is defined to process the forward and reverse normalizations.
Definition in file vpgl_rational_camera.h.
| #define VPGL_RATIONAL_CAMERA_INSTANTIATE | ( | T | ) | extern "please include vgl/vpgl_rational_camera.hxx first" |
Definition at line 268 of file vpgl_rational_camera.h.
| std::ostream & operator<< | ( | std::ostream & | s, |
| const vpgl_rational_camera< T > & | p | ||
| ) |
Write to stream.
Definition at line 428 of file vpgl_rational_camera.hxx.
| std::istream & operator>> | ( | std::istream & | is, |
| vpgl_rational_camera< T > & | p | ||
| ) |
Read from stream.
| vpgl_rational_camera< T > * read_rational_camera | ( | std::string | cam_path | ) |
Creates a rational camera from a file.
Creates a rational camera from a file.
Definition at line 436 of file vpgl_rational_camera.hxx.
| vpgl_rational_camera< T > * read_rational_camera | ( | std::istream & | istr | ) |
Creates a rational camera from a stream.
Creates a rational camera from a stream.
Definition at line 450 of file vpgl_rational_camera.hxx.
| vpgl_rational_camera< T > * read_rational_camera_from_txt | ( | std::string | cam_path | ) |
Creates a rational camera from a txt file.
Definition at line 625 of file vpgl_rational_camera.hxx.
1.8.15