mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-05 01:27:46 +08:00
updated SSC test and doc
This commit is contained in:
@@ -1194,8 +1194,13 @@ TEST(Util2dTest, SSCSelectsRoughlyCorrectNumber) {
|
|||||||
|
|
||||||
std::vector<int> selected = util2d::SSC(keypoints, maxKeypoints, tolerance, imgWidth, imgHeight, {});
|
std::vector<int> selected = util2d::SSC(keypoints, maxKeypoints, tolerance, imgWidth, imgHeight, {});
|
||||||
|
|
||||||
EXPECT_GE(selected.size(), int(maxKeypoints * (1 - tolerance)));
|
// util2d::SSC() first reduces maxKeypoints by tolerance, then searches within ±tolerance of that.
|
||||||
EXPECT_LE(selected.size(), int(maxKeypoints * (1 + tolerance)));
|
const int effectiveMax = maxKeypoints - int(std::round(maxKeypoints * tolerance));
|
||||||
|
const int kMin = int(std::round(effectiveMax * (1.f - tolerance)));
|
||||||
|
const int kMax = int(std::round(effectiveMax * (1.f + tolerance)));
|
||||||
|
EXPECT_GE(selected.size(), kMin);
|
||||||
|
EXPECT_LE(selected.size(), kMax);
|
||||||
|
EXPECT_LE(selected.size(), maxKeypoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Util2dTest, SSCReturnsEmptyOnEmptyInput) {
|
TEST(Util2dTest, SSCReturnsEmptyOnEmptyInput) {
|
||||||
|
|||||||
Reference in New Issue
Block a user