Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes
mipa_block_normaliser Class Reference

Independently normalise (non-overlapping) blocks within a region. More...

#include <mipa_block_normaliser.h>

Inheritance diagram for mipa_block_normaliser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 mipa_block_normaliser ()
const mipa_vector_normalisernormaliser () const
 The actual normaliser.
void set_normaliser (const mipa_vector_normaliser &norm)
 Set the actual normaliser.
virtual void normalise (vnl_vector< double > &v) const
 Apply transform independently to each chunk of v.
virtual vcl_string is_a () const
 Name of the class.
virtual mipa_vector_normaliserclone () 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.
virtual void config_from_stream (vcl_istream &is, const mbl_read_props_type &extra_props)
 Initialise from a text stream.
void set_region (unsigned ni, unsigned nj)
void set_nbins (unsigned nA)
void set_nc_per_block (unsigned block_size)
unsigned nA () const
unsigned ni_region () const
unsigned nj_region () const
unsigned nc_per_block () const
virtual void normalise (vnl_vector< double > &sample, unsigned) const
 Normalise the sample, preserving the direction of each nfeatures-sized sub-vector.

Static Public Member Functions

static vcl_auto_ptr
< mipa_vector_normaliser
new_normaliser_from_stream (vcl_istream &is, const mbl_read_props_type &extra_props)
 Create a concrete mipa_vector_normaliser-derived object, from a text specification.

Protected Attributes

unsigned ni_region_
 Number of x cells in region.
unsigned nj_region_
 Number of y cells in region.
unsigned nc_per_block_
 Number of cells per block.
unsigned nA_
 Number of histogram bins per cell.

Private Attributes

mbl_cloneable_nzptr
< mipa_vector_normaliser
normaliser_
 The actual normaliser.

Detailed Description

Independently normalise (non-overlapping) blocks within a region.

(e.g. as in simplified R-HOG without overlap)

Definition at line 19 of file mipa_block_normaliser.h.


Constructor & Destructor Documentation

mipa_block_normaliser::mipa_block_normaliser ( ) [inline]

Definition at line 39 of file mipa_block_normaliser.h.


Member Function Documentation

void mipa_block_normaliser::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 122 of file mipa_block_normaliser.cxx.

void mipa_block_normaliser::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 106 of file mipa_block_normaliser.cxx.

mipa_vector_normaliser * mipa_block_normaliser::clone ( ) const [virtual]

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

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 83 of file mipa_block_normaliser.cxx.

void mipa_block_normaliser::config_from_stream ( vcl_istream &  is,
const mbl_read_props_type extra_props 
) [virtual]

Initialise from a text stream.

syntax

   {
     normaliser: mipa_l2norm_vector_normaliser
     ni: 16
     nj: 16
     nA: 20;
     nc_per_block: 4
   }
   

The next non-ws character in the stream should be a '{' syntax

   {
     normaliser: mipa_l2norm_vector_normaliser
     ni: 16
     nj: 16
     nc_per_block: 4
   }
   

Reimplemented from mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 161 of file mipa_block_normaliser.cxx.

vcl_string mipa_block_normaliser::is_a ( ) const [virtual]

Name of the class.

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 76 of file mipa_block_normaliser.cxx.

unsigned mipa_block_normaliser::nA ( ) const [inline]

Definition at line 87 of file mipa_block_normaliser.h.

unsigned mipa_block_normaliser::nc_per_block ( ) const [inline]

Definition at line 90 of file mipa_block_normaliser.h.

vcl_auto_ptr< mipa_vector_normaliser > mipa_vector_normaliser::new_normaliser_from_stream ( vcl_istream &  is,
const mbl_read_props_type extra_props 
) [static, inherited]

Create a concrete mipa_vector_normaliser-derived object, from a text specification.

Definition at line 48 of file mipa_vector_normaliser.cxx.

unsigned mipa_block_normaliser::ni_region ( ) const [inline]

Definition at line 88 of file mipa_block_normaliser.h.

unsigned mipa_block_normaliser::nj_region ( ) const [inline]

Definition at line 89 of file mipa_block_normaliser.h.

virtual void mipa_vector_normaliser::normalise ( vnl_vector< double > &  sample,
unsigned   
) const [inline, virtual, inherited]

Normalise the sample, preserving the direction of each nfeatures-sized sub-vector.

The default implementation assumes that this direction would be preserved anyway.

Definition at line 30 of file mipa_vector_normaliser.h.

void mipa_block_normaliser::normalise ( vnl_vector< double > &  v) const [virtual]

Apply transform independently to each chunk of v.

Apply transform to texture vector.

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 20 of file mipa_block_normaliser.cxx.

const mipa_vector_normaliser& mipa_block_normaliser::normaliser ( ) const [inline]

The actual normaliser.

Definition at line 43 of file mipa_block_normaliser.h.

void mipa_block_normaliser::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements mipa_vector_normaliser.

Reimplemented in mipa_ms_block_normaliser.

Definition at line 91 of file mipa_block_normaliser.cxx.

void mipa_block_normaliser::set_nbins ( unsigned  nA) [inline]

Definition at line 82 of file mipa_block_normaliser.h.

void mipa_block_normaliser::set_nc_per_block ( unsigned  block_size) [inline]

Definition at line 84 of file mipa_block_normaliser.h.

void mipa_block_normaliser::set_normaliser ( const mipa_vector_normaliser norm) [inline]

Set the actual normaliser.

Definition at line 46 of file mipa_block_normaliser.h.

void mipa_block_normaliser::set_region ( unsigned  ni,
unsigned  nj 
) [inline]

Definition at line 80 of file mipa_block_normaliser.h.


Member Data Documentation

unsigned mipa_block_normaliser::nA_ [protected]

Number of histogram bins per cell.

Definition at line 35 of file mipa_block_normaliser.h.

Number of cells per block.

Definition at line 32 of file mipa_block_normaliser.h.

unsigned mipa_block_normaliser::ni_region_ [protected]

Number of x cells in region.

Definition at line 27 of file mipa_block_normaliser.h.

unsigned mipa_block_normaliser::nj_region_ [protected]

Number of y cells in region.

Definition at line 29 of file mipa_block_normaliser.h.

The actual normaliser.

Definition at line 23 of file mipa_block_normaliser.h.


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