How do I train an SVM classifier using HOG features in OpenCV 3.0 in Python?
<p>I want to train a new HoG classifier for heads and shoulders using OpenCV 3.x Python bindings.  What is my pipeline for extracting features, training an SVM, and then running it on the test database?</p>

<p>There appears to be such a pipeline for C++ here: <a href="https://stackoverflow.com/questions/10769519/svm-classifier-based-on-hog-features-for-object-detection-in-opencv">SVM classifier based on HOG features for &quot;object detection&quot; in OpenCV</a> and here:  <a href="https://github.com/DaHoC/trainHOG/wiki/trainHOG-Tutorial" rel="noreferrer">https://github.com/DaHoC/trainHOG/wiki/trainHOG-Tutorial</a> .  For Python, there's a description of how to extract a HOG feature set here:  <a href="https://stackoverflow.com/questions/6090399/get-hog-image-features-from-opencv-python">Get HOG image features from OpenCV + Python?</a> .  However, that only works for OpenCV 2.x, because you cannot initialize a classifier with <code>_winSize</code> and other such variables anymore.  Also, that's only for feature extraction, not training or detection using the newly trained classifier.  </p>

<p>The output of <code>cv2.HOGdescriptor()</code> does have an <code>svmDetector</code> parameter, but I don't know how to use it because OpenCV 3.x does not come with Python documentation, and OpenCV 2.x only lists HoG in its GPU module, even though there is a CPU implementation.</p>

<p>Is it possible to see an end-to-end pipeline and an explanation for some of the parameters?</p>