Skip to content
GitLab
Menu
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
8d7a72d5
Commit
8d7a72d5
authored
Oct 11, 2021
by
Baptiste Esteban
Browse files
Add mtos to the public API
parent
a9eb755c
Pipeline
#30538
canceled with stages
in 21 minutes and 58 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pylene/CMakeLists.txt
View file @
8d7a72d5
...
@@ -86,6 +86,7 @@ target_sources(Pylene-core PRIVATE
...
@@ -86,6 +86,7 @@ target_sources(Pylene-core PRIVATE
src/morpho/hvector_unbounded.cpp
src/morpho/hvector_unbounded.cpp
src/morpho/immersion.cpp
src/morpho/immersion.cpp
src/morpho/maxtree.cpp
src/morpho/maxtree.cpp
src/morpho/mtos.cpp
src/morpho/satmaxtree.cpp
src/morpho/satmaxtree.cpp
src/morpho/trees_fusion.cpp
src/morpho/trees_fusion.cpp
src/morpho/unionfind.cpp
src/morpho/unionfind.cpp
...
...
pylene/include/mln/morpho/mtos.hpp
0 → 100644
View file @
8d7a72d5
#pragma once
#include <mln/core/colors.hpp>
#include <mln/morpho/component_tree.hpp>
#include <tuple>
namespace
mln
::
morpho
{
std
::
pair
<
component_tree
<>
,
image2d
<
int
>>
mtos
(
image2d
<
rgb8
>
ima
,
point2d
pstart
);
}
\ No newline at end of file
pylene/src/morpho/mtos.cpp
0 → 100644
View file @
8d7a72d5
#include <mln/core/image/view/channel.hpp>
#include <mln/morpho/private/satmaxtree.hpp>
#include <mln/morpho/private/trees_fusion.hpp>
#include <mln/morpho/mtos.hpp>
#include <mln/morpho/tos.hpp>
namespace
mln
::
morpho
{
std
::
pair
<
component_tree
<>
,
image2d
<
int
>>
mtos
(
image2d
<
rgb8
>
ima
,
point2d
pstart
)
{
mln
::
morpho
::
component_tree
<>
trees
[
3
];
mln
::
image2d
<
int
>
nodemaps
[
3
];
std
::
vector
<
int
>
depths
[
3
];
for
(
int
c
=
0
;
c
<
3
;
c
++
)
{
std
::
tie
(
trees
[
c
],
nodemaps
[
c
])
=
mln
::
morpho
::
tos
(
mln
::
view
::
channel
(
ima
,
c
),
pstart
);
depths
[
c
]
=
trees
[
c
].
compute_depth
();
}
const
auto
[
gos
,
tree_to_graph
]
=
mln
::
morpho
::
details
::
compute_inclusion_graph
(
trees
,
nodemaps
,
depths
,
3
);
auto
depth_map
=
mln
::
morpho
::
details
::
compute_depth_map
(
gos
,
tree_to_graph
,
nodemaps
);
auto
[
t
,
nm
]
=
mln
::
morpho
::
details
::
satmaxtree
(
depth_map
);
return
{
std
::
move
(
t
),
std
::
move
(
nm
)};
}
}
// namespace mln::morpho
\ No newline at end of file
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