title: memory exception while training SVM
body: <p>to train SVM classifier i use features extracted from different images ( each image have number of features =! of other images beacause i use SLIC superpixeland from each region i extract 20 features) after preparing the TraingMatData and LabelsMat i got this <a href="https://www.dropbox.com/s/wxn1ltn3tjy8x58/training1.PNG?dl=0" rel="nofollow noreferrer" title="bug">bug</a> whith a notification : Microsoft C++ exception: cv::Exception at memory location 0x000000E5176E2740. I couldn't understand what's the wrong in my code here's my code and i'm waiting your helps.</p>
  
  <pre><code>int main()
  {
      /// training 
      cv::Mat image;
      //load the features from files 
  
      Mat trainingDataMat(47,27000, CV_32FC1);
  
      float features[1350][20];
      float labels[47] = {-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,-1.0,... i delet the rest of them};
  
      vector&lt;int&gt; size;
      for (int i = 1; i &lt; 48; i++) {
          vector&lt;float&gt; numbers;
          //Mat features(1200, 20, CV_32FC1);
  
          string filename = "D:\\mémoire\\training\\trainingData\\featuers";
          filename = filename + std::to_string(i);
          filename = filename + ".txt";
          int size_e = 0;
          //read(numbers, filename);
          ifstream in(filename);
          float number;
          string aa;
  
          while (in.good()) {
  
              getline(in, aa, ',');
              number = strtod(aa.c_str(), NULL);
              numbers.push_back(number);
              size_e = size_e + 1;
              //features.push_back(number);
          }
  
          in.close();
  
          size.push_back(size_e);
          int pp = numbers.size()/ 20;
  
          int d = 0;
          for (int p = 0; p &lt; 1350; p++) {
              for (int p1 = 0; p1 &lt; 20; p1++) {
                  if (pp &lt;= d) {
                      features[p][p1] = 0;
                  }
                  else {
                      //features.at&lt;uchar&gt;(p, p1) = numbers[d];
                      features[p][p1] = numbers[d];
                      d++;
                  }
              }
          }
          cv::Mat A(1350, 20, CV_32FC1, features);
          trainingDataMat.push_back(A.reshape(1, 1));
      }
  
          Mat labelsMat(47, 1, CV_32FC1, labels);
          //////////////////////////////////////////////////////////////////////////////////////////////////////
          //seting the SVM
  
          Ptr&lt;ml::SVM&gt; svm = ml::SVM::create();
          // edit: the params struct got removed,
  
          svm-&gt;setType(ml::SVM::C_SVC);
          svm-&gt;setKernel(ml::SVM::RBF);
          svm-&gt;setGamma(100);
  
          //Mat trainData; // one row per feature
  
          svm-&gt;train(trainingDataMat, ml::ROW_SAMPLE, labelsMat);
          // ...
  </code></pre>