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
6a69a27f
Commit
6a69a27f
authored
Mar 08, 2018
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds PuRe reference, starts parametrizing camera parameters
parent
a08b88c0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
16 deletions
+77
-16
EyeRecToo/deps/runtime/x64/Release/libusb-1.0.dll
EyeRecToo/deps/runtime/x64/Release/libusb-1.0.dll
+0
-0
EyeRecToo/deps/runtime/x64/Release/plugins/mediaservice/uvcengine.dll
...ps/runtime/x64/Release/plugins/mediaservice/uvcengine.dll
+0
-0
EyeRecToo/deps/runtime/x64/Release/uvc.dll
EyeRecToo/deps/runtime/x64/Release/uvc.dll
+0
-0
EyeRecToo/src/Camera.cpp
EyeRecToo/src/Camera.cpp
+32
-6
EyeRecToo/src/Camera.h
EyeRecToo/src/Camera.h
+35
-5
EyeRecToo/src/CameraWidget.cpp
EyeRecToo/src/CameraWidget.cpp
+2
-2
EyeRecToo/src/MainWindow.cpp
EyeRecToo/src/MainWindow.cpp
+8
-3
No files found.
EyeRecToo/deps/runtime/x64/Release/libusb-1.0.dll
View file @
6a69a27f
No preview for this file type
EyeRecToo/deps/runtime/x64/Release/plugins/mediaservice/uvcengine.dll
View file @
6a69a27f
No preview for this file type
EyeRecToo/deps/runtime/x64/Release/uvc.dll
View file @
6a69a27f
No preview for this file type
EyeRecToo/src/Camera.cpp
View file @
6a69a27f
...
...
@@ -18,11 +18,12 @@ Camera::Camera(QString id, QObject *parent)
this
->
id
=
id
;
if
(
id
.
contains
(
"eye"
,
Qt
::
CaseInsensitive
)
)
colorCode
=
CV_8UC1
;
ui
=
new
CameraUI
();
ui
->
moveToThread
(
QApplication
::
instance
()
->
thread
());
ui
=
new
CameraUI
();
ui
->
moveToThread
(
QApplication
::
instance
()
->
thread
());
connect
(
ui
,
SIGNAL
(
setCamera
(
QCameraInfo
)),
this
,
SLOT
(
setCamera
(
QCameraInfo
))
);
connect
(
ui
,
SIGNAL
(
setViewfinderSettings
(
QCameraViewfinderSettings
)),
this
,
SLOT
(
setViewfinderSettings
(
QCameraViewfinderSettings
))
);
connect
(
ui
,
SIGNAL
(
setColorCode
(
int
)),
this
,
SLOT
(
setColorCode
(
int
))
);
connect
(
ui
,
SIGNAL
(
setColorCode
(
int
)),
this
,
SLOT
(
setColorCode
(
int
))
);
connect
(
ui
,
SIGNAL
(
setParameter
(
QString
,
float
)),
this
,
SLOT
(
setParameter
(
QString
,
float
))
);
settings
=
new
QSettings
(
gCfgDir
+
"/"
+
id
+
" Camera"
,
QSettings
::
IniFormat
);
}
...
...
@@ -52,7 +53,7 @@ void Camera::reset()
if
(
frameGrabber
)
{
frameGrabber
->
deleteLater
();
frameGrabber
=
NULL
;
}
}
}
QCameraViewfinderSettings
Camera
::
getViewfinderSettings
(
const
QCameraInfo
cameraInfo
)
...
...
@@ -184,8 +185,9 @@ void Camera::setCamera(const QCameraInfo &cameraInfo, QCameraViewfinderSettings
settingsList
=
camera
->
supportedViewfinderSettings
();
msg
=
currentCameraInfo
.
description
()
+
" "
+
toQString
(
settings
);
retriesLeft
=
maxRetries
;
}
saveCfg
();
}
saveCfg
();
qInfo
()
<<
id
<<
msg
;
QMetaObject
::
invokeMethod
(
ui
,
"updateSettings"
,
Q_ARG
(
QList
<
QCameraViewfinderSettings
>
,
settingsList
),
Q_ARG
(
QCameraViewfinderSettings
,
currentViewfinderSettings
)
);
}
...
...
@@ -197,6 +199,30 @@ void Camera::setColorCode(int code)
saveCfg
();
}
void
Camera
::
setParameter
(
QString
what
,
float
value
)
{
//qDebug() << what << value;
if
(
!
camera
)
return
;
QCameraImageProcessing
*
ip
=
camera
->
imageProcessing
();
if
(
!
ip
->
isAvailable
())
return
;
QString
parameter
=
what
.
toLower
();
if
(
parameter
==
"brightness"
)
ip
->
setBrightness
(
value
);
if
(
parameter
==
"contrast"
)
ip
->
setContrast
(
value
);
if
(
parameter
==
"white balance"
)
ip
->
setManualWhiteBalance
(
value
);
if
(
parameter
==
"saturation"
)
ip
->
setSaturation
(
value
);
if
(
parameter
==
"sharpening level"
)
ip
->
setSharpeningLevel
(
value
);
}
void
Camera
::
showOptions
()
{
QMetaObject
::
invokeMethod
(
ui
,
"update"
,
Q_ARG
(
QCameraInfo
,
currentCameraInfo
),
Q_ARG
(
int
,
colorCode
));
...
...
EyeRecToo/src/Camera.h
View file @
6a69a27f
...
...
@@ -13,11 +13,13 @@
#include <QLabel>
#include <QGridLayout>
#include <QRegularExpression>
#include <QFormLayout>
#include "opencv/cv.h"
#include "FrameGrabber.h"
class
CameraUI
:
public
QDialog
{
Q_OBJECT
...
...
@@ -31,7 +33,8 @@ public:
QGridLayout
*
layout
=
new
QGridLayout
();
QHBoxLayout
*
hBoxLayout
;
QGroupBox
*
box
;
QFormLayout
*
formLayout
;
QGroupBox
*
box
;
devicesBox
=
new
QComboBox
();
hBoxLayout
=
new
QHBoxLayout
();
...
...
@@ -54,7 +57,17 @@ public:
box
=
new
QGroupBox
(
"Color:"
);
box
->
setLayout
(
hBoxLayout
);
hBoxLayout
->
addWidget
(
colorBox
);
layout
->
addWidget
(
box
);
layout
->
addWidget
(
box
);
box
=
new
QGroupBox
(
"Parameters:"
);
formLayout
=
new
QFormLayout
();
addSlider
(
formLayout
,
"Brightness"
);
addSlider
(
formLayout
,
"Contrast"
);
addSlider
(
formLayout
,
"White Balance"
);
addSlider
(
formLayout
,
"Saturation"
);
addSlider
(
formLayout
,
"Sharpening Level"
);
box
->
setLayout
(
formLayout
);
layout
->
addWidget
(
box
,
0
,
1
,
3
,
1
);
setLayout
(
layout
);
connect
(
devicesBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
...
...
@@ -117,17 +130,33 @@ public slots:
signals:
void
setCamera
(
QCameraInfo
cameraInfo
);
void
setViewfinderSettings
(
QCameraViewfinderSettings
settings
);
void
setColorCode
(
int
code
);
void
setColorCode
(
int
code
);
void
setParameter
(
QString
what
,
float
value
);
private
slots
:
void
deviceChanged
(
int
i
)
{
emit
setCamera
(
devicesBox
->
itemData
(
i
).
value
<
QCameraInfo
>
());}
void
settingsChanged
(
int
i
)
{
emit
setViewfinderSettings
(
settingsBox
->
itemData
(
i
).
value
<
QCameraViewfinderSettings
>
());}
void
colorChanged
(
int
i
)
{
emit
setColorCode
(
colorBox
->
itemData
(
i
).
value
<
int
>
());
}
void
colorChanged
(
int
i
)
{
emit
setColorCode
(
colorBox
->
itemData
(
i
).
value
<
int
>
());
}
void
sliderReleased
()
{
QSlider
*
slider
=
static_cast
<
QSlider
*>
(
QObject
::
sender
()
);
emit
setParameter
(
slider
->
objectName
(),
slider
->
value
()
/
100.0
);
}
private:
QComboBox
*
devicesBox
;
QComboBox
*
settingsBox
;
QComboBox
*
colorBox
;
QSlider
*
brightnessSlider
;
void
addSlider
(
QFormLayout
*
formLayout
,
QString
label
)
{
QSlider
*
slider
=
new
QSlider
(
Qt
::
Horizontal
);
slider
->
setMinimum
(
0
);
slider
->
setMaximum
(
100
);
slider
->
setSingleStep
(
1
);
slider
->
setObjectName
(
label
);
formLayout
->
addRow
(
new
QLabel
(
label
),
slider
);
connect
(
slider
,
SIGNAL
(
sliderReleased
()),
this
,
SLOT
(
sliderReleased
())
);
}
};
class
Camera
:
public
QObject
...
...
@@ -151,7 +180,8 @@ public slots:
void
setViewfinderSettings
(
QCameraViewfinderSettings
settings
);
void
setCamera
(
const
QCameraInfo
&
cameraInfo
);
void
setCamera
(
const
QCameraInfo
&
cameraInfo
,
QCameraViewfinderSettings
settings
);
void
setColorCode
(
int
code
);
void
setColorCode
(
int
code
);
void
setParameter
(
QString
what
,
float
value
);
void
showOptions
();
void
saveCfg
();
void
loadCfg
();
...
...
EyeRecToo/src/CameraWidget.cpp
View file @
6a69a27f
...
...
@@ -105,7 +105,7 @@ CameraWidget::CameraWidget(QString id, ImageProcessor::Type type, QWidget *paren
optionAction
=
new
QAction
(
"Camera"
,
optionsGroup
);
optionAction
->
setData
(
QVariant
::
fromValue
(
optionAction
->
text
()));
optionAction
->
setCheckable
(
false
);
ui
->
menuOptions
->
addAction
(
optionAction
);
ui
->
menuOptions
->
addAction
(
optionAction
);
optionAction
=
new
QAction
(
"Image Processor"
,
optionsGroup
);
optionAction
->
setData
(
QVariant
::
fromValue
(
optionAction
->
text
()));
...
...
@@ -288,7 +288,7 @@ void CameraWidget::options(QAction* action)
QMetaObject
::
invokeMethod
(
camera
,
"showOptions"
,
Qt
::
QueuedConnection
);
}
}
if
(
option
==
"image processor"
)
if
(
option
==
"image processor"
)
if
(
imageProcessor
)
QMetaObject
::
invokeMethod
(
imageProcessor
,
"showOptions"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QPoint
,
this
->
pos
()));
...
...
EyeRecToo/src/MainWindow.cpp
View file @
6a69a27f
...
...
@@ -488,17 +488,22 @@ void MainWindow::menuOption(QAction* action)
void
MainWindow
::
showReferencesDialog
()
{
ReferenceList
::
add
(
"Santini et al."
,
ReferenceList
::
add
(
"Santini et al."
,
"PuRe: Robust pupil detection for real-time pervasive eye tracking"
,
"CVIU"
,
"2018"
,
"https://www.sciencedirect.com/science/article/pii/S1077314218300146"
);
ReferenceList
::
add
(
"Santini et al."
,
"EyeRecToo: Open-source Software for Real-time Pervasive Head-mounted Eye Tracking"
,
"VISAPP"
,
"2017a"
,
"http://www.scitepress.org/DigitalLibrary/PublicationsDetail.aspx?ID=gLeoir7PxnI=&t=1"
);
ReferenceList
::
add
(
"Santini et al."
,
ReferenceList
::
add
(
"Santini et al."
,
"CalibMe: Fast and Unsupervised Eye Tracker Calibration for Gaze-Based Pervasive Human-Computer Interaction"
,
"CHI"
,
"2017b"
,
"http://dl.acm.org/citation.cfm?id=3025453.3025950"
);
ReferenceList
::
add
(
"Fuhl et al."
,
ReferenceList
::
add
(
"Fuhl et al."
,
"ElSe: Ellipse Selection for Robust Pupil Detection in Real-World Environments"
,
"ETRA"
,
"2016"
,
"http://dl.acm.org/citation.cfm?id=2857505"
...
...
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