Public Member Functions | Private Attributes
pano::ImageMolecule Class Reference

#include <ImageMolecule.h>

Inheritance diagram for pano::ImageMolecule:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void deserialize (const cv::FileNode &fn)
const cv::Ptr< ImageAtom > & getAnchor () const throw (std::logic_error)
std::set< cv::Ptr< ImageAtom > > & getAtoms () throw ()
 Gets a reference to the set of atoms that defines this molecule.
const std::set< cv::Ptr
< ImageAtom > > & 
getAtoms () const throw ()
 Gets a reference to the set of atoms that defines this molecule.
cv::Ptr< ImageAtomgetMaximallyConnectedAtom (int node_offset=0) const
const AtomPairgetPairByIndex (size_t idx) const
const std::list< int > * getPairIndices (const cv::Ptr< ImageAtom > &atom) const
std::vector< AtomPair > & getPairs () throw ()
 Gets a reference to the vector of pairs that defines this molecule.
const std::vector< AtomPair > & getPairs () const throw ()
 Gets a reference to the vector of pairs that defines this molecule.
bool hasAtom (const cv::Ptr< ImageAtom > &atom) const throw ()
 check if the given atom is in the molecule
void hasAtomThrow (const cv::Ptr< ImageAtom > &atom) const throw (std::logic_error)
 check if the given atom is in the molecule but throw if its not - does not return a value
 ImageMolecule ()
 ImageMolecule (const ImageMolecule &rhs)
 ImageMolecule (const std::list< AtomPair > &pairs)
 ImageMolecule (const std::vector< AtomPair > &pairs)
void insertAtom (const cv::Ptr< ImageAtom > &atom) throw ()
void insertAtoms (const std::set< cv::Ptr< ImageAtom > > &atoms)
void insertPair (const AtomPair &pair) throw ()
void insertPairs (const std::list< AtomPair > &pairs) throw ()
void insertPairs (const std::vector< AtomPair > &pairs) throw ()
void merge (cv::Ptr< ImageAtom > pivot, const ImageMolecule &molecule)
void peelAtoms (int flag=0)
void removeBadPairs ()
bool removePair (const AtomPair &pair) throw ()
virtual void serialize (cv::FileStorage &fs) const
void setAnchor (const cv::Ptr< ImageAtom > &atom) throw ()
virtual int version () const
 ~ImageMolecule ()

Private Attributes

cv::Ptr< ImageAtomanchor_
std::set< cv::Ptr< ImageAtom > > atoms_
std::map< cv::Ptr< ImageAtom >
, std::list< int > > 
pairmap_
std::vector< AtomPairpairs_

Detailed Description

to be a collection of ImageAtom s, holding them in a way that describes their relationship to one another.

Definition at line 27 of file ImageMolecule.h.


Constructor & Destructor Documentation

Default constructor, doesn't initialize anything

Definition at line 61 of file ImageMolecule.cpp.

copy constructor - this is relatively heavy operation - as it copies the sets and maps that keep track of atoms, however - atoms are all by pointer. Above is Debatable; ? everything is irrelevant compared to image copies and blending ?

Definition at line 66 of file ImageMolecule.cpp.

pano::ImageMolecule::ImageMolecule ( const std::list< AtomPair > &  pairs)

this creates an ImageMolecule out of a list of pairs. These pairs should already be well defined

Please note that the pairs are not required to completely interconnect And you may get a molecule with disjoint chains of atoms

Parameters:
pairsthe pairs to initialize with - these should have valid pointers to atoms and preferably valid ModelFitter results.

Definition at line 72 of file ImageMolecule.cpp.

pano::ImageMolecule::ImageMolecule ( const std::vector< AtomPair > &  pairs)

Definition at line 79 of file ImageMolecule.cpp.

Definition at line 56 of file ImageMolecule.h.


Member Function Documentation

void pano::ImageMolecule::deserialize ( const cv::FileNode &  fn) [virtual]

Implements pano::serializable.

Definition at line 323 of file ImageMolecule.cpp.

const Ptr< ImageAtom > & pano::ImageMolecule::getAnchor ( ) const throw (std::logic_error)

Get the anchor to this molecule

Returns:
a pointer to the ImageAtom that is the anchor, may crash if the molecule is empty!

Definition at line 176 of file ImageMolecule.cpp.

set< Ptr< ImageAtom > > & pano::ImageMolecule::getAtoms ( ) throw ()

Gets a reference to the set of atoms that defines this molecule.

Returns:
a mutable reference to the set of atoms;

Definition at line 234 of file ImageMolecule.cpp.

const set< Ptr< ImageAtom > > & pano::ImageMolecule::getAtoms ( ) const throw ()

Gets a reference to the set of atoms that defines this molecule.

Returns:
an immutable reference to the set of atoms;

Definition at line 239 of file ImageMolecule.cpp.

Ptr< ImageAtom > pano::ImageMolecule::getMaximallyConnectedAtom ( int  node_offset = 0) const

Definition at line 265 of file ImageMolecule.cpp.

const AtomPair * pano::ImageMolecule::getPairByIndex ( size_t  idx) const

Definition at line 205 of file ImageMolecule.cpp.

const list< int > * pano::ImageMolecule::getPairIndices ( const cv::Ptr< ImageAtom > &  atom) const

get a list of indexes for the pairs that include the incoming atom, don't hang onto the list pointer.

Returns:
a list of the associated pairs for the given atom, null if not found

Definition at line 194 of file ImageMolecule.cpp.

vector< AtomPair > & pano::ImageMolecule::getPairs ( ) throw ()

Gets a reference to the vector of pairs that defines this molecule.

Returns:
a mutable reference to pairs

Definition at line 167 of file ImageMolecule.cpp.

const vector< AtomPair > & pano::ImageMolecule::getPairs ( ) const throw ()

Gets a reference to the vector of pairs that defines this molecule.

Returns:
a mutable reference to pairs

Definition at line 172 of file ImageMolecule.cpp.

bool pano::ImageMolecule::hasAtom ( const cv::Ptr< ImageAtom > &  atom) const throw ()

check if the given atom is in the molecule

Returns:
true if its already in the molecule

Definition at line 244 of file ImageMolecule.cpp.

void pano::ImageMolecule::hasAtomThrow ( const cv::Ptr< ImageAtom > &  atom) const throw (std::logic_error)

check if the given atom is in the molecule but throw if its not - does not return a value

Definition at line 249 of file ImageMolecule.cpp.

void pano::ImageMolecule::insertAtom ( const cv::Ptr< ImageAtom > &  atom) throw ()

Insert an atom into the molecule, atoms are unique, and may be added more than once.

Parameters:
atomthe atom to insert - atoms are stored by their pointer, so the same image may be in two atoms if it has been loaded more than once(be careful with this)

Definition at line 86 of file ImageMolecule.cpp.

void pano::ImageMolecule::insertAtoms ( const std::set< cv::Ptr< ImageAtom > > &  atoms)

Definition at line 157 of file ImageMolecule.cpp.

void pano::ImageMolecule::insertPair ( const AtomPair pair) throw ()

Insert a pair this inserts a pair into the molecule, no check for uniqueness is done

Parameters:
thepair to be inserted - atoms are unique though

Definition at line 94 of file ImageMolecule.cpp.

void pano::ImageMolecule::insertPairs ( const std::list< AtomPair > &  pairs) throw ()

This inserts a list of pairs into the atom

Parameters:
pairsthe pairs to insert, no uniqueness done on pairs
  • atoms will not be double added though
void pano::ImageMolecule::insertPairs ( const std::vector< AtomPair > &  pairs) throw ()
void pano::ImageMolecule::merge ( cv::Ptr< ImageAtom pivot,
const ImageMolecule molecule 
)

Definition at line 214 of file ImageMolecule.cpp.

void pano::ImageMolecule::peelAtoms ( int  flag = 0)

revert ImageAtom objects to AtomShells by freeing their images and keypoints. flag = 0 for free everything but Imageraw + trinsics (all we need to blend) flag = 1 for free all including the image (must reload from filename to do anything)

Definition at line 104 of file ImageMolecule.cpp.

Definition at line 138 of file ImageMolecule.cpp.

bool pano::ImageMolecule::removePair ( const AtomPair pair) throw ()

Definition at line 123 of file ImageMolecule.cpp.

void pano::ImageMolecule::serialize ( cv::FileStorage &  fs) const [virtual]

Implements pano::serializable.

Definition at line 296 of file ImageMolecule.cpp.

void pano::ImageMolecule::setAnchor ( const cv::Ptr< ImageAtom > &  atom) throw ()

Set's the given atom as the anchor to this molecule, The anchor may have varying definitions to one's algorithms, For MoleculeProcessor::findAndSetTrinsics - this atom's rotation becomes "the" pivotal rotation that every other atom's rotation is relative to

Parameters:
atom- the atom that is to act as the anchor for the molecule

Definition at line 162 of file ImageMolecule.cpp.

virtual int pano::ImageMolecule::version ( ) const [inline, virtual]

Implements pano::serializable.

Definition at line 166 of file ImageMolecule.h.


Member Data Documentation

Definition at line 178 of file ImageMolecule.h.

Definition at line 176 of file ImageMolecule.h.

std::map<cv::Ptr<ImageAtom> , std::list<int> > pano::ImageMolecule::pairmap_ [private]

Definition at line 175 of file ImageMolecule.h.

std::vector<AtomPair > pano::ImageMolecule::pairs_ [private]

Definition at line 177 of file ImageMolecule.h.


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


pano_core
Author(s): Ethan Rublee
autogenerated on Mon Mar 14 2016 10:56:54