#179: Float precision issues with epsilon
---------------------+------------------------------------------------------
Reporter: lazzara | Owner: Olena Team
Type: defect | Status: new
Priority: major | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Keywords: |
---------------------+------------------------------------------------------
In level::stretch, we use float variables to do the following:
{{{
float
epsilon = mln_epsilon(float),
M = mln_max(V) + 0.5f - epsilon,
m = 0.0f - 0.5f + epsilon;
}}}
'm' is precise enough since it is a really low value. However, M is not
precise enough since mln_max(V) may be a high value, so we will loose
decimal precision if we store that number as float. As a result, M is
always equal to 'mln_max(V) + 0.5' which introduce a bug in
level::stretch.
This issue can be avoided by using double variables instead, but do we
really want that?
Don't we want to handle that issue in a more generic way?
--
Ticket URL: <https://trac.lrde.org/olena/ticket/179>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.