From 969c51fce88b3afb7dd39d77c5cb9b04875292ab Mon Sep 17 00:00:00 2001 From: MPIBR-kretschmerf Date: Wed, 1 Feb 2017 16:06:47 +0100 Subject: [PATCH] Fixed bug where rectangles where not showing actual rois at startup --- TrackerPlugin_EyeTracker.cpp | 8 ++++---- TrackerPlugin_EyeTracker.ui | 6 ++++++ TrackerWorker.cpp | 1 - 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TrackerPlugin_EyeTracker.cpp b/TrackerPlugin_EyeTracker.cpp index f6fd240..d846366 100644 --- a/TrackerPlugin_EyeTracker.cpp +++ b/TrackerPlugin_EyeTracker.cpp @@ -167,10 +167,6 @@ void TrackerPlugin_EyeTracker::initializeUI(QLayout *layout, QGraphicsScene *cam for(int i=0;icameraScene->addItem(rectItems.at(i)); - - emit(thresholdChanged(i, uiSliders.at(i)->value())); - emit(sizeChanged(i, QSize(rectItems.at(i)->rect().width(), rectItems.at(i)->rect().height()))); - emit(posChanged(i, QPoint(rectItems.at(i)->pos().rx(),rectItems.at(i)->pos().ry()))); } /*Resize rectangles according to the correct size*/ @@ -179,8 +175,12 @@ void TrackerPlugin_EyeTracker::initializeUI(QLayout *layout, QGraphicsScene *cam }else{ this->maxRectWidth = cameraResolution.width()/2; } + qDebug()<setRect(QRect(0,0,maxRectWidth,maxRectWidth)); + emit(thresholdChanged(i, uiSliders.at(i)->value())); + emit(sizeChanged(i, QSize(rectItems.at(i)->rect().width(), rectItems.at(i)->rect().height()))); + emit(posChanged(i, QPoint(rectItems.at(i)->pos().rx(),rectItems.at(i)->pos().ry()))); } } diff --git a/TrackerPlugin_EyeTracker.ui b/TrackerPlugin_EyeTracker.ui index fcd6a7d..7701069 100644 --- a/TrackerPlugin_EyeTracker.ui +++ b/TrackerPlugin_EyeTracker.ui @@ -264,6 +264,9 @@ 0 + + 99 + Qt::Horizontal @@ -377,6 +380,9 @@ 1 + + 99 + Qt::Horizontal diff --git a/TrackerWorker.cpp b/TrackerWorker.cpp index 6604397..a1a4321 100644 --- a/TrackerWorker.cpp +++ b/TrackerWorker.cpp @@ -42,7 +42,6 @@ void TrackerWorker::onFrameGrabbed(Mat src) cv::threshold(pRegion, pMask, thresholds.at(0), 1, THRESH_BINARY_INV); } - std::vector pHierarchy; std::vector > pContours; std::vector pContour;