Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
core
Commits
5dfaa7d1
Verified
Commit
5dfaa7d1
authored
Nov 25, 2021
by
Tobias WEBER
Browse files
also sum up all tof channels
parent
4e4982df
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/misc/tof.cpp
View file @
5dfaa7d1
...
...
@@ -54,6 +54,9 @@ bool convert_tof(const fs::path& tof_file, const fs::path& out_file)
{
using
t_data
=
std
::
uint32_t
;
gil
::
gray16_image_t
total_png
(
PSD_WIDTH
,
PSD_HEIGHT
);
auto
total_view
=
gil
::
view
(
total_png
);
for
(
unsigned
t
=
0
;
t
<
TOF_COUNT
;
++
t
)
{
std
::
ostringstream
ostr_file
;
...
...
@@ -76,14 +79,16 @@ bool convert_tof(const fs::path& tof_file, const fs::path& out_file)
for
(
unsigned
y
=
0
;
y
<
PSD_HEIGHT
;
++
y
)
{
auto
row
=
view
.
row_begin
(
y
);
auto
total_row
=
total_view
.
row_begin
(
y
);
for
(
unsigned
x
=
0
;
x
<
PSD_WIDTH
;
++
x
)
{
t_data
cnt
=
data
[
y
*
PSD_WIDTH
+
x
];
*
(
row
+
x
)
=
cnt
;
counts
+=
cnt
;
*
(
total_row
+
x
)
=
*
(
total_row
+
x
)
+
cnt
;
counts
+=
cnt
;
//std::cout << std::hex << cnt << " ";
}
//std::cout << std::endl;
...
...
@@ -98,6 +103,8 @@ bool convert_tof(const fs::path& tof_file, const fs::path& out_file)
}
}
std
::
string
total_png_file
=
out_file
.
string
()
+
".png"
;
gil
::
write_view
(
total_png_file
,
total_view
,
gil
::
png_tag
());
return
true
;
}
...
...
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