Commit f9545d71 authored by Melanie Lipp's avatar Melanie Lipp Committed by Melanie Lipp
Browse files

Change harmonic mean to a formulation which is more consistent with the old...

Change harmonic mean to a formulation which is more consistent with the old one (without weighting factors). One advantage of this formulation is that there are less divisions necessary.
parent 411e43d4
......@@ -69,7 +69,7 @@ constexpr Scalar harmonicMean(Scalar x, Scalar y, Scalar wx = 1.0, Scalar wy = 1
if (x*y <= 0)
return 0;
return (wx + wy) / (wx / x + wy / y);
return (wx + wy) * x * y / (wy * x + wx * y);
}
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment