Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
PairMatchSetCorner Class Reference

#include <PairMatchSetCorner.h>

Inheritance diagram for PairMatchSetCorner:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { use_existing = true }
enum  { NoMatch = -1 }

Public Member Functions

 PairMatchSetCorner ()
 Constructor.
 PairMatchSetCorner (HomgInterestPointSet const *corners1, HomgInterestPointSet const *corners2)
 Construct a PairMatchSetCorner that will contain matches between the given HomgInterestPointSets.
 PairMatchSetCorner (const PairMatchSetCorner &that)
 Copy a PairMatchSetCorner.
PairMatchSetCorneroperator= (const PairMatchSetCorner &that)
 ~PairMatchSetCorner ()
 Destructor.
void extract_matches (vcl_vector< HomgPoint2D > &points1, vcl_vector< int > &corner_index_1, vcl_vector< HomgPoint2D > &points2, vcl_vector< int > &corner_index_2) const
 Extract the point vectors for only the valid matches.
void extract_matches (vcl_vector< HomgPoint2D > &points1, vcl_vector< HomgPoint2D > &points2) const
 Extract the point vectors for only the valid matches.
void set (const vcl_vector< bool > &inliers, const vcl_vector< int > &corner_index_1, const vcl_vector< int > &corner_index_2)
 Clear all matches and then set only those for which the corresponding inliers flag is set.
void set (HomgInterestPointSet const *corners1, HomgInterestPointSet const *corners2)
 Set the pair of HomgInterestPointSets to which matches refer.
HomgInterestPointSet const * get_corners1 () const
 Return the set of corners within which the i1 indices point.
HomgInterestPointSet const * get_corners2 () const
 Return the set of corners within which the i2 indices point.
void set_size (unsigned size)
 Set the maximum allowed value of i1 to size.
bool add_match (int i1, int i2)
 Add the pair (i1, i2) to the match set.
int get_match_12 (int i1) const
 Return any match for i1.
int get_match_21 (int i2) const
 Return any match for i2.
void clear_match_1 (int i1)
 Remove any match for i1.
void set_identity ()
 Set this match set to contain matches (i,i) for i=0..size.
unsigned int count () const
void update_feature_match_data ()
void clear ()
 Empty this match set.
void update (const vcl_vector< bool > &inliers)
int size () const
 Return the maximum allowed value of i1.
int compute_match_count ()
 Count the number of matches in this set.
void print_brief (vcl_ostream &s) const
 Summarize matches on stream.
void print_brief () const
 Summarize matches on cout.
void write_ascii (vcl_ostream &s) const
 Write matches in ASCII to stream.
bool read_ascii (vcl_istream &s)
bool get_match (int at, int *i1, int *i2) const

Static Public Member Functions

static bool matchp (int i)
 Return true if i is not the "NoMatch" value.

Private Attributes

HomgInterestPointSet const * corners1_
HomgInterestPointSet const * corners2_

Friends

vcl_ostream & operator<< (vcl_ostream &s, const PairMatchSet &cc)
vcl_istream & operator>> (vcl_istream &s, PairMatchSet &cc)

Detailed Description

Definition at line 27 of file PairMatchSetCorner.h.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
NoMatch 

Definition at line 29 of file MatchSet.h.

anonymous enum [inherited]
Enumerator:
use_existing 

Definition at line 41 of file PairMatchSet.h.


Constructor & Destructor Documentation

PairMatchSetCorner::PairMatchSetCorner ( )

Constructor.

Definition at line 17 of file PairMatchSetCorner.cxx.

PairMatchSetCorner::PairMatchSetCorner ( HomgInterestPointSet const *  corners1,
HomgInterestPointSet const *  corners2 
)

Construct a PairMatchSetCorner that will contain matches between the given HomgInterestPointSets.

These objects are held by reference in the MatchSet and must therefore live longer than the PairMatchSetCorner (for example in an MViewDatabase).

Definition at line 24 of file PairMatchSetCorner.cxx.

PairMatchSetCorner::PairMatchSetCorner ( const PairMatchSetCorner that)

Copy a PairMatchSetCorner.

Definition at line 32 of file PairMatchSetCorner.cxx.

PairMatchSetCorner::~PairMatchSetCorner ( )

Destructor.

Definition at line 46 of file PairMatchSetCorner.cxx.


Member Function Documentation

bool PairMatchSet::add_match ( int  i1,
int  i2 
) [inherited]

Add the pair (i1, i2) to the match set.

If i1 had an existing match it is overwritten.

Definition at line 58 of file PairMatchSet.cxx.

void PairMatchSet::clear ( ) [inherited]

Empty this match set.

Definition at line 131 of file PairMatchSet.cxx.

void PairMatchSet::clear_match_1 ( int  i1) [inherited]

Remove any match for i1.

Specifically, remove tuples whose first element is i1.

Definition at line 75 of file PairMatchSet.cxx.

int PairMatchSet::compute_match_count ( ) [inherited]

Count the number of matches in this set.

Definition at line 147 of file PairMatchSet.cxx.

unsigned int PairMatchSet::count ( ) const [inline, inherited]

Definition at line 60 of file PairMatchSet.h.

void PairMatchSetCorner::extract_matches ( vcl_vector< HomgPoint2D > &  points1,
vcl_vector< int > &  corner_index_1,
vcl_vector< HomgPoint2D > &  points2,
vcl_vector< int > &  corner_index_2 
) const

Extract the point vectors for only the valid matches.

In addition, return the corresponding point indices in corner_index_[12]. Thus, points1[0] = corner_set_1()[corner_index_1[0]]. This is useful with procedures such as RANSAC.

Definition at line 92 of file PairMatchSetCorner.cxx.

void PairMatchSetCorner::extract_matches ( vcl_vector< HomgPoint2D > &  points1,
vcl_vector< HomgPoint2D > &  points2 
) const

Extract the point vectors for only the valid matches.

For example, given a set of matches between corner features, this function copies the inliers to a pair of arrays which can then be fed to a non-robust matcher.

Definition at line 69 of file PairMatchSetCorner.cxx.

HomgInterestPointSet const* PairMatchSetCorner::get_corners1 ( ) const [inline]

Return the set of corners within which the i1 indices point.

Definition at line 53 of file PairMatchSetCorner.h.

HomgInterestPointSet const* PairMatchSetCorner::get_corners2 ( ) const [inline]

Return the set of corners within which the i2 indices point.

Definition at line 56 of file PairMatchSetCorner.h.

bool PairMatchSet::get_match ( int  at,
int *  i1,
int *  i2 
) const [inherited]

Definition at line 119 of file PairMatchSet.cxx.

int PairMatchSet::get_match_12 ( int  i1) const [inherited]

Return any match for i1.

Specifically, return the second element of any tuple whose first element is i1.

Definition at line 92 of file PairMatchSet.cxx.

int PairMatchSet::get_match_21 ( int  i2) const [inherited]

Return any match for i2.

Specifically, return the first element of any tuple whose second element is i2. This is currently O(n) in the number of matches, consider adding an index to this class if you use it a lot.

Definition at line 110 of file PairMatchSet.cxx.

static bool MatchSet::matchp ( int  i) [inline, static, inherited]

Return true if i is not the "NoMatch" value.

Definition at line 32 of file MatchSet.h.

PairMatchSetCorner & PairMatchSetCorner::operator= ( const PairMatchSetCorner that)

Definition at line 38 of file PairMatchSetCorner.cxx.

void PairMatchSet::print_brief ( vcl_ostream &  s) const [inherited]

Summarize matches on stream.

Definition at line 243 of file PairMatchSet.cxx.

void PairMatchSet::print_brief ( ) const [inherited]

Summarize matches on cout.

Definition at line 252 of file PairMatchSet.cxx.

bool PairMatchSet::read_ascii ( vcl_istream &  s) [inherited]

Definition at line 203 of file PairMatchSet.cxx.

void PairMatchSetCorner::set ( const vcl_vector< bool > &  inliers,
const vcl_vector< int > &  corner_index_1,
const vcl_vector< int > &  corner_index_2 
)

Clear all matches and then set only those for which the corresponding inliers flag is set.

For example, if inliers[5] == true, then the match (corner_index_1[5], corner_index_2[5]) is added to the set.

Definition at line 115 of file PairMatchSetCorner.cxx.

void PairMatchSetCorner::set ( HomgInterestPointSet const *  corners1,
HomgInterestPointSet const *  corners2 
)

Set the pair of HomgInterestPointSets to which matches refer.

See the constructor for constraints.

Definition at line 54 of file PairMatchSetCorner.cxx.

void PairMatchSet::set_identity ( ) [inherited]

Set this match set to contain matches (i,i) for i=0..size.

Definition at line 139 of file PairMatchSet.cxx.

void PairMatchSet::set_size ( unsigned  size) [inherited]

Set the maximum allowed value of i1 to size.

Definition at line 164 of file PairMatchSet.cxx.

int PairMatchSet::size ( ) const [inherited]

Return the maximum allowed value of i1.

Definition at line 158 of file PairMatchSet.cxx.

void PairMatchSet::update ( const vcl_vector< bool > &  inliers) [inherited]

Definition at line 170 of file PairMatchSet.cxx.

void PairMatchSet::update_feature_match_data ( ) [inherited]

Definition at line 51 of file PairMatchSet.cxx.

void PairMatchSet::write_ascii ( vcl_ostream &  s) const [inherited]

Write matches in ASCII to stream.

Definition at line 188 of file PairMatchSet.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  s,
const PairMatchSet cc 
) [friend, inherited]

Definition at line 197 of file PairMatchSet.cxx.

vcl_istream& operator>> ( vcl_istream &  s,
PairMatchSet cc 
) [friend, inherited]

Definition at line 236 of file PairMatchSet.cxx.


Member Data Documentation

Definition at line 59 of file PairMatchSetCorner.h.

Definition at line 60 of file PairMatchSetCorner.h.


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