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
38fb2f95
Commit
38fb2f95
authored
Sep 11, 2018
by
Cédric Traizet
Browse files
ENH : use vector to store mean
parent
7ddc6a27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Modules/Applications/AppSegmentation/app/otbSmallRegionsMerging.cxx
View file @
38fb2f95
...
@@ -168,16 +168,22 @@ private:
...
@@ -168,16 +168,22 @@ private:
regionMergingFilter
->
SetInputLabelImage
(
labelIn
);
regionMergingFilter
->
SetInputLabelImage
(
labelIn
);
regionMergingFilter
->
SetInputSpectralImage
(
imageIn
);
regionMergingFilter
->
SetInputSpectralImage
(
imageIn
);
auto
my
Map
=
labelStatsFilter
->
GetLabelPopulationMap
();
auto
labelPopulation
Map
=
labelStatsFilter
->
GetLabelPopulationMap
();
std
::
vector
<
double
>
Test
;
std
::
vector
<
double
>
labelPopulation
;
for
(
int
i
=
0
;
i
<=
my
Map
.
rbegin
()
->
first
;
i
++
)
for
(
int
i
=
0
;
i
<=
labelPopulation
Map
.
rbegin
()
->
first
;
i
++
)
{
{
Test
.
push_back
(
myMap
[
i
]);
labelPopulation
.
push_back
(
labelPopulationMap
[
i
]);
}
auto
meanValueMap
=
labelStatsFilter
->
GetMeanValueMap
();
std
::
vector
<
itk
::
VariableLengthVector
<
double
>
>
meanValues
;
for
(
int
i
=
0
;
i
<=
meanValueMap
.
rbegin
()
->
first
;
i
++
)
{
meanValues
.
push_back
(
meanValueMap
[
i
]);
}
}
//regionMergingFilter->SetLabelPopulation( labelStatsFilter->GetLabelPopulationMap() );
//regionMergingFilter->SetLabelPopulation( labelStatsFilter->GetLabelPopulationMap() );
regionMergingFilter
->
SetLabelPopulation
(
Test
);
regionMergingFilter
->
SetLabelPopulation
(
labelPopulation
);
regionMergingFilter
->
SetLabelStatistic
(
labelStatsFilter
->
GetM
eanValue
Map
()
);
regionMergingFilter
->
SetLabelStatistic
(
m
eanValue
s
);
clock_t
tic2
=
clock
();
clock_t
tic2
=
clock
();
for
(
unsigned
int
size
=
1
;
size
<
minSize
;
size
++
)
for
(
unsigned
int
size
=
1
;
size
<
minSize
;
size
++
)
{
{
...
...
Modules/Segmentation/Conversion/include/otbLabelImageSmallRegionMergingFilter.h
View file @
38fb2f95
...
@@ -82,7 +82,10 @@ public:
...
@@ -82,7 +82,10 @@ public:
typedef
std
::
map
<
InputLabelType
,
std
::
set
<
InputLabelType
>
>
NeigboursMapType
;
typedef
std
::
map
<
InputLabelType
,
std
::
set
<
InputLabelType
>
>
NeigboursMapType
;
typedef
std
::
map
<
InputLabelType
,
RealVectorPixelType
>
LabelStatisticMapType
;
//typedef std::map<InputLabelType, RealVectorPixelType > LabelStatisticMapType;
typedef
std
::
vector
<
RealVectorPixelType
>
LabelStatisticMapType
;
//typedef std::map<InputLabelType, InputLabelType> CorrespondanceMapType;
//typedef std::map<InputLabelType, InputLabelType> CorrespondanceMapType;
typedef
std
::
vector
<
double
>
CorrespondanceMapType
;
typedef
std
::
vector
<
double
>
CorrespondanceMapType
;
...
...
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