mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added image sequence to rtabmap::Image class
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@740 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -386,7 +386,7 @@ bool Memory::update(const Image & image, std::map<std::string, float> & stats)
|
||||
//============================================================
|
||||
// Create a signature with the image received.
|
||||
//============================================================
|
||||
Signature * signature = this->createSignature(this->getNextId(), image, this->isRawDataKept());
|
||||
Signature * signature = this->createSignature(image, this->isRawDataKept());
|
||||
if (signature == 0)
|
||||
{
|
||||
UERROR("Failed to create a signature");
|
||||
@@ -2094,7 +2094,7 @@ private:
|
||||
VWDictionary * _vwp;
|
||||
};
|
||||
|
||||
Signature * Memory::createSignature(int id, const Image & image, bool keepRawData)
|
||||
Signature * Memory::createSignature(const Image & image, bool keepRawData)
|
||||
{
|
||||
PreUpdateThread preUpdateThread(_vwd);
|
||||
|
||||
@@ -2102,6 +2102,11 @@ Signature * Memory::createSignature(int id, const Image & image, bool keepRawDat
|
||||
timer.start();
|
||||
std::vector<cv::KeyPoint> keypoints;
|
||||
cv::Mat descriptors;
|
||||
int id = image.id();
|
||||
if(!id)
|
||||
{
|
||||
id = this->getNextId();
|
||||
}
|
||||
|
||||
int treeSize= _workingMem.size() + _stMem.size();
|
||||
int nbCommonWords = 0;
|
||||
|
||||
@@ -502,6 +502,23 @@ int Rtabmap::getTotalMemSize()
|
||||
return memSize;
|
||||
}
|
||||
|
||||
std::multimap<int, cv::KeyPoint> Rtabmap::getWords(int nodeId)
|
||||
{
|
||||
UScopeMutex s(&_threadMutex);
|
||||
std::multimap<int, cv::KeyPoint> words;
|
||||
|
||||
if(_memory)
|
||||
{
|
||||
const Signature * s = _memory->getSignature(nodeId);
|
||||
if(s)
|
||||
{
|
||||
words = s->getWords();
|
||||
}
|
||||
}
|
||||
|
||||
return words;
|
||||
}
|
||||
|
||||
void Rtabmap::clearBufferedSensors()
|
||||
{
|
||||
_imageMutex.lock();
|
||||
@@ -1466,10 +1483,10 @@ void Rtabmap::setWorkingDirectory(std::string path)
|
||||
}
|
||||
}
|
||||
|
||||
void Rtabmap::process(const cv::Mat & image)
|
||||
void Rtabmap::process(const cv::Mat & image, int id)
|
||||
{
|
||||
UScopeMutex s(&_threadMutex);
|
||||
this->process(Image(image));
|
||||
this->process(Image(image, id));
|
||||
}
|
||||
|
||||
void Rtabmap::process(const Image & image)
|
||||
|
||||
Reference in New Issue
Block a user