#include <vpgl_geo_camera.h>
Public Member Functions | |
vpgl_geo_camera () | |
creates identity matrix and all zero tiepoints. | |
vpgl_geo_camera (vnl_matrix< double > trans_matrix, vpgl_lvcs_sptr lvcs) | |
if scale tag is false be sure that trans_matrix[0][0] and trans_matrix[1][1] is 1.0 otherwise set it to true. | |
vpgl_geo_camera (vpgl_geo_camera const &rhs) | |
vpgl_geo_camera (vpgl_camera< double > const &rhs) | |
~vpgl_geo_camera () | |
virtual vcl_string | type_name () const |
class identity functions for casting. | |
void | set_utm (int utm_zone, unsigned northing) |
void | set_lvcs (vpgl_lvcs_sptr lvcs) |
void | set_scale_format (bool scale_tag) |
vpgl_lvcs_sptr const | lvcs () |
void | project (const double x, const double y, const double z, double &u, double &v) const |
Implementing the generic camera interface of vpgl_camera. | |
void | backproject (const double u, const double v, double &x, double &y, double &z) |
backprojects an image point into local coordinates (based on lvcs_). | |
void | translate (double tx, double ty, double z) |
double | pixel_spacing () |
the lidar pixel size in meters assumes square pixels. | |
bool | operator== (vpgl_geo_camera const &rhs) const |
virtual vcl_string | is_a () const |
Return a platform independent string identifying the class. | |
virtual bool | is_class (vcl_string const &cls) const |
Return true if the argument matches the string identifying the class or any parent class. | |
void | img_to_global (const double i, const double j, double &lon, double &lat) const |
returns the corresponding geographical coordinates for a given pixel position (i,j). | |
void | global_to_img (const double lon, const double lat, const double elev, double &u, double &v) const |
returns the corresponding pixel position for given geographical coordinates. | |
void | img_to_global_utm (const double i, const double j, double &x, double &y) const |
returns the corresponding geographical coordinates for a given pixel position (i,j). | |
void | global_utm_to_img (const double x, const double y, int zone, double elev, double &u, double &v) const |
returns the corresponding pixel position for given geographical coordinates. | |
void | local_to_utm (const double x, const double y, const double z, double &e, double &n, int &utm_zone) |
returns the corresponding utm location for the given local position. | |
int | utm_zone () |
bool | img_four_corners_in_utm (const unsigned ni, const unsigned nj, double elev, double &e1, double &n1, double &e2, double &n2) |
void | img_to_wgs (unsigned i, unsigned j, unsigned k, double &lon, double &lat, double &elev) |
returns the corresponding geographical coordinate (lon, lat, elev) for a given pixel position (i,j,k). | |
void | ref () |
void | unref () |
int | get_references () const |
bool | is_referenced () const |
Static Public Member Functions | |
static bool | init_geo_camera (vil_image_resource_sptr const geotiff_img, vpgl_lvcs_sptr lvcs, vpgl_geo_camera *&camera) |
static bool | comp_trans_matrix (double sx1, double sy1, double sz1, vcl_vector< vcl_vector< double > > tiepoints, vnl_matrix< double > &trans_matrix, bool scale_tag=false) |
Private Attributes | |
vnl_matrix< double > | trans_matrix_ |
vpgl_lvcs_sptr | lvcs_ |
lvcs of world parameters. | |
bool | is_utm |
int | utm_zone_ |
int | northing_ |
bool | scale_tag_ |
Friends | |
vcl_ostream & | operator<< (vcl_ostream &s, vpgl_geo_camera const &p) |
Write camera to stream. | |
vcl_istream & | operator>> (vcl_istream &s, vpgl_geo_camera &p) |
Read camera from stream. |
Definition at line 26 of file vpgl_geo_camera.h.
vpgl_geo_camera::vpgl_geo_camera | ( | ) |
creates identity matrix and all zero tiepoints.
Definition at line 19 of file vpgl_geo_camera.cxx.
vpgl_geo_camera::vpgl_geo_camera | ( | vnl_matrix< double > | trans_matrix, |
vpgl_lvcs_sptr | lvcs | ||
) | [inline] |
if scale tag is false be sure that trans_matrix[0][0] and trans_matrix[1][1] is 1.0 otherwise set it to true.
Definition at line 33 of file vpgl_geo_camera.h.
vpgl_geo_camera::vpgl_geo_camera | ( | vpgl_geo_camera const & | rhs | ) |
Definition at line 28 of file vpgl_geo_camera.cxx.
vpgl_geo_camera::vpgl_geo_camera | ( | vpgl_camera< double > const & | rhs | ) |
vpgl_geo_camera::~vpgl_geo_camera | ( | ) | [inline] |
Definition at line 46 of file vpgl_geo_camera.h.
void vpgl_geo_camera::backproject | ( | const double | u, |
const double | v, | ||
double & | x, | ||
double & | y, | ||
double & | z | ||
) |
backprojects an image point into local coordinates (based on lvcs_).
Definition at line 135 of file vpgl_geo_camera.cxx.
bool vpgl_geo_camera::comp_trans_matrix | ( | double | sx1, |
double | sy1, | ||
double | sz1, | ||
vcl_vector< vcl_vector< double > > | tiepoints, | ||
vnl_matrix< double > & | trans_matrix, | ||
bool | scale_tag = false |
||
) | [static] |
Definition at line 365 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::global_to_img | ( | const double | lon, |
const double | lat, | ||
const double | gz, | ||
double & | u, | ||
double & | v | ||
) | const |
returns the corresponding pixel position for given geographical coordinates.
the input global coord is wgs84
The input global coord is wgs84
Definition at line 215 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::global_utm_to_img | ( | const double | x, |
const double | y, | ||
int | zone, | ||
double | elev, | ||
double & | u, | ||
double & | v | ||
) | const |
returns the corresponding pixel position for given geographical coordinates.
the input global coord is UTM: x east, for y north
The input global coord is UTM: x east, for y north
Definition at line 275 of file vpgl_geo_camera.cxx.
bool vpgl_geo_camera::img_four_corners_in_utm | ( | const unsigned | ni, |
const unsigned | nj, | ||
double | elev, | ||
double & | e1, | ||
double & | n1, | ||
double & | e2, | ||
double & | n2 | ||
) |
Definition at line 319 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::img_to_global | ( | const double | i, |
const double | j, | ||
double & | lon, | ||
double & | lat | ||
) | const |
returns the corresponding geographical coordinates for a given pixel position (i,j).
the output global coord is wgs84
The output global coord is wgs84
Definition at line 189 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::img_to_global_utm | ( | const double | i, |
const double | j, | ||
double & | x, | ||
double & | y | ||
) | const |
returns the corresponding geographical coordinates for a given pixel position (i,j).
the output global coord is UTM: x east, y north
The output global coord is UTM: x east, y north
Definition at line 250 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::img_to_wgs | ( | unsigned | i, |
unsigned | j, | ||
unsigned | k, | ||
double & | lon, | ||
double & | lat, | ||
double & | elev | ||
) |
returns the corresponding geographical coordinate (lon, lat, elev) for a given pixel position (i,j,k).
Note: not yet implemented -- PVr, 16 aug 2012
Definition at line 414 of file vpgl_geo_camera.cxx.
bool vpgl_geo_camera::init_geo_camera | ( | vil_image_resource_sptr const | geotiff_img, |
vpgl_lvcs_sptr | lvcs, | ||
vpgl_geo_camera *& | camera | ||
) | [static] |
Definition at line 37 of file vpgl_geo_camera.cxx.
virtual vcl_string vpgl_geo_camera::is_a | ( | ) | const [inline, virtual] |
Return a platform independent string identifying the class.
Reimplemented from vpgl_camera< double >.
Definition at line 81 of file vpgl_geo_camera.h.
virtual bool vpgl_geo_camera::is_class | ( | vcl_string const & | cls | ) | const [inline, virtual] |
Return true if the argument matches the string identifying the class or any parent class.
Reimplemented from vpgl_camera< double >.
Definition at line 84 of file vpgl_geo_camera.h.
void vpgl_geo_camera::local_to_utm | ( | const double | x, |
const double | y, | ||
const double | z, | ||
double & | e, | ||
double & | n, | ||
int & | utm_zone | ||
) |
returns the corresponding utm location for the given local position.
Definition at line 310 of file vpgl_geo_camera.cxx.
vpgl_lvcs_sptr const vpgl_geo_camera::lvcs | ( | ) | [inline] |
Definition at line 57 of file vpgl_geo_camera.h.
bool vpgl_geo_camera::operator== | ( | vpgl_geo_camera const & | rhs | ) | const |
Definition at line 335 of file vpgl_geo_camera.cxx.
double vpgl_geo_camera::pixel_spacing | ( | ) | [inline] |
the lidar pixel size in meters assumes square pixels.
Definition at line 70 of file vpgl_geo_camera.h.
void vpgl_geo_camera::project | ( | const double | x, |
const double | y, | ||
const double | z, | ||
double & | u, | ||
double & | v | ||
) | const [virtual] |
Implementing the generic camera interface of vpgl_camera.
transforms a given local 3d world point to image plane.
x,y,z are in local coordinates, u represents image column, v image row
Implements vpgl_camera< double >.
Definition at line 107 of file vpgl_geo_camera.cxx.
void vpgl_geo_camera::set_lvcs | ( | vpgl_lvcs_sptr | lvcs | ) | [inline] |
Definition at line 53 of file vpgl_geo_camera.h.
void vpgl_geo_camera::set_scale_format | ( | bool | scale_tag | ) | [inline] |
Definition at line 55 of file vpgl_geo_camera.h.
void vpgl_geo_camera::set_utm | ( | int | utm_zone, |
unsigned | northing | ||
) | [inline] |
Definition at line 51 of file vpgl_geo_camera.h.
void vpgl_geo_camera::translate | ( | double | tx, |
double | ty, | ||
double | z | ||
) |
Definition at line 173 of file vpgl_geo_camera.cxx.
virtual vcl_string vpgl_geo_camera::type_name | ( | ) | const [inline, virtual] |
class identity functions for casting.
Reimplemented from vpgl_camera< double >.
Definition at line 48 of file vpgl_geo_camera.h.
int vpgl_geo_camera::utm_zone | ( | ) | [inline] |
Definition at line 116 of file vpgl_geo_camera.h.
vcl_ostream& operator<< | ( | vcl_ostream & | s, |
vpgl_geo_camera const & | p | ||
) | [friend] |
Write camera to stream.
Definition at line 342 of file vpgl_geo_camera.cxx.
vcl_istream& operator>> | ( | vcl_istream & | s, |
vpgl_geo_camera & | p | ||
) | [friend] |
Read camera from stream.
Definition at line 354 of file vpgl_geo_camera.cxx.
bool vpgl_geo_camera::is_utm [private] |
Definition at line 135 of file vpgl_geo_camera.h.
vpgl_lvcs_sptr vpgl_geo_camera::lvcs_ [private] |
lvcs of world parameters.
Definition at line 134 of file vpgl_geo_camera.h.
int vpgl_geo_camera::northing_ [private] |
Definition at line 137 of file vpgl_geo_camera.h.
bool vpgl_geo_camera::scale_tag_ [private] |
Definition at line 138 of file vpgl_geo_camera.h.
vnl_matrix<double> vpgl_geo_camera::trans_matrix_ [private] |
Definition at line 132 of file vpgl_geo_camera.h.
int vpgl_geo_camera::utm_zone_ [private] |
Definition at line 136 of file vpgl_geo_camera.h.