Fixed crash when using binary descriptors and maxWords/maxDepth are set

Added BRISK detector

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1839 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-10-06 19:41:45 +00:00
parent d30c2baf51
commit 4d4c5af6e5
10 changed files with 303 additions and 27 deletions

View File

@@ -81,7 +81,8 @@ public:
kFeatureFastFreak=3,
kFeatureFastBrief=4,
kFeatureGfttFreak=5,
kFeatureGfttBrief=6};
kFeatureGfttBrief=6,
kFeatureBrisk=7};
public:
virtual ~Feature2D() {}
@@ -310,6 +311,28 @@ private:
cv::FREAK * _freak;
};
//BRISK
class RTABMAP_EXP BRISK : public Feature2D
{
public:
BRISK(const ParametersMap & parameters = ParametersMap());
virtual ~BRISK();
virtual void parseParameters(const ParametersMap & parameters);
virtual Feature2D::Type getType() const {return kFeatureBrisk;}
private:
virtual std::vector<cv::KeyPoint> generateKeypointsImpl(const cv::Mat & image, const cv::Rect & roi) const;
virtual cv::Mat generateDescriptorsImpl(const cv::Mat & image, std::vector<cv::KeyPoint> & keypoints) const;
private:
int thresh_;
int octaves_;
float patternScale_;
cv::BRISK * brisk_;
};
}

View File

@@ -226,6 +226,10 @@ class RTABMAP_EXP Parameters
RTABMAP_PARAM(FREAK, PatternScale, float, 22.0, "Scaling of the description pattern.");
RTABMAP_PARAM(FREAK, NOctaves, int, 4, "Number of octaves covered by the detected keypoints.");
RTABMAP_PARAM(BRISK, Thresh, int, 30, "FAST/AGAST detection threshold score.");
RTABMAP_PARAM(BRISK, Octaves, int, 3, "Detection octaves. Use 0 to do single scale.");
RTABMAP_PARAM(BRISK, PatternScale, float, 1.0, "Apply this scale to the pattern used for sampling the neighbourhood of a keypoint.");
// BayesFilter
RTABMAP_PARAM(Bayes, VirtualPlacePriorThr, float, 0.9, "Virtual place prior");
RTABMAP_PARAM_STR(Bayes, PredictionLC, "0.1 0.36 0.30 0.16 0.062 0.0151 0.00255 0.000324 2.5e-05 1.3e-06 4.8e-08 1.2e-09 1.9e-11 2.2e-13 1.7e-15 8.5e-18 2.9e-20 6.9e-23", "Prediction of loop closures (Gaussian-like, here with sigma=1.6) - Format: {VirtualPlaceProb, LoopClosureProb, NeighborLvl1, NeighborLvl2, ...}.");

View File

@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/RtabmapExp.h>
#include <rtabmap/core/Transform.h>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
namespace rtabmap
{
@@ -88,6 +89,14 @@ public:
const Transform & pose() const {return _pose;}
const Transform & localTransform() const {return _localTransform;}
void setFeatures(const std::vector<cv::KeyPoint> & keypoints, const cv::Mat & descriptors)
{
_keypoints = keypoints;
_descriptors = descriptors;
}
const std::vector<cv::KeyPoint> & keypoints() const {return _keypoints;}
const cv::Mat & descriptors() const {return _descriptors;}
private:
cv::Mat _image;
int _id;
@@ -101,6 +110,10 @@ private:
float _cy;
Transform _pose;
Transform _localTransform;
// features
std::vector<cv::KeyPoint> _keypoints;
cv::Mat _descriptors;
};
}