Public Member Functions | Protected Member Functions | Private Attributes
vimt_dog_pyramid_builder_2d< T > Class Template Reference

Build difference of gaussian pyramids of vimt_image_2d_of<T>. More...

#include <vimt_dog_pyramid_builder_2d.h>

Inheritance diagram for vimt_dog_pyramid_builder_2d< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vimt_dog_pyramid_builder_2d ()
 Dflt ctor.
virtual ~vimt_dog_pyramid_builder_2d ()
 Destructor.
virtual vimt_image_pyramidnew_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 build_dog (vimt_image_pyramid &dog_pyr, vimt_image_pyramid &smooth_pyr, const vimt_image &im, bool abs_diff=true) const
 Build difference of gaussian pyramid and a gaussian pyramid.
virtual void build (vimt_image_pyramid &dog_pyr, const vimt_image &) const
 Build pyramid.
virtual void extend (vimt_image_pyramid &) const
 Extend pyramid (not implemented).
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.
virtual double scale_step () const
 Scale step between levels.
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 Y 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.
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?.
virtual
vimt_image_pyramid_builder
clone () const
 Create a copy on the heap and return base class pointer.
virtual void print_summary (vcl_ostream &os) const
 Print class to os.
virtual void b_write (vsl_b_ostream &bfs) const
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &bfs)
 Load class from binary file stream.

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

int max_levels_
vimt_image_2d_of< T > work_im_
unsigned min_x_size_
 Minimum size in X direction of top layer of pyramid.
unsigned min_y_size_
 Minimum size in Y direction of top layer of pyramid.

Detailed Description

template<class T>
class vimt_dog_pyramid_builder_2d< T >

Build difference of gaussian pyramids of vimt_image_2d_of<T>.

Computes each layer of a pyramid by smoothing then computing the difference from the original image. The smoothed is then subsampled using a reduction factor of 1.5 (ie each level is 2/3 the size of the level below) and used to produced the next level.

This is useful for finding locally interesting points and their associated scales - see "Object Recognition from Scale Invariant Features" D.Lowe, ICCV1999, pp.1150-1157.

Definition at line 26 of file vimt_dog_pyramid_builder_2d.h.


Constructor & Destructor Documentation

Dflt ctor.

Definition at line 26 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
vimt_dog_pyramid_builder_2d< T >::~vimt_dog_pyramid_builder_2d ( ) [virtual]

Destructor.

Definition at line 35 of file vimt_dog_pyramid_builder_2d.txx.


Member Function Documentation

template<class T >
void vimt_dog_pyramid_builder_2d< T >::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements vimt_image_pyramid_builder.

Definition at line 280 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements vimt_image_pyramid_builder.

Definition at line 269 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::build ( vimt_image_pyramid dog_pyr,
const vimt_image im 
) const [virtual]

Build pyramid.

Implements vimt_image_pyramid_builder.

Definition at line 114 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::build_dog ( vimt_image_pyramid dog_pyr,
vimt_image_pyramid smooth_pyr,
const vimt_image im,
bool  abs_diff = true 
) const

Build difference of gaussian pyramid and a gaussian pyramid.

Build pyramid.

If abs_diff, then use absolute difference of gaussians

Definition at line 124 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::check_pyr ( vimt_image_pyramid im_pyr,
int  n_levels 
) const [protected]

Checks pyramid has at least n levels of correct type.

Checks pyramid has at least n levels.

Definition at line 90 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
vimt_image_pyramid_builder * vimt_dog_pyramid_builder_2d< T >::clone ( ) const [virtual]

Create a copy on the heap and return base class pointer.

Implements vimt_image_pyramid_builder.

Definition at line 254 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::empty_pyr ( vimt_image_pyramid im_pyr) const [protected]

Deletes all data in im_pyr.

Definition at line 81 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::extend ( vimt_image_pyramid ) const [virtual]

Extend pyramid (not implemented).

Implements vimt_image_pyramid_builder.

Definition at line 229 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::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.

Applies filter in x and y, then samples every other pixel. Filter width defined by set_filter_width()

Definition at line 303 of file vimt_dog_pyramid_builder_2d.txx.

template<class T>
virtual vcl_string vimt_dog_pyramid_builder_2d< T >::is_a ( ) const [virtual]

Name of the class.

Reimplemented from vimt_image_pyramid_builder.

template<class T >
bool vimt_dog_pyramid_builder_2d< T >::is_class ( vcl_string const &  s) const [virtual]

Does the name of the class match the argument?.

Reimplemented from vimt_image_pyramid_builder.

Definition at line 238 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
int vimt_dog_pyramid_builder_2d< T >::max_levels ( ) const [virtual]

Get the current maximum number levels allowed.

Implements vimt_image_pyramid_builder.

Definition at line 55 of file vimt_dog_pyramid_builder_2d.txx.

template<class T>
unsigned vimt_dog_pyramid_builder_2d< T >::min_x_size ( ) const [inline]

Get the minimum Y size of the top layer of the pyramid.

Defaults to 5.

Definition at line 93 of file vimt_dog_pyramid_builder_2d.h.

template<class T>
unsigned vimt_dog_pyramid_builder_2d< T >::min_y_size ( ) const [inline]

Get the minimum Y size of the top layer of the pyramid.

Defaults to 5.

Definition at line 89 of file vimt_dog_pyramid_builder_2d.h.

template<class T >
vimt_image_pyramid * vimt_dog_pyramid_builder_2d< T >::new_image_pyramid ( ) const [virtual]

Create new (empty) pyramid on heap.

Caller responsible for its deletion

Implements vimt_image_pyramid_builder.

Definition at line 64 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements vimt_image_pyramid_builder.

Definition at line 262 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
double vimt_dog_pyramid_builder_2d< T >::scale_step ( ) const [virtual]

Scale step between levels.

Implements vimt_image_pyramid_builder.

Definition at line 72 of file vimt_dog_pyramid_builder_2d.txx.

template<class T >
void vimt_dog_pyramid_builder_2d< T >::set_max_levels ( int  max_l) [virtual]

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_dog_pyramid_builder_2d.txx.

template<class T>
virtual void vimt_dog_pyramid_builder_2d< T >::set_min_size ( unsigned  X,
unsigned  Y 
) [inline, virtual]

Set the minimum size of the top layer of the pyramid.

Definition at line 96 of file vimt_dog_pyramid_builder_2d.h.

template<class T >
short vimt_dog_pyramid_builder_2d< T >::version_no ( ) const

Version number for I/O.

Reimplemented from vimt_image_pyramid_builder.

Definition at line 246 of file vimt_dog_pyramid_builder_2d.txx.


Member Data Documentation

template<class T>
int vimt_dog_pyramid_builder_2d< T >::max_levels_ [private]

Definition at line 28 of file vimt_dog_pyramid_builder_2d.h.

template<class T>
unsigned vimt_dog_pyramid_builder_2d< T >::min_x_size_ [private]

Minimum size in X direction of top layer of pyramid.

Definition at line 33 of file vimt_dog_pyramid_builder_2d.h.

template<class T>
unsigned vimt_dog_pyramid_builder_2d< T >::min_y_size_ [private]

Minimum size in Y direction of top layer of pyramid.

Definition at line 36 of file vimt_dog_pyramid_builder_2d.h.

template<class T>
vimt_image_2d_of<T> vimt_dog_pyramid_builder_2d< T >::work_im_ [mutable, private]

Definition at line 30 of file vimt_dog_pyramid_builder_2d.h.


The documentation for this class was generated from the following files: