enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 };
CV_WRAP explicit ORB(int nfeatures = 500, float scaleFactor = 1.2f, int nlevels = 8, int edgeThreshold = 31,
- int firstLevel = 0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31 );
+ int firstLevel = 0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31, int fastThreshold = 20);
// returns the descriptor size in bytes
int descriptorSize() const;
CV_PROP_RW int WTA_K;
CV_PROP_RW int scoreType;
CV_PROP_RW int patchSize;
+ CV_PROP_RW int fastThreshold;
};
typedef ORB OrbFeatureDetector;
obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold);
obj.info()->addParam(obj, "patchSize", obj.patchSize);
obj.info()->addParam(obj, "WTA_K", obj.WTA_K);
- obj.info()->addParam(obj, "scoreType", obj.scoreType))
+ obj.info()->addParam(obj, "scoreType", obj.scoreType);
+ obj.info()->addParam(obj, "fastThreshold", obj.fastThreshold))
///////////////////////////////////////////////////////////////////////////////////////////////////////////
all &= !FlannBasedMatcher_info_auto.name().empty();
return all;
-}
\ No newline at end of file
+}
* @param detector_params parameters to use
*/
ORB::ORB(int _nfeatures, float _scaleFactor, int _nlevels, int _edgeThreshold,
- int _firstLevel, int _WTA_K, int _scoreType, int _patchSize) :
+ int _firstLevel, int _WTA_K, int _scoreType, int _patchSize, int _fastThreshold) :
nfeatures(_nfeatures), scaleFactor(_scaleFactor), nlevels(_nlevels),
edgeThreshold(_edgeThreshold), firstLevel(_firstLevel), WTA_K(_WTA_K),
- scoreType(_scoreType), patchSize(_patchSize)
+ scoreType(_scoreType), patchSize(_patchSize), fastThreshold(_fastThreshold)
{}
std::vector<KeyPoint>& allKeypoints,
int nfeatures, double scaleFactor,
int edgeThreshold, int patchSize, int scoreType,
- bool useOCL )
+ bool useOCL, int fastThreshold )
{
int i, nkeypoints, level, nlevels = (int)layerInfo.size();
std::vector<int> nfeaturesPerLevel(nlevels);
Mat mask = maskPyramid.empty() ? Mat() : maskPyramid(layerInfo[level]);
// Detect FAST features, 20 is a good threshold
- FastFeatureDetector fd(20, true);
+ FastFeatureDetector fd(fastThreshold, true);
fd.detect(img, keypoints, mask);
// Remove keypoints very close to the border
// Get keypoints, those will be far enough from the border that no check will be required for the descriptor
computeKeyPoints(imagePyramid, uimagePyramid, maskPyramid,
layerInfo, ulayerInfo, layerScale, keypoints,
- nfeatures, scaleFactor, edgeThreshold, patchSize, scoreType, useOCL);
+ nfeatures, scaleFactor, edgeThreshold, patchSize, scoreType, useOCL, fastThreshold);
}
else
{
(*this)(image, Mat(), keypoints, descriptors, true);
}
+
}