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
Robert Sachunsky
olena
Commits
58cdb6cb
Commit
58cdb6cb
authored
Mar 01, 2011
by
Guillaume Lazzara
Browse files
mln/labeling/fill_holes.hh: Improve speed.
parent
011b365f
Changes
2
Hide whitespace changes
Inline
Side-by-side
milena/ChangeLog
View file @
58cdb6cb
2011-03-01 Guillaume Lazzara <z@lrde.epita.fr>
* mln/labeling/fill_holes.hh: Improve speed.
2011-03-01 Guillaume Lazzara <z@lrde.epita.fr>
* mln/fun/v2v/rgb_to_luma.hh: New function for grayscale
milena/mln/labeling/fill_holes.hh
View file @
58cdb6cb
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
...
...
@@ -33,6 +34,8 @@
# include <mln/labeling/background.hh>
# include <mln/labeling/compute.hh>
# include <mln/data/transform.hh>
# include <mln/core/image/dmorph/image_if.hh>
# include <mln/accu/math/count.hh>
...
...
@@ -57,7 +60,7 @@ namespace mln
/// \see mln::labeling::background
///
template
<
typename
I
,
typename
N
,
typename
L
>
I
mln_concrete
(
I
)
fill_holes
(
const
Image
<
I
>&
input
,
const
Neighborhood
<
N
>&
nbh
,
L
&
nlabels
);
...
...
@@ -66,7 +69,7 @@ namespace mln
template
<
typename
I
,
typename
N
,
typename
L
>
inline
I
mln_concrete
(
I
)
fill_holes
(
const
Image
<
I
>&
input
,
const
Neighborhood
<
N
>&
nbh
,
L
&
nlabels
)
{
...
...
@@ -77,10 +80,6 @@ namespace mln
mln_precondition
(
exact
(
input
).
is_valid
());
mln_precondition
(
exact
(
nbh
).
is_valid
());
mln_ch_value
(
I
,
bool
)
output
;
initialize
(
output
,
input
);
data
::
fill
(
output
,
false
);
mln_ch_value
(
I
,
L
)
lbls
=
labeling
::
background
(
input
,
nbh
,
nlabels
);
accu
::
math
::
count
<
mln_value
(
I
)
>
a_
;
...
...
@@ -99,7 +98,9 @@ namespace mln
}
}
data
::
fill
((
output
|
(
pw
::
value
(
lbls
)
!=
bg_lbl
)).
rw
(),
true
);
util
::
array
<
bool
>
bg_relbl
(
arr
.
nelements
(),
true
);
bg_relbl
(
bg_lbl
)
=
false
;
mln_ch_value
(
I
,
bool
)
output
=
data
::
transform
(
lbls
,
bg_relbl
);
trace
::
exiting
(
"labeling::fill_holes"
);
return
output
;
...
...
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