vpgl_nitf_rational_camera.h
Go to the documentation of this file.
1 // This is core/vpgl/file_formats/vpgl_nitf_rational_camera.h
2 #ifndef vpgl_nitf_rational_camera_h_
3 #define vpgl_nitf_rational_camera_h_
4 //:
5 // \file
6 // \brief: instance a nitf_rational camera from nitf header information.
7 // \author Jim Green
8 // \date Dec 2006
9 //
10 // Note that there are several alternate "orderings" of the
11 // polynomial coefficients in the nitf header that apply to different
12 // versions of nitf images. These variations were added over time
13 // by different government agencies but all are in use in some circumstances.
14 // This class defined the ordering for RPC00B which is used for
15 // commercial satellite and for imagery taken by military aircraft.
16 // Details of the ordering are contained in the document STDI-0002_V3.doc.
17 // Additional coefficient permutations can be included by defining other
18 // versions of the set_order_* function.
19 //
20 // Modified extensively - J.L. Mundy January 07, 2007
21 //
22 #include <string>
24 #ifdef _MSC_VER
25 # include <vcl_msvc_warnings.h>
26 #endif
27 // not used? #include <vector>
28 #include <vnl/vnl_double_2.h>
29 #include <vil/file_formats/vil_nitf2_image.h>
30 
31 
33 {
34  public:
35 
36  enum geopt_coord { LAT, LON };
38 
39  //: Construct from a nitf image file
40  vpgl_nitf_rational_camera(std::string const& nitf_image_path,
41  bool verbose = false);
42 
43  //: Construct from a nitf image
44  vpgl_nitf_rational_camera(vil_nitf2_image* nift_image,
45  bool verbose = false);
46 
47  std::string rational_extension_type() const {return nitf_rational_type_;}
48 
49  std::string image_id() const {return image_id_;}
50 
51  //: Geographic coordinates of image corners
52  vnl_double_2 upper_left() const {return ul_;}
53  vnl_double_2 upper_right() const {return ur_;}
54  vnl_double_2 lower_left() const {return ll_;}
55  vnl_double_2 lower_right() const {return lr_;}
56 
57  private:
58  //internal functions
59  // NITF_RATIONAL00B - commercial + airborne
60  void set_order_b(int*);
61  bool init(vil_nitf2_image* nitf_image, bool verbose);
62  // data members
63  std::string nitf_rational_type_;
64  std::string image_id_;
65  std::string image_igeolo_;
66  //: geo-coordinates of image corners
67  vnl_double_2 ul_;
68  vnl_double_2 ur_;
69  vnl_double_2 ll_;
70  vnl_double_2 lr_;
71 };
72 
73 #endif // vpgl_nitf_rational_camera_h_
bool init(vil_nitf2_image *nitf_image, bool verbose)
A camera model based on ratios of cubic polynomials.
vnl_double_2 upper_left() const
Geographic coordinates of image corners.
std::string rational_extension_type() const
vnl_double_2 ul_
geo-coordinates of image corners.