Loss of precision within applications when a cast to float is made
Hi everyone.
I take as an example the application I analyzed: otbcli_OrthoRectification. The issue could be present also in other applications.
The code makes multiple casts to float, using for example SetParameterFloat() or GetParameterFloat(). There is no reason to cast to float when double can be used (and the library actually gives results as double). This type of cast can lead to approximations, with correlated loss of precision. In my testing actually there is a difference, about some pixels of discrepancy.
This issue can be solved simply changing every function named with "Float" with the same function named "Double" (SetParameterFloat() -> SetParameterDouble()). I made a test with otbcli_OrthoRectification and it works.
This post follows the chat from Orfeo forum: link