OpenCV3: added RHO homography type "Homography/method"

This commit is contained in:
matlabbe 2016-01-17 12:24:42 -05:00
parent c6ee7a27ef
commit ccb679e7c2
3 changed files with 13 additions and 1 deletions

View File

@ -282,7 +282,7 @@ class FINDOBJECT_EXP Settings
PARAMETER(General, autoPauseOnDetection, bool, false, "Auto pause the camera when an object is detected.");
PARAMETER(Homography, homographyComputed, bool, true, "Compute homography? On ROS, this is required to publish objects detected.");
PARAMETER(Homography, method, QString, "1:LMEDS;RANSAC", "Type of the robust estimation algorithm: least-median algorithm or RANSAC algorithm.");
PARAMETER(Homography, method, QString, "1:LMEDS;RANSAC;RHO", "Type of the robust estimation algorithm: least-median algorithm or RANSAC algorithm.");
PARAMETER(Homography, ransacReprojThr, double, 5.0, "Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC method only). It usually makes sense to set this parameter somewhere in the range of 1 to 10.");
PARAMETER(Homography, minimumInliers, int, 10, "Minimum inliers to accept the homography. Value must be >= 4.");
PARAMETER(Homography, ignoreWhenAllInliers, bool, false, "Ignore homography when all features are inliers (sometimes when the homography doesn't converge, it returns the best homography with all features as inliers).");

View File

@ -394,6 +394,13 @@ void ParametersToolBox::addParameter(QVBoxLayout * layout,
widget->setItemData(4, 0, Qt::UserRole - 1);
#endif
}
if(key.compare(Settings::kHomography_method()) == 0)
{
#if CV_MAJOR_VERSION < 3
// disable RHO approach
widget->setItemData(2, 0, Qt::UserRole - 1);
#endif
}
widget->setCurrentIndex(splitted.first().toInt());
connect(widget, SIGNAL(currentIndexChanged(int)), this, SLOT(changeParameter(int)));

View File

@ -1425,6 +1425,11 @@ int Settings::getHomographyMethod()
{
switch(method)
{
#if CV_MAJOR_VERSION >= 3
case 2:
method = cv::RHO;
break;
#endif
case 0:
method = cv::LMEDS;
break;