From 55a59e2a102b22f5014360423bc05aea3ed790b0 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sun, 24 Aug 2014 13:55:19 +0000 Subject: [PATCH] Fixed issue 24 (instead of crashing, an error message is shown in the console and no features are extracted) git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@387 620bd6b2-0a58-f614-fd9a-1bd335dccda9 --- src/FindObject.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/FindObject.cpp b/src/FindObject.cpp index 74d42c37..13758908 100644 --- a/src/FindObject.cpp +++ b/src/FindObject.cpp @@ -394,7 +394,17 @@ protected: } timeDetection_+=timeStep.restart(); - extractor_->compute(image_, keypoints_, descriptors_); + try + { + extractor_->compute(image_, keypoints_, descriptors_); + } + catch(cv::Exception & e) + { + UERROR("Descriptor exception: %s. Maybe some keypoints are invalid " + "for the selected descriptor extractor.", e.what()); + descriptors_ = cv::Mat(); + keypoints_.clear(); + } timeExtraction_+=timeStep.restart(); if((int)keypoints_.size() != descriptors_.rows)