Repository: opencv
Issue: svm: different results between iOS simulator & iPhone
Labels: bug,auto-transferred,priority: normal,affected: 2.4,platform: ios/osx

Transferred from http://code.opencv.org/issues/3308

```
|| Boris Mansencal on 2013-10-08 14:58
|| Priority: Normal
|| Affected: 2.4.0 - 2.4.6
|| Category: ios
|| Tracker: Bug
|| Difficulty: Medium
|| PR: 
|| Platform: ARM / iOS
```
## svm: different results between iOS simulator & iPhone

```
Hello,

It seems there is a bug when SVM classifier is executed on a real iPhone. We do not get the same results than when it is executed on iOS simulator (or MacOSX or Linux).
The attached program should show the bug.

The attached program load two files : an SVM model and a data file [also attached to this bug].
The data file contains both data and results of classification for this data with this SVM model (computed on linux).
The program load the model, load the data, classify the data with the model and check if the results are the same than those expected (loaded from file).

Once compiled, the program is launched liked this :
./test data.yml model.xml

The program executed on linux, mac, or iOS simulator gives the same results (as those obtained on linux).
But when executed on a real iPhone, the results are different than those expected.

We use the same version of OpenCV on all platforms : 2.4.6
Linux platform is : Intel Xeon, Fedora 19, g++ 4.8.1
MacOSX platform is :  Intel, MacOSX 10.8.5, Xcode 5 (5A1413)  + associated iOS simulator
iPhone platform is iPhone 5 with iOS 7, or iPhone 5S with iOS 7.0.2

We also tested on a MacBookPro, Intel Core2Duo, MacOSX 10.7.4, Xcode 4.6.3, with OpenCV 2.4.3 and we get the expected results.

On a real iPhone, we tested 2.4.6 (downloaded framework or compiled from source) & current git version, and in all cases we get different results than under the simulator.


Let me know if you need more details or to test certain things on these configurations.

Boris.
```
## History
##### Kirill Kornyakov on 2013-10-09 15:44

```
Thank you for this great report, but please do not expect fast response... Nobody is maintaining the iOS port at the moment, so if you really need the fix soon (and send the pull request), I would suggest to debug the issue yourself or workaround it somehow.
-   Difficulty set to Medium
-   Status changed from New to Open
```
##### Alexander Smorkalov on 2013-11-27 10:44

```
@Alexander Shishkov, any comments from your side?
-   Affected version changed from 2.4.6 (latest release) to 2.4.0 -
    2.4.6
```
##### Alexander Smorkalov on 2013-11-28 06:32

```
-   Target version changed from 2.4.7 to 2.4.8
```
##### Alexander Smorkalov on 2013-12-30 10:38

```
-   Target version changed from 2.4.8 to 2.4.9
```
##### Adam Lang on 2014-03-06 21:31

```
I have the same problem, SVM classification works in Simulator but not on the iPhone. On iPhone i get always the max float value as the distance result. Is there any solution yet or any news?
```
##### Andreas Hörsken on 2014-04-24 12:09

```
I tested the sample above with an iPad 4 and iPad Air (x64) under both, iOS 7 and iOS 7.1 and got no errors (wether with the simulator nor the device). Is it solved or does it just not work with the iphone? Did you test it with a current device?
```
##### Alexander Smorkalov on 2014-04-30 19:05

```
-   Target version changed from 2.4.9 to 2.4.10
```