32 this->maximumValues = Eigen::MatrixXf::Zero(rows, cols);
33 this->noiseThreshold = noiseThreshold;
38 this->noiseSamples.push_back(
data);
43 if (
data.maxCoeff() <= noiseThreshold)
45 this->maximumValues = this->maximumValues.cwiseMax(
data);
56 return CalibrationInfo(getMatrixAverage(noiseSamples), maximumValues, calibratedMinimum, calibratedMaximum);
61 return this->maximumValues.minCoeff() >= threshold;
66 return this->maximumValues;
71 return this->noiseSamples.size();
74 Eigen::MatrixXf CalibrationHelper::getMatrixAverage(std::vector<Eigen::MatrixXf> samples)
76 if (samples.size() == 0)
78 throw std::runtime_error(
"Average of zero samples not possible");
81 Eigen::MatrixXf sum = samples.at(0);
83 for (std::vector<Eigen::MatrixXf>::iterator it = samples.begin() + 1; it != samples.end(); ++it)
88 return sum / (
float)samples.size();