OpenCV3: added RHO homography type "Homography/method"
This commit is contained in:
parent
c6ee7a27ef
commit
ccb679e7c2
@ -282,7 +282,7 @@ class FINDOBJECT_EXP Settings
|
|||||||
PARAMETER(General, autoPauseOnDetection, bool, false, "Auto pause the camera when an object is detected.");
|
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, 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, 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, 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).");
|
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).");
|
||||||
|
|||||||
@ -394,6 +394,13 @@ void ParametersToolBox::addParameter(QVBoxLayout * layout,
|
|||||||
widget->setItemData(4, 0, Qt::UserRole - 1);
|
widget->setItemData(4, 0, Qt::UserRole - 1);
|
||||||
#endif
|
#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());
|
widget->setCurrentIndex(splitted.first().toInt());
|
||||||
connect(widget, SIGNAL(currentIndexChanged(int)), this, SLOT(changeParameter(int)));
|
connect(widget, SIGNAL(currentIndexChanged(int)), this, SLOT(changeParameter(int)));
|
||||||
|
|||||||
@ -1425,6 +1425,11 @@ int Settings::getHomographyMethod()
|
|||||||
{
|
{
|
||||||
switch(method)
|
switch(method)
|
||||||
{
|
{
|
||||||
|
#if CV_MAJOR_VERSION >= 3
|
||||||
|
case 2:
|
||||||
|
method = cv::RHO;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 0:
|
case 0:
|
||||||
method = cv::LMEDS;
|
method = cv::LMEDS;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user