title: NullPointerException in SVM classifier
body: <p>I am writing code for SVM classifier in Java but getting NullPointerException. The code is as follows:</p>
  
  <pre><code>Mat labelsMat = new Mat(10,1, CvType.CV_32FC1);
  Mat training_data_Mat = new Mat(10, 6, CvType.CV_32FC1);
  labelsMat.put(0, 0, labels); 
  
  for (int i =0; i &lt; 10;i++) {
      training_data_Mat.put(i,0, training_data[i]);
  }
  
  CvSVM svm = new CvSVM();
  CvSVMParams params = new CvSVMParams();
  params.set_svm_type(CvSVM.C_SVC);
  params.set_kernel_type(CvSVM.RBF);
  params.set_term_crit(new TermCriteria(TermCriteria.MAX_ITER,100,1e-6));
  svm.train(training_data_Mat, labelsMat, Mat(), Mat(), params);
  </code></pre>
  
  <p>Here training_data_Mat is a (10,6) matrix of datatype double[][]while labelsMat is a (1,10) vector of type double[].</p>
  
  <p>I am getting stuck at last line in code with NullPointerException.
  Can somebody please tell me where I am doing wrong?</p>