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
Main Repositories
otb
Commits
7ddc6a27
Commit
7ddc6a27
authored
Sep 11, 2018
by
Cédric Traizet
Browse files
ENH : removed correspondanceMapTmp, and use m_CorrespondanceMap instead
parent
8b81440e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Modules/Segmentation/Conversion/include/otbLabelImageSmallRegionMergingFilter.hxx
View file @
7ddc6a27
...
...
@@ -104,9 +104,6 @@ PersistentLabelImageSmallRegionMergingFilter<TInputLabelImage, TInputSpectralIma
}
}
// LUTtmp creation in order to modify the LUT only at the end of the pass
auto
CorrespondanceMapTmp
(
m_CorrespondanceMap
);
// For each label of the label map, find the "closest" connected label, according
// to the euclidian distance between the corresponding m_labelStatistic elements.
for
(
auto
neighbours
:
neighboursMap
)
...
...
@@ -136,23 +133,23 @@ PersistentLabelImageSmallRegionMergingFilter<TInputLabelImage, TInputSpectralIma
auto
curLabelLUT
=
label
;
auto
adjLabelLUT
=
closestNeighbour
;
std
::
cout
<<
label
<<
" "
<<
closestNeighbour
;
while
(
CorrespondanceMap
Tmp
[
curLabelLUT
]
!=
curLabelLUT
)
while
(
m_
CorrespondanceMap
[
curLabelLUT
]
!=
curLabelLUT
)
{
curLabelLUT
=
CorrespondanceMap
Tmp
[
curLabelLUT
];
curLabelLUT
=
m_
CorrespondanceMap
[
curLabelLUT
];
}
while
(
CorrespondanceMap
Tmp
[
adjLabelLUT
]
!=
adjLabelLUT
)
while
(
m_
CorrespondanceMap
[
adjLabelLUT
]
!=
adjLabelLUT
)
{
adjLabelLUT
=
CorrespondanceMap
Tmp
[
adjLabelLUT
];
adjLabelLUT
=
m_
CorrespondanceMap
[
adjLabelLUT
];
}
if
(
curLabelLUT
<
adjLabelLUT
)
{
CorrespondanceMap
Tmp
[
adjLabelLUT
]
=
curLabelLUT
;
m_
CorrespondanceMap
[
adjLabelLUT
]
=
curLabelLUT
;
}
else
{
CorrespondanceMap
Tmp
[
CorrespondanceMap
Tmp
[
curLabelLUT
]]
=
adjLabelLUT
;
CorrespondanceMap
Tmp
[
curLabelLUT
]
=
adjLabelLUT
;
m_
CorrespondanceMap
[
m_
CorrespondanceMap
[
curLabelLUT
]]
=
adjLabelLUT
;
m_
CorrespondanceMap
[
curLabelLUT
]
=
adjLabelLUT
;
}
...
...
@@ -167,21 +164,20 @@ PersistentLabelImageSmallRegionMergingFilter<TInputLabelImage, TInputSpectralIma
}
for
(
InputLabelType
label
=
0
;
label
<
CorrespondanceMap
Tmp
.
size
();
++
label
)
for
(
InputLabelType
label
=
0
;
label
<
m_
CorrespondanceMap
.
size
();
++
label
)
{
InputLabelType
can
=
label
;
while
(
CorrespondanceMap
Tmp
[
can
]
!=
can
)
while
(
m_
CorrespondanceMap
[
can
]
!=
can
)
{
can
=
CorrespondanceMap
Tmp
[
can
];
can
=
m_
CorrespondanceMap
[
can
];
}
CorrespondanceMap
Tmp
[
label
]
=
can
;
m_
CorrespondanceMap
[
label
]
=
can
;
}
for
(
InputLabelType
label
=
0
;
label
<
CorrespondanceMap
Tmp
.
size
();
++
label
)
for
(
InputLabelType
label
=
0
;
label
<
m_
CorrespondanceMap
.
size
();
++
label
)
{
InputLabelType
correspondingLabel
=
CorrespondanceMapTmp
[
label
];
m_CorrespondanceMap
[
label
]
=
correspondingLabel
;
InputLabelType
correspondingLabel
=
m_CorrespondanceMap
[
label
];
if
((
m_LabelPopulation
[
label
]
!=
0
)
&&
(
correspondingLabel
!=
label
))
{
...
...
Write
Preview
Supports
Markdown
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