Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thiago Santini
EyeRecToo
Commits
b7022930
Commit
b7022930
authored
Dec 23, 2017
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Saves calibration tuples on recording
parent
74bcbc3a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
19 deletions
+39
-19
EyeRecToo/src/GazeEstimation.cpp
EyeRecToo/src/GazeEstimation.cpp
+13
-12
EyeRecToo/src/GazeEstimation.h
EyeRecToo/src/GazeEstimation.h
+2
-1
EyeRecToo/src/GazeEstimationWidget.cpp
EyeRecToo/src/GazeEstimationWidget.cpp
+16
-3
EyeRecToo/src/GazeEstimationWidget.h
EyeRecToo/src/GazeEstimationWidget.h
+4
-1
EyeRecToo/src/MainWindow.cpp
EyeRecToo/src/MainWindow.cpp
+4
-2
No files found.
EyeRecToo/src/GazeEstimation.cpp
View file @
b7022930
...
...
@@ -493,13 +493,14 @@ void GazeEstimation::saveTuplesToFile(CollectionTuple::TupleType tupleType, QStr
{
vector
<
CollectionTuple
*>
pertinentTuples
;
for
(
unsigned
int
i
=
0
;
i
<
collectedTuples
.
size
();
i
++
)
{
if
(
tupleType
==
CollectionTuple
::
CALIBRATION
)
if
(
collectedTuples
[
i
].
isEvaluation
())
continue
;
//
if ( tupleType == CollectionTuple::CALIBRATION)
//
if (collectedTuples[i].isEvaluation())
//
continue;
if
(
tupleType
==
CollectionTuple
::
EVALUATION
)
if
(
tupleType
==
CollectionTuple
::
EVALUATION
)
{
if
(
collectedTuples
[
i
].
isCalibration
())
continue
;
}
pertinentTuples
.
push_back
(
&
collectedTuples
[
i
]);
}
...
...
EyeRecToo/src/GazeEstimation.h
View file @
b7022930
...
...
@@ -196,6 +196,7 @@ public slots:
void
addTuple
(
CollectionTuple
tuple
);
void
addTuples
(
std
::
vector
<
CollectionTuple
>
tuples
);
void
reset
(
CollectionTuple
::
TupleType
type
);
void
saveCalibration
()
{
saveTuplesToFile
(
CollectionTuple
::
TupleType
::
CALIBRATION
,
QString
(
"%1-calibration.tup"
).
arg
(
gTimer
.
elapsed
()
)
);
}
void
setCalibrating
(
bool
v
);
...
...
EyeRecToo/src/GazeEstimationWidget.cpp
View file @
b7022930
...
...
@@ -14,6 +14,7 @@ GazeEstimationWidget::GazeEstimationWidget(QWidget *parent) :
isSampling
(
false
),
lastStatus
(
false
),
calibrationRequested
(
false
),
isRecording
(
false
),
ui
(
new
Ui
::
GazeEstimationWidget
)
{
ui
->
setupUi
(
this
);
...
...
@@ -298,6 +299,17 @@ void GazeEstimationWidget::on_collectionTypeComboBox_currentIndexChanged(int ind
currentTupleType
=
static_cast
<
CollectionTuple
::
TupleType
>
(
ui
->
collectionTypeComboBox
->
itemData
(
index
).
toInt
()
);
}
void
GazeEstimationWidget
::
startRecording
()
{
isRecording
=
true
;
QMetaObject
::
invokeMethod
(
gazeEstimation
,
"saveCalibration"
);
}
void
GazeEstimationWidget
::
stopRecording
()
{
isRecording
=
false
;
}
/*
void GazeEstimationWidget::keyPressEvent(QKeyEvent *event)
{
...
...
@@ -473,6 +485,8 @@ void GazeEstimationWidget::updateStatus(bool status, QString msg)
if
(
status
)
{
statusBarLabel
->
setText
(
"Calibrated."
);
statusBarLabel
->
setStyleSheet
(
"QLabel { font : bold; color : green }"
);
if
(
isRecording
)
QMetaObject
::
invokeMethod
(
gazeEstimation
,
"saveCalibration"
);
}
else
{
statusBarLabel
->
setText
(
QString
(
"Uncalibrated: %1"
).
arg
(
msg
));
statusBarLabel
->
setStyleSheet
(
"QLabel { font : bold; color : red }"
);
...
...
@@ -480,7 +494,6 @@ void GazeEstimationWidget::updateStatus(bool status, QString msg)
}
void
GazeEstimationWidget
::
on_minCentralCoverage_editingFinished
()
{
cfg
.
minCentralAreaCoverage
=
ui
->
minCentralCoverage
->
value
();
...
...
EyeRecToo/src/GazeEstimationWidget.h
View file @
b7022930
...
...
@@ -42,6 +42,8 @@ public slots:
void
toggleCalibration
();
void
enableMarkerCollection
();
void
disableMarkerCollection
();
void
startRecording
();
void
stopRecording
();
private:
QThread
*
gazeEstimationThread
;
...
...
@@ -57,6 +59,7 @@ private:
bool
isSampling
;
bool
lastStatus
;
bool
calibrationRequested
;
bool
isRecording
;
QLabel
*
statusBarLabel
;
...
...
EyeRecToo/src/MainWindow.cpp
View file @
b7022930
...
...
@@ -118,8 +118,10 @@ MainWindow::MainWindow(QWidget *parent) :
fieldWidget
,
SLOT
(
startRecording
())
);
connect
(
this
,
SIGNAL
(
stopRecording
()),
fieldWidget
,
SLOT
(
stopRecording
())
);
// connect(this, SIGNAL(startRecording()), calibrationWidget, SLOT(startRecording()) );
// connect(this, SIGNAL(stopRecording()), calibrationWidget, SLOT(stopRecording()) );
connect
(
this
,
SIGNAL
(
startRecording
()),
gazeEstimationWidget
,
SLOT
(
startRecording
())
);
connect
(
this
,
SIGNAL
(
stopRecording
()),
gazeEstimationWidget
,
SLOT
(
stopRecording
())
);
connect
(
this
,
SIGNAL
(
startRecording
()),
journal
,
SIGNAL
(
startRecording
())
);
connect
(
this
,
SIGNAL
(
stopRecording
()),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment