Added some debug traces

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@410 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
matlabbe 2014-09-26 20:33:08 +00:00
parent 0d470f5270
commit 783173bf43
2 changed files with 16 additions and 0 deletions

View File

@ -106,6 +106,7 @@ void showUsage()
" without saving modified parameters on closing.\n"
" --scene \"path\" Path to a scene image file.\n"
" --debug Show debug log.\n"
" --debug-time Show debug log with time.\n"
" --params Show all parameters.\n"
" --defaults Use default parameters (--config is ignored).\n"
" --My/Parameter \"value\" Set find-Object's parameter (look --params for parameters' name).\n"
@ -250,6 +251,14 @@ int main(int argc, char* argv[])
ULogger::setLevel(ULogger::kDebug);
continue;
}
if(strcmp(argv[i], "-debug-time") == 0 ||
strcmp(argv[i], "--debug-time") == 0)
{
ULogger::setPrintWhere(true);
ULogger::setLevel(ULogger::kDebug);
ULogger::setPrintTime(true);
continue;
}
if(strcmp(argv[i], "-help") == 0 ||
strcmp(argv[i], "--help") == 0)
{

View File

@ -902,6 +902,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
}
// DETECT FEATURES AND EXTRACT DESCRIPTORS
UDEBUG("DETECT FEATURES AND EXTRACT DESCRIPTORS FROM THE SCENE");
ExtractFeaturesThread extractThread(detector_, extractor_, -1, grayscaleImg);
extractThread.start();
extractThread.wait();
@ -915,6 +916,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
((vocabulary_->size()==0 || vocabulary_->wordToObjects().begin().value()==-1) && !Settings::getGeneral_invertedSearch());
// COMPARE
UDEBUG("COMPARE");
if(!objectsDescriptors_.empty() &&
info.sceneKeypoints_.size() &&
consistentNNData &&
@ -930,6 +932,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
if(!Settings::getGeneral_invertedSearch())
{
// CREATE INDEX for the scene
UDEBUG("CREATE INDEX FOR THE SCENE");
vocabulary_->clear();
words = vocabulary_->addWords(info.sceneDescriptors_, -1, Settings::getGeneral_vocabularyIncremental());
if(!Settings::getGeneral_vocabularyIncremental())
@ -949,6 +952,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
cv::Mat results;
cv::Mat dists;
// DO NEAREST NEIGHBOR
UDEBUG("DO NEAREST NEIGHBOR");
int k = Settings::getNearestNeighbor_3nndrRatioUsed()?2:1;
if(!Settings::getGeneral_invertedSearch())
{
@ -966,6 +970,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
}
// PROCESS RESULTS
UDEBUG("PROCESS RESULTS");
// Get all matches for each object
for(int i=0; i<dists.rows; ++i)
{
@ -1039,6 +1044,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
else
{
//multi-threaded, match objects to scene
UDEBUG("MULTI-THREADED, MATCH OBJECTS TO SCENE");
int threadCounts = Settings::getGeneral_threads();
if(threadCounts == 0)
{
@ -1082,6 +1088,7 @@ bool FindObject::detect(const cv::Mat & image, find_object::DetectionInfo & info
if(Settings::getHomography_homographyComputed())
{
// HOMOGRAPHY
UDEBUG("COMPUTE HOMOGRAPHY");
int threadCounts = Settings::getGeneral_threads();
if(threadCounts == 0)
{