00001 // This is mul/vimt/vimt_gaussian_pyramid_builder_2d_general.h 00002 #ifndef vimt_gaussian_pyramid_builder_2d_general_h_ 00003 #define vimt_gaussian_pyramid_builder_2d_general_h_ 00004 //: 00005 // \file 00006 // \brief Build gaussian image pyramids at any scale separation 00007 // \author Ian Scott 00008 //======================================================================= 00009 00010 #include <vimt/vimt_gaussian_pyramid_builder_2d.h> 00011 #include <vil/vil_image_view.h> 00012 #include <vil/algo/vil_gauss_reduce.h> 00013 #include <vcl_iosfwd.h> 00014 00015 //: Build pyramids of vimt_image_2d_of<vxl_byte> at any scale step 00016 00017 template <class T> 00018 class vimt_gaussian_pyramid_builder_2d_general : public vimt_gaussian_pyramid_builder_2d<T> 00019 { 00020 private: 00021 //: image workspace 00022 mutable vil_image_view<T> worka_; 00023 //: image workspace 00024 mutable vil_image_view<T> workb_; 00025 00026 //: Pre-calculated scale parameters and filter taps. 00027 vil_gauss_reduce_params scale_params_; 00028 00029 public: 00030 //: Build pyramid 00031 virtual void build(vimt_image_pyramid& im_pyr, const vimt_image& im) const; 00032 00033 //: Dflt ctor 00034 vimt_gaussian_pyramid_builder_2d_general(); 00035 00036 //: Construct with given scale_step 00037 vimt_gaussian_pyramid_builder_2d_general(double scale_step); 00038 00039 //: Destructor 00040 ~vimt_gaussian_pyramid_builder_2d_general(); 00041 00042 //: get the current scale step; 00043 double scale_step() const { return scale_params_.scale_step(); } 00044 00045 //: Set the Scale step 00046 void set_scale_step(double scale_step); 00047 00048 //: Extend pyramid 00049 // The first layer of the pyramid must already be set. 00050 void extend(vimt_image_pyramid& image_pyr) const; 00051 00052 vimt_image_pyramid_builder* clone() const; 00053 //: Version number for I/O 00054 short version_no() const ; 00055 //: Name of the class 00056 virtual vcl_string is_a() const ; 00057 //: Does the name of the class match the argument? 00058 virtual bool is_class(vcl_string const& s) const; 00059 //: Print class to os 00060 void print_summary(vcl_ostream&) const; 00061 //: Save class to binary file stream 00062 void b_write(vsl_b_ostream& bfs) const; 00063 //: Load class from binary file stream 00064 void b_read(vsl_b_istream& bfs); 00065 }; 00066 00067 #endif // vimt_gaussian_pyramid_builder_2d_general_h_