[MVD2/OTB4] Crash when playing with high quantile
Mantis Issue 839, reported by jmichel, assigned to cpeyrega, created: 2013-11-26
terminate called after throwing an instance of 'std::runtime_error' what(): Accuracy loss when converting double (nan) to string.
Program received signal SIGABRT, Aborted.
1385461421 - julienIn: http://hg.orfeo-toolbox.org/OTB/file/07d5cc738ad2/Utilities/ITK/Modules/Numerics/Statistics/include/itkHistogram.hxx#l667
I think that binProportion is null, and the Quantile method therefore returns Nan.
However, I cannot find any difference with the 3.x version of this method.
1385461965 - cpeyregaI think that the issue comes from the filling of the histogram into Monteverdi2 since the main API differences with 3x come from the itkHistogram class. I will be watching in this direction.
1385483426 - cpeyregaThe issue was due to the ClipBinsAtEnds boolean set to true by default. With ITKv4, the default behavior of the last bin of histograms is different from the default settings with ITKv3:
-Last bin with ITKv3: includes the upper bound of the last bin whatever the value of ClipBinsAtEnds (true or false)
-Last bin with ITKv4: includes the upper bound of the last bin ONLY IF ClipBinsAtEnds == false.
Thus, the correction consists in setting ClipBinsAtEnds to FALS