Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
8c526ab9
Commit
8c526ab9
authored
Oct 12, 2021
by
Baptiste Esteban
Browse files
Starting writing tests for the mtos
parent
f1f3b02f
Pipeline
#30556
passed with stages
in 19 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/morpho/CMakeLists.txt
View file @
8c526ab9
...
...
@@ -23,6 +23,7 @@ add_core_test(${test_prefix}maxtree maxtree.cpp)
add_core_test
(
${
test_prefix
}
alphatree alphatree.cpp
)
add_core_test
(
${
test_prefix
}
private_directional_hqueue directional_hqueue.cpp
)
add_core_test
(
${
test_prefix
}
component_tree component_tree.cpp
)
add_core_test
(
${
test_prefix
}
MToS mtos.cpp
)
target_link_libraries
(
${
test_prefix
}
dilate PRIVATE TBB::TBB
)
tests/morpho/mtos.cpp
0 → 100644
View file @
8c526ab9
#include
<mln/morpho/mtos.hpp>
#include
<mln/core/image/view/channel.hpp>
#include
<mln/morpho/tos.hpp>
#include
<mln/morpho/private/trees_fusion.hpp>
#include
<gtest/gtest.h>
TEST
(
Morpho
,
GoS
)
{
mln
::
image2d
<
mln
::
rgb8
>
input
=
{
{{
255
,
146
,
0
},
{
31
,
174
,
0
},
{
45
,
0
,
255
},
{
255
,
75
,
0
},
{
31
,
174
,
0
}},
//
{{
45
,
0
,
255
},
{
255
,
75
,
0
},
{
3
,
0
,
0
},
{
45
,
0
,
255
},
{
255
,
255
,
255
}},
//
{{
3
,
0
,
0
},
{
31
,
174
,
0
},
{
255
,
75
,
0
},
{
31
,
174
,
0
},
{
255
,
75
,
0
}},
//
{{
31
,
174
,
0
},
{
255
,
255
,
255
},
{
45
,
0
,
255
},
{
3
,
0
,
0
},
{
45
,
0
,
255
}},
//
{{
255
,
75
,
0
},
{
31
,
174
,
0
},
{
255
,
75
,
0
},
{
31
,
174
,
0
},
{
255
,
146
,
0
}},
//
};
std
::
vector
<
std
::
vector
<
int
>>
tree_to_graph_ref
=
{{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
},
{
0
,
2
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
},
{
0
,
26
,
27
,
28
,
29
,
30
}};
mln
::
morpho
::
component_tree
<>
trees
[
3
];
mln
::
image2d
<
int
>
nodemaps
[
3
];
std
::
vector
<
int
>
depths
[
3
];
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
std
::
tie
(
trees
[
i
],
nodemaps
[
i
])
=
mln
::
morpho
::
tos
(
mln
::
view
::
channel
(
input
,
i
),
{
0
,
0
});
depths
[
i
]
=
trees
[
i
].
compute_depth
();
}
auto
[
graph
,
tree_to_graph
]
=
mln
::
morpho
::
details
::
compute_inclusion_graph
(
trees
,
nodemaps
,
depths
,
3
);
// Check number of nodes in the GoS
ASSERT_EQ
(
graph
.
size
(),
31
);
// Compare the map tree node -> graph node
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
(
int
)
tree_to_graph
[
i
].
size
();
j
++
)
ASSERT_EQ
(
tree_to_graph
[
i
][
j
],
tree_to_graph_ref
[
i
][
j
]);
}
}
TEST
(
Morpho
,
DepthMap
)
{
// Test depth map computation for GoS
}
TEST
(
Morpho
,
Satmaxtree
)
{
// Test satmaxtree computation from depth map
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment