title: OpenCV svm prediction of images
body: <br/>
  <p>Using the Orfeo Toolbox in Qgis, I labelled the image pixels and trained the svm and a model was generated in yaml format. What I understand, is that Qgis (Orfeo) uses OpenCV to do the machine learning.</p>
  <p>The model is here :<br />
  <a href="http://pastebin.com/qeRgvkK4" rel="nofollow noreferrer">SVM model in yaml format generated by Qgis</a></p>
  <p>After which, I wrote a short snippet in Opencv to load the yaml model and classify(test) new images. However, this snippet fails. <br/>
  <a href="http://pastebin.com/3QUn5jwZ" rel="nofollow noreferrer">Opencv's svm snippet</a></p>
  <pre><code>OpenCV Error: Assertion failed (samples.cols == var_count &amp;&amp; samples.type() == CV_32F) in predict, file /home/john/Desktop/OpenCV/opencv-3.0.0/modules/ml/src/svm.cpp, line 1919
  terminate called after throwing an instance of 'cv::Exception'
    what():  /home/john/Desktop/OpenCV/opencv-3.0.0/modules/ml/src/svm.cpp:1919: error: (-215) samples.cols == var_count &amp;&amp; samples.type() == CV_32F in function predict
  
  Aborted (core dumped)
  </code></pre>
  <p>Could someone figure out what is happening here ? I am quite lost. Btw, I am using OpenCV 3.0.</p>
  <p>Thks.</p>