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
70fe9d41
Commit
70fe9d41
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Revert to default compression zlib due to depth artifacts using png or jpeg2000
parent
be9fd540
No related branches found
No related tags found
No related merge requests found
Pipeline
#9845
passed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reconstruct/src/main.cpp
+5
-5
5 additions, 5 deletions
reconstruct/src/main.cpp
vision/src/main.cpp
+5
-8
5 additions, 8 deletions
vision/src/main.cpp
vision/src/streamer.cpp
+5
-5
5 additions, 5 deletions
vision/src/streamer.cpp
with
15 additions
and
18 deletions
reconstruct/src/main.cpp
+
5
−
5
View file @
70fe9d41
...
@@ -131,9 +131,9 @@ static void run(const string &file) {
...
@@ -131,9 +131,9 @@ static void run(const string &file) {
cv
::
imdecode
(
jpg
,
cv
::
IMREAD_COLOR
,
&
rgb
);
cv
::
imdecode
(
jpg
,
cv
::
IMREAD_COLOR
,
&
rgb
);
//LOG(INFO) << "Received JPG : " << rgb.cols;
//LOG(INFO) << "Received JPG : " << rgb.cols;
//
depth = Mat(rgb.size(), CV_
16U
C1);
depth
=
Mat
(
rgb
.
size
(),
CV_
32F
C1
);
/*
z_stream infstream;
z_stream
infstream
;
infstream
.
zalloc
=
Z_NULL
;
infstream
.
zalloc
=
Z_NULL
;
infstream
.
zfree
=
Z_NULL
;
infstream
.
zfree
=
Z_NULL
;
infstream
.
opaque
=
Z_NULL
;
infstream
.
opaque
=
Z_NULL
;
...
@@ -146,9 +146,9 @@ static void run(const string &file) {
...
@@ -146,9 +146,9 @@ static void run(const string &file) {
// the actual DE-compression work.
// the actual DE-compression work.
inflateInit
(
&
infstream
);
inflateInit
(
&
infstream
);
inflate
(
&
infstream
,
Z_NO_FLUSH
);
inflate
(
&
infstream
,
Z_NO_FLUSH
);
inflateEnd(&infstream);
*/
inflateEnd
(
&
infstream
);
cv
::
imdecode
(
d
,
cv
::
IMREAD_GRAYSCALE
,
&
depth
);
//
cv::imdecode(d, cv::IMREAD_GRAYSCALE, &depth);
//depth.convertTo(depth, CV_32FC1, 1.0f/
(25
6.0f
*1
6.0f)
)
;
//depth.convertTo(depth, CV_32FC1
); //
, 1.0f/
1
6.0f
); //, 1.0f/25
6.0f);
});
});
while
(
disp
.
active
())
{
while
(
disp
.
active
())
{
...
...
This diff is collapsed.
Click to expand it.
vision/src/main.cpp
+
5
−
8
View file @
70fe9d41
...
@@ -185,14 +185,13 @@ static void run(const string &file) {
...
@@ -185,14 +185,13 @@ static void run(const string &file) {
calibrate
.
rectified
(
l
,
r
);
calibrate
.
rectified
(
l
,
r
);
// Feed into sync buffer and network forward
// Feed into sync buffer and network forward
sync
->
feed
(
ftl
::
LEFT
,
l
,
lsrc
->
getTimestamp
());
//
sync->feed(ftl::LEFT, l, lsrc->getTimestamp());
sync
->
feed
(
ftl
::
RIGHT
,
r
,
lsrc
->
getTimestamp
());
//
sync->feed(ftl::RIGHT, r, lsrc->getTimestamp());
// Read back from buffer
// Read back from buffer
sync
->
get
(
ftl
::
LEFT
,
l
);
//
sync->get(ftl::LEFT, l);
sync
->
get
(
ftl
::
RIGHT
,
r
);
//
sync->get(ftl::RIGHT, r);
// TODO(nick) Pipeline this
disparity
->
compute
(
l
,
r
,
disp
);
disparity
->
compute
(
l
,
r
,
disp
);
unique_lock
<
mutex
>
lk
(
m
);
unique_lock
<
mutex
>
lk
(
m
);
...
@@ -219,13 +218,11 @@ static void run(const string &file) {
...
@@ -219,13 +218,11 @@ static void run(const string &file) {
});
});
// Send RGB+Depth images for local rendering
// Send RGB+Depth images for local rendering
display
.
render
(
l
,
disp
);
if
(
pl
.
rows
>
0
)
display
.
render
(
p
l
,
p
disp
);
display
.
wait
(
1
);
display
.
wait
(
1
);
unique_lock
<
mutex
>
lk
(
m
);
unique_lock
<
mutex
>
lk
(
m
);
cv
.
wait
(
lk
,
[
&
jobs
]{
return
jobs
==
2
;});
cv
.
wait
(
lk
,
[
&
jobs
]{
return
jobs
==
2
;});
//sleep_for(milliseconds(40));
l
.
copyTo
(
pl
);
l
.
copyTo
(
pl
);
disp
.
copyTo
(
pdisp
);
disp
.
copyTo
(
pdisp
);
...
...
This diff is collapsed.
Click to expand it.
vision/src/streamer.cpp
+
5
−
5
View file @
70fe9d41
...
@@ -25,7 +25,7 @@ void Streamer::send(const Mat &rgb, const Mat &depth) {
...
@@ -25,7 +25,7 @@ void Streamer::send(const Mat &rgb, const Mat &depth) {
cv
::
imencode
(
".jpg"
,
rgb
,
rgb_buf
);
cv
::
imencode
(
".jpg"
,
rgb
,
rgb_buf
);
vector
<
unsigned
char
>
d_buf
;
vector
<
unsigned
char
>
d_buf
;
/*
d_buf.resize(depth.step*depth.rows);
d_buf
.
resize
(
depth
.
step
*
depth
.
rows
);
z_stream
defstream
;
z_stream
defstream
;
defstream
.
zalloc
=
Z_NULL
;
defstream
.
zalloc
=
Z_NULL
;
defstream
.
zfree
=
Z_NULL
;
defstream
.
zfree
=
Z_NULL
;
...
@@ -35,14 +35,14 @@ void Streamer::send(const Mat &rgb, const Mat &depth) {
...
@@ -35,14 +35,14 @@ void Streamer::send(const Mat &rgb, const Mat &depth) {
defstream
.
avail_out
=
(
uInt
)
depth
.
step
*
depth
.
rows
;
// size of output
defstream
.
avail_out
=
(
uInt
)
depth
.
step
*
depth
.
rows
;
// size of output
defstream
.
next_out
=
(
Bytef
*
)
d_buf
.
data
();
// output char array
defstream
.
next_out
=
(
Bytef
*
)
d_buf
.
data
();
// output char array
deflateInit(&defstream, Z_
BES
T_COMPRESSION);
deflateInit
(
&
defstream
,
Z_
DEFAUL
T_COMPRESSION
);
deflate
(
&
defstream
,
Z_FINISH
);
deflate
(
&
defstream
,
Z_FINISH
);
deflateEnd
(
&
defstream
);
deflateEnd
(
&
defstream
);
d_buf.resize(defstream.total_out);
*/
d_buf
.
resize
(
defstream
.
total_out
);
//Mat d2;
//Mat d2;
//depth.convertTo(d2, CV_16UC1, 256
.0f*16.0f
);
//depth.convertTo(d2, CV_16UC1, 256);
cv
::
imencode
(
".png"
,
depth
,
d_buf
);
//
cv::imencode(".png", depth, d_buf);
LOG
(
INFO
)
<<
"Depth Size = "
<<
((
float
)
d_buf
.
size
()
/
(
1024.0
f
*
1024.0
f
));
LOG
(
INFO
)
<<
"Depth Size = "
<<
((
float
)
d_buf
.
size
()
/
(
1024.0
f
*
1024.0
f
));
net_
.
publish
(
uri_
,
rgb_buf
,
d_buf
);
net_
.
publish
(
uri_
,
rgb_buf
,
d_buf
);
...
...
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