Go to the documentation of this file.00001
00002 #ifndef vimt_scale_pyramid_builder_2d_h_
00003 #define vimt_scale_pyramid_builder_2d_h_
00004
00005
00006
00007
00008
00009
00010 #include <vimt/vimt_image_pyramid_builder.h>
00011 #include <vimt/vimt_image_2d_of.h>
00012 #include <vcl_iosfwd.h>
00013
00014
00015 template <class T>
00016 class vimt_scale_pyramid_builder_2d : public vimt_image_pyramid_builder
00017 {
00018
00019 unsigned min_x_size_;
00020
00021
00022 unsigned min_y_size_;
00023
00024
00025 unsigned max_levels_;
00026
00027
00028 void checkPyr(vimt_image_pyramid& im_pyr, int n_levels) const;
00029
00030
00031 void emptyPyr(vimt_image_pyramid& im_pyr) const;
00032
00033
00034 double scale_step_;
00035
00036 public:
00037
00038
00039 void set_min_size(unsigned X, unsigned Y) { min_y_size_=Y; min_x_size_=X; }
00040
00041
00042
00043 virtual vimt_image_pyramid* new_image_pyramid() const;
00044
00045
00046
00047
00048
00049
00050 virtual void set_max_levels(int max_l);
00051
00052
00053 virtual int max_levels() const;
00054
00055
00056 virtual void build(vimt_image_pyramid& im_pyr, const vimt_image& im) const;
00057
00058
00059 vimt_scale_pyramid_builder_2d();
00060
00061
00062 vimt_scale_pyramid_builder_2d(double scale_step);
00063
00064
00065 ~vimt_scale_pyramid_builder_2d();
00066
00067
00068 virtual double scale_step() const { return scale_step_; }
00069
00070
00071 void set_scale_step(double scale_step);
00072
00073
00074
00075
00076 void scale_reduce(vimt_image_2d_of<T>& dest_im,
00077 vimt_image_2d_of<T>const& src_im) const;
00078
00079
00080
00081 virtual void extend(vimt_image_pyramid& image_pyr) const;
00082
00083
00084
00085
00086 void scale_reduce(T* dest_im, vcl_ptrdiff_t dest_ystep,
00087 const T* src_im,
00088 int src_nx, int src_ny,
00089 int dest_nx, int dest_ny,
00090 vcl_ptrdiff_t src_istep, vcl_ptrdiff_t src_jstep) const;
00091
00092 vimt_image_pyramid_builder* clone() const;
00093
00094
00095 short version_no() const;
00096
00097
00098 virtual vcl_string is_a() const;
00099
00100
00101 virtual bool is_class(vcl_string const& s) const;
00102
00103
00104 virtual void print_summary(vcl_ostream&) const;
00105
00106
00107 virtual void b_write(vsl_b_ostream& bfs) const;
00108
00109
00110 virtual void b_read(vsl_b_istream& bfs);
00111 };
00112
00113 #endif // vimt_scale_pyramid_builder_2d_h_