I have developed an application for object recognition, using the Chris Evans OpenSURF implementation of SURF algorithm. I'm doing some experiments and I just realized that the algorithm does not behave well, if I launch the application through the IDE or directly with double clicking in the .exe file. I have checked that the .exe file is the binary compiled of the code I'm launching through the IDE. It seems that there is something different maybe related with the floating point precision, when launching the app from IDE or from .EXE, because the SURF algorithm is deterministic and with the same input always must return the same output. Some examples. The first and second columns are the number of points extracted from the images. The third column is the difference between this first and second.
EXE VS Diff
17340 17366 -26 Image001
4639 4631 8 Image002
3196 3189 7 Image003
10442 10441 1 Image004
1485 1477 8 Image005
5539 5555 -16 Image006
18102 18073 29 Image007
Anyone can tell me why the ouput is different if the algorithm and the code is exactly the same?
Thanks
This is because when we compile the code, then we have to on the optimization mode compilation.
Optimization mode compilation is in to way whether to speed up or to short the code. In visual studio when you go to the project option then you see the optimization setting in the C/C++ option where you set the code maximum code optimization by following option depending on the code itself.1. Optimization: Maximum Speed 2.Enable Intrinsic function : Yes 3. Favor Size or Speed: Favor fast code
and there is more option of optimization in COde Generation option
Floating Point Model :Fast
Note: 1.these options are to speed up the processing But some time unstable the code.