1 // This is bbas/bpgl/bpgl_rolling_shutter_camera.h 2 #ifndef bpgl_rolling_shutter_camera_h_ 3 #define bpgl_rolling_shutter_camera_h_ 4 //: 5 // \file 6 // \brief A camera model simulates rolling shutter 7 // \author Vishal Jain 8 // \date Feb 08, 2011 9 // 10 #include <iostream> 11 #include <vector> 12 #include <string> 13 #include <vgl/vgl_fwd.h> 14 #ifdef _MSC_VER 15 # include <vcl_msvc_warnings.h> 16 #endif 17 #include <vsl/vsl_binary_io.h> 18 #include <vnl/vnl_fwd.h> 19 #include <vpgl/vpgl_camera.h> 20 21 template <class T> 22 class bpgl_rolling_shutter_camera : public vpgl_camera<T> 23 { 24 public: 25 //: default constructor 26 bpgl_rolling_shutter_camera()= default; 27 28 ~bpgl_rolling_shutter_camera() override = default; 29 type_name()30 std::string type_name() const override { return "bpgl_rolling_shutter_camera"; } 31 32 //: Clone `this': creation of a new object and initialization 33 // See Prototype pattern 34 virtual bpgl_rolling_shutter_camera<T>* clone(void) const=0; 35 36 //: Project a world point onto the image 37 virtual vnl_vector_fixed<T, 2> project(vnl_vector_fixed<T, 3> const& world_point) const=0; 38 39 //: Project a world point onto the image 40 virtual vgl_point_2d<T> project(vgl_point_3d<T> world_point) const=0; 41 42 //: print the camera parameters 43 virtual void print(std::ostream& s = std::cout) const=0; 44 45 virtual bool save(std::string cam_path)=0; 46 47 // --- binary IO --- 48 49 //: Binary save self to stream. 50 virtual void b_write(vsl_b_ostream &os) const=0; 51 52 //: Binary load self from stream. 53 virtual void b_read(vsl_b_istream &is)=0; 54 }; 55 56 57 #endif // bpgl_rolling_shutter_camera_h_ 58