diff --git a/app/main.cpp b/app/main.cpp index 417a95af..fb602664 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -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) { diff --git a/src/FindObject.cpp b/src/FindObject.cpp index 2b29d43f..5e42de86 100644 --- a/src/FindObject.cpp +++ b/src/FindObject.cpp @@ -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