Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
c1bc39f4
Commit
c1bc39f4
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Fix for 2D snapshot
parent
87d660a3
No related branches found
No related tags found
No related merge requests found
Pipeline
#26454
passed
5 years ago
Stage: all
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/gui/src/camera.cpp
+17
-2
17 additions, 2 deletions
applications/gui/src/camera.cpp
applications/gui/src/camera.hpp
+2
-0
2 additions, 0 deletions
applications/gui/src/camera.hpp
with
19 additions
and
2 deletions
applications/gui/src/camera.cpp
+
17
−
2
View file @
c1bc39f4
...
@@ -437,6 +437,19 @@ void ftl::gui::Camera::_draw(std::vector<ftl::rgbd::FrameSet*> &fss) {
...
@@ -437,6 +437,19 @@ void ftl::gui::Camera::_draw(std::vector<ftl::rgbd::FrameSet*> &fss) {
record_sender_
->
post
(
fs2
);
record_sender_
->
post
(
fs2
);
record_stream_
->
select
(
0
,
Channels
<
0
>
(
Channel
::
Colour
));
record_stream_
->
select
(
0
,
Channels
<
0
>
(
Channel
::
Colour
));
f
.
swapTo
(
Channels
<
0
>
(
Channel
::
Colour
),
frame_
);
f
.
swapTo
(
Channels
<
0
>
(
Channel
::
Colour
),
frame_
);
}
else
if
(
do_snapshot_
)
{
do_snapshot_
=
false
;
cv
::
Mat
flipped
;
cv
::
Mat
im1
;
frame_
.
get
<
cv
::
cuda
::
GpuMat
>
(
Channel
::
Colour
).
download
(
im1
);
{
//UNIQUE_LOCK(mutex_, lk);
cv
::
flip
(
im1
,
flipped
,
0
);
}
cv
::
cvtColor
(
flipped
,
flipped
,
cv
::
COLOR_BGRA2BGR
);
cv
::
imwrite
(
snapshot_filename_
,
flipped
);
}
}
}
}
...
@@ -775,14 +788,16 @@ const void ftl::gui::Camera::captureFrame() {
...
@@ -775,14 +788,16 @@ const void ftl::gui::Camera::captureFrame() {
}
}
void
ftl
::
gui
::
Camera
::
snapshot
(
const
std
::
string
&
filename
)
{
void
ftl
::
gui
::
Camera
::
snapshot
(
const
std
::
string
&
filename
)
{
cv
::
Mat
flipped
;
/*
cv::Mat flipped;
{
{
UNIQUE_LOCK(mutex_, lk);
UNIQUE_LOCK(mutex_, lk);
//cv::flip(im1_, flipped, 0);
//cv::flip(im1_, flipped, 0);
}
}
cv::cvtColor(flipped, flipped, cv::COLOR_BGRA2BGR);
cv::cvtColor(flipped, flipped, cv::COLOR_BGRA2BGR);
cv
::
imwrite
(
filename
,
flipped
);
cv::imwrite(filename, flipped);*/
snapshot_filename_
=
filename
;
do_snapshot_
=
true
;
}
}
void
ftl
::
gui
::
Camera
::
startVideoRecording
(
const
std
::
string
&
filename
)
{
void
ftl
::
gui
::
Camera
::
startVideoRecording
(
const
std
::
string
&
filename
)
{
...
...
This diff is collapsed.
Click to expand it.
applications/gui/src/camera.hpp
+
2
−
0
View file @
c1bc39f4
...
@@ -147,6 +147,8 @@ class Camera {
...
@@ -147,6 +147,8 @@ class Camera {
float
lerpSpeed_
;
float
lerpSpeed_
;
bool
sdepth_
;
bool
sdepth_
;
bool
pause_
;
bool
pause_
;
bool
do_snapshot_
=
false
;
std
::
string
snapshot_filename_
;
ftl
::
codecs
::
Channel
channel_
;
ftl
::
codecs
::
Channel
channel_
;
ftl
::
codecs
::
Channels
<
0
>
channels_
;
ftl
::
codecs
::
Channels
<
0
>
channels_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment