Classes | Defines | Functions
core/vpgl/vpgl_rational_camera.h File Reference

A camera model based on ratios of cubic polynomials. More...

#include <vgl/vgl_fwd.h>
#include <vcl_iostream.h>
#include <vcl_vector.h>
#include <vcl_string.h>
#include <vnl/vnl_vector_fixed.h>
#include <vnl/vnl_matrix_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 >

Defines

#define VPGL_RATIONAL_CAMERA_INSTANTIATE(T)   extern "please include vgl/vpgl_rational_camera.txx first"

Functions

template<class T >
vcl_ostream & operator<< (vcl_ostream &s, const vpgl_rational_camera< T > &p)
 Write to stream.
template<class T >
vcl_istream & operator>> (vcl_istream &is, vpgl_rational_camera< T > &p)
 Read from stream.
template<class T >
vpgl_rational_camera< T > * read_rational_camera (vcl_string cam_path)
 Creates a rational camera from a file.
template<class T >
vpgl_rational_camera< T > * read_rational_camera (vcl_istream &istr)
 Creates a rational camera from a stream.

Detailed Description

A camera model based on ratios of cubic polynomials.

Author:
Joseph Mundy
Date:
Oct 2006

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 Documentation

#define VPGL_RATIONAL_CAMERA_INSTANTIATE (   T)    extern "please include vgl/vpgl_rational_camera.txx first"

Definition at line 259 of file vpgl_rational_camera.h.


Function Documentation

template<class T >
vcl_ostream & operator<< ( vcl_ostream &  s,
const vpgl_rational_camera< T > &  p 
)

Write to stream.

Definition at line 425 of file vpgl_rational_camera.txx.

template<class T >
vcl_istream & operator>> ( vcl_istream &  is,
vpgl_rational_camera< T > &  p 
)

Read from stream.

Definition at line 621 of file vpgl_rational_camera.txx.

template<class T >
vpgl_rational_camera< T > * read_rational_camera ( vcl_string  cam_path)

Creates a rational camera from a file.

Definition at line 433 of file vpgl_rational_camera.txx.

template<class T >
vpgl_rational_camera< T > * read_rational_camera ( vcl_istream &  istr)

Creates a rational camera from a stream.

Definition at line 447 of file vpgl_rational_camera.txx.