#include <ImageMolecule.h>
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< ImageAtom > | getMaximallyConnectedAtom (int node_offset=0) const |
const AtomPair * | getPairByIndex (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< ImageAtom > | anchor_ |
std::set< cv::Ptr< ImageAtom > > | atoms_ |
std::map< cv::Ptr< ImageAtom > , std::list< int > > | pairmap_ |
std::vector< AtomPair > | pairs_ |
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.
Default constructor, doesn't initialize anything
Definition at line 61 of file ImageMolecule.cpp.
pano::ImageMolecule::ImageMolecule | ( | const ImageMolecule & | rhs | ) |
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
pairs | the 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.
pano::ImageMolecule::~ImageMolecule | ( | ) | [inline] |
Definition at line 56 of file ImageMolecule.h.
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
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.
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.
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.
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.
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.
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
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.
atom | the 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
the | pair 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
pairs | the pairs to insert, no uniqueness done on pairs
|
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.
void pano::ImageMolecule::removeBadPairs | ( | ) |
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
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.
cv::Ptr<ImageAtom> pano::ImageMolecule::anchor_ [private] |
Definition at line 178 of file ImageMolecule.h.
std::set<cv::Ptr<ImageAtom> > pano::ImageMolecule::atoms_ [private] |
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.