From e056dd8e14763d00dfa80e366d645c10d264b1d0 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sun, 25 May 2014 22:34:10 +0000 Subject: [PATCH] Added parameter Homography/rectBorderWidth git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@286 620bd6b2-0a58-f614-fd9a-1bd335dccda9 --- src/MainWindow.cpp | 2 +- src/RectItem.cpp | 4 ++-- src/Settings.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c94acdd6..efc783fa 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1610,7 +1610,7 @@ void MainWindow::update(const cv::Mat & image) label->setText(QString("%1 in %2 out").arg(threads[j]->getInliers()).arg(threads[j]->getOutliers())); } QPen rectPen(color); - rectPen.setWidth(4); + rectPen.setWidth(Settings::getHomography_rectBorderWidth()); RectItem * rectItemScene = new RectItem(objects_.at(index)->id(), rect); connect(rectItemScene, SIGNAL(hovered(int)), this, SLOT(rectHovered(int))); rectItemScene->setPen(rectPen); diff --git a/src/RectItem.cpp b/src/RectItem.cpp index 524e676c..5638f0ff 100644 --- a/src/RectItem.cpp +++ b/src/RectItem.cpp @@ -54,7 +54,7 @@ void RectItem::showDescription() QPen pen = this->pen(); - this->setPen(QPen(pen.color(), pen.width()+2)); + this->setPen(QPen(pen.color(), pen.width()*2)); placeHolder_->setZValue(this->zValue()+1); placeHolder_->setPos(0,0); placeHolder_->setVisible(true); @@ -68,7 +68,7 @@ void RectItem::hideDescription() if(placeHolder_ && placeHolder_->isVisible()) { placeHolder_->setVisible(false); - this->setPen(QPen(pen().color(), pen().width()-2)); + this->setPen(QPen(pen().color(), pen().width()/2)); } } diff --git a/src/Settings.h b/src/Settings.h index 43be123e..8e733be7 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -190,6 +190,7 @@ class Settings PARAMETER(Homography, ransacReprojThr, double, 1.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)."); + PARAMETER(Homography, rectBorderWidth, int, 4, "Homography rectangle border width."); public: virtual ~Settings(){}