title: How to create map between string and a classifier object ptr
body: <p>How do I create a map between a string and a classifier, in this case, it is the SVM classifier in openCV. Essentially I am trying to convert a code from using opencv 2.3.1 to Opencv 3+</p>
  
  <p>The old code is</p>
  
  <pre><code>map&lt;string,CvSVM&gt; class_classifier
  </code></pre>
  
  <p>I have tried with the cv::ml::SVM but the compiler complains that it is an abstract class. The error reads </p>
  
  <blockquote>
    <p>"second is a copy of the second object</p>
  </blockquote>
  
  <pre><code>map&lt;string,cv::ml::SVM&gt; class_classifier
  </code></pre>
  
  <p>So I tried with an object and also with pointer</p>
  
  <p><code>cv::Ptr&lt;cv::ml::SVM&gt; classifier = cv::ml::SVM::create()
     map&lt;string,classifier&gt; class_classifier</code> </p>
  
  <p>and </p>
  
  <p><code>cv::Ptr&lt;cv::ml::SVM&gt; classifier = cv::ml::SVM::create()
     map&lt;string,classifier*&gt; class_classifier</code> </p>
  
  <p>But both seem like to be in error. </p>
  
  <blockquote>
    <p>'classifier' cannot appear in a constant expression</p>
  </blockquote>
  
  <p>What should I do?</p>
  
  <p>Thanks   </p>