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
0a05db5f
Commit
0a05db5f
authored
Feb 12, 2019
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handles monocular recordings playback
parent
d3796708
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
EyeRecToo/src/post-processing/PostProcessingWidget.cpp
EyeRecToo/src/post-processing/PostProcessingWidget.cpp
+25
-11
No files found.
EyeRecToo/src/post-processing/PostProcessingWidget.cpp
View file @
0a05db5f
...
@@ -557,10 +557,21 @@ void PostProcessingWidget::startPlayback(QFileInfo& info)
...
@@ -557,10 +557,21 @@ void PostProcessingWidget::startPlayback(QFileInfo& info)
ui
->
playbackSlider
->
setMaximum
(
videoSource
->
getFrameCount
());
ui
->
playbackSlider
->
setMaximum
(
videoSource
->
getFrameCount
());
ui
->
playbackSlider
->
setValue
(
0
);
ui
->
playbackSlider
->
setValue
(
0
);
leftEyeVideoSource
=
new
VideoSource
();
auto
openVideo
=
[
&
](
const
QFileInfo
&
info
)
{
leftEyeVideoSource
->
init
(
leftEyeInfo
.
absoluteFilePath
(),
findAssociatedDataFile
(
dir
,
leftEyeInfo
));
VideoSource
*
vs
=
nullptr
;
rightEyeVideoSource
=
new
VideoSource
();
if
(
info
.
exists
()
&&
info
.
isFile
())
{
rightEyeVideoSource
->
init
(
rightEyeInfo
.
absoluteFilePath
(),
findAssociatedDataFile
(
dir
,
rightEyeInfo
));
vs
=
new
VideoSource
();
vs
->
init
(
info
.
absoluteFilePath
(),
findAssociatedDataFile
(
dir
,
info
));
if
(
!
vs
->
isReady
())
{
vs
->
deleteLater
();
vs
=
nullptr
;
}
}
return
vs
;
};
leftEyeVideoSource
=
openVideo
(
leftEyeInfo
);
rightEyeVideoSource
=
openVideo
(
rightEyeInfo
);
QMetaObject
::
invokeMethod
(
videoSource
,
"play"
);
QMetaObject
::
invokeMethod
(
videoSource
,
"play"
);
ui
->
statusbar
->
showMessage
(
"Playing..."
);
ui
->
statusbar
->
showMessage
(
"Playing..."
);
...
@@ -600,9 +611,6 @@ void PostProcessingWidget::present(const VideoFrame& videoFrame)
...
@@ -600,9 +611,6 @@ void PostProcessingWidget::present(const VideoFrame& videoFrame)
tuple
.
field
.
input
=
videoFrame
.
frame
;
tuple
.
field
.
input
=
videoFrame
.
frame
;
if
(
ui
->
showEyesCheckBox
->
isChecked
())
{
if
(
ui
->
showEyesCheckBox
->
isChecked
())
{
tuple
.
lEye
.
input
=
leftEyeVideoSource
->
getFrameAt
(
tuple
.
lEye
.
timestamp
);
tuple
.
rEye
.
input
=
rightEyeVideoSource
->
getFrameAt
(
tuple
.
rEye
.
timestamp
);
// TODO:
// TODO:
// temporary solution to get the eye projection, fix later
// temporary solution to get the eye projection, fix later
auto
projectEye
=
[](
EyeData
&
ed
,
float
radius
=
12
)
{
auto
projectEye
=
[](
EyeData
&
ed
,
float
radius
=
12
)
{
...
@@ -613,11 +621,17 @@ void PostProcessingWidget::present(const VideoFrame& videoFrame)
...
@@ -613,11 +621,17 @@ void PostProcessingWidget::present(const VideoFrame& videoFrame)
projection
.
center
.
y
=
0.5
*
ed
.
input
.
rows
+
focal_length
*
center
(
1
)
/
center
(
2
);
projection
.
center
.
y
=
0.5
*
ed
.
input
.
rows
+
focal_length
*
center
(
1
)
/
center
(
2
);
projection
.
size
.
width
=
projection
.
size
.
height
=
2
*
focal_length
*
radius
/
center
(
2
);
projection
.
size
.
width
=
projection
.
size
.
height
=
2
*
focal_length
*
radius
/
center
(
2
);
};
};
projectEye
(
tuple
.
lEye
);
projectEye
(
tuple
.
rEye
);
emit
leftEyePresent
(
tuple
.
lEye
);
if
(
leftEyeVideoSource
&&
leftEyeVideoSource
->
isReady
())
{
emit
rightEyePresent
(
tuple
.
rEye
);
tuple
.
lEye
.
input
=
leftEyeVideoSource
->
getFrameAt
(
tuple
.
lEye
.
timestamp
);
projectEye
(
tuple
.
lEye
);
emit
leftEyePresent
(
tuple
.
lEye
);
}
if
(
rightEyeVideoSource
&&
rightEyeVideoSource
->
isReady
())
{
tuple
.
rEye
.
input
=
rightEyeVideoSource
->
getFrameAt
(
tuple
.
rEye
.
timestamp
);
projectEye
(
tuple
.
rEye
);
emit
rightEyePresent
(
tuple
.
rEye
);
}
}
}
emit
present
(
tuple
);
emit
present
(
tuple
);
...
...
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