32 #include <RobotAPI/interface/observers/ObserverFilters.h>
42 this->windowFilterSize = 1;
57 return new Variant(matrix->toEigen().maxCoeff());
63 ParameterTypeList result;
74 this->windowFilterSize = 1;
89 return new Variant(matrix->toEigen().minCoeff());
95 ParameterTypeList result;
106 this->windowFilterSize = 1;
121 return new Variant(matrix->toEigen().mean());
127 ParameterTypeList result;
138 this->windowFilterSize = 1;
143 this->percentile = percentile;
144 this->windowFilterSize = 1;
159 std::vector<float> vector = matrix->toVector();
160 std::sort(vector.begin(), vector.end());
167 ParameterTypeList result;
175 if (sortedData.size() == 0)
177 throw LocalException(
"GetPercentile not possible for empty vector");
180 float indexf = (sortedData.size() - 1) * percentile;
182 int index = (int)indexf;
183 float f = indexf -
index;
185 if (
index == (
int)sortedData.size() - 1)
187 return sortedData.at(sortedData.size() - 1);
190 return sortedData.at(
index) * (1 - f) + sortedData.at(
index + 1) * f;
199 this->windowFilterSize = 1;
200 this->percentiles = 10;
205 this->percentiles = percentiles;
206 this->windowFilterSize = 1;
222 std::vector<float> vector = matrix->toVector();
223 std::sort(vector.begin(), vector.end());
224 std::vector<float> result;
225 result.push_back(vector.at(0));
227 for (
int i = 1; i < percentiles; i++)
233 result.push_back(vector.at(vector.size() - 1));
240 ParameterTypeList result;
247 public MatrixCumulativeFrequencyFilterBase,
253 this->windowFilterSize = 1;
261 this->windowFilterSize = 1;
276 std::vector<float> vector = matrix->toVector();
277 std::sort(vector.begin(), vector.end());
279 std::vector<float> resultF;
283 resultF.push_back(
v);
292 ParameterTypeList result;
297 static std::vector<int>
300 std::vector<int> result;
305 for (
size_t i = 0; i < sortedData.size(); i++)
307 if (sortedData.at(i) > val && nr < bins)
316 while ((
int)result.size() < bins)
318 result.push_back(lastCount);