mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-09 21:10:19 +08:00
Added/Removed some debug info
This commit is contained in:
@@ -3903,6 +3903,7 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
|
||||
if(_parallelized)
|
||||
{
|
||||
UDEBUG("Start dictionary update thread");
|
||||
preUpdateThread.start();
|
||||
}
|
||||
|
||||
@@ -3916,12 +3917,14 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
// convert to grayscale
|
||||
if(data.imageRaw().channels() > 1)
|
||||
{
|
||||
UDEBUG("convert to grayscale...");
|
||||
cv::cvtColor(data.imageRaw(), imageMono, cv::COLOR_BGR2GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
imageMono = data.imageRaw();
|
||||
}
|
||||
UDEBUG("Set ROI...");
|
||||
cv::Rect roi = Feature2D::computeRoi(imageMono, _roiRatios);
|
||||
|
||||
if(!data.depthOrRightRaw().empty() && data.stereoCameraModel().isValid())
|
||||
@@ -3933,6 +3936,7 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
{
|
||||
subPixelOn = true;
|
||||
}
|
||||
UDEBUG("Generating keypoints...");
|
||||
keypoints = _feature2D->generateKeypoints(imageMono, roi);
|
||||
t = timer.ticks();
|
||||
if(stats) stats->addStatistic(Statistics::kTimingMemKeypoints_detection(), t*1000.0f);
|
||||
@@ -4019,6 +4023,7 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
{
|
||||
subPixelOn = true;
|
||||
}
|
||||
UDEBUG("Generating keypoints...");
|
||||
keypoints = _feature2D->generateKeypoints(imageMono, roi);
|
||||
t = timer.ticks();
|
||||
if(stats) stats->addStatistic(Statistics::kTimingMemKeypoints_detection(), t*1000.0f);
|
||||
@@ -4080,6 +4085,7 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
else
|
||||
{
|
||||
//RGB only
|
||||
UDEBUG("Generating keypoints...");
|
||||
keypoints = _feature2D->generateKeypoints(imageMono, roi);
|
||||
t = timer.ticks();
|
||||
if(stats) stats->addStatistic(Statistics::kTimingMemKeypoints_detection(), t*1000.0f);
|
||||
@@ -4199,7 +4205,9 @@ Signature * Memory::createSignature(const SensorData & data, const Transform & p
|
||||
|
||||
if(_parallelized)
|
||||
{
|
||||
UDEBUG("Joining dictionary update thread...");
|
||||
preUpdateThread.join(); // Wait the dictionary to be updated
|
||||
UDEBUG("Joining dictionary update thread... thread finished!");
|
||||
}
|
||||
|
||||
std::list<int> wordIds;
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include "rtflann/util/allocator.h"
|
||||
#include "rtflann/util/random.h"
|
||||
#include "rtflann/util/saving.h"
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
|
||||
|
||||
namespace rtflann
|
||||
@@ -142,7 +141,7 @@ public:
|
||||
|
||||
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2)
|
||||
{
|
||||
UASSERT(points.cols==veclen_);
|
||||
assert(points.cols==veclen_);
|
||||
|
||||
size_t old_size = size_;
|
||||
extendDataset(points);
|
||||
@@ -151,7 +150,6 @@ public:
|
||||
buildIndex();
|
||||
}
|
||||
else {
|
||||
UDEBUG("Add to trees (%d)", trees_);
|
||||
for (size_t i=old_size;i<size_;++i) {
|
||||
for (int j = 0; j < trees_; j++) {
|
||||
addPointToTree(tree_roots_[j], i);
|
||||
@@ -254,13 +252,12 @@ protected:
|
||||
*/
|
||||
void buildIndexImpl()
|
||||
{
|
||||
UDEBUG("");
|
||||
// Create a permutable array of indices to the input vectors.
|
||||
std::vector<int> ind(size_);
|
||||
for (size_t i = 0; i < size_; ++i) {
|
||||
ind[i] = int(i);
|
||||
}
|
||||
UDEBUG("");
|
||||
|
||||
mean_ = new DistanceType[veclen_];
|
||||
var_ = new DistanceType[veclen_];
|
||||
|
||||
@@ -271,10 +268,8 @@ protected:
|
||||
std::random_shuffle(ind.begin(), ind.end());
|
||||
tree_roots_[i] = divideTree(&ind[0], int(size_) );
|
||||
}
|
||||
UDEBUG("");
|
||||
delete[] mean_;
|
||||
delete[] var_;
|
||||
UDEBUG("");
|
||||
}
|
||||
|
||||
void freeIndex()
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "rtflann/util/result_set.h"
|
||||
#include "rtflann/util/dynamic_bitset.h"
|
||||
#include "rtflann/util/saving.h"
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
|
||||
namespace rtflann
|
||||
{
|
||||
@@ -125,15 +124,12 @@ public:
|
||||
*/
|
||||
virtual void buildIndex()
|
||||
{
|
||||
UDEBUG("");
|
||||
freeIndex();
|
||||
UDEBUG("");
|
||||
cleanRemovedPoints();
|
||||
UDEBUG("");
|
||||
|
||||
// building index
|
||||
buildIndexImpl();
|
||||
UDEBUG("");
|
||||
|
||||
size_at_build_ = size_;
|
||||
|
||||
}
|
||||
@@ -144,9 +140,7 @@ public:
|
||||
*/
|
||||
virtual void buildIndex(const Matrix<ElementType>& dataset)
|
||||
{
|
||||
UDEBUG("");
|
||||
setDataset(dataset);
|
||||
UDEBUG("");
|
||||
this->buildIndex();
|
||||
}
|
||||
|
||||
@@ -769,7 +763,6 @@ protected:
|
||||
void extendDataset(const Matrix<ElementType>& new_points)
|
||||
{
|
||||
size_t new_size = size_ + new_points.rows;
|
||||
UDEBUG("size=%d, new_size=%d, removed_=%d", size_, new_size, removed_?1:0);
|
||||
if (removed_) {
|
||||
removed_points_.resize(new_size);
|
||||
ids_.resize(new_size);
|
||||
@@ -783,7 +776,6 @@ protected:
|
||||
}
|
||||
}
|
||||
size_ = new_size;
|
||||
UDEBUG("last_id_=%d", last_id_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user