<p>You are actually implementing the idea published in this <a href="http://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf" rel="nofollow noreferrer">paper</a>.</p>

<p>An (extended) sample code can be found at <a href="http://www.ics.uci.edu/~dramanan/software/pose/pose-release1.2-full.tgz" rel="nofollow noreferrer">UCI</a></p>

<p>To summarize:</p>

<ol>
<li>You have to generate a positive and a negative training set. This means in the positive training images you have to know where the players are located.</li>
<li>Then you have to extract the HoG features at the players position. Note the original HoG method takes input patches of size 128x64, so ensure that your players are all scaled to the same size. And important: HoG feature size depends on the extraction window size, so keep it fixed!
Store the information in a data structure with corresponding label 1.</li>
<li>Then extract negative features from negative images and store them with corresponding label 0 or -1.</li>
<li>Use some training method. I currently work with a linear support vector machine similar to liblinear: <a href="http://arxiv.org/abs/1312.1743" rel="nofollow noreferrer">SVM</a></li>
<li>Then use the test set to ensure you are getting correct results. For testing use a sliding window and slide it all over the image and score the extracted features. Take the best score, as it is most likely, that the player is located there.</li>
<li>If you want to detect several players in one image use non maximum suppression.</li>
</ol>

<p>Note: HoG features are quite difficult to handle, as small changes in extraction might have a great impact on performance. For example openCV ships with an (undocumented) HoG detector. <a href="http://www.juergenwiki.de/old_wiki/doku.php?id=public:hog_descriptor_computation_and_visualization" rel="nofollow noreferrer" title="HoG visualization">HoG visualization</a> helped me to understand how it works. </p>

<p><strong>EDIT: fixed HoG visualization link</strong></p>
Extract features HOG Descriptor
<p>I'm trying to detect players in soccer game with javacv using HOG Descriptor. I already implemented the method with the default people detector, but, the results are not satisfying. So, I extracted positive and negative images and I want to extract features using this images. 
Do anyone have any ideas on how to do this please? Thanks!</p>