66 for (
int x = 0;
x <
dists.cols(); ++
x)
68 for (
int y = 0; y <
dists.rows(); ++y)
70 if (
dists(y,
x) != numeric_limits<T>::infinity())
72 values.push_back(
dists(y,
x));
77 throw ConvergenceError(
"No matches available for computing distance quantiles");
79 if (quantile < 0.0 || quantile > 1.0)
80 throw ConvergenceError(
"Distance quantile of matches must lie in the range [0,1]");
84 return *max_element(values.begin(), values.end());
85 nth_element(values.begin(), values.begin() + (values.size() * quantile), values.end());
86 return values[values.size() * quantile];
95 const long cols =
dists.cols();
96 const long rows =
dists.rows();
97 for (
int x = 0;
x < cols; ++
x)
99 for (
int y = 0; y < rows; ++y)
101 if (
dists(y,
x) != numeric_limits<T>::infinity())
103 values.push_back(
dists(y,
x));
107 if (values.size() == 0)
110 nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
111 const T median = values[values.size() / 2];
114 const unsigned size = values.size();
115 for (
unsigned i = 0; i < size; ++i)
117 values[i] = fabs(values[i] - median);
120 nth_element(values.begin(), values.begin() + (values.size() / 2), values.end());
121 return values[values.size() / 2];
127 auto d =
dists.array();
128 return std::sqrt((d - d.mean()).square().sum()/(d.size()-1));
Point matcher did not converge.
Matrix Dists
Squared distances to closest points, dense matrix of ScalarType.
T getDistsQuantile(const T quantile) const
Get the distance at the T-ratio closest point.
Functions and classes that are dependant on scalar type are defined in this templatized class...
Result of the data-association step (Matcher::findClosests), before outlier rejection.
Matches()
In case of too few matches the dists are filled with InvalidDist.
IntMatrix Ids
Identifiers of closest points, dense matrix of integers.
Dists dists
squared distances to closest points
T getStandardDeviation() const
Ids ids
identifiers of closest points
T getMedianAbsDeviation() const
Calculate the Median of Absolute Deviation(MAD), which is median(|x-median(x)|), a kind of robust sta...