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
cf9b2961
Commit
cf9b2961
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Add simple img show to display
parent
cfef444a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#10495
failed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
renderer/cpp/include/ftl/display.hpp
+7
-0
7 additions, 0 deletions
renderer/cpp/include/ftl/display.hpp
renderer/cpp/src/display.cpp
+21
-0
21 additions, 0 deletions
renderer/cpp/src/display.cpp
with
28 additions
and
0 deletions
renderer/cpp/include/ftl/display.hpp
+
7
−
0
View file @
cf9b2961
...
@@ -17,6 +17,11 @@ namespace ftl {
...
@@ -17,6 +17,11 @@ namespace ftl {
* Multiple local display options for disparity or point clouds.
* Multiple local display options for disparity or point clouds.
*/
*/
class
Display
{
class
Display
{
public:
enum
style_t
{
STYLE_NORMAL
,
STYLE_DISPARITY
,
STYLE_DEPTH
};
public
:
public
:
explicit
Display
(
nlohmann
::
json
&
config
);
explicit
Display
(
nlohmann
::
json
&
config
);
~
Display
();
~
Display
();
...
@@ -25,6 +30,8 @@ class Display {
...
@@ -25,6 +30,8 @@ class Display {
bool
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
);
bool
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
);
bool
render
(
const
cv
::
Mat
&
img
,
style_t
s
=
STYLE_NORMAL
);
bool
active
()
const
;
bool
active
()
const
;
void
wait
(
int
ms
);
void
wait
(
int
ms
);
...
...
This diff is collapsed.
Click to expand it.
renderer/cpp/src/display.cpp
+
21
−
0
View file @
cf9b2961
...
@@ -84,6 +84,27 @@ bool Display::render(const cv::Mat &rgb, const cv::Mat &depth) {
...
@@ -84,6 +84,27 @@ bool Display::render(const cv::Mat &rgb, const cv::Mat &depth) {
return
true
;
return
true
;
}
}
bool
Display
::
render
(
const
cv
::
Mat
&
img
,
style_t
s
)
{
if
(
s
==
STYLE_NORMAL
)
{
cv
::
imshow
(
"Image"
,
img
);
}
else
if
(
s
=
STYLE_DISPARITY
)
{
Mat
idepth
;
if
((
bool
)
config_
[
"flip_vert"
])
{
cv
::
flip
(
img
,
idepth
,
0
);
}
else
{
idepth
=
img
;
}
idepth
.
convertTo
(
idepth
,
CV_8U
,
255.0
f
/
256.0
f
);
applyColorMap
(
idepth
,
idepth
,
cv
::
COLORMAP_JET
);
cv
::
imshow
(
"Disparity"
,
idepth
);
}
return
true
;
}
void
Display
::
wait
(
int
ms
)
{
void
Display
::
wait
(
int
ms
)
{
if
(
config_
[
"points"
]
&&
q_
.
rows
!=
0
)
{
if
(
config_
[
"points"
]
&&
q_
.
rows
!=
0
)
{
#if defined HAVE_VIZ
#if defined HAVE_VIZ
...
...
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