Merge pull request #13361 from okriof:brisk_getset
* Get/Set functions for BRISK parameters, issue #11527. Allows setting threshold and octaves parameters after creating a brisk object. These parameters do not affect the initial pattern initialization and can be changed later without re-initialization. * Fix doc parameter name. * Brisk get/set functions tests. Check for correct value and make tests independent of default parameter values. * Add dummy implementations for BRISK get/set functions not to break API in case someone has overloaded the Feature2d::BRISK interface. This makes BRISK different from the other detectors/descriptors on the other hand, where get/set functions are pure virtual in the interface.
This commit is contained in:
committed by
Alexander Alekhin
parent
e55ad25355
commit
ef42baf9f0
@@ -73,6 +73,18 @@ void CV_BRISKTest::run( int )
|
||||
|
||||
Ptr<FeatureDetector> detector = BRISK::create();
|
||||
|
||||
// Check parameter get/set functions.
|
||||
BRISK* detectorTyped = dynamic_cast<BRISK*>(detector.get());
|
||||
ASSERT_NE(nullptr, detectorTyped);
|
||||
detectorTyped->setOctaves(3);
|
||||
detectorTyped->setThreshold(30);
|
||||
ASSERT_EQ(detectorTyped->getOctaves(), 3);
|
||||
ASSERT_EQ(detectorTyped->getThreshold(), 30);
|
||||
detectorTyped->setOctaves(4);
|
||||
detectorTyped->setThreshold(29);
|
||||
ASSERT_EQ(detectorTyped->getOctaves(), 4);
|
||||
ASSERT_EQ(detectorTyped->getThreshold(), 29);
|
||||
|
||||
vector<KeyPoint> keypoints1;
|
||||
vector<KeyPoint> keypoints2;
|
||||
detector->detect(image1, keypoints1);
|
||||
|
||||
Reference in New Issue
Block a user