Build pyramids of vimt_image_2d_of<vxl_byte> at any scale step. More...
#include <vimt_gaussian_pyramid_builder_2d_general.h>
Public Member Functions | |
virtual void | build (vimt_image_pyramid &im_pyr, const vimt_image &im) const |
Build pyramid. | |
vimt_gaussian_pyramid_builder_2d_general () | |
Dflt ctor. | |
vimt_gaussian_pyramid_builder_2d_general (double scale_step) | |
Construct with given scale_step. | |
~vimt_gaussian_pyramid_builder_2d_general () | |
Destructor. | |
double | scale_step () const |
get the current scale step;. | |
void | set_scale_step (double scale_step) |
Set the Scale step. | |
void | extend (vimt_image_pyramid &image_pyr) const |
Extend pyramid. | |
vimt_image_pyramid_builder * | clone () const |
Create a copy on the heap and return base class pointer. | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const |
Name of the class. | |
virtual bool | is_class (vcl_string const &s) const |
Does the name of the class match the argument?. | |
void | print_summary (vcl_ostream &) const |
Print class to os. | |
void | b_write (vsl_b_ostream &bfs) const |
Save class to binary file stream. | |
void | b_read (vsl_b_istream &bfs) |
Load class from binary file stream. | |
unsigned | filter_width () const |
Current filter width. | |
void | set_filter_width (unsigned) |
Set current filter width (must be 3 or 5 at present). | |
virtual vimt_image_pyramid * | new_image_pyramid () const |
Create new (empty) pyramid on heap. | |
virtual void | set_max_levels (int max_l) |
Define maximum number of levels to build. | |
virtual int | max_levels () const |
Get the current maximum number levels allowed. | |
void | gauss_reduce (const vimt_image_2d_of< T > &src_im, vimt_image_2d_of< T > &dest_im) const |
Smooth and subsample src_im to produce dest_im. | |
unsigned | min_y_size () const |
Get the minimum Y size of the top layer of the pyramid. | |
unsigned | min_x_size () const |
Get the minimum X size of the top layer of the pyramid. | |
virtual void | set_min_size (unsigned X, unsigned Y) |
Set the minimum size of the top layer of the pyramid. | |
Protected Member Functions | |
void | check_pyr (vimt_image_pyramid &im_pyr, int n_levels) const |
Checks pyramid has at least n levels of correct type. | |
void | empty_pyr (vimt_image_pyramid &im_pyr) const |
Deletes all data in im_pyr. | |
Private Attributes | |
vil_image_view< T > | worka_ |
image workspace. | |
vil_image_view< T > | workb_ |
image workspace. | |
vil_gauss_reduce_params | scale_params_ |
Pre-calculated scale parameters and filter taps. |
Build pyramids of vimt_image_2d_of<vxl_byte> at any scale step.
Definition at line 17 of file vimt_gaussian_pyramid_builder_2d_general.h.
vimt_gaussian_pyramid_builder_2d_general< T >::vimt_gaussian_pyramid_builder_2d_general | ( | ) |
Dflt ctor.
Definition at line 23 of file vimt_gaussian_pyramid_builder_2d_general.txx.
vimt_gaussian_pyramid_builder_2d_general< T >::vimt_gaussian_pyramid_builder_2d_general | ( | double | scale_step | ) |
Construct with given scale_step.
Definition at line 29 of file vimt_gaussian_pyramid_builder_2d_general.txx.
vimt_gaussian_pyramid_builder_2d_general< T >::~vimt_gaussian_pyramid_builder_2d_general | ( | ) |
Destructor.
Definition at line 36 of file vimt_gaussian_pyramid_builder_2d_general.txx.
void vimt_gaussian_pyramid_builder_2d_general< T >::b_read | ( | vsl_b_istream & | bfs | ) | [virtual] |
Load class from binary file stream.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 228 of file vimt_gaussian_pyramid_builder_2d_general.txx.
void vimt_gaussian_pyramid_builder_2d_general< T >::b_write | ( | vsl_b_ostream & | bfs | ) | const [virtual] |
Save class to binary file stream.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 218 of file vimt_gaussian_pyramid_builder_2d_general.txx.
void vimt_gaussian_pyramid_builder_2d_general< T >::build | ( | vimt_image_pyramid & | im_pyr, |
const vimt_image & | im | ||
) | const [virtual] |
Build pyramid.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 49 of file vimt_gaussian_pyramid_builder_2d_general.txx.
void vimt_gaussian_pyramid_builder_2d< T >::check_pyr | ( | vimt_image_pyramid & | im_pyr, |
int | n_levels | ||
) | const [protected, inherited] |
Checks pyramid has at least n levels of correct type.
Checks pyramid has at least n levels.
Definition at line 124 of file vimt_gaussian_pyramid_builder_2d.txx.
vimt_image_pyramid_builder * vimt_gaussian_pyramid_builder_2d_general< T >::clone | ( | ) | const [virtual] |
Create a copy on the heap and return base class pointer.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 202 of file vimt_gaussian_pyramid_builder_2d_general.txx.
void vimt_gaussian_pyramid_builder_2d< T >::empty_pyr | ( | vimt_image_pyramid & | im_pyr | ) | const [protected, inherited] |
Deletes all data in im_pyr.
Definition at line 115 of file vimt_gaussian_pyramid_builder_2d.txx.
void vimt_gaussian_pyramid_builder_2d_general< T >::extend | ( | vimt_image_pyramid & | image_pyr | ) | const [virtual] |
Extend pyramid.
The first layer of the pyramid must already be set.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 122 of file vimt_gaussian_pyramid_builder_2d_general.txx.
unsigned vimt_gaussian_pyramid_builder_2d< T >::filter_width | ( | ) | const [inline, inherited] |
Current filter width.
Definition at line 50 of file vimt_gaussian_pyramid_builder_2d.h.
void vimt_gaussian_pyramid_builder_2d< T >::gauss_reduce | ( | const vimt_image_2d_of< T > & | src_im, |
vimt_image_2d_of< T > & | dest_im | ||
) | const [inherited] |
Smooth and subsample src_im to produce dest_im.
Applies filter in x and y, then samples every other pixel. Filter width defined by set_filter_width()
Applies filter in x and y, then samples every other pixel.
Definition at line 89 of file vimt_gaussian_pyramid_builder_2d.txx.
virtual vcl_string vimt_gaussian_pyramid_builder_2d_general< T >::is_a | ( | ) | const [virtual] |
Name of the class.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
bool vimt_gaussian_pyramid_builder_2d_general< T >::is_class | ( | vcl_string const & | s | ) | const [virtual] |
Does the name of the class match the argument?.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 185 of file vimt_gaussian_pyramid_builder_2d_general.txx.
int vimt_gaussian_pyramid_builder_2d< T >::max_levels | ( | ) | const [virtual, inherited] |
Get the current maximum number levels allowed.
Implements vimt_image_pyramid_builder.
Definition at line 56 of file vimt_gaussian_pyramid_builder_2d.txx.
unsigned vimt_gaussian_pyramid_builder_2d< T >::min_x_size | ( | ) | const [inline, inherited] |
Get the minimum X size of the top layer of the pyramid.
Defaults to 5.
Definition at line 92 of file vimt_gaussian_pyramid_builder_2d.h.
unsigned vimt_gaussian_pyramid_builder_2d< T >::min_y_size | ( | ) | const [inline, inherited] |
Get the minimum Y size of the top layer of the pyramid.
Defaults to 5.
Definition at line 88 of file vimt_gaussian_pyramid_builder_2d.h.
vimt_image_pyramid * vimt_gaussian_pyramid_builder_2d< T >::new_image_pyramid | ( | ) | const [virtual, inherited] |
Create new (empty) pyramid on heap.
Caller responsible for its deletion
Implements vimt_image_pyramid_builder.
Definition at line 65 of file vimt_gaussian_pyramid_builder_2d.txx.
void vimt_gaussian_pyramid_builder_2d_general< T >::print_summary | ( | vcl_ostream & | os | ) | const [virtual] |
Print class to os.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 210 of file vimt_gaussian_pyramid_builder_2d_general.txx.
double vimt_gaussian_pyramid_builder_2d_general< T >::scale_step | ( | ) | const [inline, virtual] |
get the current scale step;.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 42 of file vimt_gaussian_pyramid_builder_2d_general.h.
void vimt_gaussian_pyramid_builder_2d< T >::set_filter_width | ( | unsigned | w | ) | [inherited] |
Set current filter width (must be 3 or 5 at present).
Definition at line 80 of file vimt_gaussian_pyramid_builder_2d.txx.
void vimt_gaussian_pyramid_builder_2d< T >::set_max_levels | ( | int | max_l | ) | [virtual, inherited] |
Define maximum number of levels to build.
Limits levels built in subsequent calls to build() Useful efficiency measure. As build() only takes a shallow copy of the original image, using max_l=1 avoids any copying or smoothing.
Limits levels built in subsequent calls to build()
Implements vimt_image_pyramid_builder.
Definition at line 43 of file vimt_gaussian_pyramid_builder_2d.txx.
virtual void vimt_gaussian_pyramid_builder_2d< T >::set_min_size | ( | unsigned | X, |
unsigned | Y | ||
) | [inline, virtual, inherited] |
Set the minimum size of the top layer of the pyramid.
Definition at line 95 of file vimt_gaussian_pyramid_builder_2d.h.
void vimt_gaussian_pyramid_builder_2d_general< T >::set_scale_step | ( | double | scale_step | ) |
Set the Scale step.
Definition at line 41 of file vimt_gaussian_pyramid_builder_2d_general.txx.
short vimt_gaussian_pyramid_builder_2d_general< T >::version_no | ( | ) | const |
Version number for I/O.
Reimplemented from vimt_gaussian_pyramid_builder_2d< T >.
Definition at line 194 of file vimt_gaussian_pyramid_builder_2d_general.txx.
vil_gauss_reduce_params vimt_gaussian_pyramid_builder_2d_general< T >::scale_params_ [private] |
Pre-calculated scale parameters and filter taps.
Definition at line 26 of file vimt_gaussian_pyramid_builder_2d_general.h.
vil_image_view<T> vimt_gaussian_pyramid_builder_2d_general< T >::worka_ [mutable, private] |
image workspace.
Definition at line 21 of file vimt_gaussian_pyramid_builder_2d_general.h.
vil_image_view<T> vimt_gaussian_pyramid_builder_2d_general< T >::workb_ [mutable, private] |
image workspace.
Definition at line 23 of file vimt_gaussian_pyramid_builder_2d_general.h.