Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Fixed bug where rectangles where not showing actual rois at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
MPIBR-kretschmerf committed Feb 1, 2017
1 parent 0a2111e commit 969c51f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions TrackerPlugin_EyeTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ void TrackerPlugin_EyeTracker::initializeUI(QLayout *layout, QGraphicsScene *cam

for(int i=0;i<rectItems.size();i++){
this->cameraScene->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*/
Expand All @@ -179,8 +175,12 @@ void TrackerPlugin_EyeTracker::initializeUI(QLayout *layout, QGraphicsScene *cam
}else{
this->maxRectWidth = cameraResolution.width()/2;
}
qDebug()<<maxRectWidth;
for(int i=0;i<rectItems.size();i++){
rectItems.at(i)->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())));
}
}

Expand Down
6 changes: 6 additions & 0 deletions TrackerPlugin_EyeTracker.ui
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@
<property name="minimum">
<number>0</number>
</property>
<property name="value">
<number>99</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand Down Expand Up @@ -377,6 +380,9 @@
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>99</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
Expand Down
1 change: 0 additions & 1 deletion TrackerWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void TrackerWorker::onFrameGrabbed(Mat src)
cv::threshold(pRegion, pMask, thresholds.at(0), 1, THRESH_BINARY_INV);
}


std::vector<Vec4i> pHierarchy;
std::vector<std::vector<Point> > pContours;
std::vector<Point> pContour;
Expand Down

0 comments on commit 969c51f

Please sign in to comment.