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
3f3d60af
Commit
3f3d60af
authored
Mar 07, 2013
by
Julien Malik
Browse files
BUG: fix percentile computation for BOUND_UPPER mode
parent
f29aff30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Code/Common/mvdHistogramModel.cxx
View file @
3f3d60af
...
...
@@ -102,11 +102,13 @@ HistogramModel
MeasurementType
minI
=
histogram
->
GetBinMin
(
0
,
index
[
0
]
);
MeasurementType
maxI
=
histogram
->
GetBinMax
(
0
,
index
[
0
]
);
//
Min/max f
requenc
ies
of
//
F
requenc
y
of
current bin
Histogram
::
FrequencyType
frequency
(
histogram
->
GetFrequency
(
index
)
);
// Initialize result.
double
percent
=
frequency
*
(
intensity
-
minI
)
/
(
maxI
-
minI
);
// Initialize result (contribution of current bin)
double
percent
=
frequency
*
(
intensity
-
(
bound
==
BOUND_LOWER
?
minI
:
maxI
)
)
/
(
maxI
-
minI
);
// Number of bins of histogram.
Histogram
::
SizeType
::
SizeValueType
binCount
=
histogram
->
Size
();
...
...
@@ -134,12 +136,12 @@ HistogramModel
break
;
};
// Traverse lower/upper bound
.
// Traverse lower/upper bound
(contribution of other bins)
Histogram
::
SizeType
::
SizeValueType
i
;
for
(
i
=
i0
;
i
<
iN
;
++
i
)
percent
+=
histogram
->
GetFrequency
(
i
,
0
);
// Calculate frequency rate.
percent
/=
histogram
->
GetTotalFrequency
();
...
...
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