Skip to content

Commit

Permalink
Memory: ignore reextract features when registration is not visual
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Jan 6, 2017
1 parent 7fa5592 commit 00c93ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions corelib/src/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2146,13 +2146,13 @@ Transform Memory::computeTransform(

// make sure we have all data needed
// load binary data from database if not in RAM (if image is already here, scan and userData should be or they are null)
if(((_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired()) && fromS.sensorData().imageCompressed().empty()) ||
if(((_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired()) && fromS.sensorData().imageCompressed().empty()) ||
(_registrationPipeline->isScanRequired() && fromS.sensorData().imageCompressed().empty() && fromS.sensorData().laserScanCompressed().empty()) ||
(_registrationPipeline->isUserDataRequired() && fromS.sensorData().imageCompressed().empty() && fromS.sensorData().userDataCompressed().empty()))
{
fromS.sensorData() = getNodeData(fromS.id());
}
if(((_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired()) && toS.sensorData().imageCompressed().empty()) ||
if(((_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired()) && toS.sensorData().imageCompressed().empty()) ||
(_registrationPipeline->isScanRequired() && toS.sensorData().imageCompressed().empty() && toS.sensorData().laserScanCompressed().empty()) ||
(_registrationPipeline->isUserDataRequired() && toS.sensorData().imageCompressed().empty() && toS.sensorData().userDataCompressed().empty()))
{
Expand All @@ -2161,27 +2161,27 @@ Transform Memory::computeTransform(
// uncompress only what we need
cv::Mat imgBuf, depthBuf, laserBuf, userBuf;
fromS.sensorData().uncompressData(
(_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired())?&imgBuf:0,
(_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired())?&depthBuf:0,
(_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired())?&imgBuf:0,
(_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired())?&depthBuf:0,
_registrationPipeline->isScanRequired()?&laserBuf:0,
_registrationPipeline->isUserDataRequired()?&userBuf:0);
toS.sensorData().uncompressData(
(_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired())?&imgBuf:0,
(_reextractLoopClosureFeatures || _registrationPipeline->isImageRequired())?&depthBuf:0,
(_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired())?&imgBuf:0,
(_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired())?&depthBuf:0,
_registrationPipeline->isScanRequired()?&laserBuf:0,
_registrationPipeline->isUserDataRequired()?&userBuf:0);


// compute transform fromId -> toId
std::vector<int> inliersV;
if(_reextractLoopClosureFeatures ||
if((_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired()) ||
(fromS.getWords().size() && toS.getWords().size()) ||
(!guess.isNull() && !_registrationPipeline->isImageRequired()))
{
Signature tmpFrom = fromS;
Signature tmpTo = toS;

if(_reextractLoopClosureFeatures)
if(_reextractLoopClosureFeatures && _registrationPipeline->isImageRequired())
{
UDEBUG("");
tmpFrom.setWords(std::multimap<int, cv::KeyPoint>());
Expand Down

0 comments on commit 00c93ab

Please sign in to comment.