core/vpgl/file_formats/vpgl_nitf_rational_camera.h
Go to the documentation of this file.
00001 // This is core/vpgl/file_formats/vpgl_nitf_rational_camera.h
00002 #ifndef vpgl_nitf_rational_camera_h_
00003 #define vpgl_nitf_rational_camera_h_
00004 //:
00005 // \file
00006 // \brief: instance a nitf_rational camera from nitf header information.
00007 // \author Jim Green
00008 // \date Dec 2006
00009 //
00010 //  Note that there are several alternate "orderings" of the
00011 //  polynomial coefficients in the nitf header that apply to different
00012 //  versions of nitf images.  These variations were added over time
00013 //  by different government agencies but all are in use in some circumstances.
00014 //  This class defined the ordering for RPC00B which is used for
00015 //  commercial satellite and for imagery taken by military aircraft.
00016 //  Details of the ordering are contained in the document STDI-0002_V3.doc.
00017 //  Additional coefficient permutations can be included by defining other
00018 //  versions of the set_order_* function.
00019 //
00020 // Modified extensively - J.L. Mundy January 07, 2007
00021 //
00022 #include <vpgl/vpgl_rational_camera.h>
00023 #include <vcl_string.h>
00024 // not used? #include <vcl_vector.h>
00025 #include <vnl/vnl_double_2.h>
00026 #include <vil/file_formats/vil_nitf2_image.h>
00027 
00028 
00029 class vpgl_nitf_rational_camera : public vpgl_rational_camera<double>
00030 {
00031  public:
00032 
00033   enum geopt_coord { LAT, LON };
00034   vpgl_nitf_rational_camera();
00035 
00036   //: Construct from a nitf image file
00037   vpgl_nitf_rational_camera(vcl_string const& nitf_image_path,
00038                             bool verbose = false);
00039 
00040   //: Construct from a nitf image
00041   vpgl_nitf_rational_camera(vil_nitf2_image* nift_image,
00042                             bool verbose = false);
00043 
00044   vcl_string rational_extension_type() const {return nitf_rational_type_;}
00045 
00046   vcl_string image_id() const {return image_id_;}
00047 
00048   //: Geographic coordinates of image corners
00049   vnl_double_2 upper_left() const {return ul_;}
00050   vnl_double_2 upper_right() const {return ur_;}
00051   vnl_double_2 lower_left() const {return ll_;}
00052   vnl_double_2 lower_right() const {return lr_;}
00053 
00054  private:
00055   //internal functions
00056   // NITF_RATIONAL00B - commercial + airborne
00057   void set_order_b(int*);
00058   bool init(vil_nitf2_image* nitf_image, bool verbose);
00059   // data members
00060   vcl_string nitf_rational_type_;
00061   vcl_string image_id_;
00062   vcl_string image_igeolo_;
00063   //: geo-coordinates of image corners
00064   vnl_double_2 ul_;
00065   vnl_double_2 ur_;
00066   vnl_double_2 ll_;
00067   vnl_double_2 lr_;
00068 };
00069 
00070 #endif // vpgl_nitf_rational_camera_h_