2 #ifndef vpgl_rational_camera_h_ 3 #define vpgl_rational_camera_h_ 52 # include <vcl_msvc_warnings.h> 93 {
return this == &that ||
119 std::vector<T>
const& den_u,
120 std::vector<T>
const& neu_v,
121 std::vector<T>
const& den_v,
122 const T x_scale,
const T x_off,
123 const T y_scale,
const T y_off,
124 const T z_scale,
const T z_off,
125 const T u_scale,
const T u_off,
126 const T v_scale,
const T v_off
134 const T x_scale,
const T x_off,
135 const T y_scale,
const T y_off,
136 const T z_scale,
const T z_off,
137 const T u_scale,
const T u_off,
138 const T v_scale,
const T v_off
153 std::string
type_name()
const override {
return "vpgl_rational_camera"; }
161 {
return this == &that ||
217 void project(
const T x,
const T y,
const T z, T& u, T& v)
const override;
230 virtual void print(std::ostream& s = std::cout)
const;
232 virtual bool save(std::string cam_path);
268 #define VPGL_RATIONAL_CAMERA_INSTANTIATE(T) extern "please include vgl/vpgl_rational_camera.hxx first" 271 #endif // vpgl_rational_camera_h_
poly_index
enumeration for indexing polynomials.
vnl_matrix_fixed< T, 4, 20 > coefficient_matrix() const
get the rational polynomial coefficients in a vnl matrix.
T normalize(const T value) const
std::istream & operator>>(std::istream &is, vpgl_local_rational_camera< T > &p)
Read from stream.
coor_index
enumeration for indexing coordinates.
bool operator==(vpgl_rational_camera< T > const &that) const
Equality test.
vnl_matrix_fixed< T, 4, 20 > rational_coeffs_
void set_coefficients(vnl_matrix_fixed< T, 4, 20 > const &rational_coeffs)
std::string type_name() const override
class identity functions for casting.
vpgl_rational_camera< T > * read_rational_camera(std::string cam_path)
Creates a rational camera from a file.
vpgl_scale_offset< T > scl_off(const coor_index coor_index) const
get a specific scale_offset.
vpgl_rational_camera(vnl_matrix_fixed< T, 4, 20 > const &rational_coeffs, std::vector< vpgl_scale_offset< T > > scale_offsets)
Constructor with a coefficient matrix.
void set_image_scale(const T u_scale, const T v_scale)
set u-v scale.
void set_scale(const coor_index coor_index, const T scale)
set a specific scale value.
virtual bool save(std::string cam_path)
std::vector< vpgl_scale_offset< T > > scale_offsets() const
get the scale and offsets in a vector.
void set_scale_offsets(std::vector< vpgl_scale_offset< T > > const &scale_offsets)
set coordinate scale and offsets.
std::vector< vpgl_scale_offset< T > > scale_offsets_
vnl_vector_fixed< T, 20 > power_vector(const T x, const T y, const T z) const
Create a vector with the standard order of monomial terms.
void set_offset(const T offset)
bool operator==(vpgl_scale_offset< T > const &that) const
Equality test.
void set_image_offset(const T u_off, const T v_off)
set u-v translation offset.
void set_scale(const T scale)
void set_offset(const coor_index coor_index, const T offset)
set a specific scale value.
void image_scale(T &u_scale, T &v_scale)
get u-v scale.
vpgl_rational_camera()
default constructor.
std::vector< std::vector< T > > coefficients() const
get the rational polynomial coefficients in a vcl array.
void image_offset(T &u_off, T &v_off) const
get u-v translation offset.
std::ostream & operator<<(std::ostream &s, const vpgl_local_rational_camera< T > &p)
Write to stream.
T un_normalize(const T value) const
T scale(const coor_index coor_index) const
get a specific scale value.
virtual vpgl_rational_camera< T > * clone(void) const
Clone ‘this’: creation of a new object and initialization.
virtual void print(std::ostream &s=std::cout) const
print the camera parameters.
void set_coefficients(std::vector< std::vector< T > > const &rational_coeffs)
set rational polynomial coefficients.
~vpgl_rational_camera() override=default
T offset(const coor_index coor_index) const
get a specific offset value.
vpgl_rational_camera< T > * read_rational_camera_from_txt(std::string cam_path)
Creates a rational camera from a txt file.
void project(const T x, const T y, const T z, T &u, T &v) const override
The generic camera interface. u represents image column, v image row.
vpgl_scale_offset(const T scale, const T offset)