public class HistogramMode extends Statistics
Statistics
is used for calculating the Histogram or the Mode of an image. These 2 operations are almost the same, the
difference is only at the final step when the histogram returns an array containing the number of pixels for every bin while the mode returns only
the most populated bean. This operation is achieved with the help of an AtomicDouble array, for avoiding thread-safety issues. There is no
statistic accumulation because multiple Histogram objects could bring to an OutOfMemoryError
.Statistics.StatsType
samples, STATS_PROPERTY, type
Modifier and Type | Method and Description |
---|---|
protected void |
accumulateStats(Statistics stats)
This method is used for accumulating the statistics from another Statistics object
|
void |
addSample(double sample)
This method adds a Double value to the statistics and updates them
|
protected void |
clearStats()
This method is used for clearing the results
|
Long |
getNumSamples()
This method returns the number of samples calculated
|
Object |
getResult()
This method returns the statistic result
|
checkSameStats, getStatsType
public void addSample(double sample)
Statistics
addSample
in class Statistics
sample
- sample value used for updating statisticsprotected void accumulateStats(Statistics stats)
Statistics
accumulateStats
in class Statistics
stats
- Statistics object to add to the current objectpublic Object getResult()
Statistics
getResult
in class Statistics
public Long getNumSamples()
Statistics
getNumSamples
in class Statistics
protected void clearStats()
Statistics
clearStats
in class Statistics
Copyright © 2006–2018 GeoSolutions. All rights reserved.