Fixed Stereo parameters not used for OdometryBOW. Saving parameters in Memory and Feature2D to re-use old parameters when underlaying algorithm strategies are re-created.

This commit is contained in:
matlabbe
2016-01-04 11:41:13 -05:00
parent 51300dde06
commit b578fc732e
11 changed files with 37 additions and 26 deletions
+17
View File
@@ -449,6 +449,23 @@ inline void uInsert(std::map<K, V> & map, const std::pair<K, V> & pair)
}
}
/**
* Insert items in the map. Contrary to the insert in the STL,
* if the key already exists, the value will be replaced by the new one.
*/
template<class K, class V>
inline void uInsert(std::map<K, V> & map, const std::map<K, V> & items)
{
for(typename std::map<K, V>::const_iterator iter=items.begin(); iter!=items.end(); ++iter)
{
std::pair<typename std::map<K, V>::iterator, bool> inserted = map.insert(*iter);
if(inserted.second == false)
{
inserted.first->second = iter->second;
}
}
}
/**
* Convert a std::list to a std::vector.
* @param list the list