Cudasift tuning and SSC supporting multicameras (#1677)

* CudaSIFT: filter doubles

* removed fixed threshold

* SSC can be used with multicameras. Refactored CudaSIFT to support SSC. Add new parameter SIFT/MaxGaussianThreshold. DbViewer: show negative features with gray color (so that we can know which features are in the vocabulary)

* Added SIFT/MaxGaussianThreshold parameter

* Updated parameter description
This commit is contained in:
matlabbe
2026-03-28 18:47:46 -07:00
committed by GitHub
parent 94bd3601fc
commit 20409d2bf6
11 changed files with 232 additions and 180 deletions
+8
View File
@@ -6163,6 +6163,14 @@ void DatabaseViewer::updateWordsMatching(const std::vector<int> & inliers)
kptB->keypoint().pt.y,
cB);
}
else if(ids[i]<0)
{
ui_->graphicsView_A->setFeatureColor(ids[i], Qt::gray);
}
}
for(auto iter = wordsB.begin(); iter.key()<0 && iter!=wordsB.end(); ++iter)
{
ui_->graphicsView_B->setFeatureColor(iter.key(), Qt::gray);
}
ui_->graphicsView_A->update();
ui_->graphicsView_B->update();
+2 -2
View File
@@ -1255,11 +1255,11 @@ void ImageView::setFeatures(const std::multimap<int, cv::KeyPoint> & refWords, c
{
if (xRatio > 0 && yRatio > 0)
{
addFeature(iter->first, iter->second, util2d::getDepth(depth, iter->second.pt.x*xRatio, iter->second.pt.y*yRatio, false), color);
addFeature(iter->first, iter->second, util2d::getDepth(depth, iter->second.pt.x*xRatio, iter->second.pt.y*yRatio, false), iter->first<0?Qt::gray:color);
}
else
{
addFeature(iter->first, iter->second, 0, color);
addFeature(iter->first, iter->second, 0, iter->first<0?Qt::gray:color);
}
}
+3
View File
@@ -171,6 +171,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->sift_label_gpu->setEnabled(false);
_ui->sift_doubleSpinBox_gaussianDiffThreshold->setEnabled(false);
_ui->sift_label_gaussianThreshold->setEnabled(false);
_ui->sift_doubleSpinBox_maxGaussianDiffThreshold->setEnabled(false);
_ui->sift_label_maxGaussianThreshold->setEnabled(false);
_ui->sift_checkBox_upscale->setEnabled(false);
_ui->sift_label_upscale->setEnabled(false);
#endif
@@ -1145,6 +1147,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
_ui->sift_checkBox_rootsift->setObjectName(Parameters::kSIFTRootSIFT().c_str());
_ui->sift_checkBox_gpu->setObjectName(Parameters::kSIFTGpu().c_str());
_ui->sift_doubleSpinBox_gaussianDiffThreshold->setObjectName(Parameters::kSIFTGaussianThreshold().c_str());
_ui->sift_doubleSpinBox_maxGaussianDiffThreshold->setObjectName(Parameters::kSIFTMaxGaussianThreshold().c_str());
_ui->sift_checkBox_upscale->setObjectName(Parameters::kSIFTUpscale().c_str());
//BRIEF descriptor
+123 -91
View File
@@ -63,9 +63,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-2161</y>
<y>-96</y>
<width>684</width>
<height>5201</height>
<height>5218</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
@@ -95,7 +95,7 @@
<enum>QFrame::Raised</enum>
</property>
<property name="currentIndex">
<number>5</number>
<number>9</number>
</property>
<widget class="QWidget" name="page_22">
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
@@ -11659,7 +11659,7 @@ generate the number of words requested.</string>
<item row="4" column="1">
<widget class="QLabel" name="label_591">
<property name="text">
<string>Filter floor from depth mask. 0 means disabled, negative means keeping pixels below the floor theshold instead.</string>
<string>Filter floor from depth mask. 0 means disabled.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -23860,7 +23860,7 @@ Lower the ratio -&gt; higher the precision.</string>
<item row="7" column="1">
<widget class="QLabel" name="label_759">
<property name="text">
<string>Filter floor from depth mask. 0 means disabled, negative means keeping pixels below the floor theshold instead.</string>
<string>Filter floor from depth mask. 0 means disabled.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -26733,39 +26733,6 @@ Lower the ratio -&gt; higher the precision.</string>
<string>SIFT</string>
</property>
<layout class="QGridLayout" name="gridLayout_19" columnstretch="0,1">
<item row="4" column="0">
<widget class="QCheckBox" name="sift_checkBox_preciseUpscale">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Edge threshold. The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="sift_spinBox_nOctaveLayers"/>
</item>
<item row="4" column="1">
<widget class="QLabel" name="sift_label_preciseUpscale">
<property name="text">
<string>Whether to enable precise upscaling in the scale pyramid.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_130">
<property name="text">
@@ -26779,13 +26746,53 @@ Lower the ratio -&gt; higher the precision.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="sift_doubleSpinBox_edgeThr">
<property name="singleStep">
<double>0.100000000000000</double>
<item row="6" column="0">
<widget class="QCheckBox" name="sift_checkBox_gpu">
<property name="text">
<string/>
</property>
<property name="value">
<double>10.000000000000000</double>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="sift_label_preciseUpscale">
<property name="text">
<string>Whether to enable precise upscaling in the scale pyramid.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="sift_label_gaussianThreshold">
<property name="text">
<string>CudaSift: Threshold on difference of Gaussians for feature pruning. The higher the threshold, the less features with low response/hessian are produced by the detector.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="sift_checkBox_upscale">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Contrast threshold. The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector. Not used by CudaSift.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
@@ -26796,6 +26803,42 @@ Lower the ratio -&gt; higher the precision.</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="sift_checkBox_preciseUpscale">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="sift_label_gpu">
<property name="text">
<string>CudaSift: Use GPU version of SIFT. This option is enabled only RTAB-Map is built with CudaSift dependency and GPUs are detected.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSpinBox" name="sift_spinBox_nOctaveLayers"/>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_129">
<property name="text">
<string>Sigma. The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QDoubleSpinBox" name="sift_doubleSpinBox_contrastThr">
<property name="decimals">
@@ -26825,23 +26868,20 @@ Lower the ratio -&gt; higher the precision.</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="sift_label_gpu">
<item row="9" column="1">
<widget class="QLabel" name="sift_label_upscale">
<property name="text">
<string>CudaSift: Use GPU version of SIFT. This option is enabled only RTAB-Map is built with CudaSift dependency and GPUs are detected.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<string>CudaSift: Whether to enable upscaling.</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_5">
<item row="2" column="1">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Contrast threshold. The contrast threshold used to filter out weak features in semi-uniform (low-contrast) regions. The larger the threshold, the less features are produced by the detector. Not used by CudaSift.</string>
<string>Edge threshold. The threshold used to filter out edge-like features. Note that the its meaning is different from the contrastThreshold, i.e. the larger the edgeThreshold, the less features are filtered out (more features are retained).</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -26870,6 +26910,16 @@ Lower the ratio -&gt; higher the precision.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="sift_doubleSpinBox_edgeThr">
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>10.000000000000000</double>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="sift_label_rootsift">
<property name="text">
@@ -26880,43 +26930,13 @@ Lower the ratio -&gt; higher the precision.</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="sift_label_gaussianThreshold">
<property name="text">
<string>CudaSift: Threshold on difference of Gaussians for feature pruning. The higher the threshold, the less features are produced by the detector.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="sift_checkBox_gpu">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_129">
<property name="text">
<string>Sigma. The sigma of the Gaussian applied to the input image at the octave #0. If your image is captured with a weak camera with soft lenses, you might want to reduce the number.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="sift_label_upscale">
<widget class="QLabel" name="sift_label_maxGaussianThreshold">
<property name="text">
<string>CudaSift: Whether to enable upscaling.</string>
<string>CudaSift: Maximum threshold on difference of Gaussians for feature pruning (ignored if smaller or equal than gaussian threshold above). The lower the threshold, the less features with high response/hessian are produced by the detector.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
@@ -26924,9 +26944,21 @@ Lower the ratio -&gt; higher the precision.</string>
</widget>
</item>
<item row="8" column="0">
<widget class="QCheckBox" name="sift_checkBox_upscale">
<property name="text">
<string/>
<widget class="QDoubleSpinBox" name="sift_doubleSpinBox_maxGaussianDiffThreshold">
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>4.500000000000000</double>
</property>
</widget>
</item>