Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
rgrl_match_set Class Reference

For each feature in the "from" set, there is a set of features in the "to" set. More...

#include <rgrl_match_set.h>

Inheritance diagram for rgrl_match_set:
Inheritance graph
[legend]

List of all members.

Classes

class  match_info
 Holds the details of match. More...

Public Types

typedef vcl_size_t size_type
typedef
rgrl_match_set_from_iterator 
from_iterator
typedef
rgrl_match_set_const_from_iterator 
const_from_iterator

Public Member Functions

 rgrl_match_set ()
 construct an empty match set.
 rgrl_match_set (const vcl_type_info &feature_type)
 construct an empty match set, specifying the feature type.
 rgrl_match_set (const vcl_type_info &from_type, const vcl_type_info &to_type, const rgrl_feature_set_label &from_label=rgrl_feature_set_label(), const rgrl_feature_set_label &to_label=rgrl_feature_set_label())
 construct an empty match set, specifying the feature type.
const vcl_type_info & from_type () const
 type of from features.
const vcl_type_info & to_type () const
 type of from features.
const rgrl_feature_set_labelfrom_label () const
 label of from features.
const rgrl_feature_set_labelto_label () const
 label of from features.
size_type from_size () const
 The number of "from" features.
const_from_iterator from_begin () const
const_from_iterator from_end () const
from_iterator from_begin ()
from_iterator from_end ()
void clear ()
 Remove all the matches from this set.
void write (vcl_ostream &os) const
 write out a match set.
void write_sorted (vcl_ostream &os) const
 write out a match set.
bool read (vcl_istream &is)
 read in a match set.
void add_feature_and_matches (rgrl_feature_sptr from_feature, rgrl_feature_sptr mapped_feature, vcl_vector< rgrl_feature_sptr > const &matching_to)
 Add from feature, the transformed feature, and its matching "to" features.
void add_feature_matches_and_weights (rgrl_feature_sptr from_feature, rgrl_feature_sptr mapped_feature, vcl_vector< rgrl_feature_sptr > const &matching_to, vcl_vector< double > const &signature_weights)
 Add from feature, the transformed feature, and its matching "to" features, and the signature weight.
void add_feature_matches_and_weights (rgrl_feature_sptr from_feature, rgrl_feature_sptr mapped_feature, vcl_vector< rgrl_feature_sptr > const &matching_to, vcl_vector< double > const &sig_wgts, vcl_vector< double > const &geo_wgts, vcl_vector< double > const &cum_wgts)
 Add from feature, the transformed feature, and its matching "to" features, and ALL weights.
void add_feature_and_match (rgrl_feature_sptr from_feature, rgrl_feature_sptr mapped_feature, rgrl_feature_sptr matching_to, double wgt=1.0)
 Add from feature and its matching "to" feature.
void remap_from_features (rgrl_transformation const &trans)
 Update the cached mapped_from_feature using trans.
void remap_only_location (rgrl_transformation const &trans)
 Update only the location of the cached mapped_from_feature using trans.
const vcl_type_info & from_feature_type () const
 to access feature types.
const vcl_type_info & to_feature_type () const
unsigned int num_constraints_per_match () const
void reserve (unsigned i)
 reserve space for a number of matches.
virtual bool is_type (const vcl_type_info &type) const
void set_debug_flag (unsigned int debugFlag) const
 Set the value of the debug flag. A non-zero value turns debugging on.
unsigned int debug_flag () const
 Get the value of the debug flag.
void set_warning (bool) const
 Set the flag for warning messages.
bool warning () const
 Get the warning flag.
unsigned int add_observer (rgrl_event_sptr event, rgrl_command_sptr)
 Allow people to add/remove/invoke observers (callbacks) to any rgrl object.
rgrl_command_sptr get_command (unsigned int tag)
 Get the command associated with the given tag.
void invoke_event (const rgrl_event &)
 Call execute(.) on all the rgrl_commands observing this event id.
void invoke_event (const rgrl_event &) const
 Call execute(.) on all the rgrl_commands observing this event id.
void remove_observer (unsigned int tag)
 Remove the observer with this tag value.
bool has_observer (const rgrl_event &event) const
 Return true if an observer is registered for this event.
void ref ()
void unref ()
int get_references () const
bool is_referenced () const

Static Public Member Functions

static const vcl_type_info & type_id ()

Private Member Functions

void set_num_constraints_per_match () const

Private Attributes

const vcl_type_info * from_type_
const vcl_type_info * to_type_
rgrl_feature_set_label from_label_
rgrl_feature_set_label to_label_
unsigned int num_constraints_per_match_
vcl_vector< rgrl_feature_sptrfrom_features_
vcl_vector< rgrl_feature_sptrxformed_from_features_
vcl_vector< vcl_vector
< match_info > > 
matches_and_weights_

Friends

class rgrl_match_set_from_iterator
class rgrl_match_set_const_from_iterator
class rgrl_match_set_from_to_iterator
class rgrl_match_set_const_from_to_iterator

Detailed Description

For each feature in the "from" set, there is a set of features in the "to" set.

Each "from" point is indexed by an index i. For each "from" point, there is a set of "to" points, indexed by j, where the range of j depends on i. A specific feature-to-feature correspondence is therefore given by (i, j). A "from" point could be repeated with a different index, allowing a many-to-many matching.

While one can request the set of "to" matches corresponding to a given "from" match, there is currently no functionality to provide the reverse. This functionality may be added in future, however, so please use with this in mind.

Definition at line 45 of file rgrl_match_set.h.


Member Typedef Documentation

Definition at line 51 of file rgrl_match_set.h.

Definition at line 50 of file rgrl_match_set.h.

typedef vcl_size_t rgrl_match_set::size_type

Definition at line 49 of file rgrl_match_set.h.


Constructor & Destructor Documentation

rgrl_match_set::rgrl_match_set ( )

construct an empty match set.

Definition at line 20 of file rgrl_match_set.cxx.

rgrl_match_set::rgrl_match_set ( const vcl_type_info &  feature_type)

construct an empty match set, specifying the feature type.

Definition at line 28 of file rgrl_match_set.cxx.

rgrl_match_set::rgrl_match_set ( const vcl_type_info &  from_type,
const vcl_type_info &  to_type,
const rgrl_feature_set_label from_label = rgrl_feature_set_label(),
const rgrl_feature_set_label to_label = rgrl_feature_set_label() 
)

construct an empty match set, specifying the feature type.

Definition at line 36 of file rgrl_match_set.cxx.


Member Function Documentation

void rgrl_match_set::add_feature_and_match ( rgrl_feature_sptr  from_feature,
rgrl_feature_sptr  mapped_feature,
rgrl_feature_sptr  matching_to,
double  wgt = 1.0 
)

Add from feature and its matching "to" feature.

Convenience method for adding a one-to-one correspondence. The wgt parameter is used to initialize all the weights for the correspondence (geometric, signature, and cumulative weights).

Definition at line 215 of file rgrl_match_set.cxx.

void rgrl_match_set::add_feature_and_matches ( rgrl_feature_sptr  from_feature,
rgrl_feature_sptr  mapped_feature,
vcl_vector< rgrl_feature_sptr > const &  matching_to 
)

Add from feature, the transformed feature, and its matching "to" features.

Definition at line 101 of file rgrl_match_set.cxx.

void rgrl_match_set::add_feature_matches_and_weights ( rgrl_feature_sptr  from_feature,
rgrl_feature_sptr  mapped_feature,
vcl_vector< rgrl_feature_sptr > const &  matching_to,
vcl_vector< double > const &  signature_weights 
)

Add from feature, the transformed feature, and its matching "to" features, and the signature weight.

Definition at line 133 of file rgrl_match_set.cxx.

void rgrl_match_set::add_feature_matches_and_weights ( rgrl_feature_sptr  from_feature,
rgrl_feature_sptr  mapped_feature,
vcl_vector< rgrl_feature_sptr > const &  matching_to,
vcl_vector< double > const &  sig_wgts,
vcl_vector< double > const &  geo_wgts,
vcl_vector< double > const &  cum_wgts 
)

Add from feature, the transformed feature, and its matching "to" features, and ALL weights.

Definition at line 171 of file rgrl_match_set.cxx.

unsigned int rgrl_object::add_observer ( rgrl_event_sptr  event,
rgrl_command_sptr  cmd 
) [inherited]

Allow people to add/remove/invoke observers (callbacks) to any rgrl object.

This is an implementation of the subject/observer design pattern. An observer is added by specifying an event to respond to and an rgrl_command to execute. It returns an unsigned long tag which can be used later to remove the event or retrieve the command.

Definition at line 47 of file rgrl_object.cxx.

void rgrl_match_set::clear ( )

Remove all the matches from this set.

Definition at line 91 of file rgrl_match_set.cxx.

unsigned int rgrl_object::debug_flag ( ) const [inherited]

Get the value of the debug flag.

Definition at line 26 of file rgrl_object.cxx.

rgrl_match_set::const_from_iterator rgrl_match_set::from_begin ( ) const

Definition at line 59 of file rgrl_match_set.cxx.

rgrl_match_set::from_iterator rgrl_match_set::from_begin ( )

Definition at line 75 of file rgrl_match_set.cxx.

rgrl_match_set::const_from_iterator rgrl_match_set::from_end ( ) const

Definition at line 67 of file rgrl_match_set.cxx.

rgrl_match_set::from_iterator rgrl_match_set::from_end ( )

Definition at line 83 of file rgrl_match_set.cxx.

const vcl_type_info& rgrl_match_set::from_feature_type ( ) const [inline]

to access feature types.

Definition at line 162 of file rgrl_match_set.h.

const rgrl_feature_set_label& rgrl_match_set::from_label ( ) const [inline]

label of from features.

Definition at line 76 of file rgrl_match_set.h.

rgrl_match_set::size_type rgrl_match_set::from_size ( ) const

The number of "from" features.

Definition at line 51 of file rgrl_match_set.cxx.

const vcl_type_info& rgrl_match_set::from_type ( ) const [inline]

type of from features.

Definition at line 68 of file rgrl_match_set.h.

rgrl_command_sptr rgrl_object::get_command ( unsigned int  tag) [inherited]

Get the command associated with the given tag.

Definition at line 57 of file rgrl_object.cxx.

bool rgrl_object::has_observer ( const rgrl_event event) const [inherited]

Return true if an observer is registered for this event.

Definition at line 107 of file rgrl_object.cxx.

void rgrl_object::invoke_event ( const rgrl_event event) [inherited]

Call execute(.) on all the rgrl_commands observing this event id.

Definition at line 69 of file rgrl_object.cxx.

void rgrl_object::invoke_event ( const rgrl_event event) const [inherited]

Call execute(.) on all the rgrl_commands observing this event id.

The actions triggered by this call doesn't modify this object.

Definition at line 83 of file rgrl_object.cxx.

virtual bool rgrl_object::is_type ( const vcl_type_info &  type) const [inline, virtual, inherited]

Reimplemented in rgrl_scale_estimator.

Definition at line 66 of file rgrl_object.h.

unsigned int rgrl_match_set::num_constraints_per_match ( ) const

Definition at line 268 of file rgrl_match_set.cxx.

bool rgrl_match_set::read ( vcl_istream &  is)

read in a match set.

stream input.

Definition at line 410 of file rgrl_match_set.cxx.

void rgrl_match_set::remap_from_features ( rgrl_transformation const &  trans)

Update the cached mapped_from_feature using trans.

This will remap each from_feature using trans and store the result in mapped_from_feature.

Definition at line 238 of file rgrl_match_set.cxx.

void rgrl_match_set::remap_only_location ( rgrl_transformation const &  trans)

Update only the location of the cached mapped_from_feature using trans.

This will remap the location of each from_feature using trans and store the result in the already existing mapped_from_feature.

Definition at line 250 of file rgrl_match_set.cxx.

void rgrl_object::remove_observer ( unsigned int  tag) [inherited]

Remove the observer with this tag value.

Definition at line 97 of file rgrl_object.cxx.

void rgrl_match_set::reserve ( unsigned  i) [inline]

reserve space for a number of matches.

Definition at line 169 of file rgrl_match_set.h.

void rgrl_object::set_debug_flag ( unsigned int  debugFlag) const [inherited]

Set the value of the debug flag. A non-zero value turns debugging on.

Definition at line 19 of file rgrl_object.cxx.

void rgrl_match_set::set_num_constraints_per_match ( ) const [private]

Definition at line 278 of file rgrl_match_set.cxx.

void rgrl_object::set_warning ( bool  flag) const [inherited]

Set the flag for warning messages.

Definition at line 33 of file rgrl_object.cxx.

const vcl_type_info& rgrl_match_set::to_feature_type ( ) const [inline]

Definition at line 163 of file rgrl_match_set.h.

const rgrl_feature_set_label& rgrl_match_set::to_label ( ) const [inline]

label of from features.

Definition at line 81 of file rgrl_match_set.h.

const vcl_type_info& rgrl_match_set::to_type ( ) const [inline]

type of from features.

Definition at line 72 of file rgrl_match_set.h.

static const vcl_type_info& rgrl_object::type_id ( ) [inline, static, inherited]

Reimplemented in rgrl_scale_estimator.

Definition at line 63 of file rgrl_object.h.

bool rgrl_object::warning ( ) const [inherited]

Get the warning flag.

Definition at line 40 of file rgrl_object.cxx.

void rgrl_match_set::write ( vcl_ostream &  os) const

write out a match set.

stream output.

Definition at line 301 of file rgrl_match_set.cxx.

void rgrl_match_set::write_sorted ( vcl_ostream &  os) const

write out a match set.

stream output.

Definition at line 368 of file rgrl_match_set.cxx.


Friends And Related Function Documentation

friend class rgrl_match_set_const_from_iterator [friend]

Definition at line 209 of file rgrl_match_set.h.

Definition at line 211 of file rgrl_match_set.h.

friend class rgrl_match_set_from_iterator [friend]

Definition at line 208 of file rgrl_match_set.h.

friend class rgrl_match_set_from_to_iterator [friend]

Definition at line 210 of file rgrl_match_set.h.


Member Data Documentation

Definition at line 220 of file rgrl_match_set.h.

Definition at line 216 of file rgrl_match_set.h.

const vcl_type_info* rgrl_match_set::from_type_ [private]

Definition at line 214 of file rgrl_match_set.h.

vcl_vector< vcl_vector< match_info > > rgrl_match_set::matches_and_weights_ [private]

Definition at line 222 of file rgrl_match_set.h.

unsigned int rgrl_match_set::num_constraints_per_match_ [mutable, private]

Definition at line 219 of file rgrl_match_set.h.

Definition at line 217 of file rgrl_match_set.h.

const vcl_type_info* rgrl_match_set::to_type_ [private]

Definition at line 215 of file rgrl_match_set.h.

Definition at line 221 of file rgrl_match_set.h.


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