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
4559b1fa
Commit
4559b1fa
authored
5 years ago
by
Sebastian Hahta
Browse files
Options
Downloads
Patches
Plain Diff
Remove Q from Display
parent
b9e55e75
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#10616
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reconstruct/src/main.cpp
+2
-5
2 additions, 5 deletions
reconstruct/src/main.cpp
renderer/cpp/include/ftl/display.hpp
+1
-4
1 addition, 4 deletions
renderer/cpp/include/ftl/display.hpp
renderer/cpp/src/display.cpp
+5
-5
5 additions, 5 deletions
renderer/cpp/src/display.cpp
with
8 additions
and
14 deletions
reconstruct/src/main.cpp
+
2
−
5
View file @
4559b1fa
...
@@ -149,10 +149,6 @@ static void run() {
...
@@ -149,10 +149,6 @@ static void run() {
net
.
subscribe
(
src
,
[
&
in
](
const
vector
<
unsigned
char
>
&
jpg
,
const
vector
<
unsigned
char
>
&
d
)
{
net
.
subscribe
(
src
,
[
&
in
](
const
vector
<
unsigned
char
>
&
jpg
,
const
vector
<
unsigned
char
>
&
d
)
{
in
.
recv
(
jpg
,
d
);
in
.
recv
(
jpg
,
d
);
});
});
// todo: Display should only need processed input, depth calculation etc.
// should happen somewhere else.
display
.
setCalibration
(
in
.
getQ
());
}
}
int
active
=
displays
.
size
();
int
active
=
displays
.
size
();
...
@@ -172,9 +168,10 @@ static void run() {
...
@@ -172,9 +168,10 @@ static void run() {
auto
lk
=
source
.
lock
();
auto
lk
=
source
.
lock
();
Mat
rgb
=
source
.
getRGB
();
Mat
rgb
=
source
.
getRGB
();
Mat
disparity
=
source
.
getDisparity
();
Mat
disparity
=
source
.
getDisparity
();
Mat
q
=
source
.
getQ
();
lk
.
unlock
();
lk
.
unlock
();
display
.
render
(
rgb
,
disparity
);
display
.
render
(
rgb
,
disparity
,
q
);
display
.
wait
(
50
);
display
.
wait
(
50
);
}
}
...
...
This diff is collapsed.
Click to expand it.
renderer/cpp/include/ftl/display.hpp
+
1
−
4
View file @
4559b1fa
...
@@ -33,9 +33,7 @@ class Display {
...
@@ -33,9 +33,7 @@ class Display {
explicit
Display
(
nlohmann
::
json
&
config
,
std
::
string
name
);
explicit
Display
(
nlohmann
::
json
&
config
,
std
::
string
name
);
~
Display
();
~
Display
();
void
setCalibration
(
const
cv
::
Mat
&
q
)
{
q_
=
q
;
}
bool
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
,
const
cv
::
Mat
&
q
);
bool
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
);
#if defined HAVE_PCL
#if defined HAVE_PCL
bool
render
(
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
);
bool
render
(
pcl
::
PointCloud
<
pcl
::
PointXYZRGB
>::
ConstPtr
);
...
@@ -47,7 +45,6 @@ class Display {
...
@@ -47,7 +45,6 @@ class Display {
void
wait
(
int
ms
);
void
wait
(
int
ms
);
private
:
private
:
cv
::
Mat
q_
;
nlohmann
::
json
config_
;
nlohmann
::
json
config_
;
#if defined HAVE_VIZ
#if defined HAVE_VIZ
...
...
This diff is collapsed.
Click to expand it.
renderer/cpp/src/display.cpp
+
5
−
5
View file @
4559b1fa
...
@@ -77,13 +77,13 @@ Display::~Display() {
...
@@ -77,13 +77,13 @@ Display::~Display() {
#endif // HAVE_VIZ
#endif // HAVE_VIZ
}
}
bool
Display
::
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
)
{
bool
Display
::
render
(
const
cv
::
Mat
&
rgb
,
const
cv
::
Mat
&
depth
,
const
cv
::
Mat
&
q
)
{
Mat
idepth
;
Mat
idepth
;
if
(
config_
[
"points"
]
&&
q
_
.
rows
!=
0
)
{
if
(
config_
[
"points"
]
&&
q
.
rows
!=
0
)
{
#if defined HAVE_PCL
#if defined HAVE_PCL
cv
::
Mat_
<
cv
::
Vec3f
>
XYZ
(
depth
.
rows
,
depth
.
cols
);
// Output point cloud
cv
::
Mat_
<
cv
::
Vec3f
>
XYZ
(
depth
.
rows
,
depth
.
cols
);
// Output point cloud
reprojectImageTo3D
(
depth
,
XYZ
,
q
_
,
false
);
reprojectImageTo3D
(
depth
,
XYZ
,
q
,
false
);
auto
pc
=
ftl
::
utility
::
matToPointXYZ
(
XYZ
,
rgb
);
auto
pc
=
ftl
::
utility
::
matToPointXYZ
(
XYZ
,
rgb
);
pcl
::
visualization
::
PointCloudColorHandlerRGBField
<
pcl
::
PointXYZRGB
>
rgb
(
pc
);
pcl
::
visualization
::
PointCloudColorHandlerRGBField
<
pcl
::
PointXYZRGB
>
rgb
(
pc
);
...
@@ -96,7 +96,7 @@ bool Display::render(const cv::Mat &rgb, const cv::Mat &depth) {
...
@@ -96,7 +96,7 @@ bool Display::render(const cv::Mat &rgb, const cv::Mat &depth) {
//cv::Mat Q_32F;
//cv::Mat Q_32F;
//calibrate_.getQ().convertTo(Q_32F, CV_32F);
//calibrate_.getQ().convertTo(Q_32F, CV_32F);
cv
::
Mat_
<
cv
::
Vec3f
>
XYZ
(
depth
.
rows
,
depth
.
cols
);
// Output point cloud
cv
::
Mat_
<
cv
::
Vec3f
>
XYZ
(
depth
.
rows
,
depth
.
cols
);
// Output point cloud
reprojectImageTo3D
(
depth
+
20.0
f
,
XYZ
,
q
_
,
true
);
reprojectImageTo3D
(
depth
+
20.0
f
,
XYZ
,
q
,
true
);
// Remove all invalid pixels from point cloud
// Remove all invalid pixels from point cloud
XYZ
.
setTo
(
Vec3f
(
NAN
,
NAN
,
NAN
),
depth
==
0.0
f
);
XYZ
.
setTo
(
Vec3f
(
NAN
,
NAN
,
NAN
),
depth
==
0.0
f
);
...
@@ -181,7 +181,7 @@ bool Display::render(const cv::Mat &img, style_t s) {
...
@@ -181,7 +181,7 @@ bool Display::render(const cv::Mat &img, style_t s) {
}
}
void
Display
::
wait
(
int
ms
)
{
void
Display
::
wait
(
int
ms
)
{
if
(
config_
[
"points"
]
&&
q_
.
rows
!=
0
)
{
if
(
config_
[
"points"
])
{
#if defined HAVE_PCL
#if defined HAVE_PCL
pclviz_
->
spinOnce
(
20
);
pclviz_
->
spinOnce
(
20
);
#elif defined HAVE_VIZ
#elif 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